Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Kevin Buettner <kevinb@redhat.com>
To: Daniel Jacobowitz <drow@false.org>
Cc: Randolph Chung <randolph@tausq.org>, gdb@sources.redhat.com
Subject: Re: Question about _dl_debug_state and new glibc
Date: Mon, 11 Oct 2004 22:00:00 -0000	[thread overview]
Message-ID: <20041011121612.02dd4495@saguaro> (raw)
In-Reply-To: <20041011175524.GA29450@nevyn.them.org>

On Mon, 11 Oct 2004 13:55:25 -0400
Daniel Jacobowitz <drow@false.org> wrote:

> On Mon, Oct 11, 2004 at 10:46:47AM -0700, Kevin Buettner wrote:
>
> > I can't think of any reason.  I'm guessing that it was more expedient
> > for the original authors of the code to do it the way it was done.
> > In any case, I know of no reason not to change it so that it's done
> > "properly".
> 
> We set the breakpoint on _dl_debug_state before starting the inferior.
> _dl_debug_initialize initializes _r_debug somewhat later...  I'm not
> sure how it is supposed to be used.  Do either of you know?

Ah!  Perhaps that's the reason why _dl_debug_state was used directly.

I ran into this problem when I wrote the FR-V's solib code.  (Due to
the fact that text and data are independetly relocated, the code in
solib-svr4.c couldn't be used.) The symbol in question was not
exported and could only be accessed from the r_debug struct.  But as you
say, it's value wasn't immediately available.  So, we set the solib
event breakpoint on the executable's entry point (probably _start). 
Once this breakpoint was hit, the data structures in question had been
initialized, and so we reset it to the address determined by examining
the r_debug struct.

I suspect that a similar strategy could be used for solib-svr4.c.

Kevin


      parent reply	other threads:[~2004-10-11 19:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-11 18:54 Randolph Chung
2004-10-11 19:03 ` Kevin Buettner
2004-10-11 19:14   ` Daniel Jacobowitz
2004-10-11 20:47     ` Mark Kettenis
2004-10-12  6:57       ` Daniel Jacobowitz
2004-10-11 22:00     ` Kevin Buettner [this message]

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=20041011121612.02dd4495@saguaro \
    --to=kevinb@redhat.com \
    --cc=drow@false.org \
    --cc=gdb@sources.redhat.com \
    --cc=randolph@tausq.org \
    /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