[RFA] Improvements for sh double register display

Andrew Cagney ac131313@redhat.com
Wed Jul 16 02:33:00 GMT 2003


> Andrew Cagney wrote:
>  > +   char *raw_buffer;
>  > +   double dbl;
>  > +   int inv;
>  >    > !   /* Allocate space for the float. */
>  > !   raw_buffer = (char *) alloca (2 * REGISTER_RAW_SIZE (FP0_REGNUM));
> 
> Can you use something other than alloca here? Also, this will collide
> in mid air with Corinna's revamp. Maybe you can revisit this after she
> is done? Otherwise it's ok.
> 
> 
> Something like:
> 
>     char raw_buffer[MAX_REGISTER_SIZE * 2];
> 
> will do the trick.
> 
> 
> Wah -- didn't we just go to a bunch of trouble to get rid of those?
> By "just", I suppose I mean a year or two ago...

Well four years ago. When MAX_REGISTER_RAW_SIZE et.al. were switched to 
variables, the arrays were replaced with alloca.  However, now that the 
codes been cleaned up a lot, it's become clear that a simple 
MAX_REGISTER_SIZE constant is sufficient for many tasks.
http://sources.redhat.com/ml/gdb/2003-04/msg00014.html

Andrew




More information about the Gdb-patches mailing list