GDBServerFoundation::GDBStub Class Reference

Implements supported gdbserver packets by invoking methods of a provided IGDBTarget object. More...

#include <GDBStub.h>

Inheritance diagram for GDBServerFoundation::GDBStub:
GDBServerFoundation::BasicGDBStub GDBServerFoundation::IGDBStub GDBServerFoundation::IBreakInTarget

Public Member Functions

 GDBStub (ISyncGDBTarget *pTarget, bool own=true)
 
 ~GDBStub ()
 
virtual void OnBreakInRequest ()
 
virtual StubResponse Handle_QueryStopReason ()
 
virtual StubResponse Handle_g (int threadID)
 Returns the values of all target registers in one block.
 
virtual StubResponse Handle_G (int threadID, const BazisLib::TempStringA &registerValueBlock)
 Sets the value of all target registers.
 
virtual StubResponse Handle_P (int threadID, const BazisLib::TempStringA &registerIndex, const BazisLib::TempStringA &registerValue)
 Sets the value of exactly one register.
 
virtual StubResponse Handle_m (const BazisLib::TempStringA &addr, const BazisLib::TempStringA &length)
 Reads target memory.
 
virtual StubResponse Handle_M (const BazisLib::TempStringA &addr, const BazisLib::TempStringA &length, const BazisLib::TempStringA &data)
 Writes target memory.
 
virtual StubResponse Handle_X (const BazisLib::TempStringA &addr, const BazisLib::TempStringA &length, const BazisLib::TempStringA &binaryData)
 Writes target memory, data is transmitted in binary format.
 
virtual StubResponse Handle_qXfer (const BazisLib::TempStringA &object, const BazisLib::TempStringA &verb, const BazisLib::TempStringA &annex, const BazisLib::TempStringA &offset, const BazisLib::TempStringA &length)
 
virtual StubResponse HandleRequest (const BazisLib::TempStringA &requestType, char splitterChar, const BazisLib::TempStringA &requestData)
 Handles a fully unescaped RLE-expanded request from GDB.
 
virtual StubResponse Handle_c (int threadID)
 Continue executing selected thread.
 
virtual StubResponse Handle_s (int threadID)
 Single-step selected thread.
 
virtual StubResponse Handle_qfThreadInfo ()
 Return a list of all thread IDs.
 
virtual StubResponse Handle_qsThreadInfo ()
 
virtual StubResponse Handle_qThreadExtraInfo (const BazisLib::TempStringA &strThreadID)
 Return user-friendly thread description.
 
virtual StubResponse Handle_T (const BazisLib::TempStringA &strThreadID)
 Check whether the specified thread is alive.
 
virtual StubResponse Handle_qC ()
 Returns the current thread ID.
 
virtual StubResponse Handle_vCont (const BazisLib::TempStringA &arguments)
 Sets step mode for each thread independently and continues execution.
 
virtual StubResponse Handle_k ()
 Kills the process.
 
virtual StubResponse Handle_Zz (bool setBreakpoint, char type, const BazisLib::TempStringA &addr, const BazisLib::TempStringA &kind, const BazisLib::TempStringA &conditions)
 Sets or removes a breakpoint.
 
virtual StubResponse Handle_qCRC (const BazisLib::TempStringA &addr, const BazisLib::TempStringA &length)
 Computes CRC of a given memory block.
 
virtual StubResponse Handle_qRcmd (const BazisLib::TempStringA &command)
 Executes an arbitrary target command sent by GDB.
 
virtual StubResponse Handle_vFlashErase (const BazisLib::TempStringA &addr, const BazisLib::TempStringA &length)
 
virtual StubResponse Handle_vFlashWrite (const BazisLib::TempStringA &addr, const BazisLib::TempStringA &binaryData)
 
virtual StubResponse Handle_vFlashDone ()
 
- Public Member Functions inherited from GDBServerFoundation::BasicGDBStub
 BasicGDBStub ()
 
- Public Member Functions inherited from GDBServerFoundation::IGDBStub
virtual ~IGDBStub ()
 

Protected Member Functions

virtual BazisLib::DynamicStringA BuildGDBReportByName (const BazisLib::TempStringA &name, const BazisLib::TempStringA &annex)
 
