Reputation: 64283
I would like to connect my compiled object code to the c++ code, and then to check if a certain line of code was executed. How to do those two things?
If the explanation is not simple (I bet it is not), can someone at least point to some web pages explaining how to do this?
I understand that the solution is different for different platforms, but I am interested in how it is done on windows and linux (linux for the start)
Upvotes: 7
Views: 4475
Reputation: 559
I suspect that you don't really need a debugger but a profiler. I like the callgrind at http://valgrind.org/docs/manual/cl-manual.html, which has a nice graphical environment at http://kcachegrind.sourceforge.net/.
To try I'd use
$ valgrind --tool=callgrind ./myapp
$ kcachegrind callgrind.out.xxx
Upvotes: 2
Reputation: 3266
In your comment you say "I would just like to gather informations on how to check which methods/functions are executed during the execution, and how many times".
If that is what you want to achieve, then use a profiler such as gprof.
Compile your program with -g -pg and when your program finishes it will create a file which can be processed by gprof to show you what you want.
Upvotes: 0