Code::Blocks  SVN r11506
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
DebuggerGDB Class Reference

#include <debuggergdb.h>

Inheritance diagram for DebuggerGDB:
Collaboration diagram for DebuggerGDB:

Public Member Functions

 DebuggerGDB ()
 
 ~DebuggerGDB ()
 
cbConfigurationPanelGetProjectConfigurationPanel (wxWindow *parent, cbProject *project)
 
void OnAttachReal ()
 
void OnReleaseReal (bool appShutDown)
 
bool SupportsFeature (cbDebuggerFeature::Flags flag)
 
cbDebuggerConfigurationLoadConfig (const ConfigManagerWrapper &config)
 
DebuggerConfigurationGetActiveConfigEx ()
 
void RunCommand (int cmd)
 
cb::shared_ptr< cbBreakpointAddBreakpoint (const wxString &filename, int line)
 Request to add a breakpoint. More...
 
cb::shared_ptr< cbBreakpointAddDataBreakpoint (const wxString &dataExpression)
 Request to add a breakpoint based on a data expression. More...
 
int GetBreakpointsCount () const
 
cb::shared_ptr< cbBreakpointGetBreakpoint (int index)
 
cb::shared_ptr< const cbBreakpointGetBreakpoint (int index) const
 
void UpdateBreakpoint (cb::shared_ptr< cbBreakpoint > breakpoint)
 
void DeleteBreakpoint (cb::shared_ptr< cbBreakpoint > breakpoint)
 
void DeleteAllBreakpoints ()
 
void ShiftBreakpoint (int index, int lines_to_shift)
 
void EnableBreakpoint (cb::shared_ptr< cbBreakpoint > breakpoint, bool enable)
 
int GetStackFrameCount () const
 
cb::shared_ptr< const cbStackFrameGetStackFrame (int index) const
 
void SwitchToFrame (int number)
 
int GetActiveStackFrame () const
 
int GetThreadsCount () const
 
cb::shared_ptr< const cbThreadGetThread (int index) const
 
bool SwitchToThread (int thread_number)
 
bool Debug (bool breakOnEntry)
 Start a new debugging process. More...
 
void Continue ()
 Continue running the debugged program. More...
 
void Next ()
 Execute the next instruction and return control to the debugger. More...
 
void NextInstruction ()
 Execute the next instruction and return control to the debugger. More...
 
void StepIntoInstruction ()
 Execute the next instruction and return control to the debugger, if the instruction is a function call step into it. More...
 
void Step ()
 Execute the next instruction, stepping into function calls if needed, and return control to the debugger. More...
 
void StepOut ()
 Execute the next instruction, stepping out of function calls if needed, and return control to the debugger. More...
 
bool RunToCursor (const wxString &filename, int line, const wxString &line_text)
 Run the debugged program until it reaches the cursor at the current editor. More...
 
void SetNextStatement (const wxString &filename, int line)
 Sets the position of the Program counter to the specified filename:line. More...
 
void Break ()
 Break the debugging process (stop the debuggee for debugging). More...
 
void Stop ()
 Stop the debugging process (exit debugging). More...
 
bool Validate (const wxString &line, const char cb)
 
bool IsRunning () const
 Is the plugin currently debugging? More...
 
bool IsStopped () const
 Is the plugin stopped on breakpoint? More...
 
bool IsBusy () const
 Is the plugin processing something? More...
 
bool IsTemporaryBreak () const
 
int GetExitCode () const
 Get the exit code of the last debug process. More...
 
cb::shared_ptr< cbWatchAddWatch (const wxString &symbol)
 
void DeleteWatch (cb::shared_ptr< cbWatch > watch)
 
bool HasWatch (cb::shared_ptr< cbWatch > watch)
 
void ShowWatchProperties (cb::shared_ptr< cbWatch > watch)
 
bool SetWatchValue (cb::shared_ptr< cbWatch > watch, const wxString &value)
 
void ExpandWatch (cb::shared_ptr< cbWatch > watch)
 
void CollapseWatch (cb::shared_ptr< cbWatch > watch)
 
void UpdateWatch (cb::shared_ptr< cbWatch > watch)
 
void AddWatchNoUpdate (const cb::shared_ptr< GDBWatch > &watch)
 
void OnWatchesContextMenu (wxMenu &menu, const cbWatch &watch, wxObject *property, int &disabledMenus)
 
void GetCurrentPosition (wxString &filename, int &line)
 
void RequestUpdate (DebugWindows window)
 
void AttachToProcess (const wxString &pid)
 
void DetachFromProcess ()
 
bool IsAttachedToProcess () const
 
void SendCommand (const wxString &cmd, bool debugLog)
 
void DoSendCommand (const wxString &cmd)
 
DebuggerStateGetState ()
 
void OnConfigurationChange (bool isActive)
 Called when the user clicks OK in Settings -> Debugger... More...
 
wxArrayStringGetSearchDirs (cbProject *prj)
 
RemoteDebuggingMapGetRemoteDebuggingMap (cbProject *project=0)
 
void OnProjectLoadingHook (cbProject *project, TiXmlElement *elem, bool loading)
 
void OnValueTooltip (const wxString &token, const wxRect &evalRect)
 
bool ShowValueTooltip (int style)
 
void DebuggeeContinued ()
 
void DetermineLanguage ()
 
- Public Member Functions inherited from cbDebuggerPlugin
 cbDebuggerPlugin (const wxString &guiName, const wxString &settingsName)
 
