Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Into GDB
@ 2006-08-30  6:07 Rajesh Warange
  2006-08-30 18:50 ` Jim Blandy
  2006-08-30 21:44 ` Michael Snyder
  0 siblings, 2 replies; 3+ messages in thread
From: Rajesh Warange @ 2006-08-30  6:07 UTC (permalink / raw)
  To: gdb

Hi,
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.

Thanks.
-- 
wrr


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

* Re: Into GDB
  2006-08-30  6:07 Into GDB Rajesh Warange
@ 2006-08-30 18:50 ` Jim Blandy
  2006-08-30 21:44 ` Michael Snyder
  1 sibling, 0 replies; 3+ messages in thread
From: Jim Blandy @ 2006-08-30 18:50 UTC (permalink / raw)
  To: Rajesh Warange; +Cc: gdb


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


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

* Re: Into GDB
  2006-08-30  6:07 Into GDB Rajesh Warange
  2006-08-30 18:50 ` Jim Blandy
@ 2006-08-30 21:44 ` Michael Snyder
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Snyder @ 2006-08-30 21:44 UTC (permalink / raw)
  To: Rajesh Warange; +Cc: gdb

On Wed, 2006-08-30 at 11:37 +0530, Rajesh Warange wrote:
> Hi,
> 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.

The parts you need to understand for your purpose are fortunately
limited.  What you need to do is provide a set of methods (for which
functional specs exist (after a fashion)) that will allow gdb to do
the basic set of debugger-like things with your new target architecture:
 * read a register
 * write a register
 * read a memory location
 * ... etc.

There are a large number of existing examples you can look at, 
eg. for mips, sparc, x86, sh, h8, etc.  They are each in a file
named <architecture>-tdep.c (eg. "mips-tdep.c").

You'll be writing a new module just like one of those, and 
exporting the same set of function/methods.

Michael


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

end of thread, other threads:[~2006-08-30 21:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-30  6:07 Into GDB Rajesh Warange
2006-08-30 18:50 ` Jim Blandy
2006-08-30 21:44 ` Michael Snyder

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