gem5  v20.1.0.0
Classes | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
BaseRemoteGDB Class Referenceabstract

#include <remote_gdb.hh>

Inheritance diagram for BaseRemoteGDB:
ArmISA::RemoteGDB MipsISA::RemoteGDB PowerISA::RemoteGDB RiscvISA::RemoteGDB SparcISA::RemoteGDB X86ISA::RemoteGDB

Classes

struct  GdbCommand
 
class  SocketEvent
 
class  TrapEvent
 

Public Member Functions

bool breakpoint ()
 
void replaceThreadContext (ThreadContext *tc)
 
virtual ~BaseRemoteGDB ()
 
 BaseRemoteGDB (System *system, ThreadContext *context, int _port)
 Interface to other parts of the simulator. More...
 
virtual ~BaseRemoteGDB ()
 
std::string name ()
 
void listen ()
 
void connect ()
 
int port () const
 
void attach (int fd)
 
void detach ()
 
bool isAttached ()
 
void replaceThreadContext (ThreadContext *_tc)
 
bool trap (int type)
 
bool breakpoint ()
 

Protected Member Functions

ThreadContextcontext ()
 
Systemsystem ()
 
void encodeBinaryData (const std::string &unencoded, std::string &encoded) const
 
void encodeXferResponse (const std::string &unencoded, std::string &encoded, size_t offset, size_t unencoded_length) const
 
virtual bool checkBpLen (size_t len)
 
virtual BaseGdbRegCachegdbRegs ()=0
 
virtual bool acc (Addr addr, size_t len)=0
 
virtual std::vector< std::string > availableFeatures () const
 
virtual bool getXferFeaturesRead (const std::string &annex, std::string &output)
 Get an XML target description. More...
 

Private Types

typedef SocketEvent<&BaseRemoteGDB::connectWrapperConnectEvent
 
typedef SocketEvent<&BaseRemoteGDB::incomingDataDataEvent
 

Private Member Functions

void incomingData (int revent)
 
void connectWrapper (int revent)
 
uint8_t getbyte ()
 
void putbyte (uint8_t b)
 
void recv (std::vector< char > &bp)
 
void send (const char *data)
 
bool read (Addr addr, size_t size, char *data)
 
bool write (Addr addr, size_t size, const char *data)
 
template<class T >
read (Addr addr)
 
template<class T >
void write (Addr addr, T data)
 
void singleStep ()
 
void clearSingleStep ()
 
void setSingleStep ()
 
void scheduleInstCommitEvent (Event *ev, int delta)
 Schedule an event which will be triggered "delta" instructions later. More...
 
void descheduleInstCommitEvent (Event *ev)
 Deschedule an instruction count based event. More...
 
void insertSoftBreak (Addr addr, size_t len)
 
void removeSoftBreak (Addr addr, size_t len)
 
void insertHardBreak (Addr addr, size_t len)
 
void removeHardBreak (Addr addr, size_t len)
 
void clearTempBreakpoint (Addr &bkpt)
 
void setTempBreakpoint (Addr bkpt)
 
bool cmd_unsupported (GdbCommand::Context &ctx)
 
bool cmd_signal (GdbCommand::Context &ctx)
 
bool cmd_cont (GdbCommand::Context &ctx)
 
bool cmd_async_cont (GdbCommand::Context &ctx)
 
bool cmd_detach (GdbCommand::Context &ctx)
 
bool cmd_reg_r (GdbCommand::Context &ctx)
 
bool cmd_reg_w (GdbCommand::Context &ctx)
 
bool cmd_set_thread (GdbCommand::Context &ctx)
 
bool cmd_mem_r (GdbCommand::Context &ctx)
 
bool cmd_mem_w (GdbCommand::Context &ctx)
 
bool cmd_query_var (GdbCommand::Context &ctx)
 
bool cmd_step (GdbCommand::Context &ctx)
 
bool cmd_async_step (GdbCommand::Context &ctx)
 
bool cmd_clr_hw_bkpt (GdbCommand::Context &ctx)
 
bool cmd_set_hw_bkpt (GdbCommand::Context &ctx)
 

Private Attributes

friend ConnectEvent
 
friend DataEvent
 
ConnectEventconnectEvent
 
DataEventdataEvent
 
ListenSocket listener
 
int _port
 
int fd
 
bool active
 
bool attached
 
Systemsys
 
ThreadContexttc
 
BaseGdbRegCacheregCachePtr
 
BaseRemoteGDB::TrapEvent trapEvent
 
