*BSD News Article 68542


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.mira.net.au!inquo!bofh.dot!in-news.erinet.com!imci5!pull-feed.internetmci.com!news.internetMCI.com!newsfeed.internetmci.com!in2.uu.net!fox.almaden.ibm.com!garlic.com!news.scruz.net!not-for-mail
From: bill@qstools.com (Bill Cox)
Newsgroups: comp.unix.bsd.bsdi.misc
Subject: Re: How to trace program
Date: 15 May 1996 05:37:41 GMT
Organization: Sirius Cybernetics, Sirius City branch
Lines: 24
Message-ID: <4nbqj5$bk0@news.scruz.net>
References: <magnej.29.31986CAD@oleg.hiof.no>
NNTP-Posting-Host: 205.179.159.64
X-Newsreader: TIN [UNIX 1.3 950515BETA PL0]

Magne Johansen (magnej@oleg.hiof.no) wrote:
: I got a problem. When I run my program it jumps out of a loop.
:  Are there any way to trace the program line after line so we can find the 
: problem. The program are running on a Silicon Graphics Indy with UNIX. The 
: language I use is C.
: 
: Magne Johansen
: magnej@oleg.hiof.no 

AT&T wrote a wonderful C preprocessor called ctrace,
which adds print commands to each line of the selected
C functions (or all of them by default).  Running the
preprocessed program outputs a 'movie' of its running,
including a printout of each line of source and all of
the variables mentioned on that line.

Try 'man ctrace'.

-- 
Bill Cox                            Software Janitor
Raise taxes to cover the deficit?  Are you *crazy*??
They'll spend 1.3 times the amount we allocate them,
no matter how much it is.