Code::Blocks
SVN r11506
|
#include <gdb_driver.h>
Public Member Functions | |
GDB_driver (DebuggerGDB *plugin) | |
virtual | ~GDB_driver () |
virtual wxString | GetCommandLine (const wxString &debugger, const wxString &debuggee, const wxString &userArguments) |
Get the command-line to launch the debugger. More... | |
virtual wxString | GetCommandLine (const wxString &debugger, int pid, const wxString &userArguments) |
Get the command-line to launch the debugger. More... | |
virtual void | SetTarget (ProjectBuildTarget *target) |
Sets the target. More... | |
virtual void | Prepare (bool isConsole, int printElements) |
Prepares the debugging process by setting up search dirs etc. More... | |
virtual void | Start (bool breakOnEntry) |
Begin the debugging process by launching a program. More... | |
virtual void | Stop () |
Stop debugging. More... | |
virtual void | Continue () |
virtual void | Step () |
virtual void | StepInstruction () |
virtual void | StepIntoInstruction () |
virtual void | StepIn () |
virtual void | StepOut () |
virtual void | SetNextStatement (const wxString &filename, int line) |
virtual void | Backtrace () |
virtual void | Disassemble () |
virtual void | CPURegisters () |
virtual void | SwitchToFrame (size_t number) |
virtual void | SetVarValue (const wxString &var, const wxString &value) |
virtual void | MemoryDump () |
virtual void | Attach (int pid) |
Attach to process. More... | |
virtual void | Detach () |
Detach from running process. More... | |
virtual void | RunningThreads () |
void | InfoFrame () |
void | InfoDLL () |
void | InfoFiles () |
void | InfoFPU () |
void | InfoSignals () |
void | EnableCatchingThrow (bool enable) |
virtual void | SwitchThread (size_t threadIndex) |
Request to switch to another thread. More... | |
virtual void | AddBreakpoint (cb::shared_ptr< DebuggerBreakpoint > bp) |
Add a breakpoint. More... | |
virtual void | RemoveBreakpoint (cb::shared_ptr< DebuggerBreakpoint > bp) |
Remove a breakpoint. More... | |
virtual void | EvaluateSymbol (const wxString &symbol, const wxRect &tipRect) |
Evaluate a symbol. More... | |
virtual void | UpdateWatches (cb::shared_ptr< GDBWatch > localsWatch, cb::shared_ptr< GDBWatch > funcArgsWatch, WatchesContainer &watches) |
Update watches. More... | |
virtual void | UpdateWatch (const cb::shared_ptr< GDBWatch > &watch) |
virtual void | UpdateWatchLocalsArgs (cb::shared_ptr< GDBWatch > const &watch, bool locals) |
virtual void | ParseOutput (const wxString &output) |
Parse debugger's output. More... | |
virtual bool | IsDebuggingStarted () const |
Is debugging started. More... | |
virtual void | DetermineLanguage () |
Determine language is debugged. More... | |
virtual bool | UseDebugBreakProcess () |
Ask the driver if the debugger should be interrupted with DebugBreakProcess or Ctrl+C event. More... | |
virtual wxString | GetDisassemblyFlavour (void) |
wxString | AsmFlavour () |
Public Member Functions inherited from DebuggerDriver | |
DebuggerDriver (DebuggerGDB *plugin) | |
virtual | ~DebuggerDriver () |
void | Log (const wxString &msg) |
void | DebugLog (const wxString &msg) |
DebuggerGDB * | GetDebugger () |
virtual void | AddDirectory (const wxString &dir) |
Add a directory in search list. More... | |
virtual void | ClearDirectories () |
Clear directories search list. More... | |
virtual void | SetWorkingDirectory (const wxString &dir) |
Set the working directory. More... | |
virtual void | SetArguments (const wxString &args) |
Set the execution arguments. More... | |
bool | IsProgramStopped () const |
Is the program stopped? More... | |
void | MarkProgramStopped (bool stopped) |
bool | IsQueueBusy () const |
Is the driver processing some commands? More... | |
void | SetChildPID (long pid) |
Set child PID (debuggee's). More... | |
long | GetChildPID () const |
Get the child's (debuggee's) PID. More... | |
wxString | GetDebuggersWorkingDirectory () const |
void | ShowFile (const wxString &file, int line) |
Show a file/line without changing the cursor. More... | |
void | QueueCommand (DebuggerCmd *dcmd, QueuePriority prio=Low) |
add a command in the queue. The DebuggerCmd will be deleted automatically when finished. More... | |
DebuggerCmd * | CurrentCommand () |
returns the currently executing command More... | |
void | RunQueue () |
runs the next command in the queue, if it is idle More... | |
void | RemoveTopCommand (bool deleteIt=true) |
removes the top command (it has finished) More... | |
const StackFrameContainer & | GetStackFrames () const |
returns the container with the current backtrace More... | |
StackFrameContainer & | GetStackFrames () |
returns the container with the current backtrace More... | |
const ThreadsContainer & | GetThreads () const |
returns the thread container with the current list of threads More... | |
ThreadsContainer & | GetThreads () |
returns the thread container with the current list of threads More... | |
const Cursor & | GetCursor () const |
Get debugger's cursor. More... | |
void | SetCursor (const Cursor &cursor) |
Set debugger's cursor. More... | |
void | ResetCurrentFrame () |
int | GetCurrentFrame () const |
int | GetUserSelectedFrame () const |
void | SetCurrentFrame (int number, bool user_selected) |
void | NotifyDebuggeeContinued () |
void | NotifyCursorChanged () |
Called by implementations to notify cursor changes. More... | |
Private Member Functions | |
void | HandleMainBreakPoint (const wxRegEx &reBreak, wxString line) |
void | DetectCygwinMount (void) |
void | CorrectCygwinPath (wxString &path) |
RemoteDebugging * | GetRemoteDebuggingInfo () |
Private Attributes | |
bool | m_CygwinPresent |
wxString | m_CygdrivePrefix |
bool | m_BreakOnEntry |
bool | m_ManualBreakOnEntry |
bool | m_IsStarted |
bool | m_needsUpdate |
bool | m_forceUpdate |
long | m_GDBVersionMajor |
long | m_GDBVersionMinor |
wxString | flavour |
bool | m_attachedToProcess |
ProjectBuildTarget * | m_pTarget |
RemoteDebugging | m_MergedRDInfo |
int | m_catchThrowIndex |
Additional Inherited Members | |
Public Types inherited from DebuggerDriver | |
enum | QueuePriority { Low = 0, High } |
The priority used when adding a command in the queue. More... | |
typedef std::vector< cb::shared_ptr< cbStackFrame > > | StackFrameContainer |
typedef std::vector< cb::shared_ptr< cbThread > > | ThreadsContainer |
Protected Member Functions inherited from DebuggerDriver | |
void | ResetCursor () |
Called by implementations to reset the cursor. More... | |
Protected Attributes inherited from DebuggerDriver | |
DebuggerGDB * | m_pDBG |
wxArrayString | m_Dirs |
wxString | m_WorkingDir |
wxString | m_Args |
bool | m_ProgramIsStopped |
wxString | m_LastCursorAddress |
Cursor | m_Cursor |
long | m_ChildPID |
DebuggerCommands | m_DCmds |
bool | m_QueueBusy |
StackFrameContainer | m_backtrace |
ThreadsContainer | m_threads |
int | m_currentFrameNo |
int | m_userSelectedFrameNo |
wxString | m_FileName |
Definition at line 13 of file gdb_driver.h.
GDB_driver::GDB_driver | ( | DebuggerGDB * | plugin | ) |
Definition at line 80 of file gdb_driver.cpp.
References m_forceUpdate, and m_needsUpdate.
|
virtual |
Definition at line 96 of file gdb_driver.cpp.
|
virtual |
Add a breakpoint.
bp | The breakpoint to add. |
editor | The editor this breakpoint is set (might be NULL). |
Implements DebuggerDriver.
Definition at line 584 of file gdb_driver.cpp.
References _T, DebuggerBreakpoint::bptData, wxRegEx::GetMatch(), wxString::IsSameAs(), wxRegEx::Matches(), DebuggerDriver::NotifyCursorChanged(), and DebuggerDriver::QueueCommand().
|
inline |
Definition at line 71 of file gdb_driver.h.
References CorrectCygwinPath(), DetectCygwinMount(), flavour, GetRemoteDebuggingInfo(), HandleMainBreakPoint(), and reBreak.
|
virtual |
Attach to process.
Implements DebuggerDriver.
Definition at line 678 of file gdb_driver.cpp.
References m_attachedToProcess, m_IsStarted, DebuggerDriver::QueueCommand(), and DebuggerDriver::SetChildPID().
|
virtual |
Implements DebuggerDriver.
Definition at line 493 of file gdb_driver.cpp.
References DebuggerDriver::QueueCommand().
|
virtual |
Implements DebuggerDriver.
Definition at line 436 of file gdb_driver.cpp.
References GetRemoteDebuggingInfo(), RemoteDebugging::IsOk(), m_attachedToProcess, m_IsStarted, m_ManualBreakOnEntry, DebuggerDriver::QueueCommand(), DebuggerDriver::ResetCursor(), and wxT.
Referenced by HandleMainBreakPoint().
|
private |
Definition at line 328 of file gdb_driver.cpp.
References _T, DetectCygwinMount(), wxString::EndsWith(), g_EscapeChar, wxString::GetChar(), wxString::Len(), m_CygdrivePrefix, wxString::Remove(), wxString::Replace(), wxString::StartsWith(), and wxEmptyString.
Referenced by AsmFlavour(), and ParseOutput().
|
virtual |
Implements DebuggerDriver.
Definition at line 506 of file gdb_driver.cpp.
References flavour, and DebuggerDriver::QueueCommand().
|
virtual |
Detach from running process.
Implements DebuggerDriver.
Definition at line 686 of file gdb_driver.cpp.
References DebuggerDriver::QueueCommand().
|
private |
Definition at line 272 of file gdb_driver.cpp.
References BUFSIZE, m_CygdrivePrefix, m_CygwinPresent, and NULL.
Referenced by AsmFlavour(), CorrectCygwinPath(), and Prepare().
|
virtual |
Determine language is debugged.
Reimplemented from DebuggerDriver.
Definition at line 1128 of file gdb_driver.cpp.
References DebuggerDriver::QueueCommand().
Referenced by IsDebuggingStarted().
|
virtual |
Implements DebuggerDriver.
Definition at line 498 of file gdb_driver.cpp.
References flavour, and DebuggerDriver::QueueCommand().
|
virtual |
Implements DebuggerDriver.
Definition at line 565 of file gdb_driver.cpp.
References wxString::Format(), m_catchThrowIndex, DebuggerDriver::QueueCommand(), and wxT.
Evaluate a symbol.
symbol | The symbol to evaluate. |
tipRect | The rect to use for the tip window. |
Implements DebuggerDriver.
Definition at line 623 of file gdb_driver.cpp.
References DebuggerDriver::QueueCommand().
|
virtual |
Get the command-line to launch the debugger.
Implements DebuggerDriver.
Definition at line 101 of file gdb_driver.cpp.
References _T, DebuggerConfiguration::DisableInit, DebuggerGDB::GetActiveConfigEx(), DebuggerConfiguration::GetFlag(), DebuggerDriver::m_pDBG, and wxT.
|
virtual |
Get the command-line to launch the debugger.
Implements DebuggerDriver.
|
virtual |
Definition at line 384 of file gdb_driver.cpp.
References flavour.
Referenced by IsDebuggingStarted().
|
private |
Definition at line 249 of file gdb_driver.cpp.
References DebuggerGDB::GetRemoteDebuggingMap(), m_MergedRDInfo, DebuggerDriver::m_pDBG, m_pTarget, and RemoteDebugging::MergeWith().
Referenced by AsmFlavour(), Continue(), Prepare(), Start(), and UseDebugBreakProcess().
Definition at line 1086 of file gdb_driver.cpp.
References _(), Cursor::address, Cursor::changed, Continue(), Cursor::file, wxRegEx::GetMatch(), DebuggerDriver::High, Cursor::line, cbDebuggerPlugin::Log(), m_BreakOnEntry, DebuggerDriver::m_Cursor, m_ManualBreakOnEntry, m_needsUpdate, DebuggerDriver::m_pDBG, wxRegEx::Matches(), DebuggerDriver::QueueCommand(), and wxString::ToLong().
Referenced by AsmFlavour(), and ParseOutput().
|
virtual |
Implements DebuggerDriver.
Definition at line 542 of file gdb_driver.cpp.
References _(), _T, and DebuggerDriver::QueueCommand().
|
virtual |
Implements DebuggerDriver.
Definition at line 550 of file gdb_driver.cpp.
References _(), _T, and DebuggerDriver::QueueCommand().
|
virtual |
Implements DebuggerDriver.
Definition at line 555 of file gdb_driver.cpp.
References _(), _T, and DebuggerDriver::QueueCommand().
|
virtual |
Implements DebuggerDriver.
Definition at line 537 of file gdb_driver.cpp.
References _(), _T, and DebuggerDriver::QueueCommand().
|
virtual |
Implements DebuggerDriver.
Definition at line 560 of file gdb_driver.cpp.
References _(), _T, and DebuggerDriver::QueueCommand().
|
inlinevirtual |
Is debugging started.
Implements DebuggerDriver.
Definition at line 63 of file gdb_driver.h.
References DetermineLanguage(), GetDisassemblyFlavour(), m_IsStarted, and UseDebugBreakProcess().
|
virtual |
Implements DebuggerDriver.
Definition at line 526 of file gdb_driver.cpp.
References DebuggerDriver::QueueCommand().
|
virtual |
Parse debugger's output.
Implements DebuggerDriver.
Definition at line 691 of file gdb_driver.cpp.
References _(), _T, GdbCmd_ChangeFrame::AddrChgMode(), Cursor::address, wxString::AfterFirst(), wxString::BeforeFirst(), cbDebuggerPlugin::BringCBToFront(), Cursor::changed, wxString::Clear(), wxString::clear(), CorrectCygwinPath(), DebuggerDriver::CurrentCommand(), cbDebuggerPlugin::DebugLog(), InfoWindow::Display(), wxString::empty(), Cursor::file, wxString::First(), wxString::Format(), Cursor::function, g_EscapeChar, GDB_PROMPT, Manager::Get(), GetArrayFromString(), DebuggerState::GetBreakpoint(), DebuggerState::GetBreakpointByNumber(), DebuggerManager::GetBreakpointDialog(), wxArrayString::GetCount(), Manager::GetDebuggerManager(), wxRegEx::GetMatch(), DebuggerGDB::GetState(), HandleMainBreakPoint(), DebuggerState::HasBreakpoint(), wxArrayString::Item(), wxString::Last(), wxString::Left(), Cursor::line, DebuggerDriver::Log(), cbDebuggerPlugin::Log(), DebuggerDriver::m_ChildPID, DebuggerDriver::m_Cursor, m_CygwinPresent, DebuggerDriver::m_DCmds, m_forceUpdate, m_GDBVersionMajor, m_GDBVersionMinor, m_IsStarted, m_needsUpdate, DebuggerDriver::m_pDBG, DebuggerDriver::m_ProgramIsStopped, DebuggerDriver::m_QueueBusy, wxRegEx::Matches(), DebuggerDriver::NotifyCursorChanged(), DebuggerCmd::ParseOutput(), DebuggerDriver::QueueCommand(), reBreak, reBreak2, reBreak3, reCatchThrow, reCatchThrowNoFile, reChildPid1, reChildPid2, reInferiorExited, reInferiorExitedWithCode, cbBreakpointsDlg::Reload(), wxString::Remove(), DebuggerState::RemoveBreakpoint(), wxString::RemoveLast(), DebuggerDriver::RemoveTopCommand(), rePendingFound, rePendingFound1, reTempBreakFound, reThreadSwitch, reThreadSwitch2, DebuggerDriver::RunQueue(), DebuggerDriver::SetChildPID(), wxString::StartsWith(), wxString::ToLong(), UnixFilename(), wxEmptyString, wxNOT_FOUND, and wxT.
|
virtual |
Prepares the debugging process by setting up search dirs etc.
isConsole | If true, the debuggee is a console executable. |
Implements DebuggerDriver.
Definition at line 132 of file gdb_driver.cpp.
References _T, RemoteDebugging::additionalCmds, RemoteDebugging::additionalCmdsBefore, RemoteDebugging::additionalShellCmdsAfter, RemoteDebugging::additionalShellCmdsBefore, DebuggerConfiguration::CatchExceptions, RemoteDebugging::connType, DetectCygwinMount(), wxString::empty(), flavour, wxString::Format(), FULL_GDB_PROMPT, Manager::Get(), DebuggerGDB::GetActiveConfigEx(), GetArrayFromString(), wxArrayString::GetCount(), DebuggerConfiguration::GetDisassemblyFlavorCommand(), DebuggerConfiguration::GetFlag(), DebuggerConfiguration::GetInitCommands(), Manager::GetMacrosManager(), GetRemoteDebuggingInfo(), wxString::IsEmpty(), RemoteDebugging::IsOk(), DebuggerDriver::m_Args, m_catchThrowIndex, DebuggerDriver::m_Dirs, DebuggerDriver::m_pDBG, DebuggerDriver::QueueCommand(), MacrosManager::ReplaceMacros(), RemoteDebugging::Serial, RemoteDebugging::serialBaud, and wxT.
|
virtual |
Remove a breakpoint.
bp | The breakpoint to remove. If NULL, all reakpoints are removed. |
Implements DebuggerDriver.
Definition at line 617 of file gdb_driver.cpp.
References DebuggerDriver::QueueCommand().
|
virtual |
Implements DebuggerDriver.
Definition at line 531 of file gdb_driver.cpp.
References Manager::Get(), and DebuggerDriver::QueueCommand().
|
virtual |
Implements DebuggerDriver.
Definition at line 486 of file gdb_driver.cpp.
References wxString::c_str(), wxString::Format(), DebuggerDriver::QueueCommand(), DebuggerDriver::ResetCursor(), and wxT.
|
virtual |
Sets the target.
Implements DebuggerDriver.
Definition at line 126 of file gdb_driver.cpp.
References m_pTarget.
Implements DebuggerDriver.
Definition at line 520 of file gdb_driver.cpp.
References _T, wxString::c_str(), CleanStringValue(), wxString::Format(), and DebuggerDriver::QueueCommand().
|
virtual |
Begin the debugging process by launching a program.
Implements DebuggerDriver.
Definition at line 391 of file gdb_driver.cpp.
References _T, cbDisassemblyDlg::Clear(), GdbCmd_DisassemblyInit::Clear(), DebuggerConfiguration::DoNotRun, Manager::Get(), DebuggerGDB::GetActiveConfigEx(), Manager::GetDebuggerManager(), DebuggerManager::GetDisassemblyDialog(), DebuggerConfiguration::GetFlag(), GetRemoteDebuggingInfo(), RemoteDebugging::IsOk(), m_attachedToProcess, m_BreakOnEntry, m_IsStarted, m_ManualBreakOnEntry, DebuggerDriver::m_pDBG, DebuggerDriver::QueueCommand(), and DebuggerDriver::ResetCursor().
|
virtual |
Implements DebuggerDriver.
Definition at line 456 of file gdb_driver.cpp.
References _T, DebuggerDriver::QueueCommand(), and DebuggerDriver::ResetCursor().
|
virtual |
Implements DebuggerDriver.
Definition at line 474 of file gdb_driver.cpp.
References _T, DebuggerDriver::QueueCommand(), and DebuggerDriver::ResetCursor().
|
virtual |
Implements DebuggerDriver.
Definition at line 462 of file gdb_driver.cpp.
References DebuggerDriver::QueueCommand(), and DebuggerDriver::ResetCursor().
|
virtual |
Implements DebuggerDriver.
Definition at line 468 of file gdb_driver.cpp.
References DebuggerDriver::QueueCommand(), and DebuggerDriver::ResetCursor().
|
virtual |
Implements DebuggerDriver.
Definition at line 480 of file gdb_driver.cpp.
References _T, DebuggerDriver::QueueCommand(), and DebuggerDriver::ResetCursor().
|
virtual |
Stop debugging.
Implements DebuggerDriver.
Definition at line 426 of file gdb_driver.cpp.
References _T, DebuggerGDB::IsAttachedToProcess(), m_attachedToProcess, m_IsStarted, DebuggerDriver::m_pDBG, DebuggerDriver::QueueCommand(), DebuggerDriver::ResetCursor(), and wxT.
|
virtual |
Request to switch to another thread.
Implements DebuggerDriver.
Definition at line 576 of file gdb_driver.cpp.
References _T, wxString::Format(), Manager::Get(), DebuggerDriver::QueueCommand(), and DebuggerDriver::ResetCursor().
|
virtual |
Implements DebuggerDriver.
Definition at line 514 of file gdb_driver.cpp.
References _T, DebuggerDriver::QueueCommand(), and DebuggerDriver::ResetCursor().
|
virtual |
Implements DebuggerDriver.
Definition at line 666 of file gdb_driver.cpp.
References DebuggerDriver::QueueCommand().
|
virtual |
Update watches.
doLocals | Display values of local variables. |
doArgs | Display values of function arguments. |
tree | The watches tree control. |
Implements DebuggerDriver.
Definition at line 628 of file gdb_driver.cpp.
References DebuggerGDB::DetermineLanguage(), Cursor::file, wxString::IsSameAs(), DebuggerDriver::m_Cursor, DebuggerDriver::m_FileName, DebuggerDriver::m_pDBG, and DebuggerDriver::QueueCommand().
|
virtual |
Implements DebuggerDriver.
Definition at line 672 of file gdb_driver.cpp.
References DebuggerDriver::QueueCommand().
|
virtual |
Ask the driver if the debugger should be interrupted with DebugBreakProcess or Ctrl+C event.
Implements DebuggerDriver.
Definition at line 376 of file gdb_driver.cpp.
References GetRemoteDebuggingInfo(), and RemoteDebugging::IsOk().
Referenced by IsDebuggingStarted().
|
private |
Definition at line 104 of file gdb_driver.h.
Referenced by AsmFlavour(), CPURegisters(), Disassemble(), GetDisassemblyFlavour(), and Prepare().
|
private |
Definition at line 106 of file gdb_driver.h.
Referenced by Attach(), Continue(), Start(), and Stop().
|
private |
Definition at line 88 of file gdb_driver.h.
Referenced by HandleMainBreakPoint(), and Start().
|
private |
Definition at line 114 of file gdb_driver.h.
Referenced by EnableCatchingThrow(), and Prepare().
|
private |
Definition at line 84 of file gdb_driver.h.
Referenced by CorrectCygwinPath(), and DetectCygwinMount().
|
private |
Definition at line 83 of file gdb_driver.h.
Referenced by DetectCygwinMount(), and ParseOutput().
|
private |
Definition at line 99 of file gdb_driver.h.
Referenced by GDB_driver(), and ParseOutput().
|
private |
Definition at line 102 of file gdb_driver.h.
Referenced by ParseOutput().
|
private |
Definition at line 103 of file gdb_driver.h.
Referenced by ParseOutput().
|
private |
Definition at line 95 of file gdb_driver.h.
Referenced by Attach(), Continue(), IsDebuggingStarted(), ParseOutput(), Start(), and Stop().
|
private |
Definition at line 92 of file gdb_driver.h.
Referenced by Continue(), HandleMainBreakPoint(), and Start().
|
private |
Definition at line 112 of file gdb_driver.h.
Referenced by GetRemoteDebuggingInfo().
|
private |
Definition at line 98 of file gdb_driver.h.
Referenced by GDB_driver(), HandleMainBreakPoint(), and ParseOutput().
|
private |
Definition at line 109 of file gdb_driver.h.
Referenced by GetRemoteDebuggingInfo(), and SetTarget().