void OnAttach () override
 Any descendent plugin should override this virtual method and perform any necessary initialization. More...
 
void OnRelease (bool appShutDown) override
 
void BuildMenu (wxMenuBar *menuBar) override
 
void BuildModuleMenu (const ModuleType type, wxMenu *menu, const FileTreeData *data=nullptr) override
 
bool BuildToolBar (wxToolBar *toolBar) override
 
virtual void EditorLinesAddedOrRemoved (cbEditor *editor, int startline, int lines)
 Notify the debugger that lines were added or removed in an editor. More...
 
virtual bool ToolMenuEnabled () const
 
cbDebuggerConfigurationGetActiveConfig ()
 
void SetActiveConfig (int index)
 
int GetIndexOfActiveConfig () const
 
virtual wxString GetEditorWordAtCaret (const wxPoint *mousePosition=NULL)
 
void ClearActiveMarkFromAllEditors ()
 
SyncEditorResult SyncEditor (const wxString &filename, int line, bool setMarker=true)
 
void BringCBToFront ()
 
void ShowLog (bool clear)
 
void Log (const wxString &msg, Logger::level level=Logger::info)
 
void DebugLog (const wxString &msg, Logger::level level=Logger::info)
 
bool HasDebugLog () const
 
void ClearLog ()
 
void SetupLog (int normalIndex)
 
wxString GetGUIName () const
 
wxString GetSettingsName () const
 
- Public Member Functions inherited from cbPlugin
 cbPlugin ()
 In default cbPlugin's constructor the associated PluginInfo structure is filled with default values. More...
 
 ~cbPlugin () override
 cbPlugin destructor. More...
 
virtual PluginType GetType () const
 The plugin must return its type on request. More...
 
virtual int GetConfigurationPriority () const
 Return the plugin's configuration priority. More...
 
virtual int GetConfigurationGroup () const
 Return the configuration group for this plugin. More...
 
virtual cbConfigurationPanelGetConfigurationPanel (cb_optional wxWindow *parent)
 Return plugin's configuration panel. More...
 
virtual cbConfigurationPanelGetProjectConfigurationPanel (cb_optional wxWindow *parent, cb_optional cbProject *project)
 Return plugin's configuration panel for projects. More...
 
virtual void BuildMenu (cb_optional wxMenuBar *menuBar)
 This method is called by Code::Blocks and is used by the plugin to add any menu items it needs on Code::Blocks's menu bar. More...
 
virtual void BuildModuleMenu (cb_optional const ModuleType type, cb_optional wxMenu *menu, cb_optional const FileTreeData *data=nullptr)
 This method is called by Code::Blocks core modules (EditorManager, ProjectManager etc) and is used by the plugin to add any menu items it needs in the module's popup menu. More...
 
virtual bool BuildToolBar (cb_optional wxToolBar *toolBar)
 This method is called by Code::Blocks and is used by the plugin to add any toolbar items it needs on Code::Blocks's toolbar. More...
 
virtual int GetToolBarPriority ()
 This method return the priority of the plugin's toolbar, the less value indicates a more preceding position when C::B starts with no configuration file. More...
 
virtual void CreateStatusField (cbStatusBar *statusBar)
 This method is called by Code::Blocks and is used by the plugin to add a field on Code::Blocks's statusbar. More...
 
bool IsAttached () const
 See whether this plugin is attached or not. More...
 
virtual bool CanDetach () const
 See whether this plugin can be detached (unloaded) or not. More...
 

Static Public Member Functions

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 Member Functions

cbProjectGetProject ()
 
void ResetProject ()
 
void ConvertDirectory (wxString &str, wxString base, bool relative)
 
void CleanupWhenProjectClosed (cbProject *project)
 
bool CompilerFinished (bool compilerFailed, StartType startType)
 Called when the compilation has finished. More...
 
void AddSourceDir (const wxString &dir)
 
- Protected Member Functions inherited from cbDebuggerPlugin
void SwitchToDebuggingLayout ()
 
void SwitchToPreviousLayout ()
 
bool GetDebuggee (wxString &pathToDebuggee, wxString &workingDirectory, ProjectBuildTarget *target)
 
bool EnsureBuildUpToDate (StartType startType)
 
bool WaitingCompilerToFinish () const
 
int RunNixConsole (wxString &consoleTty)
 
void MarkAsStopped ()
 
- Protected Member Functions inherited from cbPlugin
virtual void OnRelease (cb_optional bool appShutDown)
 Any descendent plugin should override this virtual method and perform any necessary de-initialization. More...
 
virtual void NotImplemented (const wxString &log) const
 This method logs a "Not implemented" message and is provided for convenience only. More...
 

Private Types

typedef std::map< cbProject *, wxArrayStringSearchDirsMap
 
typedef std::map< cbProject *, RemoteDebuggingMapProjectRemoteDebuggingMap
 

Private Member Functions

void ParseOutput (const wxString &output)
 
void DoWatches ()
 
void MarkAllWatchesAsUnchanged ()
 
int LaunchProcess (const wxString &cmd, const wxString &cwd)
 
int LaunchProcessWithShell (const wxString &cmd, wxProcess *process, const wxString &cwd)
 
int DoDebug (bool breakOnEntry)
 
void DoBreak (bool temporary)
 
void OnAddSymbolFile (wxCommandEvent &event)
 
void DeleteAllProjectBreakpoints (cbProject *project)
 
void OnBuildTargetSelected (CodeBlocksEvent &event)
 
