Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[gdb] Add support for x86_64
Signed-off-by: Michael Brown <mcb30@ipxe.org>
  • Loading branch information
mcb30 committed Mar 22, 2016
1 parent 1afcccd commit 311a573
Show file tree
Hide file tree
Showing 8 changed files with 477 additions and 225 deletions.
28 changes: 8 additions & 20 deletions src/arch/i386/core/gdbidt.S
Expand Up @@ -15,41 +15,29 @@
/* POSIX signal numbers for reporting traps to GDB */
#define SIGILL 4
#define SIGTRAP 5
#define SIGBUS 7
#define SIGFPE 8
#define SIGSEGV 11
#define SIGSTKFLT 16

.globl gdbmach_nocode_sigfpe
gdbmach_nocode_sigfpe:
.globl gdbmach_sigfpe
gdbmach_sigfpe:
pushl $SIGFPE
jmp gdbmach_interrupt

.globl gdbmach_nocode_sigtrap
gdbmach_nocode_sigtrap:
.globl gdbmach_sigtrap
gdbmach_sigtrap:
pushl $SIGTRAP
jmp gdbmach_interrupt

.globl gdbmach_nocode_sigstkflt
gdbmach_nocode_sigstkflt:
.globl gdbmach_sigstkflt
gdbmach_sigstkflt:
pushl $SIGSTKFLT
jmp gdbmach_interrupt

.globl gdbmach_nocode_sigill
gdbmach_nocode_sigill:
.globl gdbmach_sigill
gdbmach_sigill:
pushl $SIGILL
jmp gdbmach_interrupt

.globl gdbmach_withcode_sigbus
gdbmach_withcode_sigbus:
movl $SIGBUS, (%esp)
jmp gdbmach_interrupt

.globl gdbmach_withcode_sigsegv
gdbmach_withcode_sigsegv:
movl $SIGSEGV, (%esp)
jmp gdbmach_interrupt

/* When invoked, the stack contains: eflags, cs, eip, signo. */
#define IH_OFFSET_GDB_REGS ( 0 )
#define IH_OFFSET_GDB_EIP ( IH_OFFSET_GDB_REGS + SIZEOF_I386_REGS )
Expand Down
184 changes: 0 additions & 184 deletions src/arch/i386/core/gdbmach.c

This file was deleted.

10 changes: 4 additions & 6 deletions src/arch/i386/include/gdbmach.h
Expand Up @@ -47,12 +47,10 @@ enum {
};

/* Interrupt vectors */
extern void gdbmach_nocode_sigfpe ( void );
extern void gdbmach_nocode_sigtrap ( void );
extern void gdbmach_nocode_sigstkflt ( void );
extern void gdbmach_nocode_sigill ( void );
extern void gdbmach_withcode_sigbus ( void );
extern void gdbmach_withcode_sigsegv ( void );
extern void gdbmach_sigfpe ( void );
extern void gdbmach_sigtrap ( void );
extern void gdbmach_sigstkflt ( void );
extern void gdbmach_sigill ( void );

static inline void gdbmach_set_pc ( gdbreg_t *regs, gdbreg_t pc ) {
regs [ GDBMACH_EIP ] = pc;
Expand Down

0 comments on commit 311a573

Please sign in to comment.