From: Hans-Bernhard Broeker Newsgroups: comp.os.msdos.djgpp Subject: Re: where to start to look at (gdb) Date: 28 Nov 2002 15:51:31 GMT Organization: Aachen University of Technology (RWTH) Lines: 39 Message-ID: References: NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de X-Trace: nets3.rz.RWTH-Aachen.DE 1038498691 7857 137.226.32.75 (28 Nov 2002 15:51:31 GMT) X-Complaints-To: abuse AT rwth-aachen DOT de NNTP-Posting-Date: 28 Nov 2002 15:51:31 GMT Originator: broeker@ To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Jacky Luk 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 . -- Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de) Even if all the snow were burnt, ashes would remain.