From: Kevin Buettner <kevinb@redhat.com>
To: gdb-patches@sources.redhat.com
Subject: Re: [RFC] Add FR-V Linux core file support
Date: Thu, 02 Mar 2006 00:01:00 -0000 [thread overview]
Message-ID: <20060301170123.6353b16c@ironwood.lan> (raw)
In-Reply-To: <20060220153046.GD14155@nevyn.them.org>
On Mon, 20 Feb 2006 10:30:46 -0500
Daniel Jacobowitz <drow@false.org> wrote:
> > @@ -421,6 +421,14 @@ frv_current_sos (void)
> > struct so_list *sos_head = NULL;
> > struct so_list **sos_next_ptr = &sos_head;
> >
> > + /* Make sure that the main executable has been relocated. Normally
> > + this is done by SOLIB_CREATE_INFERIOR_HOOK(), however, this hook
> > + is not run when loading core files. Rather than create a new hook,
> > + we'll do it here if necessary. */
> > + if (main_executable_lm_info == 0 && core_bfd != NULL)
> > + frv_relocate_main_executable ();
> > +
> > + /* Fetch the GOT corresponding to the main executable. */
> > mgot = main_got ();
> >
> > /* Locate the address of the first link map struct. */
>
> Was this patch written recently, or forward ported from something a
> bit older? I'm thinking 2006-01-24 here. The new post_create_inferior
> is called when loading core files, and in turn calls
> solib_create_inferior_hook.
FYI, I just revisited this. post_create_inferior() does indeed cause
the main executable to be relocated. However, the shared libraries
associated with the post mortem aren't being loaded. (My revised
comment below explains why.) Thus, I'm strongly considering retaining
the call to solib_relocate_main_executable() (within the current_sos
function) and revising the comment as follows:
/* Make sure that the main executable has been relocated. This is
required in order to find the address of the global offset table,
which in turn is used to find the link map info. (See lm_base()
for details.)
Note that the relocation of the main executable is also performed
by SOLIB_CREATE_INFERIOR_HOOK(), however, in the case of core
files, this hook is called too late in order to be of benefit to
SOLIB_ADD. SOLIB_ADD eventually calls this this function,
frv_current_sos, and also precedes the call to
SOLIB_CREATE_INFERIOR_HOOK(). (See post_create_inferior() in
infcmd.c.) */
The other alternative is to rework post_create_inferior() so that
SOLIB_ADD is called after SOLIB_CREATE_INFERIOR_HOOK. According to
the comments in post_create_inferior() though, this would not be
desirable since SOLIB_ADD might be called without the correct FROM_TTY
values.
Opinions?
Kevin
next prev parent reply other threads:[~2006-03-02 0:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-14 21:10 Kevin Buettner
2006-02-20 15:31 ` Daniel Jacobowitz
2006-02-20 19:52 ` Kevin Buettner
2006-02-20 19:53 ` Daniel Jacobowitz
2006-02-20 19:59 ` Daniel Jacobowitz
2006-03-02 0:08 ` Kevin Buettner
2006-03-02 0:01 ` Kevin Buettner [this message]
2006-03-16 13:44 ` Kevin Buettner
2006-03-16 14:49 ` Daniel Jacobowitz
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=20060301170123.6353b16c@ironwood.lan \
--to=kevinb@redhat.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