6 * GDB architecture specifics
8 * This file declares functions for manipulating the machine state and
15 typedef unsigned long gdbreg_t;
17 /* The register snapshot, this must be in sync with interrupt handler and the
37 GDBMACH_SIZEOF_REGS = GDBMACH_NREGS * sizeof ( gdbreg_t )
40 /* Breakpoint types */
49 /* Interrupt vectors */
50 extern void gdbmach_nocode_sigfpe ( void );
51 extern void gdbmach_nocode_sigtrap ( void );
52 extern void gdbmach_nocode_sigstkflt ( void );
53 extern void gdbmach_nocode_sigill ( void );
54 extern void gdbmach_withcode_sigbus ( void );
55 extern void gdbmach_withcode_sigsegv ( void );
57 static inline void gdbmach_set_pc ( gdbreg_t *regs, gdbreg_t pc ) {
58 regs [ GDBMACH_EIP ] = pc;
61 static inline void gdbmach_set_single_step ( gdbreg_t *regs, int step ) {
62 regs [ GDBMACH_EFLAGS ] &= ~( 1 << 8 ); /* Trace Flag (TF) */
63 regs [ GDBMACH_EFLAGS ] |= ( step << 8 );
66 static inline void gdbmach_breakpoint ( void ) {
67 __asm__ __volatile__ ( "int $3\n" );
70 extern int gdbmach_set_breakpoint ( int type, unsigned long addr, size_t len, int enable );
72 extern void gdbmach_init ( void );
74 #endif /* GDBMACH_H */