By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,865 Members | 1,365 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,865 IT Pros & Developers. It's quick & easy.

Debugging tool: Trace function calls + variable usage automatically

P: n/a
Hi folks!

"JSCPP" is a ANSI-C preprocessor and language parser. It can analyze or
instrument C-code. The most prominent application currently is to add
function trace calls to existing C programs simply by recompiling it.

The tracing will show when functions are entered or left along with the
arguments. Default is to trace EVERY function, but fine-grained control is
possible through a custom header file.

Additionally, one can trace how variables are changed or accessed.

The program has been used successfully on large projects and can be helpful
to detect errors.

The program can emit the original sources after instrumenting them instead
of the preprocessed sources. So it can be used to permanently add trace
calls to C coding.

Other ideas are to separate large and bloated functions into smaller ones as
follows: prefix a large block by a certain pragma and run the code through
jscpp. It will analyze the dependencies between the block and the
surrounding subroutine (i. e. variables used/altered) and move the block to
a separate subroutine, creating an appropriate function call.

Documentation and example programs are included. You find the tarball under
http://home.t-online.de/home/JoergSi...n/prg/prg.html

Nov 14 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.