Search code examples
c++ubuntu-12.04program-entry-pointpipelineentry-point

Can't find program entry point in a C++ project


I have a C++ project in Ubuntu 12.04. To run the project the make file requires the following files:

1-All the .cpp files

2-All the .h files

3-Three shared libraries.

The project is fully functionall and performs according to the specifications. All the required .cpp files and .h files are available. The problem is that there is no main() function in any of the source files and the program entry point resides in one of the three shared libraries. My job is to find out the program execution pipeline and without having any main file I am not able to do that. I can't run the project in any IDE (i.e: eclipse) because there is no main function available.

Question: Can you please tell me how to find the program entry point?

P.S: I will be glad to provide any kind of information or material you may need to solve my problem.

Edit: The CMakeLists.txt file available here.

Edit 2: The build.sh file available here.


Solution

  • To find enty point look into each shared object with:

    nm $library | egrep "T main$"
    

    Library with main() will output something like

    090d8ab0 T main
    

    Very usefull way to visualize execution tree is to run:

    valgrind --tool=callgrind ./my_executable -arg -arg ....
    

    (you can abort execution early with Ctrl+C)

    This will output callgrind.<pid> file. To visualize it run kcachegrind callgrind.<pid>.


    You will need valgrind:

    sudo apt-get install valgrind
    

    and kcachegrind

    sudo apt-get install kcachegrind