Menu

[r1967]: / trunk / src / plugins / debuggergdb / debuggergdb.h  Maximize  Restore  History

Download this file

174 lines (151 with data), 5.4 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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
#ifndef DEBUGGERGDB_H
#define DEBUGGERGDB_H
#include <settings.h> // much of the SDK is here
#include <sdk_events.h>
#include <cbplugin.h>
#include <simpletextlog.h>
#include <pipedprocess.h>
#include <wx/regex.h>
#include <wx/tipwin.h>
#include "debuggerstate.h"
#include "debugger_defs.h"
#include "backtracedlg.h"
#include "disassemblydlg.h"
#include "cpuregistersdlg.h"
#include "breakpointsdlg.h"
extern const wxString g_EscapeChars;
class DebuggerDriver;
class DebuggerCmd;
class Compiler;
class DebuggerTree;
class DisassemblyDlg;
class CPURegistersDlg;
class BacktraceDlg;
class BreakpointsDlg;
class DebuggerGDB : public cbDebuggerPlugin
{
DebuggerState m_State;
public:
DebuggerGDB();
~DebuggerGDB();
int Configure();
int GetConfigurationPriority(){ return 0; }
int GetConfigurationGroup(){ return cgDebugger; }
cbConfigurationPanel* GetConfigurationPanel(wxWindow* parent);
void BuildMenu(wxMenuBar* menuBar);
void BuildModuleMenu(const ModuleType type, wxMenu* menu, const FileTreeData* data = 0);
bool BuildToolBar(wxToolBar* toolBar);
void OnAttach(); // fires when the plugin is attached to the application
void OnRelease(bool appShutDown); // fires when the plugin is released from the application
void RunCommand(int cmd);
void Disassemble();
void Registers();
void Backtrace();
bool AddBreakpoint(const wxString& file, int line);
bool AddBreakpoint(const wxString& functionSignature);
bool RemoveBreakpoint(const wxString& file, int line);
bool RemoveBreakpoint(const wxString& functionSignature);
bool RemoveAllBreakpoints(const wxString& file = wxEmptyString);
int Debug();
void Continue();
void Next();
void Step();
void StepOut();
void RunToCursor();
void ToggleBreakpoint();
void Stop();
bool Validate(const wxString& line, const char cb);
bool IsRunning() const { return m_pProcess; }
int GetExitCode() const { return m_LastExitCode; }
void SyncEditor(const wxString& filename, int line, bool setMarker = true);
void Log(const wxString& msg);
void DebugLog(const wxString& msg);
void SendCommand(const wxString& cmd);
DebuggerState& GetState(){ return m_State; }
void BringAppToFront();
void RefreshConfiguration();
static void ConvertToGDBFriendly(wxString& str);
static void ConvertToGDBFile(wxString& str);
static void ConvertToGDBDirectory(wxString& str, wxString base = _T(""), bool relative = true);
static void StripQuotes(wxString& str);
protected:
void AddSourceDir(const wxString& dir);
private:
void DoSwitchLayout(const wxString& config_key);
void ParseOutput(const wxString& output);
void ClearActiveMarkFromAllEditors();
void DoWatches();
wxString GetEditorWordAtCaret();
wxString FindDebuggerExecutable(Compiler* compiler);
int LaunchProcess(const wxString& cmd, const wxString& cwd);
wxString GetDebuggee(ProjectBuildTarget* target);
bool IsStopped();
void OnUpdateUI(wxUpdateUIEvent& event);
void OnDebug(wxCommandEvent& event);
void OnStop(wxCommandEvent& event);
void OnSendCommandToGDB(wxCommandEvent& event);
void OnAddSymbolFile(wxCommandEvent& event);
void OnBacktrace(wxCommandEvent& event);
void OnDisassemble(wxCommandEvent& event);
void OnRegisters(wxCommandEvent& event);
void OnViewWatches(wxCommandEvent& event);
void OnBreakpoints(wxCommandEvent& event);
void OnEditWatches(wxCommandEvent& event);
void OnContinue(wxCommandEvent& event);
void OnNext(wxCommandEvent& event);
void OnStep(wxCommandEvent& event);
void OnStepOut(wxCommandEvent& event);
void OnToggleBreakpoint(wxCommandEvent& event);
void OnRunToCursor(wxCommandEvent& event);
void OnBreakpointAdd(CodeBlocksEvent& event);
void OnBreakpointEdit(CodeBlocksEvent& event);
void OnBreakpointDelete(CodeBlocksEvent& event);
void OnValueTooltip(CodeBlocksEvent& event);
void OnEditorOpened(CodeBlocksEvent& event);
void OnGDBOutput(wxCommandEvent& event);
void OnGDBError(wxCommandEvent& event);
void OnGDBTerminated(wxCommandEvent& event);
void OnIdle(wxIdleEvent& event);
void OnTimer(wxTimerEvent& event);
void OnWatchesChanged(wxCommandEvent& event);
void OnCursorChanged(wxCommandEvent& event);
void OnAddWatch(wxCommandEvent& event);
void OnAttachToProcess(wxCommandEvent& event);
void OnDetach(wxCommandEvent& event);
void OnSettings(wxCommandEvent& event);
wxMenu* m_pMenu;
SimpleTextLog* m_pLog;
SimpleTextLog* m_pDbgLog;
PipedProcess* m_pProcess;
wxToolBar* m_pTbar;
int m_PageIndex;
int m_DbgPageIndex;
wxRegEx reSource;
wxString m_LastCmd;
wxString m_Variable;
cbCompilerPlugin* m_pCompiler;
bool m_LastExitCode;
int m_TargetIndex;
int m_Pid;
int m_PidToAttach; // for "attach to process"
wxTipWindow* m_EvalWin;
wxString m_LastEval;
wxRect m_EvalRect;
wxTimer m_TimerPollDebugger;
bool m_NoDebugInfo;
bool m_BreakOnEntry;
int m_HaltAtLine;
bool m_HasDebugLog;
bool m_StoppedOnSignal;
// current frame info
StackFrame m_CurrentFrame;
// extra dialogs
DebuggerTree* m_pTree;
DisassemblyDlg* m_pDisassembly;
CPURegistersDlg* m_pCPURegisters;
BacktraceDlg* m_pBacktrace;
BreakpointsDlg* m_pBreakpointsWindow;
DECLARE_EVENT_TABLE()
};
CB_DECLARE_PLUGIN();
#endif // DEBUGGERGDB_H