]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* sparc-tdep.c (sparc_frame_cache): Don't bail out if %fp is zero.
authorMark Kettenis <kettenis@gnu.org>
Fri, 5 Mar 2004 15:30:17 +0000 (15:30 +0000)
committerMark Kettenis <kettenis@gnu.org>
Fri, 5 Mar 2004 15:30:17 +0000 (15:30 +0000)
Reorganize code a bit.

gdb/ChangeLog
gdb/sparc-tdep.c

index bab019968a80cb0c5783b28b4d59ada72108975c..7596a06806acb0dc01525d93799bc479ca2d3dbc 100644 (file)
@@ -1,3 +1,8 @@
+2004-03-04  Mark Kettenis  <kettenis@gnu.org>
+
+       * sparc-tdep.c (sparc_frame_cache): Don't bail out if %fp is zero.
+       Reorganize code a bit.
+
 2004-03-04  Orjan Friberg  <orjanf@axis.com>
 
        * cris-tdep.c (cris_scan_prologue): Save the frame pointer's offset
index 66dbac798c0e6e803f5bd825c791c5530fdda668..ac8eb48f439b68037142c166732b925a65e907a9 100644 (file)
@@ -615,14 +615,6 @@ sparc_frame_cache (struct frame_info *next_frame, void **this_cache)
   cache = sparc_alloc_frame_cache ();
   *this_cache = cache;
 
-  /* In priciple, for normal frames, %fp (%i6) holds the frame
-     pointer, which holds the base address for the current stack
-     frame.  */
-
-  cache->base = frame_unwind_register_unsigned (next_frame, SPARC_FP_REGNUM);
-  if (cache->base == 0)
-    return cache;
-
   cache->pc = frame_func_unwind (next_frame);
   if (cache->pc != 0)
     {
@@ -632,10 +624,18 @@ sparc_frame_cache (struct frame_info *next_frame, void **this_cache)
 
   if (cache->frameless_p)
     {
-      /* We didn't find a valid frame, which means that CACHE->base
-        currently holds the frame pointer for our calling frame.  */
-      cache->base = frame_unwind_register_unsigned (next_frame,
-                                                   SPARC_SP_REGNUM);
+      /* This function is frameless, so %fp (%i6) holds the frame
+         pointer for our calling frame.  Use %sp (%o6) as this frame's
+         base address.  */
+      cache->base =
+       frame_unwind_register_unsigned (next_frame, SPARC_SP_REGNUM);
+    }
+  else
+    {
+      /* For normal frames, %fp (%i6) holds the frame pointer, the
+         base address for the current stack frame.  */
+      cache->base =
+       frame_unwind_register_unsigned (next_frame, SPARC_FP_REGNUM);
     }
 
   return cache;