From: Daniel Jacobowitz <drow@false.org>
To: Lukas Heiniger <lukas.heiniger@fela.ch>
Cc: gdb@sources.redhat.com
Subject: Re: SIGTRAP or SIG32 when remote debugging threads
Date: Thu, 25 Mar 2004 15:37:00 -0000 [thread overview]
Message-ID: <20040325144702.GA3830@nevyn.them.org> (raw)
In-Reply-To: <200403251129.32860.lukas.heiniger@fela.ch>
On Thu, Mar 25, 2004 at 11:29:32AM +0100, Lukas Heiniger wrote:
> On Wednesday 24 March 2004 16:07, Daniel Jacobowitz wrote:
> > On Wed, Mar 24, 2004 at 04:03:13PM +0100, Lukas Heiniger wrote:
> > > On Wednesday 24 March 2004 15:39, Daniel Jacobowitz wrote:
> > > > On Wed, Mar 24, 2004 at 02:11:16PM +0100, Lukas Heiniger wrote:
> > > > > It looks like setting and hitting the shlib event breakpoint works.
> > > >
> > > > Not to me. Is 0x40002570 the shlib event breakpoint, and if so, why
> > > > are you stopped there instead of at the first instruction in the
> > > > program?
> > >
> > > According to 'maint info breakpoints' (you can find it approximately in
> > > the middle of my last session) the shlib event breakpoint is located at
> > > 0x4000c3fc. After entering 'continue', gdb seems to set a breakpoint
> > > there. The instruction is restored after SIG32 has been received.
> > >
> > > I think that 0x40002570 actually is the first instruction in the program.
> >
> > In that case the breakpoint was not hit, just set, according to your
> > log.
>
>
> Yeah, you're right (of course). Let me see if I got the mechanisms right (I
> hope I don't go to much into details):
>
> 1. When I start the gdb (i.e. when I type 'target remote /dev/ttyS0'), it will
> try to set a break point in the dynamic linker (creating an inferior hook).
> When this special breakpoint was hit, gdb would examine the linker and load
> in any shared libs.
>
> 2. Setting the shlib bp is done by enable_break. enable_break first assumes
> that the target is running
>
> (is this the case in remote debugging ?)
It should be.
> and tries to get the dynamic linker base from the shared library table. This
> fails because the inferior returns 0 for the debug_base in svr4_current_sos.
> So (comment from the code): /* Otherwise we find the dynamic linker's base
> address by examining the current pc (which should point at the entry point
> for the dynamic linker) and subtracting the offset of the entry point. */
>
> (Isn't pc pointing at the first instruction of the program?)
No, the program is invoked by the dynamic linker.
> so enable_break calculates some value for the breakpoint, which in my case is
> 0x4000c3fc. For whatever reason this bp is not hit before the SIG32 appears.
> If this really is the problem, I have no Idea what I could do about it.
You need to figure out if the breakpoint is at the right place or not.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
prev parent reply other threads:[~2004-03-25 14:47 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-19 17:30 Lukas Heiniger
2004-03-19 18:31 ` Daniel Jacobowitz
2004-03-22 13:21 ` Lukas Heiniger
2004-03-22 17:33 ` Daniel Jacobowitz
2004-03-23 19:25 ` Lukas Heiniger
2004-03-23 20:41 ` Daniel Jacobowitz
2004-03-24 14:44 ` Lukas Heiniger
2004-03-24 14:54 ` Daniel Jacobowitz
2004-03-24 15:09 ` Lukas Heiniger
2004-03-24 15:44 ` Daniel Jacobowitz
2004-03-25 14:29 ` Lukas Heiniger
2004-03-25 15:37 ` Daniel Jacobowitz [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=20040325144702.GA3830@nevyn.them.org \
--to=drow@false.org \
--cc=gdb@sources.redhat.com \
--cc=lukas.heiniger@fela.ch \
/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