From: naga raj <gnuuser.raj@gmail.com>
To: John Smith <horserivers@gmail.com>
Cc: gdb@sourceware.org
Subject: Re: debug gdb by gdb
Date: Tue, 11 Sep 2012 10:15:00 -0000 [thread overview]
Message-ID: <CAKuVEhAmw90F5gDdoyHikozKSQX=AoKmsBDU-yQ4+x-MHoCAFw@mail.gmail.com> (raw)
In-Reply-To: <CAJR88pjyN6g3rkNY2UKXgGNp-tE-n7MLCw8x+09J0w=JCOk9cQ@mail.gmail.com>
Hi John,
On Tue, Sep 11, 2012 at 3:06 PM, John Smith <horserivers@gmail.com> wrote:
> hi,
>
> i am try to debug gdb by gdb , and a problem confused me
> , here it is : how can i send command to the debugged gdb
> process which is the child process of top-gdb ?
>
> as you know ,when I type command to the command line , this
> command will always be send to top-gdb , and how to send
> command to the child gdb dynamicly?
>
If you want to debug a gdb with gdb you can debug as below
gdb --args child-gdb <elf>
once you execute this command a gdb prompt of parent will appear
where you can set break point or do any other stuff. once you set a
breakpoint then enter run command
now this time again another gdb console will come there you can
commands for client gdb
ex:
[console]$ gdb --args mb-gdb a.out
GNU gdb 6.1.1
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...Using host
libthread_db library "/lib/tls/libthread_db.so.1".
(gdb) b microblaze_extract_return_value
Breakpoint 1 at 0x804d451: file
/gnu/mb_gnu//src/gdb/gdb/microblaze-tdep.c, line 621.
(gdb) run
Starting program: /gnu/mb_gnu/gnu/microblaze/lin/bin/mb-gdb a.out
Detaching after fork from child process 546.
GNU gdb (GDB) 7.4.50.20120403-cvs
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-pc-linux-gnu
--target=microblaze-xilinx-elf".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /wrk/ptx/users/nagaraju/prgs/a.out...(no
debugging symbols found)...done.
(gdb) tar remote localhost:1234
Remote debugging using localhost:1234
> thanks!
Hope this helps you
Nagaraju
next prev parent reply other threads:[~2012-09-11 10:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-11 9:36 John Smith
2012-09-11 10:15 ` naga raj [this message]
2012-09-15 0:21 ` Doug Evans
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='CAKuVEhAmw90F5gDdoyHikozKSQX=AoKmsBDU-yQ4+x-MHoCAFw@mail.gmail.com' \
--to=gnuuser.raj@gmail.com \
--cc=gdb@sourceware.org \
--cc=horserivers@gmail.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).