void OnGDBOutput (wxCommandEvent &event)
 
void OnGDBError (wxCommandEvent &event)
 
void OnGDBTerminated (wxCommandEvent &event)
 
void OnIdle (wxIdleEvent &event)
 
void OnTimer (wxTimerEvent &event)
 
void OnShowFile (wxCommandEvent &event)
 
void OnCursorChanged (wxCommandEvent &event)
 
void SetupToolsMenu (wxMenu &menu)
 
void KillConsole ()
 
void CheckIfConsoleIsClosed ()
 
void OnInfoFrame (wxCommandEvent &event)
 
void OnInfoDLL (wxCommandEvent &event)
 
void OnInfoFiles (wxCommandEvent &event)
 
void OnInfoFPU (wxCommandEvent &event)
 
void OnInfoSignals (wxCommandEvent &event)
 
void OnMenuWatchDereference (wxCommandEvent &event)
 
void OnUpdateTools (wxUpdateUIEvent &event)
 
void OnPrintElements (wxCommandEvent &event)
 
void OnUpdateCatchThrow (wxUpdateUIEvent &event)
 
void OnCatchThrow (wxCommandEvent &event)
 

Private Attributes

DebuggerState m_State
 
PipedProcessm_pProcess
 
bool m_LastExitCode
 
int m_Pid
 
int m_PidToAttach
 
wxRect m_EvalRect
 
wxTimer m_TimerPollDebugger
 
bool m_NoDebugInfo
 
bool m_StoppedOnSignal
 
cbProjectm_pProject
 
wxString m_ActiveBuildTarget
 
SearchDirsMap m_SearchDirs
 
ProjectRemoteDebuggingMap m_RemoteDebugging
 
int m_HookId
 
bool m_bIsConsole
 
bool m_stopDebuggerConsoleClosed
 
int m_nConsolePid
 
bool m_Canceled
 
bool m_TemporaryBreak
 
WatchesContainer m_watches
 
cb::shared_ptr< GDBWatchm_localsWatch
 
cb::shared_ptr< GDBWatchm_funcArgsWatch
 
wxString m_watchToDereferenceSymbol
 
wxObjectm_watchToDereferenceProperty
 
int m_printElements
 

Friends

struct TestIfBelongToProject
 

Additional Inherited Members

- Public Types inherited from cbDebuggerPlugin
enum  DebugWindows {
  Backtrace, CPURegisters, Disassembly, ExamineMemory,
  Threads, Watches
}
 
enum  SyncEditorResult { SyncOk = 0, SyncFileNotFound, SyncFileUnknown }
 
- Protected Types inherited from cbDebuggerPlugin
enum  StartType { StartTypeUnknown = 0, StartTypeRun, StartTypeStepInto }
 
- Protected Attributes inherited from cbPlugin
PluginType m_Type
 Holds the plugin's type. More...
 
bool m_IsAttached
 Holds the "attached" state. More...
 

Detailed Description

Definition at line 32 of file debuggergdb.h.

Member Typedef Documentation

◆ ProjectRemoteDebuggingMap

Definition at line 200 of file debuggergdb.h.

◆ SearchDirsMap

typedef std::map<cbProject*, wxArrayString> DebuggerGDB::SearchDirsMap
private

Definition at line 197 of file debuggergdb.h.

Constructor & Destructor Documentation

◆ DebuggerGDB()

DebuggerGDB::DebuggerGDB ( )

◆ ~DebuggerGDB()

DebuggerGDB::~DebuggerGDB ( )

Definition at line 199 of file debuggergdb.cpp.

Member Function Documentation

◆ AddBreakpoint()

cb::shared_ptr< cbBreakpoint > DebuggerGDB::AddBreakpoint ( const wxString filename,
int  line 
)
virtual

Request to add a breakpoint.

Parameters
fileThe file to add the breakpoint based on a file/line pair.
lineThe line number to put the breakpoint in file.
Returns
True if succeeded, false if not.

Implements cbDebuggerPlugin.

Definition at line 1371 of file debuggergdb.cpp.

References DebuggerState::AddBreakpoint(), Continue(), DoBreak(), IsStopped(), and m_State.

◆ AddDataBreakpoint()

cb::shared_ptr< cbBreakpoint > DebuggerGDB::AddDataBreakpoint ( const wxString dataExpression)
virtual

Request to add a breakpoint based on a data expression.

Parameters
dataExpressionThe data expression to add the breakpoint.
Returns
True if succeeded, false if not.

Implements cbDebuggerPlugin.

Definition at line 1385 of file debuggergdb.cpp.

References DebuggerState::AddBreakpoint(), Manager::Get(), DataBreakpointDlg::GetDataExpression(), DataBreakpointDlg::GetSelection(), m_State, PlaceWindow(), wxDialog::ShowModal(), and wxID_OK.

◆ AddSourceDir()

void DebuggerGDB::AddSourceDir ( const wxString dir)
protected

◆ AddWatch()

cb::shared_ptr< cbWatch > DebuggerGDB::AddWatch ( const wxString symbol)
virtual

◆ AddWatchNoUpdate()

void DebuggerGDB::AddWatchNoUpdate ( const cb::shared_ptr< GDBWatch > &  watch)

Definition at line 2116 of file debuggergdb.cpp.

References m_watches.

Referenced by GetExitCode(), and GdbCmd_TooltipEvaluation::ParseOutput().

◆ AttachToProcess()

void DebuggerGDB::AttachToProcess ( const wxString pid)
virtual

