This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix i386_get_longjmp_target


This makes i386_get_longjmp_target slightly more "correct", although
it's largely cosmetic.

Checked in.

Mark

Index: ChangeLog
from  Mark Kettenis  <kettenis at gnu dot org>
 
	* 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.

Index: i386-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-tdep.c,v
retrieving revision 1.133
diff -u -p -r1.133 i386-tdep.c
--- i386-tdep.c 11 Apr 2003 18:15:38 -0000 1.133
+++ i386-tdep.c 19 Apr 2003 14:24:31 -0000
@@ -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;
 }
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]