34 #ifndef __REMOTE_GDB_HH__
35 #define __REMOTE_GDB_HH__
37 #include <sys/signal.h>
43 #include "arch/types.hh"
109 virtual void mem2hex(
char *,
const char *,
int);
110 virtual const char *
hex2mem(
char *,
const char *,
int);
192 virtual char *
data()
const = 0;
198 virtual size_t size()
const = 0;
217 virtual const std::string
name()
const = 0;
260 return trap(SIGTRAP);
302 const std::string
name()
const {
return gdb->
name() +
".hwbkpt"; }
330 read(addr,
sizeof(T), (
char *)&temp);
337 {
write(addr,
sizeof(T), (
const char *)&data); }
SingleStepEvent(BaseRemoteGDB *g)
virtual void setRegs(ThreadContext *) const =0
Set the ThreadContext's registers from the values in the raw buffer.
void removeSoftBreak(Addr addr, size_t len)
void descheduleInstCommitEvent(Event *ev)
Deschedule an instruction count based event.
virtual bool read(Addr addr, size_t size, char *data)
int recv(char *data, int len)
HardBreakpoint(BaseRemoteGDB *_gdb, Addr addr)
void insertSoftBreak(Addr addr, size_t len)
BaseGdbRegCache(BaseRemoteGDB *g)
std::map< Addr, HardBreakpoint * > break_map_t
void send(const char *data)
void clearTempBreakpoint(Addr &bkpt)
break_map_t::iterator break_iter_t
SingleStepEvent singleStepEvent
BadClient(const char *_warning=NULL)
bool cmd_async_cont(GdbCommand::Context &ctx)
bool cmd_reg_r(GdbCommand::Context &ctx)
void setTempBreakpoint(Addr bkpt)
GDBListener(BaseRemoteGDB *g, int p)
bool cmd_reg_w(GdbCommand::Context &ctx)
ThreadContext is the external interface to all thread state for anything outside of the CPU...
Concrete subclasses of this abstract class represent how the register values are transmitted on the w...
virtual char * data() const =0
Return the pointer to the raw bytes buffer containing the register values.
void scheduleInstCommitEvent(Event *ev, int delta)
Schedule an event which will be triggered "delta" instructions later.
GdbCommand(const char *_name, Func _func)
bool cmd_detach(GdbCommand::Context &ctx)
const std::string name() const
BaseGdbRegCache * regCachePtr
Queue of events sorted in time order.
bool cmd_query_var(GdbCommand::Context &ctx)
Exception to throw when an error needs to be reported to the client.
bool cmd_cont(GdbCommand::Context &ctx)
void replaceThreadContext(ThreadContext *tc)
virtual bool acc(Addr addr, size_t len)=0
bool cmd_set_thread(GdbCommand::Context &ctx)
Exception to throw when something isn't supported.
bool(BaseRemoteGDB::* Func)(Context &ctx)
virtual const char * hex2mem(char *, const char *, int)
bool cmd_set_hw_bkpt(GdbCommand::Context &ctx)
virtual bool checkBpLen(size_t len)
virtual ~BaseGdbRegCache()
virtual const char * break_type(char c)
virtual void getRegs(ThreadContext *)=0
Fill the raw buffer from the registers in the ThreadContext.
TrapEvent(BaseRemoteGDB *g)
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
virtual bool write(Addr addr, size_t size, const char *data)
virtual BaseGdbRegCache * gdbRegs()=0
Addr hex2i(const char **)
bool cmd_clr_hw_bkpt(GdbCommand::Context &ctx)
EventQueue * getComInstEventQueue()
virtual const std::string name() const =0
Return the name to use in places like DPRINTF.
bool cmd_unsupported(GdbCommand::Context &ctx)
bool cmd_mem_w(GdbCommand::Context &ctx)
CmdError(std::string _error)
bool cmd_mem_r(GdbCommand::Context &ctx)
bool cmd_async_step(GdbCommand::Context &ctx)
virtual void mem2hex(char *, const char *, int)
Exception to throw when the connection to the client is broken.
bool cmd_signal(GdbCommand::Context &ctx)
PCEventQueue * getPcEventQueue()
static std::map< char, GdbCommand > command_map
bool cmd_step(GdbCommand::Context &ctx)
BaseRemoteGDB(System *system, ThreadContext *context)
void removeHardBreak(Addr addr, size_t len)
virtual void insertHardBreak(Addr addr, size_t len)
virtual bool breakpoint()
virtual size_t size() const =0
Return the size of the raw buffer, in bytes (i.e., half of the number of digits in the g/G packet)...
virtual void process(ThreadContext *tc)