This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch:arm] Don't use NUM_PSEUDO_REGS in arm_gdbarch_init()


> Hello,
> 
> The macro NUM_PSEUDO_REGS refers to ``current_gdbarch'' and not 
> ``gdbarch''.  Hence the equation in the patch was picking up the number 
> of pseudo-registers from the previously selected architecture (which may 
> not even be ARM), outch!  No wonder macro's are bad :-)
> 
> The attached calls gdbarch_num_pseudo_regs() directly with the correct 
> architecture.  (It also fixes a core dump that my next patch will cause ...)
> 
> Committed as fairly obvious.
> 
> Andrew
> 
> 2002-04-20  Andrew Cagney  <ac131313@redhat.com>
> 
> 	* arm-tdep.c (arm_gdbarch_init): Use gdbarch_num_pseudo_regs
> 	instead of NUM_PSEUDO_REGS.

Argh! As you will see from the comment, I'd already fixed a similar 
problem to avoid using SIZEOF_FRAME_SAVED_REGS, but missed that part.  Can 
you update the comment as well?

  /* We can't use SIZEOF_FRAME_SAVED_REGS here, since that still
     references the old architecture vector, not the one we are
     building here.  */

R.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]