Implements cbDebuggerPlugin.

Definition at line 2281 of file debuggergdb.cpp.

References Debug(), wxString::IsEmpty(), m_PidToAttach, and wxString::ToLong().

Referenced by GetExitCode().

◆ Break()

void DebuggerGDB::Break ( )
virtual

Break the debugging process (stop the debuggee for debugging).

Implements cbDebuggerPlugin.

Definition at line 1610 of file debuggergdb.cpp.

References DoBreak().

Referenced by Stop().

◆ CheckIfConsoleIsClosed()

void DebuggerGDB::CheckIfConsoleIsClosed ( )
private

◆ CleanupWhenProjectClosed()

void DebuggerGDB::CleanupWhenProjectClosed ( cbProject project)
protectedvirtual

◆ CollapseWatch()

void DebuggerGDB::CollapseWatch ( cb::shared_ptr< cbWatch watch)
virtual

Implements cbDebuggerPlugin.

Definition at line 2215 of file debuggergdb.cpp.

Referenced by GetExitCode().

◆ CompilerFinished()

bool DebuggerGDB::CompilerFinished ( bool  compilerFailed,
StartType  startType 
)
protectedvirtual

Called when the compilation has finished.

The compilation is started when EnsureBuildUpToDate is called.

Parameters
compilerFailedthe compilation failed for some reason.
startTypeit is the same value given to the Debug method, when the debugger session was started.
Returns
True if debug session is start, false if there are any errors or the users canceled the session.

Reimplemented from cbDebuggerPlugin.

Definition at line 2302 of file debuggergdb.cpp.

References DoDebug(), cbDebuggerPlugin::StartTypeStepInto, and cbDebuggerPlugin::StartTypeUnknown.

Referenced by ResetProject().

◆ Continue()

void DebuggerGDB::Continue ( )
virtual

Continue running the debugged program.

Implements cbDebuggerPlugin.

Definition at line 1531 of file debuggergdb.cpp.

References CMD_CONTINUE, and RunCommand().

Referenced by AddBreakpoint(), DeleteAllBreakpoints(), DeleteBreakpoint(), EnableBreakpoint(), RunToCursor(), and UpdateBreakpoint().

◆ ConvertDirectory()

void DebuggerGDB::ConvertDirectory ( wxString str,
wxString  base,
bool  relative 
)
protectedvirtual

Implements cbDebuggerPlugin.

Definition at line 1028 of file debuggergdb.cpp.

References ConvertToGDBDirectory().

Referenced by ResetProject().

◆ ConvertToGDBDirectory()

void DebuggerGDB::ConvertToGDBDirectory ( wxString str,
wxString  base = _T(""),
bool  relative = true 
)
static

◆ ConvertToGDBFile()

void DebuggerGDB::ConvertToGDBFile ( wxString str)
static

Definition at line 1020 of file debuggergdb.cpp.

References ConvertToGDBDirectory(), wxFileName::GetFullName(), and wxFileName::GetPath().

Referenced by GetState().

◆ ConvertToGDBFriendly()

void DebuggerGDB::ConvertToGDBFriendly ( wxString str)
static

◆ Debug()

bool DebuggerGDB::Debug ( bool  breakOnEntry)
virtual

◆ DebuggeeContinued()

void DebuggerGDB::DebuggeeContinued ( )

Definition at line 2033 of file debuggergdb.cpp.

References m_TemporaryBreak.

Referenced by GetState(), and DebuggerDriver::NotifyDebuggeeContinued().

◆ DeleteAllBreakpoints()

void DebuggerGDB::DeleteAllBreakpoints ( )
virtual

◆ DeleteAllProjectBreakpoints()

void DebuggerGDB::DeleteAllProjectBreakpoints ( cbProject project)
private

◆ DeleteBreakpoint()

void DebuggerGDB::DeleteBreakpoint ( cb::shared_ptr< cbBreakpoint breakpoint)
virtual

◆ DeleteWatch()

void DebuggerGDB::DeleteWatch ( cb::shared_ptr< cbWatch watch)
virtual

Implements cbDebuggerPlugin.

Definition at line 2121 of file debuggergdb.cpp.

References m_watches.

Referenced by GetExitCode().

◆ DetachFromProcess()

void DebuggerGDB::DetachFromProcess ( )
virtual

◆ DetermineLanguage()

void DebuggerGDB::DetermineLanguage ( )

◆ DoBreak()

void DebuggerGDB::DoBreak ( bool  temporary)
private

◆ DoDebug()

int DebuggerGDB::DoDebug ( bool  breakOnEntry)
private

Definition at line 707 of file debuggergdb.cpp.

