Mail Archives: djgpp/2002/11/28/12:23:13
Jacky Luk <luckie AT netvigator DOT com> wrote:
> There are plenty of files in the gnu dir. I would like to start reading the
> gdb source, but don't know where the main starts.
First, go down to the 'gdb' source dir. Should be something like
%DJDIR%/gnu/gdb-5.2/gdb
Next, get yourself a tool that can navigate through lots of source
files. For finding your way through the source of a program as large
as GDB, GCC or Emacs, you definitely need such tools. Trying to get
along without one is a bit like trying to find a particular shop in
the darker areas of Tokyo without a map, and not talking a word of
Japanese.
Emacs can use a TAGS file generated by its helper program "etags" to
this end (M-. is the hotkey). Id-utils can help the shell do it. Or
you could give cscope a try. All of these are available on your
friendly neighborhood DJGPP ftp server.
E.g. using cscope, you could just
cscope -R -L1main
and it'll parse all the sources below the current directory, and list
up all definitions of functions called 'main' anywhere. Or you can ask
for all functions called by main, interactively:
cscope -R
and then move the cursor to the line
Find functions called by this function:
type 'main' there and hit <return>.
--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -