.
[deliverable/binutils-gdb.git] / gdb / i386-nto-tdep.c
index 4047f42b0173206f8eb37209f7112da62e69b606..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.
 
@@ -87,9 +87,9 @@ static void
 i386nto_supply_fpregset (char *fpregs)
 {
   if (nto_cpuinfo_valid && nto_cpuinfo_flags | X86_CPU_FXSR)
-    i387_supply_fxsave (fpregs);
+    i387_supply_fxsave (current_regcache, -1, fpregs);
   else
-    i387_supply_fsave (fpregs);
+    i387_supply_fsave (current_regcache, -1, fpregs);
 }
 
 static void
@@ -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;
 }
 
@@ -240,9 +247,9 @@ static CORE_ADDR
 i386nto_sigcontext_addr (struct frame_info *next_frame)
 {
   char buf[4];
-  unsigned sp;
+  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.028661 seconds and 4 git commands to generate.