Into GDB

Jim Blandy jimb@codesourcery.com
Wed Aug 30 18:50:00 GMT 2006


"Rajesh Warange" <warange.rajesh@gmail.com> writes:
> I 'm very much new to GDB. My final goal is to change GDB for a native
> chipset of ours.
> I need some pointers from you in the right direction.
>
> 1. I wanted to know the "chain of functions" followed by GDB when we
> just type "gdb" on the command-prompt.
> 2. also the "chain of functions" when we give commands like step or
> breakpoint etc.
>
> I 'm reading GDB Internals. But its not helping me much in this regard.
> Please help.

We have a manual on the internals of GDB in doc/gdbint.texinfo; it's
not structured as a tutorial, however.

I wouldn't recommend starting with 'main' and trying to see everything
that happens.  GDB is a large, old program, and you'll waste a lot of
time trying to figure out stuff you don't need to change: at this
point, GDB has been ported to dozens and dozens of different chips, so
the chip-specific code is pretty nicely isolated in the *-tdep.c
files.

I would recommend finding a *-tdep.c file that seems relatively small
and straightforward, and starting your work from that.  Each foo-tdep.c
file has a function at the end called _initialize_foo_tdep that is
automatically called by GDB at startup; that registers a function
called foo_gdbarch_init, which usually appears immediately above it.
That registers callback functions for all the architecture-specific
operations GDB uses.



More information about the Gdb mailing list