|
gem5
v22.0.0.2
|
#include <remote_gdb.hh>
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) |
| void | trap (ContextID id, int signum) |
Static Public Member Functions | |
| template<class GDBStub , class ... Args> | |
| static BaseRemoteGDB * | build (Args... args) |
Protected Member Functions | |
| ThreadContext * | context () |
| System * | system () |
| 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 | checkBpKind (size_t kind) |
| virtual BaseGdbRegCache * | gdbRegs ()=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::incomingConnection > | IncomingConnectionEvent |
| typedef SocketEvent<&BaseRemoteGDB::incomingData > | IncomingDataEvent |
Private Member Functions | |
| void | incomingData (int revent) |
| void | incomingConnection (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) |
| void | processCommands (int signum=0) |
| bool | read (Addr addr, size_t size, char *data) |
| 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 | 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 kind) |
| void | removeSoftBreak (Addr addr, size_t kind) |
| void | insertHardBreak (Addr addr, size_t kind) |
| void | removeHardBreak (Addr addr, size_t kind) |
| 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 | IncomingConnectionEvent |
| friend | IncomingDataEvent |
| IncomingConnectionEvent * | incomingConnectionEvent |
| IncomingDataEvent * | incomingDataEvent |
| ListenSocket | listener |
| int | _port |
| int | fd |
| bool | attached = false |
| bool | threadSwitching = false |
| System * | sys |
| std::map< ContextID, ThreadContext * > | threads |
| ThreadContext * | tc = nullptr |
| BaseGdbRegCache * | regCachePtr = nullptr |
| EventWrapper< BaseRemoteGDB, &BaseRemoteGDB::connect > | connectEvent |
| EventWrapper< BaseRemoteGDB, &BaseRemoteGDB::detach > | disconnectEvent |
| gem5::BaseRemoteGDB::TrapEvent | trapEvent |
| EventWrapper< BaseRemoteGDB, &BaseRemoteGDB::singleStep > | singleStepEvent |
| size_t | threadInfoIdx = 0 |
Static Private Attributes | |
| static std::map< char, GdbCommand > | commandMap |
| static std::map< std::string, QuerySetCommand > | queryMap |
Friends | |
| class | HardBreakpoint |
Definition at line 48 of file remote_gdb.hh.
|
private |
Definition at line 222 of file remote_gdb.hh.
|
private |
Definition at line 224 of file remote_gdb.hh.
|
inlinevirtual |
Definition at line 57 of file remote_gdb.hh.
|
protectedpure virtual |
|
protectedvirtual |
Reimplemented in gem5::RiscvISA::RemoteGDB, gem5::ArmISA::RemoteGDB, gem5::PowerISA::RemoteGDB, and gem5::MipsISA::RemoteGDB.
Definition at line 1226 of file remote_gdb.cc.
Referenced by querySupported().
|
inline |
Definition at line 53 of file remote_gdb.hh.
|
inlinestatic |
Definition at line 180 of file remote_gdb.hh.
References gem5::getRemoteGDBPort(), and port().
|
protectedvirtual |
Reimplemented in gem5::ArmISA::RemoteGDB, gem5::RiscvISA::RemoteGDB, and gem5::X86ISA::RemoteGDB.
Definition at line 920 of file remote_gdb.cc.
Referenced by insertHardBreak(), insertSoftBreak(), removeHardBreak(), and removeSoftBreak().
|
private |
Definition at line 774 of file remote_gdb.cc.
References descheduleInstCommitEvent(), and singleStepEvent.
Referenced by cmdAsyncCont(), cmdCont(), and detach().
|
private |
Definition at line 954 of file remote_gdb.cc.
References clearSingleStep(), gem5::BaseRemoteGDB::GdbCommand::Context::data, gem5::VegaISA::p, gem5::ThreadContext::pcState(), and tc.
|
private |
Definition at line 1271 of file remote_gdb.cc.
References gem5::BaseRemoteGDB::GdbCommand::Context::data, gem5::VegaISA::p, gem5::ThreadContext::pcState(), setSingleStep(), and tc.
|
private |
Definition at line 1296 of file remote_gdb.cc.
References gem5::X86ISA::addr, gem5::BaseRemoteGDB::GdbCommand::Context::data, DPRINTF, gem5::VegaISA::p, removeHardBreak(), removeSoftBreak(), and send().
|
private |
Definition at line 942 of file remote_gdb.cc.
References clearSingleStep(), gem5::BaseRemoteGDB::GdbCommand::Context::data, gem5::BaseRemoteGDB::GdbCommand::Context::len, gem5::VegaISA::p, gem5::ThreadContext::pcState(), and tc.
|
private |
Definition at line 967 of file remote_gdb.cc.
References detach().
|
private |
Definition at line 1264 of file remote_gdb.cc.
References gem5::EmulationPageTable::externalize(), gem5::ThreadContext::getProcessPtr(), gem5::Process::pTable, send(), and tc.
|
private |
Definition at line 1039 of file remote_gdb.cc.
References acc(), gem5::X86ISA::addr, gem5::BaseRemoteGDB::GdbCommand::Context::data, len, gem5::VegaISA::p, read(), and send().
|
private |
Definition at line 1063 of file remote_gdb.cc.
References acc(), gem5::X86ISA::addr, gem5::BaseRemoteGDB::GdbCommand::Context::data, len, gem5::BaseRemoteGDB::GdbCommand::Context::len, gem5::VegaISA::p, send(), and write().
|
private |
Definition at line 1191 of file remote_gdb.cc.
References gem5::BaseRemoteGDB::QuerySetCommand::Context::args, gem5::BaseRemoteGDB::GdbCommand::Context::data, DPRINTF, gem5::BaseRemoteGDB::GdbCommand::Context::len, queryMap, and gem5::VegaISA::s.
|
private |
Definition at line 974 of file remote_gdb.cc.
References gem5::BaseGdbRegCache::data(), regCachePtr, send(), and gem5::BaseGdbRegCache::size().
|
private |
Definition at line 984 of file remote_gdb.cc.
References gem5::BaseGdbRegCache::data(), gem5::BaseRemoteGDB::GdbCommand::Context::data, gem5::VegaISA::p, regCachePtr, send(), gem5::BaseGdbRegCache::setRegs(), gem5::BaseGdbRegCache::size(), and tc.
|
private |
Definition at line 1329 of file remote_gdb.cc.
References gem5::X86ISA::addr, gem5::BaseRemoteGDB::GdbCommand::Context::data, DPRINTF, insertHardBreak(), insertSoftBreak(), gem5::VegaISA::p, and send().
|
private |
Definition at line 998 of file remote_gdb.cc.
References gem5::ThreadContext::contextId(), gem5::BaseRemoteGDB::GdbCommand::Context::data, gem5::BaseRemoteGDB::TrapEvent::id(), gem5::VegaISA::p, scheduleInstCommitEvent(), selectThreadContext(), send(), tc, threadSwitching, and trapEvent.
|
private |
Definition at line 935 of file remote_gdb.cc.
References send(), and gem5::BaseRemoteGDB::GdbCommand::Context::type.
|
private |
Definition at line 1284 of file remote_gdb.cc.
References gem5::BaseRemoteGDB::GdbCommand::Context::data, gem5::BaseRemoteGDB::GdbCommand::Context::len, gem5::VegaISA::p, gem5::ThreadContext::pcState(), setSingleStep(), and tc.
|
private |
Definition at line 926 of file remote_gdb.cc.
References gem5::BaseRemoteGDB::GdbCommand::Context::cmd, gem5::BaseRemoteGDB::GdbCommand::Context::data, DDUMP, DPRINTF, gem5::BaseRemoteGDB::GdbCommand::Context::len, and gem5::BaseRemoteGDB::GdbCommand::name.
|
inlineprotected |
Definition at line 395 of file remote_gdb.hh.
References tc.
Referenced by gem5::ArmISA::RemoteGDB::acc(), gem5::ArmISA::RemoteGDB::gdbRegs(), gem5::SparcISA::RemoteGDB::SPARCGdbRegCache::getRegs(), gem5::PowerISA::RemoteGDB::PowerGdbRegCache::getRegs(), gem5::ArmISA::RemoteGDB::AArch32GdbRegCache::getRegs(), gem5::X86ISA::RemoteGDB::X86GdbRegCache::getRegs(), gem5::SparcISA::RemoteGDB::SPARC64GdbRegCache::getRegs(), gem5::PowerISA::RemoteGDB::Power64GdbRegCache::getRegs(), gem5::ArmISA::RemoteGDB::AArch64GdbRegCache::getRegs(), gem5::RiscvISA::RemoteGDB::RiscvGdbRegCache::getRegs(), gem5::X86ISA::RemoteGDB::AMD64GdbRegCache::getRegs(), gem5::ArmISA::RemoteGDB::getXferFeaturesRead(), gem5::SparcISA::RemoteGDB::SPARCGdbRegCache::setRegs(), gem5::PowerISA::RemoteGDB::PowerGdbRegCache::setRegs(), gem5::ArmISA::RemoteGDB::AArch32GdbRegCache::setRegs(), gem5::X86ISA::RemoteGDB::X86GdbRegCache::setRegs(), gem5::SparcISA::RemoteGDB::SPARC64GdbRegCache::setRegs(), gem5::PowerISA::RemoteGDB::Power64GdbRegCache::setRegs(), gem5::ArmISA::RemoteGDB::AArch64GdbRegCache::setRegs(), gem5::RiscvISA::RemoteGDB::RiscvGdbRegCache::setRegs(), and gem5::X86ISA::RemoteGDB::AMD64GdbRegCache::setRegs().
|
private |
Deschedule an instruction count based event.
Definition at line 854 of file remote_gdb.cc.
References gem5::ThreadContext::descheduleInstCountEvent(), gem5::Event::scheduled(), and tc.
Referenced by clearSingleStep(), and incomingData().
|
protected |
Definition at line 1239 of file remote_gdb.cc.
References gem5::VegaISA::c.
Referenced by encodeXferResponse().
|
protected |
Definition at line 1253 of file remote_gdb.cc.
References encodeBinaryData(), and gem5::ArmISA::offset.
Referenced by queryXfer().
|
protectedpure virtual |
Implemented in gem5::RiscvISA::RemoteGDB, gem5::ArmISA::RemoteGDB, gem5::X86ISA::RemoteGDB, gem5::PowerISA::RemoteGDB, gem5::SparcISA::RemoteGDB, and gem5::MipsISA::RemoteGDB.
Referenced by processCommands().
|
private |
Definition at line 575 of file remote_gdb.cc.
References gem5::ArmISA::b, fd, and read().
|
protectedvirtual |
Get an XML target description.
| [in] | annex | the XML filename |
| [out] | output | set to the decoded XML |
Reimplemented in gem5::RiscvISA::RemoteGDB, gem5::ArmISA::RemoteGDB, gem5::PowerISA::RemoteGDB, and gem5::MipsISA::RemoteGDB.
Definition at line 1232 of file remote_gdb.cc.
Referenced by queryXfer().
|
private |
Definition at line 544 of file remote_gdb.cc.
References connectEvent, scheduleInstCommitEvent(), and warn.
|
private |
Definition at line 557 of file remote_gdb.cc.
References gem5::ThreadContext::contextId(), descheduleInstCommitEvent(), disconnectEvent, gem5::BaseRemoteGDB::TrapEvent::id(), gem5::Event::scheduled(), scheduleInstCommitEvent(), tc, trapEvent, gem5::BaseRemoteGDB::TrapEvent::type(), and warn.
|
private |
Definition at line 805 of file remote_gdb.cc.
References gem5::X86ISA::addr, checkBpKind(), DPRINTF, HardBreakpoint, gem5::HardBreakpoint::refcount, and sys.
Referenced by cmdSetHwBkpt(), and insertSoftBreak().
|
private |
Definition at line 787 of file remote_gdb.cc.
References gem5::X86ISA::addr, checkBpKind(), and insertHardBreak().
Referenced by cmdSetHwBkpt().
|
private |
Definition at line 675 of file remote_gdb.cc.
References gem5::BaseRemoteGDB::GdbCommand::Context::cmd, gem5::BaseRemoteGDB::GdbCommand::Context::cmdByte, commandMap, data, gem5::BaseRemoteGDB::GdbCommand::Context::data, detach(), DPRINTF, gem5::ArmISA::e, gem5::BaseRemoteGDB::GdbCommand::func, gdbRegs(), gem5::BaseGdbRegCache::getRegs(), gem5::BaseRemoteGDB::GdbCommand::Context::len, panic, recv(), regCachePtr, send(), tc, gem5::BaseRemoteGDB::GdbCommand::Context::type, and warn.
Referenced by attach().
|
private |
Definition at line 585 of file remote_gdb.cc.
References gem5::ArmISA::b, fd, and write().
|
private |
Definition at line 1111 of file remote_gdb.cc.
References gem5::ThreadContext::contextId(), send(), and tc.
|
private |
Definition at line 1171 of file remote_gdb.cc.
References querySThreadInfo(), and threadInfoIdx.
|
private |
Definition at line 1178 of file remote_gdb.cc.
References send(), threadInfoIdx, and threads.
Referenced by queryFThreadInfo().
|
private |
Definition at line 1117 of file remote_gdb.cc.
References availableFeatures(), and send().
|
private |
Definition at line 1130 of file remote_gdb.cc.
References gem5::BaseRemoteGDB::QuerySetCommand::Context::args, encodeXferResponse(), getXferFeaturesRead(), gem5::ArmISA::offset, and send().
|
inlineprivate |
Definition at line 428 of file remote_gdb.hh.
References gem5::X86ISA::addr, and read().
|
private |
Definition at line 725 of file remote_gdb.cc.
References data, DPRINTF, DPRINTFNR, gem5::FullSystem, tc, and gem5::MipsISA::vaddr.
|
private |
Definition at line 595 of file remote_gdb.cc.
References gem5::VegaISA::c, DPRINTF, gem5::GDBBadP, gem5::GDBEnd, gem5::GDBGoodP, gem5::GDBStart, getbyte(), and putbyte().
Referenced by processCommands().
|
private |
Definition at line 820 of file remote_gdb.cc.
References gem5::X86ISA::addr, checkBpKind(), DPRINTF, gem5::ArmISA::i, and gem5::HardBreakpoint::refcount.
Referenced by cmdClrHwBkpt(), and removeSoftBreak().
|
private |
Definition at line 796 of file remote_gdb.cc.
References gem5::X86ISA::addr, checkBpKind(), and removeHardBreak().
Referenced by cmdClrHwBkpt().
|
inline |
Definition at line 54 of file remote_gdb.hh.
Referenced by gem5::Workload::replaceThreadContext().
|
private |
Schedule an event which will be triggered "delta" instructions later.
Definition at line 839 of file remote_gdb.cc.
References gem5::ThreadContext::Active, gem5::ThreadContext::getCurrentInstCount(), gem5::Event::process(), gem5::ThreadContext::scheduleInstCountEvent(), gem5::ThreadContext::status(), and tc.
Referenced by cmdSetThread(), incomingConnection(), incomingData(), setSingleStep(), and singleStep().
|
private |
Definition at line 647 of file remote_gdb.cc.
References gem5::VegaISA::c, DPRINTF, gem5::GDBBadP, gem5::GDBEnd, gem5::GDBStart, getbyte(), gem5::VegaISA::p, and putbyte().
Referenced by cmdClrHwBkpt(), cmdDumpPageTable(), cmdMemR(), cmdMemW(), cmdRegR(), cmdRegW(), cmdSetHwBkpt(), cmdSetThread(), cmdSignal(), processCommands(), queryC(), querySThreadInfo(), querySupported(), queryXfer(), and send().
|
inlineprivate |
Definition at line 248 of file remote_gdb.hh.
References gem5::csprintf(), gem5::ArmISA::format, and send().
|
inlineprivate |
|
private |
Definition at line 780 of file remote_gdb.cc.
References scheduleInstCommitEvent(), and singleStepEvent.
Referenced by cmdAsyncStep(), and cmdStep().
|
private |
Definition at line 766 of file remote_gdb.cc.
References gem5::ThreadContext::contextId(), scheduleInstCommitEvent(), singleStepEvent, tc, and trap().
|
inlineprotected |
Definition at line 396 of file remote_gdb.hh.
References sys.
|
inline |
Definition at line 55 of file remote_gdb.hh.
Referenced by gem5::HardBreakpoint::process(), gem5::BaseRemoteGDB::TrapEvent::process(), singleStep(), and gem5::Workload::trapToGdb().
|
private |
Definition at line 748 of file remote_gdb.cc.
References data, DPRINTFN, DPRINTFNR, gem5::FullSystem, tc, and gem5::MipsISA::vaddr.
|
inlineprivate |
Definition at line 437 of file remote_gdb.hh.
References gem5::X86ISA::addr, data, and write().
|
friend |
Definition at line 145 of file remote_gdb.hh.
Referenced by insertHardBreak().
|
private |
Definition at line 233 of file remote_gdb.hh.
|
private |
Definition at line 264 of file remote_gdb.hh.
Referenced by attach(), detach(), and isAttached().
|
staticprivate |
Definition at line 344 of file remote_gdb.hh.
Referenced by processCommands().
|
private |
Definition at line 274 of file remote_gdb.hh.
Referenced by incomingConnection().
|
private |
Definition at line 275 of file remote_gdb.hh.
Referenced by incomingData().
|
private |
|
private |
Definition at line 226 of file remote_gdb.hh.
|
private |
Definition at line 229 of file remote_gdb.hh.
|
private |
Definition at line 227 of file remote_gdb.hh.
|
private |
Definition at line 230 of file remote_gdb.hh.
|
private |
Definition at line 232 of file remote_gdb.hh.
Referenced by addThreadContext(), connect(), listen(), and port().
|
staticprivate |
Definition at line 384 of file remote_gdb.hh.
Referenced by cmdQueryVar().
|
private |
Definition at line 272 of file remote_gdb.hh.
Referenced by cmdRegR(), cmdRegW(), processCommands(), and selectThreadContext().
|
private |
Definition at line 305 of file remote_gdb.hh.
Referenced by clearSingleStep(), setSingleStep(), and singleStep().
|
private |
Definition at line 267 of file remote_gdb.hh.
Referenced by insertHardBreak(), name(), and system().
|
private |
Definition at line 270 of file remote_gdb.hh.
Referenced by addThreadContext(), cmdAsyncCont(), cmdAsyncStep(), cmdCont(), cmdDumpPageTable(), cmdRegW(), cmdSetThread(), cmdStep(), context(), descheduleInstCommitEvent(), incomingData(), gem5::HardBreakpoint::process(), processCommands(), queryC(), read(), scheduleInstCommitEvent(), selectThreadContext(), singleStep(), and write().
|
private |
Definition at line 390 of file remote_gdb.hh.
Referenced by queryFThreadInfo(), and querySThreadInfo().
|
private |
Definition at line 269 of file remote_gdb.hh.
Referenced by addThreadContext(), querySThreadInfo(), and selectThreadContext().
|
private |
Definition at line 265 of file remote_gdb.hh.
Referenced by cmdSetThread().
|
private |
Referenced by cmdSetThread(), and incomingData().