From: Mark Kettenis <mark.kettenis@xs4all.nl>
To: kevinb@redhat.com
Cc: gdb-patches@sourceware.org
Subject: Re: [RFC] Limit attempts to place breakpoints on _start, __start, and main in solib-svr4.c
Date: Sun, 05 Dec 2010 19:47:00 -0000 [thread overview]
Message-ID: <201012051947.oB5JlOMj023972@glazunov.sibelius.xs4all.nl> (raw)
In-Reply-To: <20101203140433.69c17fc4@mesquite.lan> (message from Kevin Buettner on Fri, 3 Dec 2010 14:04:33 -0700)
> Date: Fri, 3 Dec 2010 14:04:33 -0700
> From: Kevin Buettner <kevinb@redhat.com>
>
> On Thu, 2 Dec 2010 00:03:39 +0100
> Jan Kratochvil <jan.kratochvil@redhat.com> wrote:
>
> Hi Jan,
>
> That's a nice demonstration of GDB's behavior when using gdbserver.
> My earlier testing and analysis was flawed. (FWIW, I was testing
> only case 1.)
>
> We do want to (potentially) attempt to place the breakpoints on
> _start, __start, and main in case 1, but not for case 2 and 3. You
> have demonstrated that the patch appended below will work correctly
> for gdbserver. I have used variants of your examples to verify that
> this is the case. (I have a hacked static executable in which I
> see a breakpoint placed on _start in case 1, but not for case 2 and 3 -
> which is as it should be.)
>
> The patch below won't necessarily work correctly with stubs which do
> not implement the qAttached packet. (gdbserver does implement
> qAttached.) My reading of remote.c indicates that stubs which do
> not implement "qAttached" will end up causing attach_flag to be 0.
> This may or may not be what we want depending upon the situation. It
> is certainly not what we want when connecting to a kernel stub (intended
> to debug a running kernel). On the other hand, there may be other
> stubs where this is in fact the correct answer. I'm going to
> recommend that my colleague (who pointed me at this problem a while
> ago) implement qAttached in his kernel stubs.
>
> I hereby withdraw my earlier patch in favor of the one below.
>
> Further comments?
Makes sense to me.
> * solib-svr4.c (enable_break): Don't attempt to place breakpoints,
> when attaching, on the names in bkpt_names: _start, __start, and
> main.
next prev parent reply other threads:[~2010-12-05 19:47 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-29 23:02 Kevin Buettner
2010-11-30 0:07 ` Jan Kratochvil
2010-11-30 5:15 ` Kevin Buettner
2010-12-01 1:06 ` Kevin Buettner
2010-12-01 23:03 ` Jan Kratochvil
2010-12-03 21:04 ` Kevin Buettner
2010-12-05 19:47 ` Mark Kettenis [this message]
2010-12-07 7:41 ` Jan Kratochvil
2010-12-13 15:47 ` Kevin Buettner
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=201012051947.oB5JlOMj023972@glazunov.sibelius.xs4all.nl \
--to=mark.kettenis@xs4all.nl \
--cc=gdb-patches@sourceware.org \
--cc=kevinb@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