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

#include <remote_gdb.hh>

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

Classes

struct  GdbCommand
 
struct  QuerySetCommand
 
class  SocketEvent
 
class  TrapEvent
 

Public Member Functions

bool breakpoint ()
 
void replaceThreadContext (ThreadContext *tc)
 
bool trap (ContextID id, int type)
 
virtual ~BaseRemoteGDB ()
 
 BaseRemoteGDB (System *system, 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 addThreadContext (ThreadContext *_tc)
 
void replaceThreadContext (ThreadContext *_tc)
 
bool selectThreadContext (ContextID id)
 
bool trap (ContextID id, int type)
 

Static Public Member Functions

template<class GDBStub , class ... Args>
static BaseRemoteGDBbuild (Args... args)
 

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)
 
void send (const std::string &data)
 
template<typename ... Args>
void send (const char *format, const Args &...args)
 
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)
 
bool cmdUnsupported (GdbCommand::Context &ctx)
 
bool cmdSignal (GdbCommand::Context &ctx)
 
bool cmdCont (GdbCommand::Context &ctx)
 
bool cmdAsyncCont (GdbCommand::Context &ctx)
 
bool cmdDetach (GdbCommand::Context &ctx)
 
bool cmdRegR (GdbCommand::Context &ctx)
 
bool cmdRegW (GdbCommand::Context &ctx)
 
bool cmdSetThread (GdbCommand::Context &ctx)
 
bool cmdMemR (GdbCommand::Context &ctx)
 
bool cmdMemW (GdbCommand::Context &ctx)
 
bool cmdQueryVar (GdbCommand::Context &ctx)
 
bool cmdStep (GdbCommand::Context &ctx)
 
bool cmdAsyncStep (GdbCommand::Context &ctx)
 
bool cmdClrHwBkpt (GdbCommand::Context &ctx)
 
bool cmdSetHwBkpt (GdbCommand::Context &ctx)
 
bool cmdDumpPageTable (GdbCommand::Context &ctx)
 
void queryC (QuerySetCommand::Context &ctx)
 
void querySupported (QuerySetCommand::Context &ctx)
 
void queryXfer (QuerySetCommand::Context &ctx)
 
void queryFThreadInfo (QuerySetCommand::Context &ctx)
 
void querySThreadInfo (QuerySetCommand::Context &ctx)
 

Private Attributes

friend ConnectEvent
 
friend DataEvent
 
ConnectEventconnectEvent
 
DataEventdataEvent
 
ListenSocket listener
 
int _port
 
int fd
 
bool active = false
 
bool attached = false
 
bool threadSwitching = false
 
Systemsys
 
std::map< ContextID, ThreadContext * > threads
 
ThreadContexttc = nullptr
 
BaseGdbRegCacheregCachePtr = nullptr
 
gem5::BaseRemoteGDB::TrapEvent trapEvent
 
EventWrapper< BaseRemoteGDB, &BaseRemoteGDB::singleStepsingleStepEvent
 
size_t threadInfoIdx = 0
 

Static Private Attributes

static std::map< char, GdbCommandcommandMap
 
static std::map< std::string, QuerySetCommandqueryMap
 

Friends

class HardBreakpoint
 

Detailed Description

Definition at line 48 of file remote_gdb.hh.

Member Typedef Documentation

◆ ConnectEvent

Definition at line 210 of file remote_gdb.hh.

◆ DataEvent

Definition at line 211 of file remote_gdb.hh.

Constructor & Destructor Documentation

◆ ~BaseRemoteGDB()

gem5::BaseRemoteGDB::~BaseRemoteGDB ( )
inlinevirtual

Definition at line 57 of file remote_gdb.hh.

Member Function Documentation

◆ acc()

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

◆ availableFeatures()

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

◆ breakpoint()

bool gem5::BaseRemoteGDB::breakpoint ( )
inline

Definition at line 53 of file remote_gdb.hh.

◆ build()

template<class GDBStub , class ... Args>
static BaseRemoteGDB* gem5::BaseRemoteGDB::build ( Args...  args)
inlinestatic

Definition at line 180 of file remote_gdb.hh.

References gem5::getRemoteGDBPort(), and port().

◆ checkBpLen()

