gem5
|
#include <remote_gdb.hh>
Classes | |
struct | BadClient |
Exception to throw when the connection to the client is broken. More... | |
class | BaseGdbRegCache |
Concrete subclasses of this abstract class represent how the register values are transmitted on the wire. More... | |
struct | CmdError |
Exception to throw when an error needs to be reported to the client. More... | |
class | HardBreakpoint |
class | InputEvent |
class | SingleStepEvent |
class | TrapEvent |
class | Unsupported |
Exception to throw when something isn't supported. More... | |
Public Member Functions | |
bool | breakpoint () |
void | replaceThreadContext (ThreadContext *tc) |
virtual | ~BaseRemoteGDB () |
BaseRemoteGDB (System *system, ThreadContext *context) | |
virtual | ~BaseRemoteGDB () |
virtual BaseGdbRegCache * | gdbRegs ()=0 |
void | replaceThreadContext (ThreadContext *tc) |
void | attach (int fd) |
void | detach () |
bool | isattached () |
virtual bool | acc (Addr addr, size_t len)=0 |
bool | trap (int type) |
virtual bool | breakpoint () |
std::string | name () |
Protected Types | |
typedef std::map< Addr, HardBreakpoint * > | break_map_t |
typedef break_map_t::iterator | break_iter_t |
Protected Member Functions | |
int | digit2i (char) |
char | i2digit (int) |
Addr | hex2i (const char **) |
virtual void | mem2hex (char *, const char *, int) |
virtual const char * | hex2mem (char *, const char *, int) |
virtual const char * | break_type (char c) |
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) |
uint8_t | getbyte () |
void | putbyte (uint8_t b) |
int | recv (char *data, int len) |
void | send (const char *data) |
virtual bool | read (Addr addr, size_t size, char *data) |
virtual bool | write (Addr addr, size_t size, const char *data) |
template<class T > | |
T | read (Addr addr) |
template<class T > | |
void | write (Addr addr, T data) |
void | clearSingleStep () |
void | setSingleStep () |
PCEventQueue * | getPcEventQueue () |
EventQueue * | getComInstEventQueue () |
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... | |
virtual bool | checkBpLen (size_t len) |
void | insertSoftBreak (Addr addr, size_t len) |
void | removeSoftBreak (Addr addr, size_t len) |
virtual void | insertHardBreak (Addr addr, size_t len) |
void | removeHardBreak (Addr addr, size_t len) |
void | clearTempBreakpoint (Addr &bkpt) |
void | setTempBreakpoint (Addr bkpt) |
Protected Attributes | |
InputEvent * | inputEvent |
TrapEvent | trapEvent |
GDBListener * | listener |
int | number |
int | fd |
bool | active |
bool | attached |
System * | system |
ThreadContext * | context |
BaseGdbRegCache * | regCachePtr |
SingleStepEvent | singleStepEvent |
break_map_t | hardBreakMap |
Static Protected Attributes | |
static std::map< char, GdbCommand > | command_map |
Friends | |
class | GDBListener |
class | InputEvent |
class | HardBreakpoint |
void | debugger () |
Definition at line 45 of file remote_gdb.hh.
|
protected |
Definition at line 309 of file remote_gdb.hh.
|
protected |
Definition at line 308 of file remote_gdb.hh.
|
inlinevirtual |
Definition at line 53 of file remote_gdb.hh.
BaseRemoteGDB::BaseRemoteGDB | ( | System * | system, |
ThreadContext * | context | ||
) |
Definition at line 289 of file remote_gdb.cc.
|
virtual |
|
pure virtual |
Implemented in ArmISA::RemoteGDB, X86ISA::RemoteGDB, RiscvISA::RemoteGDB, AlphaISA::RemoteGDB, PowerISA::RemoteGDB, MipsISA::RemoteGDB, and SparcISA::RemoteGDB.
Referenced by cmd_mem_r(), and cmd_mem_w().
void BaseRemoteGDB::attach | ( | int | fd | ) |
Definition at line 313 of file remote_gdb.cc.
References attached, DPRINTFN, ArmISA::f, fd, InputEvent, inputEvent, pollQueue, and PollQueue::schedule().
Referenced by GDBListener::accept().
|
protectedvirtual |
Definition at line 659 of file remote_gdb.cc.
References GdbAccWp, GdbHardBp, GdbReadWp, GdbSoftBp, and GdbWriteWp.
Referenced by cmd_clr_hw_bkpt(), and cmd_set_hw_bkpt().
|
inline |
Definition at line 50 of file remote_gdb.hh.
|
inlinevirtual |
Definition at line 258 of file remote_gdb.hh.
References trap().
|
protectedvirtual |
Reimplemented in X86ISA::RemoteGDB.
Definition at line 562 of file remote_gdb.cc.
Referenced by insertHardBreak(), insertSoftBreak(), removeHardBreak(), and removeSoftBreak().
|
protected |
Definition at line 521 of file remote_gdb.cc.
References descheduleInstCommitEvent(), and singleStepEvent.
Referenced by cmd_async_cont(), cmd_cont(), detach(), and trap().
|
protected |
Definition at line 643 of file remote_gdb.cc.
References DPRINTF, and removeHardBreak().
|
protected |
Definition at line 758 of file remote_gdb.cc.
References clearSingleStep(), context, GdbCommand::Context::data, hex2i(), MipsISA::p, and ThreadContext::pcState().
|
protected |
Definition at line 869 of file remote_gdb.cc.
References context, GdbCommand::Context::data, hex2i(), MipsISA::p, ThreadContext::pcState(), and setSingleStep().
|
protected |
Definition at line 894 of file remote_gdb.cc.
References addr, break_type(), GdbCommand::Context::data, DPRINTF, GdbAccWp, GdbHardBp, GdbReadWp, GdbSoftBp, GdbWriteWp, hex2i(), ArmISA::len, MipsISA::p, removeHardBreak(), removeSoftBreak(), and send().
|
protected |
Definition at line 746 of file remote_gdb.cc.
References clearSingleStep(), context, GdbCommand::Context::data, hex2i(), GdbCommand::Context::len, MipsISA::p, and ThreadContext::pcState().
|
protected |
Definition at line 771 of file remote_gdb.cc.
References detach().
|
protected |
Definition at line 812 of file remote_gdb.cc.
References acc(), addr, GdbCommand::Context::data, hex2i(), ArmISA::len, mem2hex(), MipsISA::p, read(), and send().
|
protected |
Definition at line 836 of file remote_gdb.cc.
References acc(), addr, GdbCommand::Context::data, hex2i(), hex2mem(), GdbCommand::Context::len, ArmISA::len, MipsISA::p, send(), and write().
|
protected |
Definition at line 860 of file remote_gdb.cc.
References GdbCommand::Context::data, GdbCommand::Context::len, and send().
|
protected |
Definition at line 778 of file remote_gdb.cc.
References BaseRemoteGDB::BaseGdbRegCache::data(), mem2hex(), regCachePtr, send(), and BaseRemoteGDB::BaseGdbRegCache::size().
|
protected |
Definition at line 788 of file remote_gdb.cc.
References context, GdbCommand::Context::data, BaseRemoteGDB::BaseGdbRegCache::data(), hex2mem(), MipsISA::p, regCachePtr, send(), BaseRemoteGDB::BaseGdbRegCache::setRegs(), and BaseRemoteGDB::BaseGdbRegCache::size().
|
protected |
Definition at line 927 of file remote_gdb.cc.
References addr, break_type(), GdbCommand::Context::data, DPRINTF, GdbAccWp, GdbHardBp, GdbReadWp, GdbSoftBp, GdbWriteWp, hex2i(), insertHardBreak(), insertSoftBreak(), ArmISA::len, MipsISA::p, and send().
|
protected |
Definition at line 802 of file remote_gdb.cc.
References GdbCommand::Context::data, hex2i(), MipsISA::p, and send().
|
protected |
Definition at line 739 of file remote_gdb.cc.
References csprintf(), send(), and GdbCommand::Context::type.
|
protected |
Definition at line 882 of file remote_gdb.cc.
References context, GdbCommand::Context::data, hex2i(), GdbCommand::Context::len, MipsISA::p, ThreadContext::pcState(), and setSingleStep().
|
protected |
Definition at line 730 of file remote_gdb.cc.
References GdbCommand::Context::cmd, GdbCommand::Context::data, DDUMP, DPRINTF, GdbCommand::Context::len, and GdbCommand::name.
|
protected |
Deschedule an instruction count based event.
Definition at line 555 of file remote_gdb.cc.
References EventQueue::deschedule(), getComInstEventQueue(), and Event::scheduled().
Referenced by clearSingleStep().
void BaseRemoteGDB::detach | ( | ) |
Definition at line 325 of file remote_gdb.cc.
References active, attached, clearSingleStep(), DPRINTFN, fd, inputEvent, pollQueue, and PollQueue::remove().
Referenced by cmd_detach(), and trap().
|
protected |
Definition at line 1043 of file remote_gdb.cc.
|
pure virtual |
Implemented in X86ISA::RemoteGDB, ArmISA::RemoteGDB, SparcISA::RemoteGDB, RiscvISA::RemoteGDB, MipsISA::RemoteGDB, PowerISA::RemoteGDB, and AlphaISA::RemoteGDB.
Referenced by trap().
|
protected |
|
protected |
Definition at line 539 of file remote_gdb.cc.
References context, ThreadContext::getCpuPtr(), and ThreadContext::threadId().
Referenced by descheduleInstCommitEvent(), and scheduleInstCommitEvent().
|
protected |
Definition at line 533 of file remote_gdb.cc.
References system.
|
protected |
Definition at line 1102 of file remote_gdb.cc.
References digit2i(), and MipsISA::r.
Referenced by cmd_async_cont(), cmd_async_step(), cmd_clr_hw_bkpt(), cmd_cont(), cmd_mem_r(), cmd_mem_w(), cmd_set_hw_bkpt(), cmd_set_thread(), and cmd_step().
|
protectedvirtual |
Definition at line 1081 of file remote_gdb.cc.
References digit2i().
Referenced by cmd_mem_w(), and cmd_reg_w().
|
protected |
Definition at line 1057 of file remote_gdb.cc.
|
protectedvirtual |
Reimplemented in AlphaISA::RemoteGDB.
Definition at line 602 of file remote_gdb.cc.
References addr, checkBpLen(), DPRINTF, hardBreakMap, HardBreakpoint, and BaseRemoteGDB::HardBreakpoint::refcount.
Referenced by cmd_set_hw_bkpt(), AlphaISA::RemoteGDB::insertHardBreak(), insertSoftBreak(), and setTempBreakpoint().
|
protected |
Definition at line 584 of file remote_gdb.cc.
References checkBpLen(), and insertHardBreak().
Referenced by cmd_set_hw_bkpt().
bool BaseRemoteGDB::isattached | ( | ) |
Definition at line 309 of file remote_gdb.cc.
References attached.
Referenced by GDBListener::accept(), and debugger().
|
protectedvirtual |
Definition at line 1064 of file remote_gdb.cc.
References i2digit().
Referenced by cmd_mem_r(), cmd_reg_r(), read(), and write().
string BaseRemoteGDB::name | ( | ) |
Definition at line 303 of file remote_gdb.cc.
References SimObject::name(), and system.
Referenced by MipsISA::RemoteGDB::MipsGdbRegCache::name(), RiscvISA::RemoteGDB::RiscvGdbRegCache::name(), X86ISA::RemoteGDB::X86GdbRegCache::name(), SparcISA::RemoteGDB::SPARC64GdbRegCache::name(), ArmISA::RemoteGDB::AArch64GdbRegCache::name(), X86ISA::RemoteGDB::AMD64GdbRegCache::name(), BaseRemoteGDB::HardBreakpoint::name(), and GDBListener::name().
|
protected |
|
protectedvirtual |
Definition at line 454 of file remote_gdb.cc.
References context, DPRINTF, DPRINTFNR, DTRACE, FullSystem, ThreadContext::getMemProxy(), ThreadContext::getVirtProxy(), mem2hex(), FSTranslatingPortProxy::readBlob(), and SETranslatingPortProxy::readBlob().
Referenced by cmd_mem_r(), getbyte(), and read().
|
inlineprotected |
Definition at line 327 of file remote_gdb.hh.
References read().
|
protected |
Definition at line 391 of file remote_gdb.cc.
References ArmISA::c, digit2i(), DPRINTF, GDBBadP, GDBEnd, GDBGoodP, GDBStart, getbyte(), ArmISA::len, MipsISA::p, and putbyte().
Referenced by trap().
|
protected |
Definition at line 617 of file remote_gdb.cc.
References checkBpLen(), DPRINTF, hardBreakMap, ArmISA::i, and BaseRemoteGDB::HardBreakpoint::refcount.
Referenced by clearTempBreakpoint(), cmd_clr_hw_bkpt(), and removeSoftBreak().
|
protected |
Definition at line 593 of file remote_gdb.cc.
References checkBpLen(), and removeHardBreak().
Referenced by cmd_clr_hw_bkpt().
|
inline |
Definition at line 51 of file remote_gdb.hh.
|
inline |
Definition at line 250 of file remote_gdb.hh.
References context.
|
protected |
Schedule an event which will be triggered "delta" instructions later.
Definition at line 546 of file remote_gdb.cc.
References PowerISA::eq, getComInstEventQueue(), EventQueue::getCurTick(), and EventQueue::schedule().
Referenced by setSingleStep().
|
protected |
Definition at line 362 of file remote_gdb.cc.
References ArmISA::c, DPRINTF, GDBBadP, GDBEnd, GDBStart, getbyte(), i2digit(), MipsISA::p, and putbyte().
Referenced by cmd_clr_hw_bkpt(), cmd_mem_r(), cmd_mem_w(), cmd_query_var(), cmd_reg_r(), cmd_reg_w(), cmd_set_hw_bkpt(), cmd_set_thread(), cmd_signal(), and trap().
|
protected |
Definition at line 527 of file remote_gdb.cc.
References Event::scheduled(), scheduleInstCommitEvent(), and singleStepEvent.
Referenced by cmd_async_step(), and cmd_step().
|
protected |
Definition at line 636 of file remote_gdb.cc.
References DPRINTF, and insertHardBreak().
bool BaseRemoteGDB::trap | ( | int | type | ) |
Definition at line 966 of file remote_gdb.cc.
References active, attached, clearSingleStep(), GdbCommand::Context::cmd, GdbCommand::Context::cmd_byte, command_map, context, csprintf(), data, GdbCommand::Context::data, detach(), DPRINTF, ArmISA::e, BaseRemoteGDB::CmdError::error, GdbCommand::func, GDBPacketBufLen, gdbRegs(), BaseRemoteGDB::BaseGdbRegCache::getRegs(), GdbCommand::Context::len, panic, ThreadContext::pcState(), recv(), regCachePtr, send(), GdbCommand::Context::type, X86ISA::type, warn, and BaseRemoteGDB::BadClient::warning.
Referenced by breakpoint(), and debugger().
|
protectedvirtual |
Reimplemented in AlphaISA::RemoteGDB.
Definition at line 490 of file remote_gdb.cc.
References context, DPRINTF, DPRINTFN, DPRINTFNR, DTRACE, FullSystem, ThreadContext::getMemProxy(), ThreadContext::getVirtProxy(), mem2hex(), FSTranslatingPortProxy::writeBlob(), and SETranslatingPortProxy::writeBlob().
Referenced by cmd_mem_w(), putbyte(), AlphaISA::RemoteGDB::write(), and write().
|
inlineprotected |
Definition at line 336 of file remote_gdb.hh.
References write().
|
friend |
Definition at line 161 of file remote_gdb.cc.
|
friend |
Definition at line 81 of file remote_gdb.hh.
|
friend |
Definition at line 306 of file remote_gdb.hh.
Referenced by insertHardBreak().
|
friend |
Definition at line 158 of file remote_gdb.hh.
Referenced by attach().
|
protected |
Definition at line 169 of file remote_gdb.hh.
|
protected |
Definition at line 170 of file remote_gdb.hh.
Referenced by attach(), detach(), isattached(), and trap().
|
staticprotected |
Definition at line 114 of file remote_gdb.hh.
Referenced by trap().
|
protected |
Definition at line 173 of file remote_gdb.hh.
Referenced by SparcISA::RemoteGDB::acc(), MipsISA::RemoteGDB::acc(), PowerISA::RemoteGDB::acc(), AlphaISA::RemoteGDB::acc(), RiscvISA::RemoteGDB::acc(), X86ISA::RemoteGDB::acc(), ArmISA::RemoteGDB::acc(), cmd_async_cont(), cmd_async_step(), cmd_cont(), cmd_reg_w(), cmd_step(), SparcISA::RemoteGDB::gdbRegs(), ArmISA::RemoteGDB::gdbRegs(), X86ISA::RemoteGDB::gdbRegs(), getComInstEventQueue(), read(), replaceThreadContext(), trap(), and write().
|
protected |
|
protected |
Definition at line 310 of file remote_gdb.hh.
Referenced by insertHardBreak(), and removeHardBreak().
|
protected |
Definition at line 159 of file remote_gdb.hh.
|
protected |
Definition at line 161 of file remote_gdb.hh.
Referenced by debugger(), and GDBListener::GDBListener().
|
protected |
Definition at line 162 of file remote_gdb.hh.
Referenced by GDBListener::listen().
|
protected |
Definition at line 228 of file remote_gdb.hh.
Referenced by cmd_reg_r(), cmd_reg_w(), and trap().
|
protected |
Definition at line 276 of file remote_gdb.hh.
Referenced by clearSingleStep(), and setSingleStep().
|
protected |
Definition at line 172 of file remote_gdb.hh.
Referenced by AlphaISA::RemoteGDB::acc(), getPcEventQueue(), and name().
|
protected |
Definition at line 160 of file remote_gdb.hh.