From: "H.J. Lu" <hjl.tools@gmail.com>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: Fix solib-disc.exp regression with x86 gdbserver
Date: Sun, 11 Apr 2010 16:59:00 -0000 [thread overview]
Message-ID: <j2n6dc9ffc81004110959lf1787403ya90d1e6f819530d0@mail.gmail.com> (raw)
In-Reply-To: <201004111517.48725.pedro@codesourcery.com>
On Sun, Apr 11, 2010 at 7:17 AM, Pedro Alves <pedro@codesourcery.com> wrote:
> On Sunday 11 April 2010 15:04:39, H.J. Lu wrote:
>> How can I debug gdbserver with gdb? I tried and it didn't work.
>
> What doesn't work? It Just Works for me:
>
> $gdb -q --args ./gdbserver :9999 ~/gdb/tests/threads
> Reading symbols from /home/pedro/gdb/gdbserver_tracepoints_step_over_bkpt_pushed/build/gdb/gdbserver/gdbserver...done.
> (gdb) start
> Temporary breakpoint 1 at 0x40f51f: file ../../../src/gdb/gdbserver/server.c, line 2238.
> Starting program: /home/pedro/gdb/gdbserver_tracepoints_step_over_bkpt_pushed/build/gdb/gdbserver/gdbserver :9999 /home/pedro/gdb/tests/threads
>
> Temporary breakpoint 1, main (argc=4, argv=0x7fffffffe068) at ../../../src/gdb/gdbserver/server.c:2238
> 2238 char **next_arg = &argv[1];
> (gdb)
>
>
> Attaching works too:
>
> $ ./gdbserver :9999 ~/gdb/tests/threads
> ...
>
> $ gdb -p $(pidof gdbserver)
> ...
>
> It used to be GDB would get confused due to the uses of the clone
> syscall in linux-low.c, and so breakpoints wouldn't work. The
> easy workaround was just to comment out the linux_test_for_tracefork
> call (and hardcode linux_supports_tracefork_flag as 1, to get the
> same behaviour you'd get without the hack). clone is only used
> on uclinux/nommu, so you shouldn't need the hack anymore on linux.
>
> gdbserver's "--debug" command line switch is also useful (it enables
> all that the internal debug output controlled by `if (debug_threads)').
> "(gdb) monitor set debug 1" has the same effect.
>
I set breakpoint in x86_linux_process_qsupported. Gdb only stopped
at the first call. The second call was never stopped. It may be a
follow-fork issue.
--
H.J.
next prev parent reply other threads:[~2010-04-11 16:59 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-11 1:52 Pedro Alves
2010-04-11 14:04 ` H.J. Lu
2010-04-11 14:18 ` Pedro Alves
2010-04-11 15:43 ` H.J. Lu
2010-04-11 16:17 ` Pedro Alves
2010-04-11 16:22 ` H.J. Lu
2010-04-11 16:59 ` H.J. Lu [this message]
2010-04-11 16:04 ` H.J. Lu
2010-04-11 16:13 ` Pedro Alves
2010-04-11 16:18 ` H.J. Lu
2010-04-11 21:12 ` H.J. Lu
2010-04-11 21:18 ` H.J. Lu
2010-04-12 7:46 ` Pedro Alves
2010-04-12 13:05 ` H.J. Lu
2010-04-12 13:26 ` Pedro Alves
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=j2n6dc9ffc81004110959lf1787403ya90d1e6f819530d0@mail.gmail.com \
--to=hjl.tools@gmail.com \
--cc=gdb-patches@sourceware.org \
--cc=pedro@codesourcery.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