bool gem5::BaseRemoteGDB::checkBpLen ( size_t  len)
protectedvirtual

◆ clearSingleStep()

void gem5::BaseRemoteGDB::clearSingleStep ( )
private

Definition at line 735 of file remote_gdb.cc.

References descheduleInstCommitEvent(), and singleStepEvent.

Referenced by cmdAsyncCont(), cmdCont(), and detach().

◆ cmdAsyncCont()

bool gem5::BaseRemoteGDB::cmdAsyncCont ( GdbCommand::Context ctx)
private

◆ cmdAsyncStep()

bool gem5::BaseRemoteGDB::cmdAsyncStep ( GdbCommand::Context ctx)
private

◆ cmdClrHwBkpt()

bool gem5::BaseRemoteGDB::cmdClrHwBkpt ( GdbCommand::Context ctx)
private

◆ cmdCont()

bool gem5::BaseRemoteGDB::cmdCont ( GdbCommand::Context ctx)
private

◆ cmdDetach()

bool gem5::BaseRemoteGDB::cmdDetach ( GdbCommand::Context ctx)
private

Definition at line 928 of file remote_gdb.cc.

References detach().

◆ cmdDumpPageTable()

bool gem5::BaseRemoteGDB::cmdDumpPageTable ( GdbCommand::Context ctx)
private

◆ cmdMemR()

bool gem5::BaseRemoteGDB::cmdMemR ( GdbCommand::Context ctx)
private

◆ cmdMemW()

bool gem5::BaseRemoteGDB::cmdMemW ( GdbCommand::Context ctx)
private

◆ cmdQueryVar()

bool gem5::BaseRemoteGDB::cmdQueryVar ( GdbCommand::Context ctx)
private

◆ cmdRegR()

bool gem5::BaseRemoteGDB::cmdRegR ( GdbCommand::Context ctx)
private

◆ cmdRegW()

bool gem5::BaseRemoteGDB::cmdRegW ( GdbCommand::Context ctx)
private

◆ cmdSetHwBkpt()

bool gem5::BaseRemoteGDB::cmdSetHwBkpt ( GdbCommand::Context ctx)
private

◆ cmdSetThread()

bool gem5::BaseRemoteGDB::cmdSetThread ( GdbCommand::Context ctx)
private

◆ cmdSignal()

bool gem5::BaseRemoteGDB::cmdSignal ( GdbCommand::Context ctx)
private

Definition at line 896 of file remote_gdb.cc.

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

◆ cmdStep()

bool gem5::BaseRemoteGDB::cmdStep ( GdbCommand::Context ctx)
private

◆ cmdUnsupported()

bool gem5::BaseRemoteGDB::cmdUnsupported ( GdbCommand::Context ctx)
private

◆ connectWrapper()

void gem5::BaseRemoteGDB::connectWrapper ( int  revent)
inlineprivate

Definition at line 194 of file remote_gdb.hh.

References connect().

◆ context()

ThreadContext* gem5::BaseRemoteGDB::context ( )
inlineprotected

◆ descheduleInstCommitEvent()

void gem5::BaseRemoteGDB::descheduleInstCommitEvent ( Event ev)
private

Deschedule an instruction count based event.

Definition at line 815 of file remote_gdb.cc.

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

Referenced by clearSingleStep(), and incomingData().

◆ encodeBinaryData()

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

Definition at line 1200 of file remote_gdb.cc.

References gem5::ArmISA::c.

Referenced by encodeXferResponse().

◆ encodeXferResponse()

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

Definition at line 1214 of file remote_gdb.cc.

References encodeBinaryData(), and gem5::ArmISA::offset.

Referenced by queryXfer().

◆ gdbRegs()

virtual BaseGdbRegCache* gem5::BaseRemoteGDB::gdbRegs ( )
protectedpure virtual

◆ getbyte()

uint8_t gem5::BaseRemoteGDB::getbyte ( )
private

Definition at line 585 of file remote_gdb.cc.

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

Referenced by recv(), and send().

◆ getXferFeaturesRead()

bool gem5::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 gem5::RiscvISA::RemoteGDB, gem5::ArmISA::RemoteGDB, gem5::PowerISA::RemoteGDB, and gem5::MipsISA::RemoteGDB.

