[GDB] Add watch and rwatch hardware watchpoints

This commit is contained in:
Stefan Hajnoczi
2008-06-12 16:56:20 +01:00
committed by Michael Brown
parent 6e670b5f38
commit 19386ec2c8
7 changed files with 221 additions and 2 deletions

View File

@@ -10,6 +10,8 @@
*
*/
#include <stdint.h>
typedef uint32_t gdbreg_t;
/* The register snapshot, this must be in sync with interrupt handler and the
@@ -35,6 +37,15 @@ enum {
GDBMACH_SIZEOF_REGS = GDBMACH_NREGS * sizeof ( gdbreg_t )
};
/* Breakpoint types */
enum {
GDBMACH_BPMEM,
GDBMACH_BPHW,
GDBMACH_WATCH,
GDBMACH_RWATCH,
GDBMACH_AWATCH,
};
static inline void gdbmach_set_pc ( gdbreg_t *regs, gdbreg_t pc ) {
regs [ GDBMACH_EIP ] = pc;
}
@@ -48,4 +59,6 @@ static inline void gdbmach_breakpoint ( void ) {
__asm__ __volatile__ ( "int $3\n" );
}
extern int gdbmach_set_breakpoint ( int type, unsigned long addr, size_t len, int enable );
#endif /* GDBMACH_H */