1 #ifndef AVR_DEBUGINTERFACE_H
2 #define AVR_DEBUGINTERFACE_H
13 class DebugInterface
{
15 DebugInterface(Device
& dev
, Core
& core
);
19 byte
reg(int reg
) const;
21 word
stackPointer() const;
22 dword
programCounter() const;
25 void setReg(int reg
, byte val
);
26 void setStatus(byte val
);
27 void setStackPointer(word val
);
28 void setProgramCounter(dword val
);
33 bool stepDone() const;
36 bool checkBreak(dword addr
);
37 bool hasBreaked() const { return breaked
; }
38 void insertBreak(dword addr
);
39 void removeBreak(dword addr
);
40 void deleteAllBreakpoints();
43 const std::string
& registerName(byte addr
) const;
44 void trace(std::ostream
& ostr
, dword addr
);
47 const unsigned char *readRam(unsigned int offset
, unsigned int size
) const;
48 void writeRam(unsigned char *data
, unsigned int offset
, unsigned int size
);
49 const unsigned char *readFlash(unsigned int offset
, unsigned int size
) const;
50 void writeFlash(unsigned char *data
, unsigned int offset
, unsigned int size
);
51 const unsigned char *readEeprom(unsigned int offset
, unsigned int size
) const;
52 void writeEeprom(unsigned char *data
, unsigned int offset
, unsigned int size
);
59 typedef std::vector
<dword
> Breakpoints
;
60 Breakpoints breakPoints
;
64 inline void DebugInterface::step() {
68 inline void DebugInterface::reset() {
69 dev
.reset( SIM_RESET
);
74 #endif /*AVR_DEBUGINTERFACE_H*/