RegisterSetContainer InitializeRegisterSetContainer ()
 
void ResetAllCachesWhenResumingTarget ()
 
void ProvideThreadInfo ()
 
- Protected Member Functions inherited from GDBServerFoundation::BasicGDBStub
virtual StubResponse Handle_qSupported (const BazisLib::TempStringA &requestData)
 Stores features supported by GDB and reports features supported by the stub.
 
virtual StubResponse Handle_H (const BazisLib::TempStringA &requestType)
 Sets thread ID for subsequent thread-related commands.
 
StubResponse StopRecordToStopReply (const TargetStopRecord &rec, const char *pReportedRegisterValues=NULL, bool updateLastReportedThreadID=true)
 
int GetThreadIDForOp (bool isRegOp)
 
void AppendRegisterValueToString (const RegisterValue &val, size_t sizeInBytes, BazisLib::DynamicStringA &str, const char *pSuffix=NULL)
 
StubResponse FormatGDBStatus (GDBStatus status)
 
void RegisterStubFeature (const char *pFeature)
 

Additional Inherited Members

- Protected Attributes inherited from GDBServerFoundation::BasicGDBStub
int m_ThreadIDForCont
 
int m_ThreadIDForReg
 
int m_LastReportedCurrentThreadID
 

Detailed Description

Implements supported gdbserver packets by invoking methods of a provided IGDBTarget object.

Examples:
SimpleWin32Server/SimpleWin32Server.cpp.

Constructor & Destructor Documentation

GDBServerFoundation::GDBStub::GDBStub ( ISyncGDBTarget pTarget,
bool  own = true 
)
GDBServerFoundation::GDBStub::~GDBStub ( )
inline

Member Function Documentation

BazisLib::DynamicStringA GDBServerFoundation::GDBStub::BuildGDBReportByName ( const BazisLib::TempStringA &  name,
const BazisLib::TempStringA &  annex 
)
protectedvirtual
GDBServerFoundation::StubResponse GDBServerFoundation::GDBStub::Handle_c ( int  threadID)
virtual

Continue executing selected thread.

Implements GDBServerFoundation::BasicGDBStub.

GDBServerFoundation::StubResponse GDBServerFoundation::GDBStub::Handle_g ( int  threadID)
virtual

Returns the values of all target registers in one block.

Implements GDBServerFoundation::BasicGDBStub.

GDBServerFoundation::StubResponse GDBServerFoundation::GDBStub::Handle_G ( int  threadID,
const BazisLib::TempStringA &  registerValueBlock 
)
virtual

Sets the value of all target registers.

Implements GDBServerFoundation::BasicGDBStub.

GDBServerFoundation::StubResponse GDBServerFoundation::GDBStub::Handle_k ( )
virtual

Kills the process.

Implements GDBServerFoundation::BasicGDBStub.

GDBServerFoundation::StubResponse GDBServerFoundation::GDBStub::Handle_m ( const BazisLib::TempStringA &  addr,
const BazisLib::TempStringA &  length 
)
virtual

Reads target memory.

Implements GDBServerFoundation::BasicGDBStub.

GDBServerFoundation::StubResponse GDBServerFoundation::GDBStub::Handle_M ( const BazisLib::TempStringA &  addr,
const BazisLib::TempStringA &  length,
const BazisLib::TempStringA &  data 
)
virtual

Writes target memory.

Implements GDBServerFoundation::BasicGDBStub.

GDBServerFoundation::StubResponse GDBServerFoundation::GDBStub::Handle_P ( int  threadID,
const BazisLib::TempStringA &  registerIndex,
const BazisLib::TempStringA &  registerValue 
)
virtual

Sets the value of exactly one register.

Implements GDBServerFoundation::BasicGDBStub.

GDBServerFoundation::StubResponse GDBServerFoundation::GDBStub::Handle_qC ( )
virtual

Returns the current thread ID.

Implements GDBServerFoundation::BasicGDBStub.

GDBServerFoundation::StubResponse GDBServerFoundation::GDBStub::Handle_qCRC ( const BazisLib::TempStringA &  addr,
const BazisLib::TempStringA &  length 
)
virtual

Computes CRC of a given memory block.

Implements GDBServerFoundation::BasicGDBStub.

