www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/11/28/12:23:13

From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
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: <as5e23$7lh$1@nets3.rz.RWTH-Aachen.DE>
References: <as577f$jfj12 AT imsp212 DOT netvigator DOT com>
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 <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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019