42 #ifndef __REMOTE_GDB_HH__ 43 #define __REMOTE_GDB_HH__ 45 #include <sys/signal.h> 51 #include "arch/types.hh" 79 virtual char *
data()
const = 0;
85 virtual size_t size()
const = 0;
104 virtual const std::string
name()
const = 0;
146 void incomingData(
int revent);
149 template <
void (BaseRemoteGDB::*F)(
int revent)>
160 void process(
int revent) { (gdb->*F)(revent); }
180 void putbyte(uint8_t
b);
183 void send(
const char *
data);
215 bool write(
Addr addr,
size_t size,
const char *data);
217 template <
class T> T read(
Addr addr);
218 template <
class T>
void write(
Addr addr, T data);
224 void clearSingleStep();
225 void setSingleStep();
228 void scheduleInstCommitEvent(
Event *ev,
int delta);
230 void descheduleInstCommitEvent(
Event *ev);
233 void insertSoftBreak(
Addr addr,
size_t len);
234 void removeSoftBreak(
Addr addr,
size_t len);
235 void insertHardBreak(
Addr addr,
size_t len);
236 void removeHardBreak(
Addr addr,
size_t len);
238 void clearTempBreakpoint(
Addr &bkpt);
239 void setTempBreakpoint(
Addr bkpt);
261 GdbCommand(
const char *_name, Func _func) : name(_name), func(_func) {}
287 void encodeBinaryData(
const std::string &unencoded,
288 std::string &encoded)
const;
290 void encodeXferResponse(
const std::string &unencoded,
291 std::string &encoded,
size_t offset,
size_t unencoded_length)
const;
294 virtual bool checkBpLen(
size_t len);
298 virtual bool acc(
Addr addr,
size_t len) = 0;
309 virtual bool getXferFeaturesRead(
const std::string &annex,
318 read(addr,
sizeof(T), (
char *)&temp);
326 write(addr,
sizeof(T), (
const char *)&data);
bool read(Addr addr, size_t size, char *data)
void connectWrapper(int revent)
static void output(const char *filename)
ConnectEvent * connectEvent
virtual void getRegs(ThreadContext *)=0
Fill the raw buffer from the registers in the ThreadContext.
virtual const std::string name() const =0
Return the name to use in places like DPRINTF.
ThreadContext is the external interface to all thread state for anything outside of the CPU...
virtual void setRegs(ThreadContext *) const =0
Set the ThreadContext's registers from the values in the raw buffer.
EventWrapper< BaseRemoteGDB, &BaseRemoteGDB::singleStep > singleStepEvent
BaseGdbRegCache * regCachePtr
SocketEvent(BaseRemoteGDB *gdb, int fd, int e)
void replaceThreadContext(ThreadContext *_tc)
Concrete subclasses of this abstract class represent how the register values are transmitted on the w...
static std::map< char, GdbCommand > command_map
SocketEvent<&BaseRemoteGDB::incomingData > DataEvent
TrapEvent(BaseRemoteGDB *g)
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
bool write(Addr addr, size_t size, const char *data)
virtual ~BaseGdbRegCache()
GdbCommand(const char *_name, Func _func)
virtual char * data() const =0
Return the pointer to the raw bytes buffer containing the register values.
ThreadContext * context()
BaseGdbRegCache(BaseRemoteGDB *g)
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)...
SocketEvent<&BaseRemoteGDB::connectWrapper > ConnectEvent