diff options
author | Pedro Alves <palves@redhat.com> | 2008-04-25 14:57:30 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2008-04-25 14:57:30 +0000 |
commit | 436675d3af53e8d46fd065d7e12451a7a123761e (patch) | |
tree | b8481eadf4a2a27c73d4a60a4be5e77e3d728e10 /gdb/i386-tdep.c | |
parent | ddeca4680f02382f5d6c64cbf2d8e30cfb7d942f (diff) | |
download | gdb-436675d3af53e8d46fd065d7e12451a7a123761e.zip gdb-436675d3af53e8d46fd065d7e12451a7a123761e.tar.gz gdb-436675d3af53e8d46fd065d7e12451a7a123761e.tar.bz2 |
* amd64-tdep.c (amd64_get_longjmp_target): New.
(amd64_init_abi): Register amd64_get_longjmp_target as
gdbarch_get_longjmp_target callback.
* i386-tdep.c (i386_get_longjmp_target): Remove 64-bit handling.
Diffstat (limited to 'gdb/i386-tdep.c')
-rw-r--r-- | gdb/i386-tdep.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index ee7ed51..765f1ca 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -1295,36 +1295,31 @@ i386_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *next_frame) 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 non-zero on - success. - - This function is 64-bit safe. */ + success. */ static int i386_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc) { - gdb_byte buf[8]; + gdb_byte buf[4]; CORE_ADDR sp, jb_addr; struct gdbarch *gdbarch = get_frame_arch (frame); int jb_pc_offset = gdbarch_tdep (gdbarch)->jb_pc_offset; - int len = TYPE_LENGTH (builtin_type_void_func_ptr); /* If JB_PC_OFFSET is -1, we have no way to find out where the longjmp will land. */ if (jb_pc_offset == -1) return 0; - /* Don't use I386_ESP_REGNUM here, since this function is also used - for AMD64. */ - get_frame_register (frame, gdbarch_sp_regnum (gdbarch), buf); - sp = extract_typed_address (buf, builtin_type_void_data_ptr); - if (target_read_memory (sp + len, buf, len)) + get_frame_register (frame, I386_ESP_REGNUM, buf); + sp = extract_unsigned_integer (buf, 4); + if (target_read_memory (sp + 4, buf, 4)) return 0; - jb_addr = extract_typed_address (buf, builtin_type_void_data_ptr); - if (target_read_memory (jb_addr + jb_pc_offset, buf, len)) + jb_addr = extract_unsigned_integer (buf, 4); + if (target_read_memory (jb_addr + jb_pc_offset, buf, 4)) return 0; - *pc = extract_typed_address (buf, builtin_type_void_func_ptr); + *pc = extract_unsigned_integer (buf, 4); return 1; } |