how to determine which functions are called

L

Lowell Kirsh

I am integrating an open source library into a project which I will have
to modify slightly. Before I modify it, I'd like to know which functions
in the library are being called. Even though my code will only call a
few library functions directly, I'm also interested in the library
functions that will be called by other library functions. Are there any
tools which can help me with this?

Lowell
 
E

Eric Sosman

Lowell said:
I am integrating an open source library into a project which I will have
to modify slightly. Before I modify it, I'd like to know which functions
in the library are being called. Even though my code will only call a
few library functions directly, I'm also interested in the library
functions that will be called by other library functions. Are there any
tools which can help me with this?

Look for tools that say they do "coverage analysis."
As a crude alternative, you could (since you can modify
the source) output a "Kilroy was here" message from the
start of each function the first time it's called. (I'd
suggest doing the actual output from a helper function
written for the purpose, so you needn't add <stdio.h>
to files that don't already #include it. Obviously, a
macro could ease the burden of all those insertions.)
 
L

Lowell Kirsh

Look for tools that say they do "coverage analysis."
As a crude alternative, you could (since you can modify
the source) output a "Kilroy was here" message from the
start of each function the first time it's called. (I'd
suggest doing the actual output from a helper function
written for the purpose, so you needn't add <stdio.h>
to files that don't already #include it. Obviously, a
macro could ease the burden of all those insertions.)

Your second technique is a little too crude. There are too many funtions
in the library to do that. I'll do a google search for coverage analysis.

Thanks,
Lowell
 
C

CBFalconer

Lowell said:
I am integrating an open source library into a project which I will
have to modify slightly. Before I modify it, I'd like to know which
functions in the library are being called. Even though my code will
only call a few library functions directly, I'm also interested in
the library functions that will be called by other library
functions. Are there any tools which can help me with this?

try Cscope.
 

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,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top