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 | f824e13dcba6710993dcb4b65600699906fa7557 (patch) | |
tree | 47ca06aada7dee0c2d594745687640b3116b93af | |
parent | 2999ec1159c7ad7223982827712ee06d9e9adb3f (diff) | |
download | gdb-f824e13dcba6710993dcb4b65600699906fa7557.tar.gz |
* 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.
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/i386-tdep.c | 13 | ||||
-rw-r--r-- | gdb/x86-64-tdep.c | 4 |
3 files changed, 13 insertions, 10 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 703f654c08e..89c2f448178 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2003-01-05 Mark Kettenis <kettenis@gnu.org> + + * 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. + 2003-01-05 Andrew Cagney <ac131313@redhat.com> * arm-tdep.c (prologue_cache): Change to a pointer. diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 9b4cf0286b0..f4a7df0bb41 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; } diff --git a/gdb/x86-64-tdep.c b/gdb/x86-64-tdep.c index 2cf005eca1c..a47ef171878 100644 --- a/gdb/x86-64-tdep.c +++ b/gdb/x86-64-tdep.c @@ -967,10 +967,6 @@ x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) set_gdbarch_register_byte (gdbarch, x86_64_register_byte); set_gdbarch_register_virtual_type (gdbarch, x86_64_register_virtual_type); - /* FIXME: kettenis/20021026: As long as we don't support longjmp, - that is, as long as we have `tdep->jb_pc_offset == -1', using - i386_get_longjmp_target is fine. */ - set_gdbarch_register_convertible (gdbarch, x86_64_register_convertible); set_gdbarch_register_convert_to_virtual (gdbarch, x86_64_register_convert_to_virtual); |