This is the mail archive of the gdb-patches@sourceware.cygnus.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]

Re: [PATCH]: multi-arch fix for monitor.c


Oops, there's a mistake in here -- please disregard, 
and I'll resubmit in a few minutes.


msnyder@cygnus.com wrote:
> 
> 2000-04-26  Michael Snyder  <msnyder@seadog.cygnus.com>
> 
>         * monitor.c (monitor_fetch_register): MAX_REGISTER_RAW_SIZE
>         is not static in the MULTI_ARCH world, so don't use it in a
>         static array declaration.
> 
> Index: monitor.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/monitor.c,v
> retrieving revision 1.4
> diff -c -r1.4 monitor.c
> *** monitor.c   2000/04/04 02:08:52     1.4
> --- monitor.c   2000/04/26 21:41:38
> ***************
> *** 1206,1216 ****
>        int regno;
>   {
>     char *name;
> !   static char zerobuf[MAX_REGISTER_RAW_SIZE] =
> !   {0};
> !   char regbuf[MAX_REGISTER_RAW_SIZE * 2 + 1];
>     int i;
> 
>     name = current_monitor->regnames[regno];
>     monitor_debug ("MON fetchreg %d '%s'\n", regno, name ? name : "(null name)");
> 
> --- 1206,1221 ----
>        int regno;
>   {
>     char *name;
> !   static char *zerobuf;
> !   char *regbuf;
>     int i;
> 
> +   if (zerobuf == NULL)
> +     {
> +       zerobuf = alloca (MAX_REGISTER_RAW_SIZE);
> +       memset (zerobuf, 0, MAX_REGISTER_RAW_SIZE);
> +     }
> +   regbuf  = alloca (MAX_REGISTER_RAW_SIZE * 2 + 1);
>     name = current_monitor->regnames[regno];
>     monitor_debug ("MON fetchreg %d '%s'\n", regno, name ? name : "(null name)");
>

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