Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Debugging GDB and breaking?
@ 2002-12-18  5:49 James Sampson
  0 siblings, 0 replies; 5+ messages in thread
From: James Sampson @ 2002-12-18  5:49 UTC (permalink / raw)
  To: GDB Archive

Hello

I'm debugging the GDB with the GDB - Not to catch a bug, but to investigate 
what's going on. In that case I wan't to step through everything the GDB does 
when just working with it manualy. Where I am now, I've loaded a file into the 
GDB being debugged, and I want the other GDB to take over, so I can see what 
happens, when the GDB actually sets a breakpoint in this small testprogram. 
But when I type e.g. "break main", the control never goes back to the other 
GDB, so I can't see what's going on.
Isn't there a command to issue a breakpoint at the next line of code instead 
of a obsolute position (name, address)?

Or could someone tell me where to look in the source code for the functions 
which places a breakpoint?.

Best Regards
James
						


^ permalink raw reply	[flat|nested] 5+ messages in thread
* Re: Debugging GDB and breaking?
@ 2002-12-18  7:23 Michael Elizabeth Chastain
  2002-12-18  7:59 ` Andreas Schwab
  2002-12-18 11:01 ` Grant Edwards
  0 siblings, 2 replies; 5+ messages in thread
From: Michael Elizabeth Chastain @ 2002-12-18  7:23 UTC (permalink / raw)
  To: gdb, i_am_triumph

Some general hints for debugging gdb:

I start with "gdb /my/gdb/to/debug/bin/gdb".  I like to use a stable gdb
for the top gdb, such as the vendor-supplied gdb or gdb 5.3.  Also this
helps separate, in my mind, the top gdb from the inferior gdb.

Then I immediately:

  (gdb) set prompt [top] 
  [top] break help_command
  [top] set args /program/under/test

The first line distinguishes the top gdb from the inferior gdb.

The second line lets me get back to the top gdb from the inferior gdb.
If the inferior gdb is waiting at a prompt, I just type "help foo"
and take the breakpoint at help_command.

The third line is the normal way to provide arguments to the inferior gdb.

After that, in your specific case, you want to break at break_command
and then use "next" and "step" from there.

Hope this helps,

Michael C


^ permalink raw reply	[flat|nested] 5+ messages in thread
* RE: Debugging GDB and breaking?
@ 2002-12-19  1:16 James Sampson
  0 siblings, 0 replies; 5+ messages in thread
From: James Sampson @ 2002-12-19  1:16 UTC (permalink / raw)
  To: GDB Archive

>Some general hints for debugging gdb:

Cool!



>I start with "gdb /my/gdb/to/debug/bin/gdb". I like to use a stable gdb
>for the top gdb, such as the vendor-supplied gdb or gdb 5.3. Also this
>helps separate, in my mind, the top gdb from the inferior gdb.


I didn't even know the 5.3 was out - Gonna grab that immediatly :-)




>After that, in your specific case, you want to break at break_command
>and then use "next" and "step" from there.


Ok, so the "break_command" is the first function to be called when setting a 
breakpoint? :-)



>Hope this helps,


Sure did, thanks :-D

Best Regards
James
						


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

end of thread, other threads:[~2002-12-19  9:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-18  5:49 Debugging GDB and breaking? James Sampson
2002-12-18  7:23 Michael Elizabeth Chastain
2002-12-18  7:59 ` Andreas Schwab
2002-12-18 11:01 ` Grant Edwards
2002-12-19  1:16 James Sampson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox