summaryrefslogtreecommitdiff
path: root/gdb/sparc-tdep.c
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2004-03-04 10:10:33 +0000
committerMark Kettenis <kettenis@gnu.org>2004-03-04 10:10:33 +0000
commitdd4cee4771d7ca6a1703205188b1e9aac9215dd5 (patch)
tree83677193d0e355e399a3c13f6f4e71c2ce8dc6ec /gdb/sparc-tdep.c
parent22a7eeb8082ec5e768e1755c1f02c02937564ed5 (diff)
downloadgdb-dd4cee4771d7ca6a1703205188b1e9aac9215dd5.tar.gz
* sparc-tdep.c (sparc_frame_cache): Don't bail out if %fp is zero.
Reorganize code a bit.
Diffstat (limited to 'gdb/sparc-tdep.c')
-rw-r--r--gdb/sparc-tdep.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c
index 66dbac798c0..ac8eb48f439 100644
--- a/gdb/sparc-tdep.c
+++ b/gdb/sparc-tdep.c
@@ -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;