This is the mail archive of the gdb-patches@sourceware.org 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]

[RFC 4/4] - Adjust x86 and x86_64 linux.


I left adjusting x86 and x86_64 out of the "adjust all" patch, since
it depends on this patch that isn't ready to go in. 

[Re: 5/5 - handle glibc pointer mangling jmp_bufs (x86/x86_64)]
http://sourceware.org/ml/gdb-patches/2008-04/msg00139.html

-- 
Pedro Alves
2008-04-09  Pedro Alves  <pedro@codesourcery.com>

	* amd64-linux-tdep.c (amd64_linux_get_longjmp_target): Add SP
	parameter, Also unmangle SP.
	(amd64_linux_init_abi): Set tdep->jb_sp_offset.

	* i386-linux-tdep.c (i386_linux_get_longjmp_target): Add SP
	parameter, Also unmangle SP.

---
 gdb/amd64-linux-tdep.c |    7 +++++--
 gdb/i386-linux-tdep.c  |    6 ++++--
 2 files changed, 9 insertions(+), 4 deletions(-)

Index: src/gdb/amd64-linux-tdep.c
===================================================================
--- src.orig/gdb/amd64-linux-tdep.c	2008-04-09 14:45:56.000000000 +0100
+++ src/gdb/amd64-linux-tdep.c	2008-04-09 14:46:42.000000000 +0100
@@ -293,12 +293,14 @@ amd64_linux_pointer_demangle (CORE_ADDR 
 /* glibc pointer mangles the PC in jmp_buf.  We unmangle it here.  */
 
 static int
-amd64_linux_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc)
+amd64_linux_get_longjmp_target (struct frame_info *frame,
+				CORE_ADDR *pc, CORE_ADDR *sp)
 {
-  if (!amd64_get_longjmp_target (frame, pc))
+  if (!amd64_get_longjmp_target (frame, pc, sp))
     return 0;
 
   *pc = amd64_linux_pointer_demangle (*pc);
+  *sp = amd64_linux_pointer_demangle (*sp);
 
   return 1;
 }
@@ -320,6 +322,7 @@ amd64_linux_init_abi (struct gdbarch_inf
   tdep->sc_num_regs = ARRAY_SIZE (amd64_linux_sc_reg_offset);
 
   tdep->jb_pc_offset = 7 * 8;
+  tdep->jb_sp_offset = 6 * 8;
   set_gdbarch_get_longjmp_target (gdbarch, amd64_linux_get_longjmp_target);
 
   /* GNU/Linux uses SVR4-style shared libraries.  */
Index: src/gdb/i386-linux-tdep.c
===================================================================
--- src.orig/gdb/i386-linux-tdep.c	2008-04-09 13:27:17.000000000 +0100
+++ src/gdb/i386-linux-tdep.c	2008-04-09 14:46:04.000000000 +0100
@@ -435,12 +435,14 @@ i386_linux_pointer_demangle (CORE_ADDR a
 /* glibc pointer mangles the PC in jmp_buf.  We unmangle it here.  */
 
 static int
-i386_linux_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc)
+i386_linux_get_longjmp_target (struct frame_info *frame,
+			       CORE_ADDR *pc, CORE_ADDR *sp)
 {
-  if (!i386_get_longjmp_target (frame, pc))
+  if (!i386_get_longjmp_target (frame, pc, sp))
     return 0;
 
   *pc = i386_linux_pointer_demangle (*pc);
+  *sp = i386_linux_pointer_demangle (*sp);
 
   return 1;
 }

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