GDBServerFoundation::StubResponse GDBServerFoundation::GDBStub::Handle_qfThreadInfo ( )
virtual

Return a list of all thread IDs.

Implements GDBServerFoundation::BasicGDBStub.

GDBServerFoundation::StubResponse GDBServerFoundation::GDBStub::Handle_qRcmd ( const BazisLib::TempStringA &  command)
virtual

Executes an arbitrary target command sent by GDB.

Implements GDBServerFoundation::BasicGDBStub.

GDBServerFoundation::StubResponse GDBServerFoundation::GDBStub::Handle_qsThreadInfo ( )
virtual
GDBServerFoundation::StubResponse GDBServerFoundation::GDBStub::Handle_qThreadExtraInfo ( const BazisLib::TempStringA &  strThreadID)
virtual

Return user-friendly thread description.

Implements GDBServerFoundation::BasicGDBStub.

StubResponse GDBStub::Handle_QueryStopReason ( )
virtual
GDBServerFoundation::StubResponse GDBServerFoundation::GDBStub::Handle_qXfer ( const BazisLib::TempStringA &  object,
const BazisLib::TempStringA &  verb,
const BazisLib::TempStringA &  annex,
const BazisLib::TempStringA &  offset,
const BazisLib::TempStringA &  length 
)
virtual
GDBServerFoundation::StubResponse GDBServerFoundation::GDBStub::Handle_s ( int  threadID)
virtual

Single-step selected thread.

Implements GDBServerFoundation::BasicGDBStub.

GDBServerFoundation::StubResponse GDBServerFoundation::GDBStub::Handle_T ( const BazisLib::TempStringA &  strThreadID)
virtual

Check whether the specified thread is alive.

Implements GDBServerFoundation::BasicGDBStub.

GDBServerFoundation::StubResponse GDBServerFoundation::GDBStub::Handle_vCont ( const BazisLib::TempStringA &  arguments)
virtual

Sets step mode for each thread independently and continues execution.

Implements GDBServerFoundation::BasicGDBStub.

GDBServerFoundation::StubResponse GDBServerFoundation::GDBStub::Handle_vFlashDone ( )
virtual
GDBServerFoundation::StubResponse GDBServerFoundation::GDBStub::Handle_vFlashErase ( const BazisLib::TempStringA &  addr,
const BazisLib::TempStringA &  length 
)
virtual
GDBServerFoundation::StubResponse GDBServerFoundation::GDBStub::Handle_vFlashWrite ( const BazisLib::TempStringA &  addr,
const BazisLib::TempStringA &  binaryData 
)
virtual
GDBServerFoundation::StubResponse GDBServerFoundation::GDBStub::Handle_X ( const BazisLib::TempStringA &  addr,
const BazisLib::TempStringA &  length,
const BazisLib::TempStringA &  binaryData 
)
virtual

Writes target memory, data is transmitted in binary format.

Implements GDBServerFoundation::BasicGDBStub.

GDBServerFoundation::StubResponse GDBServerFoundation::GDBStub::Handle_Zz ( bool  setBreakpoint,
char  type,
const BazisLib::TempStringA &  addr,
const BazisLib::TempStringA &  kind,
const BazisLib::TempStringA &  conditions 
)
virtual

Sets or removes a breakpoint.

Implements GDBServerFoundation::BasicGDBStub.

GDBServerFoundation::StubResponse GDBServerFoundation::GDBStub::HandleRequest ( const BazisLib::TempStringA &  requestType,
char  splitterChar,
const BazisLib::TempStringA &  requestData 
)
virtual

Handles a fully unescaped RLE-expanded request from GDB.

Reimplemented from GDBServerFoundation::BasicGDBStub.

GDBServerFoundation::RegisterSetContainer GDBServerFoundation::GDBStub::InitializeRegisterSetContainer ( )
protected
virtual void GDBServerFoundation::GDBStub::OnBreakInRequest ( )
inlinevirtual
void GDBServerFoundation::GDBStub::ProvideThreadInfo ( )
protected
void GDBServerFoundation::GDBStub::ResetAllCachesWhenResumingTarget ( )
protectedvirtual

Reimplemented from GDBServerFoundation::BasicGDBStub.


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