This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Into 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