From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Kevin Buettner <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: Wed, 01 Dec 2010 23:03:00 -0000 [thread overview]
Message-ID: <20101201230339.GA8453@host0.dyn.jankratochvil.net> (raw)
In-Reply-To: <20101130180618.66003c99@mesquite.lan>
On Wed, 01 Dec 2010 02:06:18 +0100, Kevin Buettner wrote:
> My testing shows that use of `! current_inferior ()->attach_flag' as
> the test in enable_break() works when attaching to a process started
> natively. I also see the correct behavior (in which a breakpoint is
> placed on _start, et al) when the process is started via GDB's
> "run" command.
>
> The case that doesn't work - and, unfortunately, it's the case that
> really matters to me - is connecting to a remote target via "target
> remote".
GNU gdb (GDB) 7.2.50.20101201-cvs
killall -9 gdbserver;sleep 1h&p=$!;sleep 0.1;./gdbserver/gdbserver :1234 ./pause& ./gdb -nx -ex 'file ./pause' -ex 'target remote localhost:1234'
attach_flag=0
- correct
killall -9 gdbserver;./pause&p=$!;sleep 0.1;./gdbserver/gdbserver --attach :1234 $p& ./gdb -nx -ex 'file ./pause' -ex 'target remote localhost:1234'
attach_flag=1
- correct
killall -9 gdbserver;./pause&p=$!;sleep 0.1;./gdbserver/gdbserver --multi :1234& ./gdb -nx -ex 'file ./pause' -ex 'target extended-remote localhost:1234' -ex "attach $p"
attach_flag=1
- correct
Probably in the first case you do not want to place those breakpoints?
But I think at least the "main" breakpoint is the one requested by Mark
Kettenis to stay there even in the case solib_break_names[] bpts fail:
http://sourceware.org/ml/gdb-patches/2010-09/msg00313.html
Maybe the single-hit variant would be enough?
> The patch that I've posted does correctly handle the "target remote"
> case. (It correctly handles the native cases too.)
(The problem is it introduces two variants of "attach_flag".)
Thanks,
Jan
next prev parent reply other threads:[~2010-12-01 23:03 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 [this message]
2010-12-03 21:04 ` Kevin Buettner
2010-12-05 19:47 ` Mark Kettenis
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=20101201230339.GA8453@host0.dyn.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--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