how to determine which functions are called

Discussion in 'C Programming' started by Lowell Kirsh, Mar 1, 2005.

  1. Lowell Kirsh

    Lowell Kirsh Guest

    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
     
    Lowell Kirsh, Mar 1, 2005
    #1
    1. Advertising

  2. Lowell Kirsh

    Eric Sosman Guest

    Lowell Kirsh wrote:
    > 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.)

    --
     
    Eric Sosman, Mar 1, 2005
    #2
    1. Advertising

  3. Lowell Kirsh

    Lowell Kirsh Guest

    > 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
     
    Lowell Kirsh, Mar 2, 2005
    #3
  4. Lowell Kirsh

    CBFalconer Guest

    Lowell Kirsh wrote:
    >
    > 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.

    --
    Chuck F () ()
    Available for consulting/temporary embedded and systems.
    <http://cbfalconer.home.att.net> USE worldnet address!
     
    CBFalconer, Mar 2, 2005
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ben
    Replies:
    2
    Views:
    498
    Thomas Weidenfeller
    Mar 20, 2006
  2. Mark Sullivan
    Replies:
    0
    Views:
    277
    Mark Sullivan
    Dec 21, 2007
  3. Mark Sullivan
    Replies:
    0
    Views:
    284
    Mark Sullivan
    Dec 21, 2007
  4. Peter
    Replies:
    6
    Views:
    280
    Peter
    Jan 5, 2012
  5. Peña, Botp
    Replies:
    1
    Views:
    266
    Robert Klemme
    Jan 24, 2004
Loading...

Share This Page