public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: "Kris Warkentin" <kewarken@qnx.com>
To: "Kris Warkentin" <kewarken@qnx.com>,
	"Daniel Jacobowitz" <drow@mvista.com>
Cc: <gdb@sources.redhat.com>
Subject: Re: auto-solib-add when attaching to inferior
Date: Thu, 17 Apr 2003 18:14:00 -0000	[thread overview]
Message-ID: <01cf01c3050d$3736fc50$0202040a@catdog> (raw)
In-Reply-To: <000f01c304eb$728c2a40$0202040a@catdog>

> > Remember that you don't use attach with the normal remote protocol.
> > When you to_open the target has already started.  For your agent it
> > sounds like you need to do it at to_attach time; but why isn't the one
> > in infcmd.c:attach_command working?
>
> Good question.  For some reason locate_base() seems to be failing.  Maybe
> that's the answer to the puzzle.  It looks like the SOLIB_ADD() in
> attach_command() should do the right thing.  I'll chase it deeper from
that
> end.

Well, I think I've found the cause but only part of the solution.  When
solib-svr4.c:elf_locate_base() is called, the dynamic pointer stored in the
DT_DEBUG section is zero.  This is because QNX has a util called 'on' which
can spawn a process in a 'held' state where it's stopped on the very first
instruction.  This is handy if you want to attach to a process before it
gets going but in this case, the loader hasn't been run yet so the DT_DEBUG
section isn't filled in.  If I attach to a process that is running properly,
I get my solibs loaded up and everything is fine.

This, however, presents the next problem: the shlib_event breakpoint not
being set.  On our native gdb, if I just add a SOLIB_CREATE_INFERIOR_HOOK
call to the attach function, it works properly.  The remote is another case.
I'm still thinking it's a sync issue with the debug agent though.

Thanks for the help.  You definitely got me barking up the right tree.

cheers,

Kris

      reply	other threads:[~2003-04-17 18:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-16 18:59 Kris Warkentin
2003-04-16 19:04 ` Daniel Jacobowitz
2003-04-16 22:05   ` Kris Warkentin
2003-04-16 22:14     ` Daniel Jacobowitz
2003-04-17 14:12       ` Kris Warkentin
2003-04-17 18:14         ` Kris Warkentin [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='01cf01c3050d$3736fc50$0202040a@catdog' \
    --to=kewarken@qnx.com \
    --cc=drow@mvista.com \
    --cc=gdb@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).