Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@cygnus.com>
To: Kevin Buettner <kevinb@cygnus.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [PATCH] solib-svr4.c: Fix set_solib_svr4_fetch_link_map_offsets
Date: Fri, 21 Sep 2001 19:32:00 -0000	[thread overview]
Message-ID: <3BABF816.9040308@cygnus.com> (raw)
In-Reply-To: <1010920205607.ZM17368@ocotillo.lan>

> I recently attempted to use set_solib_svr4_fetch_link_map_offsets() to
> establish a Linux/PPC specific link map fetcher, but discovered a
> number of problems.  One of them is as follows...  I attempted to call
> set_solib_svr4_fetch_link_map_offsets() from rs6000_gdbarch_init().
> The <arch>_gdbarch_init() functions (as they are commonly named) are
> used to allocate and initialize a gdbarch struct which is then installed
> to define a new "architecture" after this function returns.

First an fyi.  Elena found a cute bug in gdbarch's init sequence - it 
leaves the old architecture installed while it is creating the new 
architecture vis:

	-	create new architecture
	-	swap out old architecture
	-	install new architecture
	-	initialize remainder of new architecture

  This leads to all sorts of confusion such as what you encountered here.

I'm working on a patch that will change the initialization behavour so 
that it:

	-	swaps out the old architecture
	-	creates the new architecture
	-	installs new architecture
	-	initializes remainder of new architecture

I recall NickD encountering a similar situation to yours.  The 
gdbarch_data object's behavour was changed to better handle this situtation.

Instead of having a global variable, have you looked at registering a 
data pointer and then calling set_gdbarch_data(), from 
set_solib_svr4_fetch_link_map_offsets(), to set it?

The only potential problem I can see with this is with non- multi-arch 
but there, looking at the code I think it is already handled.

Andrew




  parent reply	other threads:[~2001-09-21 19:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1010920205607.ZM17368@ocotillo.lan>
     [not found] ` <s3ielp1ecwc.fsf@soliton.wins.uva.nl>
2001-09-20 15:16   ` Kevin Buettner
2001-09-21 18:56 ` Andrew Cagney
2001-09-21 20:31   ` Kevin Buettner
2001-09-21 20:42     ` Andrew Cagney
2001-09-21 19:32 ` Andrew Cagney [this message]
2001-09-21 20:14   ` Kevin Buettner

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=3BABF816.9040308@cygnus.com \
    --to=ac131313@cygnus.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=kevinb@cygnus.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