References _(), _T, DebuggerConfiguration::AddOtherProjectDirs, AddSourceDir(), DebuggerState::ApplyBreakpoints(), DebuggerDriver::Attach(), cbProject::BuildTargetValid(), cbEVT_DEBUGGER_STARTED, cbMessageBox(), DebuggerDriver::ClearDirectories(), ConvertToGDBDirectory(), cbDebuggerPlugin::DebugLog(), wxString::empty(), Logger::error, wxString::Format(), Manager::Get(), GetActiveConfigEx(), CompileTargetBase::GetBasePath(), cbProject::GetBuildTarget(), DebuggerDriver::GetCommandLine(), cbProject::GetCommonTopLevelPath(), CompilerFactory::GetCompiler(), CompileTargetBase::GetCompilerID(), cbDebuggerPlugin::GetDebuggee(), DebuggerConfiguration::GetDebuggerExecutable(), DebuggerDriver::GetDebuggersWorkingDirectory(), CompilerFactory::GetDefaultCompiler(), DebuggerState::GetDriver(), CompileTargetBase::GetExecutionParameters(), CompilerCommandGenerator::GetLinkerSearchDirs(), Manager::GetPluginManager(), Manager::GetProjectManager(), ProjectManager::GetProjects(), GetRemoteDebuggingMap(), GetSearchDirs(), GetStringFromArray(), CompileTargetBase::GetTargetType(), CompileTargetBase::GetTitle(), ProjectBuildTarget::GetUseConsoleRunner(), HandlerRoutine(), DebuggerState::HasDriver(), wxString::IsEmpty(), LaunchProcess(), wxString::Length(), cbDebuggerPlugin::Log(), m_ActiveBuildTarget, m_bIsConsole, m_Canceled, m_nConsolePid, m_PidToAttach, m_pProcess, m_pProject, m_printElements, m_State, m_stopDebuggerConsoleClosed, m_TimerPollDebugger, RemoteDebugging::MergeWith(), wxString::Mid(), PluginManager::NotifyPlugins(), DebuggerDriver::Prepare(), wxString::Printf(), DebuggerDriver::QueueCommand(), cbDebuggerPlugin::RunNixConsole(), cbProject::SelectTarget(), DebuggerDriver::SetArguments(), DebuggerDriver::SetWorkingDirectory(), RemoteDebugging::skipLDpath, wxTimer::Start(), DebuggerDriver::Start(), DebuggerState::StartDriver(), cbDebuggerPlugin::SwitchToDebuggingLayout(), wxString::Trim(), ttCommandsOnly, ttConsoleOnly, DebuggerDriver::UseDebugBreakProcess(), wxString::wx_str(), wxEmptyString, wxGetEnv(), wxICON_ERROR, wxICON_INFORMATION, wxMilliSleep(), wxSetEnv(), wxT, and Manager::Yield().

Referenced by CompilerFinished(), Debug(), and ResetProject().

◆ DoSendCommand()

void DebuggerGDB::DoSendCommand ( const wxString cmd)

◆ DoWatches()

void DebuggerGDB::DoWatches ( )
private

◆ EnableBreakpoint()

void DebuggerGDB::EnableBreakpoint ( cb::shared_ptr< cbBreakpoint breakpoint,
bool  enable 
)
virtual

◆ ExpandWatch()

void DebuggerGDB::ExpandWatch ( cb::shared_ptr< cbWatch watch)
virtual

Implements cbDebuggerPlugin.

Definition at line 2211 of file debuggergdb.cpp.

Referenced by GetExitCode().

◆ GetActiveConfigEx()

DebuggerConfiguration & DebuggerGDB::GetActiveConfigEx ( )

◆ GetActiveStackFrame()

int DebuggerGDB::GetActiveStackFrame ( ) const
virtual

◆ GetBreakpoint() [1/2]

cb::shared_ptr< cbBreakpoint > DebuggerGDB::GetBreakpoint ( int  index)
virtual

Implements cbDebuggerPlugin.

Definition at line 1405 of file debuggergdb.cpp.

References cbAssert, DebuggerState::GetBreakpoints(), and m_State.

◆ GetBreakpoint() [2/2]

cb::shared_ptr< const cbBreakpoint > DebuggerGDB::GetBreakpoint ( int  index) const
virtual

Implements cbDebuggerPlugin.

Definition at line 1413 of file debuggergdb.cpp.

References cbAssert, DebuggerState::GetBreakpoints(), and m_State.

◆ GetBreakpointsCount()

int DebuggerGDB::GetBreakpointsCount ( ) const
virtual

Implements cbDebuggerPlugin.

Definition at line 1400 of file debuggergdb.cpp.

References DebuggerState::GetBreakpoints(), and m_State.

◆ GetCurrentPosition()

void DebuggerGDB::GetCurrentPosition ( wxString filename,
int &  line 
)
virtual

◆ GetExitCode()

int DebuggerGDB::GetExitCode ( ) const
inlinevirtual

◆ GetProject()

cbProject* DebuggerGDB::GetProject ( )
inlineprotectedvirtual

Implements cbDebuggerPlugin.

Definition at line 136 of file debuggergdb.h.

References m_pProject.

◆ GetProjectConfigurationPanel()

cbConfigurationPanel * DebuggerGDB::GetProjectConfigurationPanel ( wxWindow parent,
cbProject project 
)

Definition at line 290 of file debuggergdb.cpp.

◆ GetRemoteDebuggingMap()

RemoteDebuggingMap & DebuggerGDB::GetRemoteDebuggingMap ( cbProject project = 0)

◆ GetSearchDirs()

wxArrayString & DebuggerGDB::GetSearchDirs ( cbProject prj)

◆ GetStackFrame()

cb::shared_ptr< const cbStackFrame > DebuggerGDB::GetStackFrame ( int  index) const
virtual

◆ GetStackFrameCount()

int DebuggerGDB::GetStackFrameCount ( ) const
virtual

◆ GetState()

DebuggerState& DebuggerGDB::GetState ( )
inline

◆ GetThread()

cb::shared_ptr< const cbThread > DebuggerGDB::GetThread ( int  index) const
virtual

Implements cbDebuggerPlugin.

Definition at line 1347 of file debuggergdb.cpp.

References DebuggerState::GetDriver(), DebuggerDriver::GetThreads(), and m_State.

