From: Mark Kettenis Date: Thu, 4 Mar 2004 10:10:33 +0000 (+0000) Subject: * sparc-tdep.c (sparc_frame_cache): Don't bail out if %fp is zero. X-Git-Tag: gprof-pre-ansify-2004-05-26~976 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cbeae229a5a89e8037852eb6f5b859240cdb227e;p=platform%2Fupstream%2Fbinutils.git * sparc-tdep.c (sparc_frame_cache): Don't bail out if %fp is zero. Reorganize code a bit. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 90ab349..2acfb72 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2004-03-04 Mark Kettenis + + * sparc-tdep.c (sparc_frame_cache): Don't bail out if %fp is zero. + Reorganize code a bit. + 2004-03-04 Orjan Friberg * cris-tdep.c (cris_scan_prologue): Save the frame pointer's offset diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c index 66dbac7..ac8eb48 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;