diff options
author | Mark Kettenis <kettenis@gnu.org> | 2003-01-05 14:07:03 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@gnu.org> | 2003-01-05 14:07:03 +0000 |
commit | 28bcfd306b8cf443e9d2612a2f86ec4b05b86ce2 (patch) | |
tree | 6f025c8748b9e3e5f0dc9018e6b3afd92fa48ec4 /gdb/i386-tdep.c | |
parent | 15a5b3eeaf29a0d6e55274892b5d153386d266d4 (diff) | |
download | gdb-28bcfd306b8cf443e9d2612a2f86ec4b05b86ce2.zip gdb-28bcfd306b8cf443e9d2612a2f86ec4b05b86ce2.tar.gz gdb-28bcfd306b8cf443e9d2612a2f86ec4b05b86ce2.tar.bz2 |
* i386-tdep.c (i386_get_longjmp_target): Make usable on x86-64.
* x86-64-tdep.c (x86_64_init_abi): Remove FIXME about
i386_get_longjmp_target.
Diffstat (limited to 'gdb/i386-tdep.c')
-rw-r--r-- | gdb/i386-tdep.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 9b4cf02..f4a7df0 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -891,15 +891,16 @@ i386_pop_frame (void) /* Figure out where the longjmp will land. Slurp the args out of the stack. We expect the first arg to be a pointer to the jmp_buf structure from which we extract the address that we will land at. - This address is copied into PC. This routine returns true on + This address is copied into PC. This routine returns non-zero on success. */ static int i386_get_longjmp_target (CORE_ADDR *pc) { - char buf[4]; + char buf[8]; CORE_ADDR sp, jb_addr; int jb_pc_offset = gdbarch_tdep (current_gdbarch)->jb_pc_offset; + int len = TARGET_PTR_BIT / TARGET_CHAR_BIT; /* If JB_PC_OFFSET is -1, we have no way to find out where the longjmp will land. */ @@ -907,14 +908,14 @@ i386_get_longjmp_target (CORE_ADDR *pc) return 0; sp = read_register (SP_REGNUM); - if (target_read_memory (sp + 4, buf, 4)) + if (target_read_memory (sp + len, buf, len)) return 0; - jb_addr = extract_address (buf, 4); - if (target_read_memory (jb_addr + jb_pc_offset, buf, 4)) + jb_addr = extract_address (buf, len); + if (target_read_memory (jb_addr + jb_pc_offset, buf, len)) return 0; - *pc = extract_address (buf, 4); + *pc = extract_address (buf, len); return 1; } |