◆ GetThreadsCount()

int DebuggerGDB::GetThreadsCount ( ) const
virtual

◆ HasWatch()

bool DebuggerGDB::HasWatch ( cb::shared_ptr< cbWatch watch)
virtual

Implements cbDebuggerPlugin.

Definition at line 2128 of file debuggergdb.cpp.

References m_funcArgsWatch, m_localsWatch, and m_watches.

Referenced by GetExitCode(), SetWatchValue(), and UpdateWatch().

◆ IsAttachedToProcess()

bool DebuggerGDB::IsAttachedToProcess ( ) const
virtual

Implements cbDebuggerPlugin.

Definition at line 2297 of file debuggergdb.cpp.

References m_PidToAttach.

Referenced by GetExitCode(), and GDB_driver::Stop().

◆ IsBusy()

bool DebuggerGDB::IsBusy ( ) const
virtual

Is the plugin processing something?

Implements cbDebuggerPlugin.

Definition at line 661 of file debuggergdb.cpp.

References DebuggerState::GetDriver(), DebuggerState::HasDriver(), DebuggerDriver::IsQueueBusy(), and m_State.

Referenced by IsRunning().

◆ IsRunning()

bool DebuggerGDB::IsRunning ( ) const
inlinevirtual

Is the plugin currently debugging?

Implements cbDebuggerPlugin.

Definition at line 85 of file debuggergdb.h.

References IsBusy(), IsStopped(), and m_pProcess.

Referenced by OnUpdateTools().

◆ IsStopped()

bool DebuggerGDB::IsStopped ( ) const
virtual

◆ IsTemporaryBreak()

bool DebuggerGDB::IsTemporaryBreak ( ) const
inline

Definition at line 88 of file debuggergdb.h.

References m_TemporaryBreak.

Referenced by CDB_driver::ParseOutput().

◆ KillConsole()

void DebuggerGDB::KillConsole ( )
private

Definition at line 1927 of file debuggergdb.cpp.

References HandlerRoutine(), m_bIsConsole, m_nConsolePid, and wxKill().

Referenced by OnGDBTerminated(), OnReleaseReal(), and ResetProject().

◆ LaunchProcess()

int DebuggerGDB::LaunchProcess ( const wxString cmd,
const wxString cwd 
)
private

◆ LaunchProcessWithShell()

int DebuggerGDB::LaunchProcessWithShell ( const wxString cmd,
wxProcess process,
const wxString cwd 
)
private

◆ LoadConfig()

cbDebuggerConfiguration * DebuggerGDB::LoadConfig ( const ConfigManagerWrapper config)
virtual

Implements cbDebuggerPlugin.

Definition at line 280 of file debuggergdb.cpp.

◆ MarkAllWatchesAsUnchanged()

void DebuggerGDB::MarkAllWatchesAsUnchanged ( )
private

Definition at line 2235 of file debuggergdb.cpp.

References m_funcArgsWatch, m_localsWatch, and m_watches.

Referenced by OnCursorChanged(), and ResetProject().

◆ Next()

void DebuggerGDB::Next ( )
virtual

Execute the next instruction and return control to the debugger.

Implements cbDebuggerPlugin.

Definition at line 1536 of file debuggergdb.cpp.

References CMD_STEP, and RunCommand().

◆ NextInstruction()

void DebuggerGDB::NextInstruction ( )
virtual

Execute the next instruction and return control to the debugger.

Implements cbDebuggerPlugin.

Definition at line 1541 of file debuggergdb.cpp.

References CMD_STEP_INSTR, and RunCommand().

◆ OnAddSymbolFile()

void DebuggerGDB::OnAddSymbolFile ( wxCommandEvent event)
private

◆ OnAttachReal()

void DebuggerGDB::OnAttachReal ( )
virtual

◆ OnBuildTargetSelected()

void DebuggerGDB::OnBuildTargetSelected ( CodeBlocksEvent event)
private

◆ OnCatchThrow()

void DebuggerGDB::OnCatchThrow ( wxCommandEvent event)
private

◆ OnConfigurationChange()

void DebuggerGDB::OnConfigurationChange ( bool  isActive)
virtual

◆ OnCursorChanged()

void DebuggerGDB::OnCursorChanged ( wxCommandEvent event)
private

◆ OnGDBError()

void DebuggerGDB::OnGDBError ( wxCommandEvent event)
private

Definition at line 1882 of file debuggergdb.cpp.

References wxString::IsEmpty(), and ParseOutput().

Referenced by ResetProject().

◆ OnGDBOutput()

void DebuggerGDB::OnGDBOutput ( wxCommandEvent event)
private

Definition at line 1875 of file debuggergdb.cpp.

References wxString::IsEmpty(), and ParseOutput().

Referenced by ResetProject().

◆ OnGDBTerminated()

void DebuggerGDB::OnGDBTerminated ( wxCommandEvent event)
private

◆ OnIdle()

void DebuggerGDB::OnIdle ( wxIdleEvent event)
private

Definition at line 2010 of file debuggergdb.cpp.

References m_pProcess.

Referenced by ResetProject().

◆ OnInfoDLL()

void DebuggerGDB::OnInfoDLL ( wxCommandEvent event)
private

◆ OnInfoFiles()

void DebuggerGDB::OnInfoFiles ( wxCommandEvent event)
private

◆ OnInfoFPU()

void DebuggerGDB::OnInfoFPU ( wxCommandEvent event)
private

◆ OnInfoFrame()

