Debugging tool: Trace function calls + variable usage automatically

J

Joerg Schoen

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/JoergSilkeSchoen/prg/prg.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top