[r571]: cmajor++ / Cm / Cm.Debugger / Command.hpp  Maximize  Restore  History

Download this file

153 lines (127 with data), 4.1 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
/*========================================================================
Copyright (c) 2012-2014 Seppo Laakko
http://sourceforge.net/projects/cmajor/
Distributed under the GNU General Public License, version 3 (GPLv3).
(See accompanying LICENSE.txt or http://www.gnu.org/licenses/gpl.html)
========================================================================*/
#ifndef CM_DEBUGGER_COMMAND_INCLUDED
#define CM_DEBUGGER_COMMAND_INCLUDED
#include <Cm.Debugger/InputReader.hpp>
#include <Cm.Debugger/Util.hpp>
#include <memory>
namespace Cm { namespace Debugger {
class DebugInfo;
class Gdb;
class Shell;
class Command;
typedef std::shared_ptr<Command> CommandPtr;
class Command
{
public:
virtual ~Command() {}
virtual void Execute(DebugInfo& debugInfo, Gdb& gdb, InputReader& inputReader, Shell& shell) {}
virtual bool IsQuit() const { return false; }
};
class StartCommand: public Command
{
public:
virtual void Execute(DebugInfo& debugInfo, Gdb& gdb, InputReader& inputReader, Shell& shell);
};
class QuitCommand: public Command
{
public:
virtual void Execute(DebugInfo& debugInfo, Gdb& gdb, InputReader& inputReader, Shell& shell);
virtual bool IsQuit() const { return true; }
};
class HelpCommand: public Command
{
public:
virtual void Execute(DebugInfo& debugInfo, Gdb& gdb, InputReader& inputReader, Shell& shell);
};
class ContinueCommand: public Command
{
public:
virtual void Execute(DebugInfo& debugInfo, Gdb& gdb, InputReader& inputReader, Shell& shell);
};
class NextCommand: public Command
{
public:
virtual void Execute(DebugInfo& debugInfo, Gdb& gdb, InputReader& inputReader, Shell& shell);
};
class StepCommand: public Command
{
public:
virtual void Execute(DebugInfo& debugInfo, Gdb& gdb, InputReader& inputReader, Shell& shell);
};
class OutCommand: public Command
{
virtual void Execute(DebugInfo& debugInfo, Gdb& gdb, InputReader& inputReader, Shell& shell);
};
class BreakCommand: public Command
{
public:
BreakCommand(const SourceFileLine& sourceFileLine_);
virtual void Execute(DebugInfo& debugInfo, Gdb& gdb, InputReader& inputReader, Shell& shell);
private:
SourceFileLine sourceFileLine;
};
class ClearCommand: public Command
{
public:
ClearCommand(int bp_);
virtual void Execute(DebugInfo& debugInfo, Gdb& gdb, InputReader& inputReader, Shell& shell);
private:
int bp;
};
class ListCommand: public Command
{
public:
ListCommand(const SourceFileLine& sourceFileLine_);
ListCommand(const std::string& command_);
virtual void Execute(DebugInfo& debugInfo, Gdb& gdb, InputReader& inputReader, Shell& shell);
private:
std::string command;
SourceFileLine sourceFileLine;
};
class CallStackCommand: public Command
{
public:
virtual void Execute(DebugInfo& debugInfo, Gdb& gdb, InputReader& inputReader, Shell& shell);
};
class FrameCommand: public Command
{
public:
FrameCommand(int frameNumber_);
virtual void Execute(DebugInfo& debugInfo, Gdb& gdb, InputReader& inputReader, Shell& shell);
private:
int frameNumber;
};
class ShowBreakpointsCommand: public Command
{
public:
virtual void Execute(DebugInfo& debugInfo, Gdb& gdb, InputReader& inputReader, Shell& shell);
};
class ShowLibrariesCommand: public Command
{
public:
virtual void Execute(DebugInfo& debugInfo, Gdb& gdb, InputReader& inputReader, Shell& shell);
};
class SetDebugLibraryStatusCommand: public Command
{
public:
SetDebugLibraryStatusCommand(const std::string& libName_, bool enabled_);
virtual void Execute(DebugInfo& debugInfo, Gdb& gdb, InputReader& inputReader, Shell& shell);
private:
std::string libName;
bool enabled;
};
class SetBreakOnThrowCommand: public Command
{
public:
SetBreakOnThrowCommand(bool enabled_);
virtual void Execute(DebugInfo& debugInfo, Gdb& gdb, InputReader& inputReader, Shell& shell);
private:
bool enabled;
};
} } // namespace Cm::Debugger
#endif // CM_DEBUGGER_COMMAND_INCLUDED