* config/rs6000/tm-rs6000.h, rs6000-tdep.c: Move FRAME_CHAIN
authorJim Kingdon <jkingdon@engr.sgi.com>
Tue, 13 Apr 1993 06:15:14 +0000 (06:15 +0000)
committerJim Kingdon <jkingdon@engr.sgi.com>
Tue, 13 Apr 1993 06:15:14 +0000 (06:15 +0000)
to rs6000_frame_chain and deal with it if we're in a signal handler.
(FRAME_SAVED_PC): Use rs6000_frame_chain.

gdb/ChangeLog
gdb/rs6000-tdep.c

index cc85f615c068e9f84c6f976d2f46109476a192f8..8fe721bf43748bac99ef1a5005efc3dfbdc2d1fd 100644 (file)
@@ -1,5 +1,9 @@
 Mon Apr 12 10:53:50 1993  Jim Kingdon  (kingdon@cygnus.com)
 
+       * config/rs6000/tm-rs6000.h, rs6000-tdep.c: Move FRAME_CHAIN
+       to rs6000_frame_chain and deal with it if we're in a signal handler.
+       (FRAME_SAVED_PC): Use rs6000_frame_chain.
+
        * breakpoint.c (within_scope): New function.
        (enable_breakpoint, watchpoint_check): Use it.
 
index 4d1b73a492938dbe9feb7572d22bffdc5ae7619c..5aa763264856bed7b4ec16a91c6e9b70e22882fd 100644 (file)
@@ -1091,6 +1091,33 @@ frame_initial_stack_address (fi)
   return fi->initial_sp = read_register (fdata.alloca_reg);     
 }
 
+FRAME_ADDR
+rs6000_frame_chain (thisframe)
+     struct frame_info *thisframe;
+{
+  FRAME_ADDR fp;
+  if (inside_entry_file ((thisframe)->pc))
+    return 0;
+  fp = read_memory_integer ((thisframe)->frame, 4);
+  if (fp == 0 && thisframe->pc < TEXT_SEGMENT_BASE)
+    {
+      /* If we are doing a backtrace from a signal handler, fp will be 0
+        and thisframe->pc will be something like 0x3f88 or 0x2790.  */
+
+      /* This was determined by experimentation on AIX 3.2.  Perhaps
+        it corresponds to some offset in /usr/include/sys/user.h or
+        something like that.  Using some system include file would
+        have the advantage of probably being more robust in the face
+        of OS upgrades, but the disadvantage of being wrong for
+        cross-debugging.  */
+
+#define SIG_FRAME_FP_OFFSET 284
+      fp = read_memory_integer (thisframe->frame + SIG_FRAME_FP_OFFSET, 4);
+    }
+  return fp;
+}
+
+\f
 /* xcoff_relocate_symtab -     hook for symbol table relocation.
    also reads shared libraries.. */