void DebuggerGDB::OnInfoFrame ( wxCommandEvent event)
private

◆ OnInfoSignals()

void DebuggerGDB::OnInfoSignals ( wxCommandEvent event)
private

◆ OnMenuWatchDereference()

void DebuggerGDB::OnMenuWatchDereference ( wxCommandEvent event)
private

◆ OnPrintElements()

void DebuggerGDB::OnPrintElements ( wxCommandEvent event)
private

◆ OnProjectLoadingHook()

void DebuggerGDB::OnProjectLoadingHook ( cbProject project,
TiXmlElement *  elem,
bool  loading 
)

◆ OnReleaseReal()

void DebuggerGDB::OnReleaseReal ( bool  appShutDown)
virtual

◆ OnShowFile()

void DebuggerGDB::OnShowFile ( wxCommandEvent event)
private

Definition at line 2028 of file debuggergdb.cpp.

References cbDebuggerPlugin::SyncEditor().

Referenced by ResetProject().

◆ OnTimer()

void DebuggerGDB::OnTimer ( wxTimerEvent event)
private

Definition at line 2018 of file debuggergdb.cpp.

References CheckIfConsoleIsClosed(), ParseOutput(), wxEmptyString, and wxWakeUpIdle().

Referenced by ResetProject().

◆ OnUpdateCatchThrow()

void DebuggerGDB::OnUpdateCatchThrow ( wxUpdateUIEvent event)
private

◆ OnUpdateTools()

void DebuggerGDB::OnUpdateTools ( wxUpdateUIEvent event)
private

Definition at line 1798 of file debuggergdb.cpp.

References IsRunning(), IsStopped(), and m_printElements.

Referenced by ResetProject().

◆ OnValueTooltip()

void DebuggerGDB::OnValueTooltip ( const wxString token,
const wxRect evalRect 
)
virtual

Reimplemented from cbDebuggerPlugin.

Definition at line 1988 of file debuggergdb.cpp.

References DebuggerDriver::EvaluateSymbol(), DebuggerState::GetDriver(), and m_State.

Referenced by GetState().

◆ OnWatchesContextMenu()

void DebuggerGDB::OnWatchesContextMenu ( wxMenu menu,
const cbWatch watch,
wxObject property,
int &  disabledMenus 
)
virtual

◆ ParseOutput()

void DebuggerGDB::ParseOutput ( const wxString output)
private

◆ RequestUpdate()

void DebuggerGDB::RequestUpdate ( DebugWindows  window)
virtual

◆ ResetProject()

void DebuggerGDB::ResetProject ( )
inlineprotectedvirtual

◆ RunCommand()

void DebuggerGDB::RunCommand ( int  cmd)

◆ RunToCursor()

bool DebuggerGDB::RunToCursor ( const wxString filename,
int  line,
const wxString line_text 
)
virtual

◆ SendCommand()

void DebuggerGDB::SendCommand ( const wxString cmd,
bool  debugLog 
)
virtual

◆ SetNextStatement()

void DebuggerGDB::SetNextStatement ( const wxString filename,
int  line 
)
virtual

Sets the position of the Program counter to the specified filename:line.

Implements cbDebuggerPlugin.

Definition at line 1602 of file debuggergdb.cpp.

References DebuggerState::GetDriver(), DebuggerState::HasDriver(), IsStopped(), m_State, and DebuggerDriver::SetNextStatement().

◆ SetupToolsMenu()

void DebuggerGDB::SetupToolsMenu ( wxMenu menu)
privatevirtual

◆ SetWatchValue()

bool DebuggerGDB::SetWatchValue ( cb::shared_ptr< cbWatch watch,
const wxString value 
)
virtual

◆ ShiftBreakpoint()

void DebuggerGDB::ShiftBreakpoint ( int  index,
int  lines_to_shift 
)
virtual

◆ ShowValueTooltip()

bool DebuggerGDB::ShowValueTooltip ( int  style)
virtual

◆ ShowWatchProperties()

void DebuggerGDB::ShowWatchProperties ( cb::shared_ptr< cbWatch watch)
virtual

Implements cbDebuggerPlugin.

Definition at line 2137 of file debuggergdb.cpp.

References DoWatches(), and wxID_OK.

Referenced by GetExitCode().

◆ Step()

void DebuggerGDB::Step ( )
virtual

Execute the next instruction, stepping into function calls if needed, and return control to the debugger.

Implements cbDebuggerPlugin.

Definition at line 1551 of file debuggergdb.cpp.

References CMD_STEPIN, and RunCommand().

◆ StepIntoInstruction()

void DebuggerGDB::StepIntoInstruction ( )
virtual

Execute the next instruction and return control to the debugger, if the instruction is a function call step into it.

Implements cbDebuggerPlugin.

Definition at line 1546 of file debuggergdb.cpp.

References CMD_STEP_INTO_INSTR, and RunCommand().

◆ StepOut()

void DebuggerGDB::StepOut ( )
virtual

Execute the next instruction, stepping out of function calls if needed, and return control to the debugger.

Implements cbDebuggerPlugin.

Definition at line 1577 of file debuggergdb.cpp.

References CMD_STEPOUT, and RunCommand().

◆ Stop()

void DebuggerGDB::Stop ( )
virtual

◆ StripQuotes()

void DebuggerGDB::StripQuotes ( wxString str)
static

Definition at line 998 of file debuggergdb.cpp.

References _T, wxString::GetChar(), wxString::Length(), and wxString::Mid().

Referenced by ConvertToGDBDirectory(), and GetState().

