openMSX
BreakPointBase.hh
Go to the documentation of this file.
1 #ifndef BREAKPOINTBASE_HH
2 #define BREAKPOINTBASE_HH
3 
4 #include "TclObject.hh"
5 #include <string_view>
6 
7 namespace openmsx {
8 
9 class Interpreter;
10 class GlobalCliComm;
11 
15 {
16 public:
17  std::string_view getCondition() const { return condition.getString(); }
18  std::string_view getCommand() const { return command .getString(); }
19  TclObject getConditionObj() const { return condition; }
20  TclObject getCommandObj() const { return command; }
21  bool onlyOnce() const { return once; }
22 
23  void checkAndExecute(GlobalCliComm& cliComm, Interpreter& interp);
24 
25 protected:
26  // Note: we require GlobalCliComm here because breakpoint objects can
27  // be transfered to different MSX machines, and so the MSXCliComm
28  // object won't remain valid.
29  BreakPointBase(TclObject command_, TclObject condition_, bool once_)
30  : command(std::move(command_))
31  , condition(std::move(condition_))
32  , once(once_) {}
33 
34 private:
35  bool isTrue(GlobalCliComm& cliComm, Interpreter& interp) const;
36 
37  TclObject command;
38  TclObject condition;
39  bool once;
40  bool executing = false;
41 };
42 
43 } // namespace openmsx
44 
45 #endif
STL namespace.
std::string_view getCondition() const
BreakPointBase(TclObject command_, TclObject condition_, bool once_)
Base class for CPU break and watch points.
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
void checkAndExecute(GlobalCliComm &cliComm, Interpreter &interp)
std::string_view getString() const
Definition: TclObject.cc:102
TclObject getCommandObj() const
std::string_view getCommand() const
TclObject getConditionObj() const