This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: RFA: relax restrictions on per-architecture data registration
- To: Jim Blandy <jimb at cygnus dot com>
- Subject: Re: RFA: relax restrictions on per-architecture data registration
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Wed, 06 Jun 2001 07:59:51 -0400
- Cc: gdb-patches at sources dot redhat dot com
- References: <20010601233233.C19845E9CB@zwingli.cygnus.com>
> This is supposed to fix G++ V3 on non-multiarch targets. Not sure
> this is right yet, just posting for the curious.
>
> 2001-06-01 Jim Blandy <jimb@redhat.com>
>
> Expand the gdbarch per-architecture data vector as needed, rather
> than requiring that all per-architecture data be registered before
> the first gdbarch object is allocated.
> * gdbarch.sh: Changes to effect the following:
> * gdbarch.c (alloc_gdbarch_data, init_gdbarch_data): Delete
> declarations and definitions.
> (check_gdbarch_data): New function, and declaration.
> (gdbarch_alloc): Don't call alloc_gdbarch_data; leaving the fields
> zero is good enough.
> (free_gdbarch_data): Tolerate a null data pointer. Free only
> those data items gdbarch->data actually has allocated.
> (set_gdbarch_data, gdbarch_data): Call check_gdbarch_data.
> (gdbarch_update_p): No need to call init_gdbarch_data.
>
>
Jim,
I think this is wrong. GDB's startup sequence is currently something like:
o _initialize_*() registers any
per-architecture data
o GDB creates the initial architecture
So that data buffer size would never change.
Andrew
PS: xmalloc(size) == zrealloc (NULL, size)