[PATCH] Signal handler back-tracing fixes for NetBSD/alpha

Jason R Thorpe thorpej@wasabisystems.com
Sat Aug 31 15:46:00 GMT 2002


The following fixes back-tracing through signal handlers for the
alpha-netbsd target.

Committed to trunk.

	* Makefile.in (alphanbsd-tdep.o): Add $(frame_h) to dependency
	list.
	* alphanbsd-tdep.c (alphanbsd_sigcontext_addr)
	(alphanbsd_skip_sigtramp_frame): New functions.
	(alphanbsd_init_abi): Set tdep->skip_sigtramp_frame to
	alphanbsd_skip_sigtramp_frame.  Set tdep->sigcontext_addr
	to alphanbsd_sigcontext_addr.

-- 
        -- Jason R. Thorpe <thorpej@wasabisystems.com>
-------------- next part --------------
Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.253
diff -c -r1.253 Makefile.in
*** Makefile.in	31 Aug 2002 20:28:36 -0000	1.253
--- Makefile.in	31 Aug 2002 22:37:25 -0000
***************
*** 1500,1508 ****
  alphabsd-tdep.o: alphabsd-tdep.c $(defs_h) $(regcache_h) $(alpha_tdep_h) \
  	$(alphabsd_tdep_h)
  alphafbsd-tdep.o: alphafbsd-tdep.c $(defs_h) $(value_h) $(alpha_tdep_h)
! alphanbsd-tdep.o: alphanbsd-tdep.c $(defs_h) $(gdbcore_h) $(regcache_h) \
! 	$(value_h) $(solib_svr4_h) $(alpha_tdep_h) $(alphabsd_tdep_h) \
! 	$(nbsd_tdep_h)
  annotate.o: annotate.c $(defs_h) $(annotate_h) $(value_h) $(target_h) \
  	$(gdbtypes_h) $(breakpoint_h)
  # OBSOLETE arc-tdep.o: arc-tdep.c
--- 1500,1508 ----
  alphabsd-tdep.o: alphabsd-tdep.c $(defs_h) $(regcache_h) $(alpha_tdep_h) \
  	$(alphabsd_tdep_h)
  alphafbsd-tdep.o: alphafbsd-tdep.c $(defs_h) $(value_h) $(alpha_tdep_h)
! alphanbsd-tdep.o: alphanbsd-tdep.c $(defs_h) $(gdbcore_h) $(frame_h) \
! 	$(regcache_h) $(value_h) $(solib_svr4_h) $(alpha_tdep_h) \
! 	$(alphabsd_tdep_h) $(nbsd_tdep_h)
  annotate.o: annotate.c $(defs_h) $(annotate_h) $(value_h) $(target_h) \
  	$(gdbtypes_h) $(breakpoint_h)
  # OBSOLETE arc-tdep.o: arc-tdep.c
Index: alphanbsd-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/alphanbsd-tdep.c,v
retrieving revision 1.9
diff -c -r1.9 alphanbsd-tdep.c
*** alphanbsd-tdep.c	31 Aug 2002 20:28:37 -0000	1.9
--- alphanbsd-tdep.c	31 Aug 2002 22:37:25 -0000
***************
*** 21,26 ****
--- 21,27 ----
  
  #include "defs.h"
  #include "gdbcore.h"
+ #include "frame.h"
  #include "regcache.h"
  #include "value.h"
  
***************
*** 182,187 ****
--- 183,211 ----
  	  || alphanbsd_sigtramp_offset (pc) >= 0);
  }
  
+ static CORE_ADDR
+ alphanbsd_sigcontext_addr (struct frame_info *frame)
+ {
+   /* FIXME: This is not correct for all versions of NetBSD/alpha.
+      We will probably need to disassemble the trampoline to figure
+      out which trampoline frame type we have.  */
+   return frame->frame;
+ }
+ 
+ static CORE_ADDR
+ alphanbsd_skip_sigtramp_frame (struct frame_info *frame, CORE_ADDR pc)
+ {
+   char *name;
+ 
+   /* FIXME: This is not correct for all versions of NetBSD/alpha.
+      We will probably need to disassemble the trampoline to figure
+      out which trampoline frame type we have.  */
+   find_pc_partial_function (pc, &name, (CORE_ADDR *) NULL, (CORE_ADDR *) NULL);
+   if (PC_IN_SIGTRAMP (pc, name))
+     return frame->frame;
+   return 0;
+ }
+ 
  static void
  alphanbsd_init_abi (struct gdbarch_info info,
                      struct gdbarch *gdbarch)
***************
*** 197,203 ****
--- 221,229 ----
    set_solib_svr4_fetch_link_map_offsets (gdbarch,
                                   nbsd_lp64_solib_svr4_fetch_link_map_offsets);
  
+   tdep->skip_sigtramp_frame = alphanbsd_skip_sigtramp_frame;
    tdep->dynamic_sigtramp_offset = alphanbsd_sigtramp_offset;
+   tdep->sigcontext_addr = alphanbsd_sigcontext_addr;
  
    tdep->jb_pc = 2;
    tdep->jb_elt_size = 8;


More information about the Gdb-patches mailing list