◆ SupportsFeature()

bool DebuggerGDB::SupportsFeature ( cbDebuggerFeature::Flags  flag)
virtual

◆ SwitchToFrame()

void DebuggerGDB::SwitchToFrame ( int  number)
virtual

◆ SwitchToThread()

bool DebuggerGDB::SwitchToThread ( int  thread_number)
virtual

◆ UpdateBreakpoint()

void DebuggerGDB::UpdateBreakpoint ( cb::shared_ptr< cbBreakpoint breakpoint)
virtual

◆ UpdateWatch()

void DebuggerGDB::UpdateWatch ( cb::shared_ptr< cbWatch watch)
virtual

◆ Validate()

bool DebuggerGDB::Validate ( const wxString line,
const char  cb 
)

Definition at line 1556 of file debuggergdb.cpp.

References _T, and wxString::Find().

Friends And Related Function Documentation

◆ TestIfBelongToProject

friend struct TestIfBelongToProject
friend

Definition at line 219 of file debuggergdb.h.

Member Data Documentation

◆ m_ActiveBuildTarget

wxString DebuggerGDB::m_ActiveBuildTarget
private

Definition at line 194 of file debuggergdb.h.

Referenced by Debug(), DoDebug(), and OnBuildTargetSelected().

◆ m_bIsConsole

bool DebuggerGDB::m_bIsConsole
private

Definition at line 206 of file debuggergdb.h.

Referenced by DoDebug(), and KillConsole().

◆ m_Canceled

bool DebuggerGDB::m_Canceled
private

Definition at line 210 of file debuggergdb.h.

Referenced by Debug(), and DoDebug().

◆ m_EvalRect

wxRect DebuggerGDB::m_EvalRect
private

Definition at line 186 of file debuggergdb.h.

◆ m_funcArgsWatch

cb::shared_ptr<GDBWatch> DebuggerGDB::m_funcArgsWatch
private

◆ m_HookId

int DebuggerGDB::m_HookId
private

Definition at line 203 of file debuggergdb.h.

Referenced by OnAttachReal(), and OnReleaseReal().

◆ m_LastExitCode

bool DebuggerGDB::m_LastExitCode
private

Definition at line 183 of file debuggergdb.h.

Referenced by GetExitCode(), and OnGDBTerminated().

◆ m_localsWatch

cb::shared_ptr<GDBWatch> DebuggerGDB::m_localsWatch
private

◆ m_nConsolePid

int DebuggerGDB::m_nConsolePid
private

Definition at line 208 of file debuggergdb.h.

Referenced by CheckIfConsoleIsClosed(), DoDebug(), and KillConsole().

◆ m_NoDebugInfo

bool DebuggerGDB::m_NoDebugInfo
private

Definition at line 188 of file debuggergdb.h.

Referenced by Debug(), and OnGDBTerminated().

◆ m_Pid

int DebuggerGDB::m_Pid
private

Definition at line 184 of file debuggergdb.h.

Referenced by DoBreak(), LaunchProcess(), and Stop().

◆ m_PidToAttach

int DebuggerGDB::m_PidToAttach
private

◆ m_pProcess

PipedProcess* DebuggerGDB::m_pProcess
private

◆ m_pProject

cbProject* DebuggerGDB::m_pProject
private

◆ m_printElements

int DebuggerGDB::m_printElements
private

Definition at line 221 of file debuggergdb.h.

Referenced by DoDebug(), OnPrintElements(), and OnUpdateTools().

◆ m_RemoteDebugging

ProjectRemoteDebuggingMap DebuggerGDB::m_RemoteDebugging
private

Definition at line 201 of file debuggergdb.h.

Referenced by GetRemoteDebuggingMap().

◆ m_SearchDirs

SearchDirsMap DebuggerGDB::m_SearchDirs
private

Definition at line 198 of file debuggergdb.h.

Referenced by GetSearchDirs().

◆ m_State

DebuggerState DebuggerGDB::m_State
private

◆ m_stopDebuggerConsoleClosed

bool DebuggerGDB::m_stopDebuggerConsoleClosed
private

Definition at line 207 of file debuggergdb.h.

Referenced by CheckIfConsoleIsClosed(), and DoDebug().

◆ m_StoppedOnSignal

bool DebuggerGDB::m_StoppedOnSignal
private

Definition at line 190 of file debuggergdb.h.

◆ m_TemporaryBreak

bool DebuggerGDB::m_TemporaryBreak
private

Definition at line 212 of file debuggergdb.h.

Referenced by DebuggeeContinued(), DoBreak(), IsTemporaryBreak(), and OnCursorChanged().

◆ m_TimerPollDebugger

wxTimer DebuggerGDB::m_TimerPollDebugger
private

Definition at line 187 of file debuggergdb.h.

Referenced by DoDebug(), OnAttachReal(), and OnGDBTerminated().

◆ m_watches

WatchesContainer DebuggerGDB::m_watches
private

◆ m_watchToDereferenceProperty

wxObject* DebuggerGDB::m_watchToDereferenceProperty
private

Definition at line 217 of file debuggergdb.h.

Referenced by OnMenuWatchDereference(), and OnWatchesContextMenu().

◆ m_watchToDereferenceSymbol

wxString DebuggerGDB::m_watchToDereferenceSymbol
private

Definition at line 216 of file debuggergdb.h.

Referenced by OnMenuWatchDereference(), and OnWatchesContextMenu().


The documentation for this class was generated from the following files: