.
[deliverable/binutils-gdb.git] / gdb / i386-nto-tdep.c
index a80c7a47f988e2873511255477768cecd90d80f5..8538db7acf7c76630615f6d50260f825518cc349 100644 (file)
@@ -1,6 +1,6 @@
-/* i386-nto-tdep.c - i386 specific functionality for QNX Neutrino.
+/* Target-dependent code for QNX Neutrino x86.
 
-   Copyright 2003 Free Software Foundation, Inc.
+   Copyright 2003, 2004 Free Software Foundation, Inc.
 
    Contributed by QNX Software Systems Ltd.
 
@@ -225,9 +225,16 @@ i386nto_svr4_fetch_link_map_offsets (void)
   return lmp;
 }
 
+/* Return whether the frame preceding NEXT_FRAME corresponds to a QNX
+   Neutrino sigtramp routine.  */
+
 static int
-i386nto_pc_in_sigtramp (CORE_ADDR pc, char *name)
+i386nto_sigtramp_p (struct frame_info *next_frame)
 {
+  CORE_ADDR pc = frame_pc_unwind (next_frame);
+  char *name;
+
+  find_pc_partial_function (pc, &name, NULL, NULL);
   return name && strcmp ("__signalstub", name) == 0;
 }
 
@@ -242,7 +249,7 @@ i386nto_sigcontext_addr (struct frame_info *next_frame)
   char buf[4];
   CORE_ADDR sp;
 
-  frame_unwind_register (next_frame, SP_REGNUM, buf);
+  frame_unwind_register (next_frame, I386_ESP_REGNUM, buf);
   sp = extract_unsigned_integer (buf, 4);
 
   return sp + I386_NTO_SIGCONTEXT_OFFSET;
@@ -270,14 +277,15 @@ i386nto_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
   /* NTO uses ELF.  */
   i386_elf_init_abi (info, gdbarch);
 
-  /* Neutrino rewinds to look more normal.  */
+  /* Neutrino rewinds to look more normal.  Need to override the i386
+     default which is [unfortunately] to decrement the PC.  */
   set_gdbarch_decr_pc_after_break (gdbarch, 0);
 
   /* NTO has shared libraries.  */
   set_gdbarch_in_solib_call_trampoline (gdbarch, in_plt_section);
   set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target);
 
-  set_gdbarch_pc_in_sigtramp (gdbarch, i386nto_pc_in_sigtramp);
+  tdep->sigtramp_p = i386nto_sigtramp_p;
   tdep->sigcontext_addr = i386nto_sigcontext_addr;
   tdep->sc_pc_offset = 56;
   tdep->sc_sp_offset = 68;
This page took 0.030078 seconds and 4 git commands to generate.