Breakpoint.h
Go to the documentation of this file.
1 /*
2  * PFPSim: Library for the Programmable Forwarding Plane Simulation Framework
3  *
4  * Copyright (C) 2016 Concordia Univ., Montreal
5  * Samar Abdi
6  * Umair Aftab
7  * Gordon Bailey
8  * Faras Dewal
9  * Shafigh Parsazad
10  * Eric Tremblay
11  *
12  * Copyright (C) 2016 Ericsson
13  * Bochra Boughzala
14  *
15  * This program is free software; you can redistribute it and/or
16  * modify it under the terms of the GNU General Public License
17  * as published by the Free Software Foundation; either version 2
18  * of the License, or (at your option) any later version.
19  *
20  * This program is distributed in the hope that it will be useful,
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23  * GNU General Public License for more details.
24  *
25  * You should have received a copy of the GNU General Public License
26  * along with this program; if not, write to the Free Software
27  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
28  * 02110-1301, USA.
29  */
30 
39 #ifndef CORE_DEBUGGER_BREAKPOINT_H_
40 #define CORE_DEBUGGER_BREAKPOINT_H_
41 
42 #include <string>
43 #include <iostream>
44 #include <map>
45 
46 namespace pfp {
47 namespace core {
48 namespace db {
49 
53 class Breakpoint {
54  public:
60  BREAK_ON_MODULE_READ,
61  BREAK_ON_MODULE_WRITE,
62  BREAK_AT_TIME,
63  BREAK_ON_PACKET_ID
64  };
65 
70  explicit Breakpoint(bool stealth = false);
71 
77  bool isEqual(Breakpoint br);
78 
84  void addCondition(BreakpointCondition condition, std::string value);
85 
90  int getID() const;
91 
94  std::map<BreakpointCondition, std::string> conditions;
97  bool temp;
101  bool disabled;
102 
103  private:
105  int id;
107  static int next_id;
108 };
109 
110 }; // namespace db
111 }; // namespace core
112 }; // namespace pfp
113 
114 #endif // CORE_DEBUGGER_BREAKPOINT_H_
Breakpoint(bool stealth=false)
Default Constructor.
Definition: Breakpoint.cpp:41
bool isEqual(Breakpoint br)
Function to compare two Breakpoint objects.
Definition: Breakpoint.cpp:49
Class representation of a pfpdb breakpoint.
Definition: Breakpoint.h:53
bool temp
Indicates whether the Breakpoint is temporary.
Definition: Breakpoint.h:97
BreakpointCondition
Enumeration representing the various conditions on which the user can break.
Definition: Breakpoint.h:59
bool disabled
Indicates whether the Breakpoint is disabled.
Definition: Breakpoint.h:101
std::map< BreakpointCondition, std::string > conditions
Map containing all the conditions of the Breakpoint and the associated value.
Definition: Breakpoint.h:94
void addCondition(BreakpointCondition condition, std::string value)
Add a condition to the Breakpoint.
Definition: Breakpoint.cpp:62
int getID() const
Get the unique ID of the Breakpoint.
Definition: Breakpoint.cpp:68
PacketBase.h.
Definition: ConfigurationParameters.cpp:36