From 0ed2d8ea0679ea84e1e2c4f0fb6d8d7f58c4e4b6 Mon Sep 17 00:00:00 2001 From: kettenis Date: Sat, 19 Apr 2003 14:26:14 +0000 Subject: [PATCH] * i386-tdep.c (i386_get_longjmp_target): Use TYPE_LENGTH(builtin_type_void_func_ptr) instead of TARGET_PTR_BIT and TARGET_CHAR_BIT. Use extract_typed_address instead of extract_address. --- gdb/ChangeLog | 7 +++++++ gdb/i386-tdep.c | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e59cf05196..700bdbac56 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,12 @@ 2003-04-19 Mark Kettenis + * i386-tdep.c (i386_get_longjmp_target): Use + TYPE_LENGTH(builtin_type_void_func_ptr) instead of TARGET_PTR_BIT + and TARGET_CHAR_BIT. Use extract_typed_address instead of + extract_address. + +2003-04-19 Mark Kettenis + * core-regset.c: Update comments to reflect reality. Re-order includes. (fetch_core_registers): Use switch instead of if. Remove diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 475f89c203..dde3b255de 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -901,7 +901,7 @@ i386_get_longjmp_target (CORE_ADDR *pc) 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; + 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. */ @@ -912,11 +912,11 @@ i386_get_longjmp_target (CORE_ADDR *pc) if (target_read_memory (sp + len, buf, len)) return 0; - jb_addr = extract_address (buf, len); + jb_addr = extract_typed_address (buf, builtin_type_void_func_ptr); if (target_read_memory (jb_addr + jb_pc_offset, buf, len)) return 0; - *pc = extract_address (buf, len); + *pc = extract_typed_address (buf, builtin_type_void_func_ptr); return 1; } -- 2.11.0