EventWrapper< BaseRemoteGDB, &BaseRemoteGDB::singleStepsingleStepEvent
 

Static Private Attributes

static std::map< char, GdbCommandcommand_map
 

Friends

class HardBreakpoint
 

Detailed Description

Definition at line 43 of file remote_gdb.hh.

Member Typedef Documentation

◆ ConnectEvent

Definition at line 183 of file remote_gdb.hh.

◆ DataEvent

Definition at line 184 of file remote_gdb.hh.

Constructor & Destructor Documentation

◆ ~BaseRemoteGDB()

BaseRemoteGDB::~BaseRemoteGDB ( )
inlinevirtual

Definition at line 51 of file remote_gdb.hh.

Member Function Documentation

◆ acc()

virtual bool BaseRemoteGDB::acc ( Addr  addr,
size_t  len 
)
protectedpure virtual

◆ availableFeatures()

std::vector< std::string > BaseRemoteGDB::availableFeatures ( ) const
protectedvirtual

Reimplemented in ArmISA::RemoteGDB, MipsISA::RemoteGDB, and PowerISA::RemoteGDB.

Definition at line 986 of file remote_gdb.cc.

Referenced by cmd_query_var().

◆ breakpoint()

bool BaseRemoteGDB::breakpoint ( )
inline

Definition at line 48 of file remote_gdb.hh.

Referenced by System::breakpoint().

◆ checkBpLen()

bool BaseRemoteGDB::checkBpLen ( size_t  len)
protectedvirtual

Reimplemented in RiscvISA::RemoteGDB, and X86ISA::RemoteGDB.

Definition at line 805 of file remote_gdb.cc.

References ArmISA::len.

Referenced by insertHardBreak(), insertSoftBreak(), removeHardBreak(), and removeSoftBreak().

◆ clearSingleStep()

void BaseRemoteGDB::clearSingleStep ( )
private

Definition at line 653 of file remote_gdb.cc.

References descheduleInstCommitEvent(), and singleStepEvent.

Referenced by cmd_async_cont(), cmd_cont(), detach(), and trap().

◆ clearTempBreakpoint()

void BaseRemoteGDB::clearTempBreakpoint ( Addr bkpt)
private

Definition at line 718 of file remote_gdb.cc.

References DPRINTF, and removeHardBreak().

◆ cmd_async_cont()

bool BaseRemoteGDB::cmd_async_cont ( GdbCommand::Context ctx)
private

◆ cmd_async_step()

bool BaseRemoteGDB::cmd_async_step ( GdbCommand::Context ctx)
private

◆ cmd_clr_hw_bkpt()

bool BaseRemoteGDB::cmd_clr_hw_bkpt ( GdbCommand::Context ctx)
private

◆ cmd_cont()

bool BaseRemoteGDB::cmd_cont ( GdbCommand::Context ctx)
private

◆ cmd_detach()

bool BaseRemoteGDB::cmd_detach ( GdbCommand::Context ctx)
private

Definition at line 852 of file remote_gdb.cc.

References detach().

◆ cmd_mem_r()

bool BaseRemoteGDB::cmd_mem_r ( GdbCommand::Context ctx)
private

◆ cmd_mem_w()

bool BaseRemoteGDB::cmd_mem_w ( GdbCommand::Context ctx)
private

◆ cmd_query_var()

bool BaseRemoteGDB::cmd_query_var ( GdbCommand::Context ctx)
private

◆ cmd_reg_r()

bool BaseRemoteGDB::cmd_reg_r ( GdbCommand::Context ctx)
private

Definition at line 859 of file remote_gdb.cc.

References BaseGdbRegCache::data(), regCachePtr, send(), and BaseGdbRegCache::size().

◆ cmd_reg_w()

bool BaseRemoteGDB::cmd_reg_w ( GdbCommand::Context ctx)
private

◆ cmd_set_hw_bkpt()

bool BaseRemoteGDB::cmd_set_hw_bkpt ( GdbCommand::Context ctx)
private

◆ cmd_set_thread()

bool BaseRemoteGDB::cmd_set_thread ( GdbCommand::Context ctx)
private

Definition at line 883 of file remote_gdb.cc.

References BaseRemoteGDB::GdbCommand::Context::data, MipsISA::p, and send().

◆ cmd_signal()

bool BaseRemoteGDB::cmd_signal ( GdbCommand::Context ctx)
private

Definition at line 820 of file remote_gdb.cc.

