From: Hans-Bernhard Broeker Newsgroups: comp.os.msdos.djgpp Subject: Re: Has anyone written a debugging tool like this? Date: 25 Mar 2001 16:01:04 GMT Organization: Aachen University of Technology (RWTH) Lines: 28 Message-ID: <99l4o0$f8a$1@nets3.rz.RWTH-Aachen.DE> References: NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de X-Trace: nets3.rz.RWTH-Aachen.DE 985536064 15626 137.226.32.75 (25 Mar 2001 16:01:04 GMT) X-Complaints-To: abuse AT rwth-aachen DOT de NNTP-Posting-Date: 25 Mar 2001 16:01:04 GMT Originator: broeker@ To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com James W Sager Iii wrote: > I'm really bad with keeping up to date with other people's code... So I > was wondering does anyone have a utility for taking the first step of > stripping down a large project? > For example if you had 20.cc files, you'd pass them as arguments. > The ripper utility would add a line of code with an index to every one > of your functions that'd basically do the following when executed: Code for this is already inside GCC: if you compile with profiling enabled (any type of profiling would usually do, but on DOS, currently only '-pg' really works in the existing GCC binaries), code is added that keeps a count of all function invocations among other things and writes them to a special protocol file (gmon.out). > You then run ripper part 2, and it removes every function that wasn't > used, and outputs new files for you to make debugging easier. You can't just remove the functions that weren't used: you have to remove their calls, too, otherwise the linker would complain. -- Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de) Even if all the snow were burnt, ashes would remain.