Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA/solib-svr4] use AT_BASE auxiliary entry to compute load 	base address
Date: Sun, 16 Sep 2007 19:36:00 -0000	[thread overview]
Message-ID: <20070916193558.GA27177@caradoc.them.org> (raw)
In-Reply-To: <20070912211805.GF10540@adacore.com>

On Wed, Sep 12, 2007 at 02:18:05PM -0700, Joel Brobecker wrote:
> Hello,
> 
> I came across an unexpected issue on sparc-solaris 2.9, where I tried
> to attach to an Ada program. When I later did a "continue", the debugger
> error'ed out saying:
> 
>     (gdb) c
>     Continuing.
>     Warning:
>     Cannot insert breakpoint -1.
>     Error accessing memory address 0xff36159c: I/O error.

So, it has attached to the program and decided that it's at the start
address.  That means we tried this:

      /* On a running target, we can get the dynamic linker's base
         address from the shared library table.  */
      solib_add (NULL, 0, &current_target, auto_solib_add);
      so = master_so_list ();
      while (so)
...

and did not find any loaded libraries or else did not find the
interpreter in the list.  That's strange and almost certainly
indicates a bug that we should fix.  The loader should have
been in the list at that point.  Maybe it has a different
filename in the list than in .interp?

If you have time, I would recommend looking into this more.

> I think that the problem is that we're computing the wrong base load
> address in solib-svr4.c. As it turned out, there was a "TODO" hint
> added by Daniel that suggested using the AT_BASE auxiliary entry.
> The attached patch attempts to do that.
> 
> 2007-09-12  Joel Brobecker  <brobecker@adacore.com>
> 
>         * solib-svr4.c: Add include of "auxv.h".
>         (enable_break): Use the AT_BASE auxiliary entry if available.
>         * Makefile.in (solib-svr4.o): Update dependencies.

This patch, independently, is a good idea and I'm glad you did it.
It's OK.

-- 
Daniel Jacobowitz
CodeSourcery


  parent reply	other threads:[~2007-09-16 19:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-12 21:18 Joel Brobecker
2007-09-13  1:02 ` Joel Brobecker
2007-09-16 19:36 ` Daniel Jacobowitz [this message]
2007-09-17 19:42   ` Joel Brobecker
2007-09-17 19:49     ` Daniel Jacobowitz
2008-04-17 15:29 ` Ulrich Weigand
2008-04-17 17:48   ` Daniel Jacobowitz
2008-04-17 21:45     ` Ulrich Weigand
2008-04-17 22:32       ` 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=20070916193558.GA27177@caradoc.them.org \
    --to=drow@false.org \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.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