References csprintf(), send(), and BaseRemoteGDB::GdbCommand::Context::type.

◆ cmd_step()

bool BaseRemoteGDB::cmd_step ( GdbCommand::Context ctx)
private

◆ cmd_unsupported()

bool BaseRemoteGDB::cmd_unsupported ( GdbCommand::Context ctx)
private

◆ connectWrapper()

void BaseRemoteGDB::connectWrapper ( int  revent)
inlineprivate

Definition at line 167 of file remote_gdb.hh.

References connect().

◆ context()

ThreadContext* BaseRemoteGDB::context ( )
inlineprotected

◆ descheduleInstCommitEvent()

void BaseRemoteGDB::descheduleInstCommitEvent ( Event ev)
private

Deschedule an instruction count based event.

Definition at line 741 of file remote_gdb.cc.

References ThreadContext::descheduleInstCountEvent(), Event::scheduled(), and tc.

Referenced by clearSingleStep(), and incomingData().

◆ encodeBinaryData()

void BaseRemoteGDB::encodeBinaryData ( const std::string &  unencoded,
std::string &  encoded 
) const
protected

Definition at line 999 of file remote_gdb.cc.

References ArmISA::c.

Referenced by encodeXferResponse().

◆ encodeXferResponse()

void BaseRemoteGDB::encodeXferResponse ( const std::string &  unencoded,
std::string &  encoded,
size_t  offset,
size_t  unencoded_length 
) const
protected

Definition at line 1013 of file remote_gdb.cc.

References encodeBinaryData(), and ArmISA::offset.

Referenced by cmd_query_var().

◆ gdbRegs()

virtual BaseGdbRegCache* BaseRemoteGDB::gdbRegs ( )
protectedpure virtual

◆ getbyte()

uint8_t BaseRemoteGDB::getbyte ( )
private

Definition at line 503 of file remote_gdb.cc.

References ArmISA::b, fd, and read().

Referenced by recv(), and send().

◆ getXferFeaturesRead()

bool BaseRemoteGDB::getXferFeaturesRead ( const std::string &  annex,
std::string &  output 
)
protectedvirtual

Get an XML target description.

Parameters
[in]annexthe XML filename
[out]outputset to the decoded XML
Returns
true if the given annex was found

Reimplemented in ArmISA::RemoteGDB, MipsISA::RemoteGDB, and PowerISA::RemoteGDB.

Definition at line 992 of file remote_gdb.cc.

Referenced by cmd_query_var().

◆ incomingData()

void BaseRemoteGDB::incomingData ( int  revent)
private

◆ insertHardBreak()

void BaseRemoteGDB::insertHardBreak ( Addr  addr,
size_t  len 
)
private

◆ insertSoftBreak()

void BaseRemoteGDB::insertSoftBreak ( Addr  addr,
size_t  len 
)
private

Definition at line 666 of file remote_gdb.cc.

References addr, checkBpLen(), insertHardBreak(), and ArmISA::len.

Referenced by cmd_set_hw_bkpt().

◆ putbyte()

void BaseRemoteGDB::putbyte ( uint8_t  b)
private

Definition at line 513 of file remote_gdb.cc.

References ArmISA::b, fd, and write().

Referenced by recv(), and send().

◆ read() [1/2]

template<class T >
T BaseRemoteGDB::read ( Addr  addr)
inlineprivate

Definition at line 335 of file remote_gdb.hh.

References addr, and read().

◆ read() [2/2]

bool BaseRemoteGDB::read ( Addr  addr,
size_t  size,
char *  data 
)
private

◆ recv()

void BaseRemoteGDB::recv ( std::vector< char > &  bp)
private

Definition at line 523 of file remote_gdb.cc.

References ArmISA::c, DPRINTF, GDBBadP, GDBEnd, GDBGoodP, GDBStart, getbyte(), and putbyte().

Referenced by trap().

◆ removeHardBreak()

void BaseRemoteGDB::removeHardBreak ( Addr  addr,
size_t  len 
)
private

◆ removeSoftBreak()

void BaseRemoteGDB::removeSoftBreak ( Addr  addr,
size_t  len 
)
private

Definition at line 675 of file remote_gdb.cc.

References addr, checkBpLen(), ArmISA::len, and removeHardBreak().

Referenced by cmd_clr_hw_bkpt().

◆ replaceThreadContext()

void BaseRemoteGDB::replaceThreadContext ( ThreadContext tc)
inline

Definition at line 49 of file remote_gdb.hh.

◆ scheduleInstCommitEvent()

