This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: debug gdb by gdb


On Tue, Sep 11, 2012 at 2:36 AM, 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ï
>
>
> thanks!

This all works rather well (depending on what you mean by "dynamically").
gdb developers do it regularly. :-)

bash$ cd $build/gdb
bash$ gdb gdb
[...]
(top-gdb) r -nx hello
[...]
(gdb) r
Starting program: /home/dje/hello
Hello.
[Inferior 1 (process 9905) exited normally]
(gdb) i
(top-gdb) c
(gdb) quit
(top-gdb) quit
bash$

Do you have something specific that is not working?

Note that above I show how to get back to top-gdb from the child gdb
without terminating the child gdb using "i" or "info" without
arguments.  See gdb-gdb.gdb for how this is done.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]