From: Jim Blandy <jimb@zwingli.cygnus.com>
To: Andrew Cagney <ac131313@cygnus.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: RFA: relax restrictions on per-architecture data registration
Date: Wed, 06 Jun 2001 07:39:00 -0000 [thread overview]
Message-ID: <np4rtt659m.fsf@zwingli.cygnus.com> (raw)
In-Reply-To: <3B1E1B37.10209@cygnus.com>
Andrew Cagney <ac131313@cygnus.com> writes:
> > 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.
>
> 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.
>
> To follow up my previous post. All I think is needed is for the code in
> arch-utils.c:initialize_current_architecture():
>
>
> if (GDB_MULTI_ARCH)
> {
> if (! gdbarch_update_p (info))
> {
> internal_error (__FILE__, __LINE__,
> "initialize_current_architecture: Selection
> of initial architecture
> failed");
> }
> }
>
> to be tweeked so that, when there is no multi-arch, the data vector is
> still initialized.
Okay. My first patch was exactly that, but then I felt like I was
assuming that all per-architecture data would be registered by the
time initialization was done, which wasn't a documented requirement in
gdbarch.h. So I made it more dynamic.
I'll revert my patch, and post a new one shortly.
next prev parent reply other threads:[~2001-06-06 7:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20010601233233.C19845E9CB@zwingli.cygnus.com>
2001-06-01 20:54 ` PATCH: " Jim Blandy
2001-06-06 4:59 ` RFA: " Andrew Cagney
2001-06-06 7:39 ` Jim Blandy [this message]
2001-06-06 9:35 ` Andrew Cagney
2001-06-06 6:34 ` Andrew Cagney
2001-06-06 9:59 ` RFA: initialize per-arch data in startup_gdbarch Jim Blandy
2001-06-06 10:13 ` Andrew Cagney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=np4rtt659m.fsf@zwingli.cygnus.com \
--to=jimb@zwingli.cygnus.com \
--cc=ac131313@cygnus.com \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox