[RFA/commit] Fix SP register unwinding on alpha-tru64

Joel Brobecker brobecker@adacore.com
Sat May 31 06:46:00 GMT 2008


Thanks for the feedback, Ulrich.

> Hmm, in alpha-mdebug-tdep.c this is now implemented as:
> 
>   /* The stack pointer of the previous frame is computed by popping
>      the current stack frame.  */
>   if (!trad_frame_addr_p (info->saved_regs, ALPHA_SP_REGNUM))
>    trad_frame_set_value (info->saved_regs, ALPHA_SP_REGNUM, vfp);
> 
> at the end of alpha_mdebug_frame_unwind_cache ...
> 
> Should the two files use the same method here?

I agree. I think that the mdebug approach is a little cleaner, so
how about the attached?

2008-05-30  Joel Brobecker  <brobecker@adacore.com>

        * alpha-tdep.c (alpha_heuristic_frame_unwind_cache): Set
        the trad-frame register value for the SP register.

Tested on alpha-tru64 with the AdaCore testsuite.

-- 
Joel
-------------- next part --------------
Index: alpha-tdep.c
===================================================================
--- alpha-tdep.c	(revision 131933)
+++ alpha-tdep.c	(working copy)
@@ -1149,6 +1149,11 @@ alpha_heuristic_frame_unwind_cache (stru
     if (trad_frame_addr_p(info->saved_regs, reg))
       info->saved_regs[reg].addr += val - 1;
 
+  /* The stack pointer of the previous frame is computed by popping
+     the current stack frame.  */
+  if (!trad_frame_addr_p (info->saved_regs, ALPHA_SP_REGNUM))
+   trad_frame_set_value (info->saved_regs, ALPHA_SP_REGNUM, info->vfp);
+
   return info;
 }
 


More information about the Gdb-patches mailing list