public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* How to debug gdb using gdb ?
@ 2012-08-07 14:18 Smith John
  2012-08-07 14:21 ` Tom Emerson
  2012-08-07 14:22 ` Jan Kratochvil
  0 siblings, 2 replies; 3+ messages in thread
From: Smith John @ 2012-08-07 14:18 UTC (permalink / raw)
  To: gdb

hi,guys:

   I am  researching  gdb source code ,  and  I want  to  debug  it
using  its  executable file .
   but  how can I send  command  to  the  debugged  gdb procedure
which is children  process  ,

  as the gdb which is parent process will  deal with every command
inputed from  the command line ,so I get no way to communicate  with

  that debugged gdb procedure.



any advice?


thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to debug gdb using gdb ?
  2012-08-07 14:18 How to debug gdb using gdb ? Smith John
@ 2012-08-07 14:21 ` Tom Emerson
  2012-08-07 14:22 ` Jan Kratochvil
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Emerson @ 2012-08-07 14:21 UTC (permalink / raw)
  To: Smith John; +Cc: gdb

http://sourceware.org/gdb/current/onlinedocs/gdbint/Debugging-GDB.html#Debugging-GDB

On Tue, Aug 7, 2012 at 10:18 AM, Smith John <baseboy126@gmail.com> wrote:
> hi,guys:
>
>    I am  researching  gdb source code ,  and  I want  to  debug  it
> using  its  executable file .
>    but  how can I send  command  to  the  debugged  gdb procedure
> which is children  process  ,
>
>   as the gdb which is parent process will  deal with every command
> inputed from  the command line ,so I get no way to communicate  with
>
>   that debugged gdb procedure.
>
>
>
> any advice?
>
>
> thanks!



-- 
Tom Emerson
tremerson@gmail.com
http://www.dreamersrealm.net/tree

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to debug gdb using gdb ?
  2012-08-07 14:18 How to debug gdb using gdb ? Smith John
  2012-08-07 14:21 ` Tom Emerson
@ 2012-08-07 14:22 ` Jan Kratochvil
  1 sibling, 0 replies; 3+ messages in thread
From: Jan Kratochvil @ 2012-08-07 14:22 UTC (permalink / raw)
  To: Smith John; +Cc: gdb

On Tue, 07 Aug 2012 16:18:01 +0200, Smith John wrote:
>    but  how can I send  command  to  the  debugged  gdb procedure
> which is children  process  ,

I find most easy to make child GDB non-interactive.  So that you do not have
to re-enter the exact commands to reproduce the problem each time.  Therefore
use -ex (or -x) for the child GDB:

gdb -ex 'b breakpoint.c:9152' -ex r --args ./gdb ~/t/try5 -ex 'b display' -ex r -ex up -ex b -ex 'info b' -ex 'p/x $pc' -ex 'info line *$pc' -ex 'set confirm no' -ex q -q


Regards,
Jan

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-08-07 14:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-07 14:18 How to debug gdb using gdb ? Smith John
2012-08-07 14:21 ` Tom Emerson
2012-08-07 14:22 ` Jan Kratochvil

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).