Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Debugging GDB with GDB
@ 2002-11-14  6:13 James Sampson
  2002-11-14  6:58 ` Tim Combs
  0 siblings, 1 reply; 16+ messages in thread
From: James Sampson @ 2002-11-14  6:13 UTC (permalink / raw)
  To: GDB Archive

Hello

GDB doesn't recognize a COFF file that I have made to a certain target - In 
that respect I wish to see whats going on "inside" the GDB, so I'm using GDB 
to debug itself - Only thing is, that I don't know how this is done.
I'm using GDB 5.0 to debug GDB 5.2.1, but how do I break or step the GDB when 
I have started the GDB being debugged? - The debugged GDB has control of the 
console. Is there any way I can use another console for debugging, or is there 
another way to do this?.

Cheers,

J.S.



^ permalink raw reply	[flat|nested] 16+ messages in thread
* Debugging GDB with GDB
@ 2006-08-31 16:17 Rajesh Warange
  2006-08-31 16:34 ` Daniel Jacobowitz
  2006-08-31 17:43 ` Michael Snyder
  0 siblings, 2 replies; 16+ messages in thread
From: Rajesh Warange @ 2006-08-31 16:17 UTC (permalink / raw)
  To: gdb

Hi all,
Thanks Jim and Michael for giving me a start to GDB.

I am trying to debug GDB with GDB. I have built a target for ARM (gdb-arm).
So I am debugging gdb-arm with gdb.
Below is a session output I had.
I have explained my problem below.
----------------------------------------------------------
<start_session>

GNU gdb Red Hat Linux (6.3.0.0-1.63rh)
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 "x86_64-redhat-linux-gnu".
Setting up the environment for debugging gdb.
No symbol table is loaded.  Use the "file" command.
No symbol table is loaded.  Use the "file" command.
.gdbinit:8: Error in sourced command file:
No breakpoint number 0.
(gdb) file gdb
Reading symbols from /home/warangr/gdb-6.5-build/gdb/gdb...done.
Using host libthread_db library "/lib64/tls/libthread_db.so.1".
(gdb) break _initialize_arm_tdep
Breakpoint 1 at 0x414b80: file ../../gdb-6.5/gdb/arm-tdep.c, line 2871.
(gdb) run
Starting program: /home/warangr/gdb-6.5-build/gdb/gdb

Breakpoint 1, _initialize_arm_tdep () at ../../gdb-6.5/gdb/arm-tdep.c:2871
2871    {
(gdb) s
During symbol reading, Incomplete CFI data; unspecified register rax
at 0x0000000000414b82.
2883      gdbarch_register (bfd_arch_arm, arm_gdbarch_init, arm_dump_tdep);
(gdb) s
2871    {
(gdb) s
2881      size_t rest = sizeof (regdesc);
(gdb) s
2871    {
(gdb) s
2909      for (i = 0; i < num_disassembly_options; i++)
(gdb)

<end_session>
----------------------------------------------------------

I started with setting a breakpoint at the function
_initialize_arm_tdep (defined in arm-tdep.c - line 2871).
When doing a single-step it jumped to line 2883 to a function
gdbarch_register (bfd_arch_arm, arm_gdbarch_init, arm_dump_tdep);
Now single stepping into this function would mean executing the first
line of the function gdbarch_register(bfd_....).
But it again jumps to line 2871 ... which is the start of the function
_initialize_arm_tdep.
Again after single-stepping, the debugger jumps to line 2909 executing
the "for loop".
There were some functions in between which it skipped entirely.

I 'm pretty badly foxed by this behaviour.
Could anyone please explain me this

Thanks.
-- 
wrr


^ permalink raw reply	[flat|nested] 16+ messages in thread
* RE: Debugging GDB with GDB
@ 2002-11-15  0:51 James Sampson
  0 siblings, 0 replies; 16+ messages in thread
From: James Sampson @ 2002-11-15  0:51 UTC (permalink / raw)
  To: GDB Archive, Tim Combs

Thanks a lot - I didn't know the ctrl-c options, since I'm pretty new to GDB 
:-D

Now I can get a bit further - More problems are sure to arise ;-)

J.S.


>The .gdbinit file uses "set prompt (top-gdb)" so you can differentiate
>between which gdb is running.  This works best on
>the command line as you can readily see which gdb you are in.  Things
>work the same as when you are debugging a program.  When you want to
>stop use ctrl-c and you will see the top-level prompt and you can step
>through gdb source.  When using the command line, I've always found it
>helpful to open the source file I'm debugging to follow along.
>
>Hope this helps
>Tim



^ permalink raw reply	[flat|nested] 16+ messages in thread
* Debugging gdb with gdb
@ 2002-02-01  8:25 Salman Khilji
  2002-02-01  9:26 ` Daniel Jacobowitz
  2002-02-03 12:29 ` Joel Brobecker
  0 siblings, 2 replies; 16+ messages in thread
From: Salman Khilji @ 2002-02-01  8:25 UTC (permalink / raw)
  To: gdb

I am running gdb under gdb.

Lets assume gdb starts mygdb.  I issue the run command in (gdb) without 
setting any breakpoints anywhere.  mygdb comes up and the prompt now says 
(mygdb) instead of (gdb).  I want to put a break point somewhere inside the 
mygdb code---not the program that mygdb is going to debug.  However if I 
issue the break command, the break point is going to be set in the program 
that (mygdb) is going to debug---not in mygdb itself.

So the question is:  How do I temporarily stop the target application in 
gdb---set a break point in the target---then continue?  This is useful in 
GUI applications as well.

Salman



_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com


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

end of thread, other threads:[~2006-08-31 22:54 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-14  6:13 Debugging GDB with GDB James Sampson
2002-11-14  6:58 ` Tim Combs
  -- strict thread matches above, loose matches on Subject: below --
2006-08-31 16:17 Rajesh Warange
2006-08-31 16:34 ` Daniel Jacobowitz
2006-08-31 17:43 ` Michael Snyder
2006-08-31 21:24   ` Andreas Schwab
2006-08-31 22:54     ` Michael Snyder
2002-11-15  0:51 James Sampson
2002-02-01  8:25 Debugging gdb with gdb Salman Khilji
2002-02-01  9:26 ` Daniel Jacobowitz
2002-02-03 12:29 ` Joel Brobecker
2002-02-04  1:32   ` Christophe PLANAT
2002-02-04 12:24   ` Piet/Pete Delaney
2002-02-04 14:02     ` Kevin Buettner
2002-02-04 15:00       ` Piet/Pete Delaney
2002-02-04 15:13         ` Piet/Pete Delaney

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