Code::Blocks  SVN r11506
Public Member Functions | Private Member Functions | Private Attributes | List of all members
CDB_driver Class Reference

#include <cdb_driver.h>

Inheritance diagram for CDB_driver:
Collaboration diagram for CDB_driver:

Public Member Functions

 CDB_driver (DebuggerGDB *plugin)
 
virtual ~CDB_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 (cb_unused size_t threadIndex)
 
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 (cb::shared_ptr< GDBWatch > const &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 bool UseDebugBreakProcess ()
 Ask the driver if the debugger should be interrupted with DebugBreakProcess or Ctrl+C event. More...
 
- Public Member Functions inherited from DebuggerDriver
 DebuggerDriver (DebuggerGDB *plugin)
 
virtual ~DebuggerDriver ()
 
void Log (const wxString &msg)
 
void DebugLog (const wxString &msg)
 
DebuggerGDBGetDebugger ()
 
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...
 
virtual void SwitchThread (size_t threadIndex)=0
 Request to switch to another thread. 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...
 
DebuggerCmdCurrentCommand ()
 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 StackFrameContainerGetStackFrames () const
 returns the container with the current backtrace More...
 
StackFrameContainerGetStackFrames ()
 returns the container with the current backtrace More...
 
const ThreadsContainerGetThreads () const
 returns the thread container with the current list of threads More...
 
ThreadsContainerGetThreads ()
 returns the thread container with the current list of threads More...
 
const CursorGetCursor () 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...
 
virtual void DetermineLanguage ()
 Determine language is debugged. More...
 

Private Member Functions

void DoBacktrace (bool switchToFirst)
 
wxString GetCommonCommandLine (const wxString &debugger)
 

Private Attributes

ProjectBuildTargetm_Target
 
bool m_IsStarted
 

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
DebuggerGDBm_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
 

Detailed Description

Definition at line 11 of file cdb_driver.h.

Constructor & Destructor Documentation

◆ CDB_driver()

CDB_driver::CDB_driver ( DebuggerGDB plugin)

Definition at line 42 of file cdb_driver.cpp.

◆ ~CDB_driver()

CDB_driver::~CDB_driver ( )
virtual

Definition at line 50 of file cdb_driver.cpp.

Member Function Documentation

◆ AddBreakpoint()

void CDB_driver::AddBreakpoint ( cb::shared_ptr< DebuggerBreakpoint bp)
virtual

Add a breakpoint.

Parameters
bpThe breakpoint to add.
editorThe editor this breakpoint is set (might be NULL).

Implements DebuggerDriver.

Definition at line 257 of file cdb_driver.cpp.

References DebuggerDriver::QueueCommand().

Referenced by SwitchThread().

◆ Attach()

void CDB_driver::Attach ( int  pid)
virtual

Attach to process.

Implements DebuggerDriver.

Definition at line 321 of file cdb_driver.cpp.

◆ Backtrace()

void CDB_driver::Backtrace ( )
virtual

Implements DebuggerDriver.

Definition at line 186 of file cdb_driver.cpp.

References DoBacktrace().

◆ Continue()

void CDB_driver::Continue ( )
virtual

◆ CPURegisters()

void CDB_driver::CPURegisters ( )
virtual

Implements DebuggerDriver.

Definition at line 201 of file cdb_driver.cpp.

References DebuggerDriver::QueueCommand().

◆ Detach()

void CDB_driver::Detach ( )
virtual

Detach from running process.

Implements DebuggerDriver.

Definition at line 326 of file cdb_driver.cpp.

References DebuggerDriver::QueueCommand().

◆ Disassemble()

void CDB_driver::Disassemble ( )
virtual

Implements DebuggerDriver.

Definition at line 196 of file cdb_driver.cpp.

References DebuggerDriver::QueueCommand().

◆ DoBacktrace()

void CDB_driver::DoBacktrace ( bool  switchToFirst)
private

Definition at line 190 of file cdb_driver.cpp.

References Manager::Get(), and DebuggerDriver::QueueCommand().

Referenced by Backtrace(), ParseOutput(), and UseDebugBreakProcess().

◆ EnableCatchingThrow()

void CDB_driver::EnableCatchingThrow ( bool  enable)
virtual

Implements DebuggerDriver.

Definition at line 252 of file cdb_driver.cpp.

References NOT_IMPLEMENTED.

◆ EvaluateSymbol()

void CDB_driver::EvaluateSymbol ( const wxString symbol,
const wxRect tipRect 
)
virtual

Evaluate a symbol.

Parameters
symbolThe symbol to evaluate.
tipRectThe rect to use for the tip window.

Implements DebuggerDriver.

Definition at line 267 of file cdb_driver.cpp.

References DebuggerDriver::QueueCommand().

Referenced by SwitchThread().

◆ GetCommandLine() [1/2]

virtual wxString CDB_driver::GetCommandLine ( const wxString debugger,
const wxString debuggee,
const wxString userArguments 
)
virtual

Get the command-line to launch the debugger.

Implements DebuggerDriver.

Referenced by GetCommonCommandLine().

◆ GetCommandLine() [2/2]

virtual wxString CDB_driver::GetCommandLine ( const wxString debugger,
int  pid,
const wxString userArguments 
)
virtual

Get the command-line to launch the debugger.

Implements DebuggerDriver.

◆ GetCommonCommandLine()

wxString CDB_driver::GetCommonCommandLine ( const wxString debugger)
private

◆ InfoDLL()

void CDB_driver::InfoDLL ( )
virtual

Implements DebuggerDriver.

Definition at line 232 of file cdb_driver.cpp.

References NOT_IMPLEMENTED.

◆ InfoFiles()

void CDB_driver::InfoFiles ( )
virtual

Implements DebuggerDriver.

Definition at line 237 of file cdb_driver.cpp.

References NOT_IMPLEMENTED.

◆ InfoFPU()

void CDB_driver::InfoFPU ( )
virtual

Implements DebuggerDriver.

Definition at line 242 of file cdb_driver.cpp.

References NOT_IMPLEMENTED.

◆ InfoFrame()

void CDB_driver::InfoFrame ( )
virtual

Implements DebuggerDriver.

Definition at line 227 of file cdb_driver.cpp.

References NOT_IMPLEMENTED.

◆ InfoSignals()

void CDB_driver::InfoSignals ( )
virtual

Implements DebuggerDriver.

Definition at line 247 of file cdb_driver.cpp.

References NOT_IMPLEMENTED.

◆ IsDebuggingStarted()

bool CDB_driver::IsDebuggingStarted ( ) const
virtual

Is debugging started.

Implements DebuggerDriver.

Definition at line 416 of file cdb_driver.cpp.

References m_IsStarted.

Referenced by SwitchThread().

◆ MemoryDump()

void CDB_driver::MemoryDump ( )
virtual

Implements DebuggerDriver.

Definition at line 217 of file cdb_driver.cpp.

References NOT_IMPLEMENTED.

◆ ParseOutput()

void CDB_driver::ParseOutput ( const wxString output)
virtual

◆ Prepare()

void CDB_driver::Prepare ( bool  isConsole,
int  printElements 
)
virtual

Prepares the debugging process by setting up search dirs etc.

Parameters
isConsoleIf true, the debuggee is a console executable.

Implements DebuggerDriver.

Definition at line 110 of file cdb_driver.cpp.

References _T, DebuggerDriver::High, DebuggerDriver::m_QueueBusy, and DebuggerDriver::QueueCommand().

◆ RemoveBreakpoint()

void CDB_driver::RemoveBreakpoint ( cb::shared_ptr< DebuggerBreakpoint bp)
virtual

Remove a breakpoint.

Parameters
bpThe breakpoint to remove. If NULL, all reakpoints are removed.

Implements DebuggerDriver.

Definition at line 262 of file cdb_driver.cpp.

References DebuggerDriver::QueueCommand().

Referenced by SwitchThread().

◆ RunningThreads()

void CDB_driver::RunningThreads ( )
virtual

Implements DebuggerDriver.

Definition at line 222 of file cdb_driver.cpp.

References NOT_IMPLEMENTED.

◆ SetNextStatement()

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

Implements DebuggerDriver.

Definition at line 181 of file cdb_driver.cpp.

References NOT_IMPLEMENTED.

◆ SetTarget()

void CDB_driver::SetTarget ( ProjectBuildTarget target)
virtual

Sets the target.

Implements DebuggerDriver.

Definition at line 105 of file cdb_driver.cpp.

References m_Target.

◆ SetVarValue()

void CDB_driver::SetVarValue ( const wxString var,
const wxString value 
)
virtual

Implements DebuggerDriver.

Definition at line 212 of file cdb_driver.cpp.

References NOT_IMPLEMENTED.

◆ Start()

void CDB_driver::Start ( bool  breakOnEntry)
virtual

◆ Step()

void CDB_driver::Step ( )
virtual

Implements DebuggerDriver.

Definition at line 149 of file cdb_driver.cpp.

References _T, DebuggerDriver::QueueCommand(), and DebuggerDriver::ResetCursor().

Referenced by StepIn().

◆ StepIn()

void CDB_driver::StepIn ( )
virtual

Implements DebuggerDriver.

Definition at line 167 of file cdb_driver.cpp.

References _T, DebuggerDriver::QueueCommand(), DebuggerDriver::ResetCursor(), and Step().

◆ StepInstruction()

void CDB_driver::StepInstruction ( )
virtual

Implements DebuggerDriver.

Definition at line 157 of file cdb_driver.cpp.

References NOT_IMPLEMENTED.

◆ StepIntoInstruction()

void CDB_driver::StepIntoInstruction ( )
virtual

Implements DebuggerDriver.

Definition at line 162 of file cdb_driver.cpp.

References NOT_IMPLEMENTED.

◆ StepOut()

void CDB_driver::StepOut ( )
virtual

Implements DebuggerDriver.

Definition at line 174 of file cdb_driver.cpp.

References _T, DebuggerDriver::QueueCommand(), and DebuggerDriver::ResetCursor().

◆ Stop()

void CDB_driver::Stop ( )
virtual

Stop debugging.

Implements DebuggerDriver.

Definition at line 135 of file cdb_driver.cpp.

References _T, m_IsStarted, DebuggerDriver::QueueCommand(), and DebuggerDriver::ResetCursor().

◆ SwitchThread()

virtual void CDB_driver::SwitchThread ( cb_unused size_t  threadIndex)
inlinevirtual

◆ SwitchToFrame()

void CDB_driver::SwitchToFrame ( size_t  number)
virtual

Implements DebuggerDriver.

Definition at line 206 of file cdb_driver.cpp.

References DebuggerDriver::QueueCommand(), and DebuggerDriver::ResetCursor().

◆ UpdateWatch()

void CDB_driver::UpdateWatch ( cb::shared_ptr< GDBWatch > const &  watch)
virtual

Implements DebuggerDriver.

Definition at line 309 of file cdb_driver.cpp.

References DebuggerDriver::QueueCommand().

Referenced by SwitchThread().

◆ UpdateWatches()

void CDB_driver::UpdateWatches ( cb::shared_ptr< GDBWatch localsWatch,
cb::shared_ptr< GDBWatch funcArgsWatch,
WatchesContainer watches 
)
virtual

Update watches.

Parameters
doLocalsDisplay values of local variables.
doArgsDisplay values of function arguments.
treeThe watches tree control.

Implements DebuggerDriver.

Definition at line 272 of file cdb_driver.cpp.

References DebuggerDriver::QueueCommand().

Referenced by SwitchThread().

◆ UpdateWatchLocalsArgs()

void CDB_driver::UpdateWatchLocalsArgs ( cb::shared_ptr< GDBWatch > const &  watch,
bool  locals 
)
virtual

Implements DebuggerDriver.

Definition at line 315 of file cdb_driver.cpp.

Referenced by SwitchThread().

◆ UseDebugBreakProcess()

virtual bool CDB_driver::UseDebugBreakProcess ( )
inlinevirtual

Ask the driver if the debugger should be interrupted with DebugBreakProcess or Ctrl+C event.

Implements DebuggerDriver.

Definition at line 63 of file cdb_driver.h.

References DoBacktrace(), and GetCommonCommandLine().

Member Data Documentation

◆ m_IsStarted

bool CDB_driver::m_IsStarted
private

Definition at line 71 of file cdb_driver.h.

Referenced by Continue(), IsDebuggingStarted(), Start(), and Stop().

◆ m_Target

ProjectBuildTarget* CDB_driver::m_Target
private

Definition at line 70 of file cdb_driver.h.

Referenced by GetCommonCommandLine(), and SetTarget().


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