Definition at line 1193 of file remote_gdb.cc.

Referenced by queryXfer().

◆ incomingData()

void gem5::BaseRemoteGDB::incomingData ( int  revent)
private

◆ insertHardBreak()

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

◆ insertSoftBreak()

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

Definition at line 748 of file remote_gdb.cc.

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

Referenced by cmdSetHwBkpt().

◆ putbyte()

void gem5::BaseRemoteGDB::putbyte ( uint8_t  b)
private

Definition at line 595 of file remote_gdb.cc.

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

Referenced by recv(), and send().

◆ queryC()

void gem5::BaseRemoteGDB::queryC ( QuerySetCommand::Context ctx)
private

Definition at line 1072 of file remote_gdb.cc.

References gem5::ThreadContext::contextId(), send(), and tc.

◆ queryFThreadInfo()

void gem5::BaseRemoteGDB::queryFThreadInfo ( QuerySetCommand::Context ctx)
private

Definition at line 1132 of file remote_gdb.cc.

References querySThreadInfo(), and threadInfoIdx.

◆ querySThreadInfo()

void gem5::BaseRemoteGDB::querySThreadInfo ( QuerySetCommand::Context ctx)
private

Definition at line 1139 of file remote_gdb.cc.

References send(), threadInfoIdx, and threads.

Referenced by queryFThreadInfo().

◆ querySupported()

void gem5::BaseRemoteGDB::querySupported ( QuerySetCommand::Context ctx)
private

Definition at line 1078 of file remote_gdb.cc.

References availableFeatures(), and send().

◆ queryXfer()

void gem5::BaseRemoteGDB::queryXfer ( QuerySetCommand::Context ctx)
private

◆ read() [1/2]

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

Definition at line 403 of file remote_gdb.hh.

References gem5::X86ISA::addr, and read().

◆ read() [2/2]

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

◆ recv()

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

◆ removeHardBreak()

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

◆ removeSoftBreak()

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

Definition at line 757 of file remote_gdb.cc.

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

Referenced by cmdClrHwBkpt().

◆ replaceThreadContext()

void gem5::BaseRemoteGDB::replaceThreadContext ( ThreadContext tc)
inline

Definition at line 54 of file remote_gdb.hh.

Referenced by gem5::Workload::replaceThreadContext().

◆ scheduleInstCommitEvent()

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

◆ send() [1/3]

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

◆ send() [2/3]

template<typename ... Args>
void gem5::BaseRemoteGDB::send ( const char *  format,
const Args &...  args 
)
inlineprivate

Definition at line 235 of file remote_gdb.hh.

References gem5::csprintf(), gem5::ArmISA::format, and send().

◆ send() [3/3]

void gem5::BaseRemoteGDB::send ( const std::string &  data)
inlineprivate

Definition at line 231 of file remote_gdb.hh.

References data, and send().

Referenced by send().

◆ setSingleStep()

void gem5::BaseRemoteGDB::setSingleStep ( )
private

Definition at line 741 of file remote_gdb.cc.

References scheduleInstCommitEvent(), and singleStepEvent.

Referenced by cmdAsyncStep(), and cmdStep().

◆ singleStep()

void gem5::BaseRemoteGDB::singleStep ( )
private

◆ system()

System* gem5::BaseRemoteGDB::system ( )
inlineprotected

Definition at line 373 of file remote_gdb.hh.

References sys.

◆ trap()

bool gem5::BaseRemoteGDB::trap ( ContextID  id,
int  type 
)
inline

◆ write() [1/2]

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

◆ write() [2/2]

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

Definition at line 412 of file remote_gdb.hh.

References gem5::X86ISA::addr, data, and write().

Friends And Related Function Documentation

◆ HardBreakpoint

friend class HardBreakpoint
friend

Definition at line 145 of file remote_gdb.hh.

Referenced by insertHardBreak().

Member Data Documentation

◆ _port

int gem5::BaseRemoteGDB::_port
private

Definition at line 220 of file remote_gdb.hh.

Referenced by listen(), and port().

◆ active

bool gem5::BaseRemoteGDB::active = false
private