void BaseRemoteGDB::scheduleInstCommitEvent ( Event ev,
int  delta 
)
private

Schedule an event which will be triggered "delta" instructions later.

Definition at line 733 of file remote_gdb.cc.

References ThreadContext::getCurrentInstCount(), ThreadContext::scheduleInstCountEvent(), and tc.

Referenced by incomingData(), setSingleStep(), and singleStep().

◆ send()

void BaseRemoteGDB::send ( const char *  data)
private

◆ setSingleStep()

void BaseRemoteGDB::setSingleStep ( )
private

Definition at line 659 of file remote_gdb.cc.

References Event::scheduled(), scheduleInstCommitEvent(), and singleStepEvent.

Referenced by cmd_async_step(), and cmd_step().

◆ setTempBreakpoint()

void BaseRemoteGDB::setTempBreakpoint ( Addr  bkpt)
private

Definition at line 726 of file remote_gdb.cc.

References DPRINTF, and insertHardBreak().

◆ singleStep()

void BaseRemoteGDB::singleStep ( )
private

Definition at line 645 of file remote_gdb.cc.

References Event::scheduled(), scheduleInstCommitEvent(), singleStepEvent, and trap().

◆ system()

System* BaseRemoteGDB::system ( )
inlineprotected

Definition at line 305 of file remote_gdb.hh.

References sys.

◆ write() [1/2]

bool BaseRemoteGDB::write ( Addr  addr,
size_t  size,
const char *  data 
)
private

◆ write() [2/2]

template<class T >
void BaseRemoteGDB::write ( Addr  addr,
data 
)
inlineprivate

Definition at line 344 of file remote_gdb.hh.

References addr, data, and write().

Friends And Related Function Documentation

◆ HardBreakpoint

friend class HardBreakpoint
friend

Definition at line 130 of file remote_gdb.hh.

Referenced by insertHardBreak().

Member Data Documentation

◆ _port

int BaseRemoteGDB::_port
private

Definition at line 193 of file remote_gdb.hh.

Referenced by listen(), and port().

◆ active

bool BaseRemoteGDB::active
private

Definition at line 208 of file remote_gdb.hh.

Referenced by detach(), and trap().

◆ attached

bool BaseRemoteGDB::attached
private

Definition at line 209 of file remote_gdb.hh.

Referenced by attach(), detach(), isAttached(), and trap().

◆ command_map

std::map< char, BaseRemoteGDB::GdbCommand > BaseRemoteGDB::command_map
staticprivate

Definition at line 284 of file remote_gdb.hh.

Referenced by trap().

◆ ConnectEvent

Definition at line 186 of file remote_gdb.hh.

◆ connectEvent

ConnectEvent* BaseRemoteGDB::connectEvent
private

Definition at line 189 of file remote_gdb.hh.

Referenced by listen().

◆ DataEvent

friend BaseRemoteGDB::DataEvent
private

Definition at line 187 of file remote_gdb.hh.

◆ dataEvent

DataEvent* BaseRemoteGDB::dataEvent
private

Definition at line 190 of file remote_gdb.hh.

Referenced by attach(), and detach().

◆ fd

int BaseRemoteGDB::fd
private

Definition at line 196 of file remote_gdb.hh.

Referenced by attach(), detach(), getbyte(), and putbyte().

◆ listener

ListenSocket BaseRemoteGDB::listener
private

Definition at line 192 of file remote_gdb.hh.

Referenced by connect(), listen(), and port().

◆ regCachePtr

BaseGdbRegCache* BaseRemoteGDB::regCachePtr
private

Definition at line 214 of file remote_gdb.hh.

Referenced by cmd_reg_r(), cmd_reg_w(), and trap().

◆ singleStepEvent

EventWrapper<BaseRemoteGDB, &BaseRemoteGDB::singleStep> BaseRemoteGDB::singleStepEvent
private

Definition at line 242 of file remote_gdb.hh.

Referenced by clearSingleStep(), setSingleStep(), and singleStep().

◆ sys

System* BaseRemoteGDB::sys
private

Definition at line 211 of file remote_gdb.hh.

Referenced by insertHardBreak(), name(), and system().

◆ tc

ThreadContext* BaseRemoteGDB::tc
private

◆ trapEvent

BaseRemoteGDB::TrapEvent BaseRemoteGDB::trapEvent
private

Referenced by incomingData().


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

Generated on Wed Sep 30 2020 14:02:21 for gem5 by doxygen 1.8.17