[PATCH] Fix phantom frames on ppc

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] Fix phantom frames on ppc

Andreas Schwab
On ppc the DWARF2 register 64 is the cr register.  But
rs6000_dwarf2_reg_to_regnum failed to translate that to the gdb internal
cr register number, causing it to be mistaken as the gdb internal pc
register.  This resulted in phantom frames whenever a frame has the cr
register saved.

Andreas.

2007-04-01  Andreas Schwab  <[hidden email]>

        * rs6000-tdep.c (rs6000_dwarf2_reg_to_regnum): Decode 64 as CR
        register.

--- gdb/rs6000-tdep.c.~1.269.~ 2007-04-01 21:23:44.000000000 +0200
+++ gdb/rs6000-tdep.c 2007-04-01 21:24:17.000000000 +0200
@@ -2274,6 +2274,8 @@ rs6000_dwarf2_reg_to_regnum (int num)
   else
     switch (num)
       {
+      case 64:
+ return tdep->ppc_cr_regnum;
       case 67:
         return tdep->ppc_vrsave_regnum - 1; /* vscr */
       case 99:

--
Andreas Schwab, SuSE Labs, [hidden email]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] Fix phantom frames on ppc

Daniel Jacobowitz-2
On Sun, Apr 01, 2007 at 10:11:25PM +0200, Andreas Schwab wrote:

> On ppc the DWARF2 register 64 is the cr register.  But
> rs6000_dwarf2_reg_to_regnum failed to translate that to the gdb internal
> cr register number, causing it to be mistaken as the gdb internal pc
> register.  This resulted in phantom frames whenever a frame has the cr
> register saved.
>
> Andreas.
>
> 2007-04-01  Andreas Schwab  <[hidden email]>
>
> * rs6000-tdep.c (rs6000_dwarf2_reg_to_regnum): Decode 64 as CR
> register.

Whoops!  This is OK.  That "default:" case does not seem like a really
good idea...

--
Daniel Jacobowitz
CodeSourcery