Definition at line 243 of file remote_gdb.hh.

Referenced by detach().

◆ attached

bool gem5::BaseRemoteGDB::attached = false
private

Definition at line 244 of file remote_gdb.hh.

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

◆ commandMap

std::map< char, BaseRemoteGDB::GdbCommand > gem5::BaseRemoteGDB::commandMap
staticprivate

Definition at line 321 of file remote_gdb.hh.

◆ ConnectEvent

Definition at line 213 of file remote_gdb.hh.

◆ connectEvent

ConnectEvent* gem5::BaseRemoteGDB::connectEvent
private

Definition at line 216 of file remote_gdb.hh.

Referenced by listen().

◆ DataEvent

Definition at line 214 of file remote_gdb.hh.

◆ dataEvent

DataEvent* gem5::BaseRemoteGDB::dataEvent
private

Definition at line 217 of file remote_gdb.hh.

Referenced by attach(), and detach().

◆ fd

int gem5::BaseRemoteGDB::fd
private

Definition at line 223 of file remote_gdb.hh.

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

◆ listener

ListenSocket gem5::BaseRemoteGDB::listener
private

Definition at line 219 of file remote_gdb.hh.

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

◆ queryMap

std::map< std::string, BaseRemoteGDB::QuerySetCommand > gem5::BaseRemoteGDB::queryMap
staticprivate
Initial value:
= {
{ "C", { &BaseRemoteGDB::queryC } },
{ "Supported", { &BaseRemoteGDB::querySupported, ";" } },
{ "Xfer", { &BaseRemoteGDB::queryXfer } },
{ "fThreadInfo", { &BaseRemoteGDB::queryFThreadInfo } },
{ "sThreadInfo", { &BaseRemoteGDB::querySThreadInfo } },
}

Definition at line 361 of file remote_gdb.hh.

Referenced by cmdQueryVar().

◆ regCachePtr

BaseGdbRegCache* gem5::BaseRemoteGDB::regCachePtr = nullptr
private

Definition at line 252 of file remote_gdb.hh.

Referenced by cmdRegR(), cmdRegW(), and selectThreadContext().

◆ singleStepEvent

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

Definition at line 282 of file remote_gdb.hh.

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

◆ sys

System* gem5::BaseRemoteGDB::sys
private

Definition at line 247 of file remote_gdb.hh.

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

◆ tc

ThreadContext* gem5::BaseRemoteGDB::tc = nullptr
private

◆ threadInfoIdx

size_t gem5::BaseRemoteGDB::threadInfoIdx = 0
private

Definition at line 367 of file remote_gdb.hh.

Referenced by queryFThreadInfo(), and querySThreadInfo().

◆ threads

std::map<ContextID, ThreadContext *> gem5::BaseRemoteGDB::threads
private

Definition at line 249 of file remote_gdb.hh.

Referenced by addThreadContext(), querySThreadInfo(), and selectThreadContext().

◆ threadSwitching

bool gem5::BaseRemoteGDB::threadSwitching = false
private

Definition at line 245 of file remote_gdb.hh.

Referenced by cmdSetThread().

◆ trapEvent

gem5::BaseRemoteGDB::TrapEvent gem5::BaseRemoteGDB::trapEvent
private

Referenced by cmdSetThread(), and incomingData().


The documentation for this class was generated from the following files:
gem5::BaseRemoteGDB::queryXfer
void queryXfer(QuerySetCommand::Context &ctx)
Definition: remote_gdb.cc:1091
gem5::BaseRemoteGDB::queryC
void queryC(QuerySetCommand::Context &ctx)
Definition: remote_gdb.cc:1072
gem5::BaseRemoteGDB::querySupported
void querySupported(QuerySetCommand::Context &ctx)
Definition: remote_gdb.cc:1078
gem5::BaseRemoteGDB::queryFThreadInfo
void queryFThreadInfo(QuerySetCommand::Context &ctx)
Definition: remote_gdb.cc:1132
gem5::BaseRemoteGDB::querySThreadInfo
void querySThreadInfo(QuerySetCommand::Context &ctx)
Definition: remote_gdb.cc:1139

Generated on Tue Sep 21 2021 12:27:20 for gem5 by doxygen 1.8.17