looking for function calls in an executing program

Started by
9 comments, last by miminawewe 16 years, 6 months ago
How can I see the functions that are being called by an executing program as the program is running? I have the source code of the program and the exe. I would like to run the exe and be able to see the functions that it's calling as it runs. THANKS.
Advertisement
using a profiling tool would be the easiest option. try VTune

It's not practical to see them "as they are called" because they will be called millions of times faster than you can possibly read. But a profiling tool will show you which are called how often and such.

To see the order in which things are called, just look at the source code.

-me
You may also be looking for information on how to debug this program. Page 3 (Execution Flow Tools) seems like it's what you want, but you should probably start from the beginning if you're new to the concept.
Palidine: I'm checking out VTune.

jouley: I have visual studio. I would like to run the exe (without compiling the code) and be able to see the function calls in the call stack. Can something like "attach to process" help with that. I am not able to compile the code because I don't have some dependencies.
The best option is debugging with Microsoft Visual Studios


There is step into commnd and a runto command that lets you step into a program
at the bottom, there should be values of variable and returned functions cool for beginners best i have seen which makes life well simpler for programmer

also just read up on ur post. by the way the newer version of studios have call graph which are all the call to and from a given function right click a function to get to it
Quote:Original post by miminawewe
jouley: I have visual studio. I would like to run the exe (without compiling the code) and be able to see the function calls in the call stack. Can something like "attach to process" help with that. I am not able to compile the code because I don't have some dependencies.


Yes. Debug -> Attach to Process.

when you pause it in the debugger you can pick the source code location.

I should point out that this will only work if you have a debug build or a release build that was built with symbols (i.e. this won't work if, say, you have half-life2 and the leaked half-life2 source code).

If you have a release build, the best you're going to be able to do is look at assembly code.

-me
when deciphering code i always find winmain and start from there that way i can see how the program flows plus there not many programs whitout winmain or main
i have the leaked source code and have got a fully working version but i did get it to compile
Thanks.
I'm not working on leaked code or anything illegal. I have a program called VLC that plays media files. I'm interested in how it plays vorbis and theora files. The code is really messed up and that's why I needed to know the functions the exe calls (in sequence) as it executes then I refer to the code.
I only have the release version of the exe and dlls.
Quote:Original post by miminawewe
Thanks.
I'm not working on leaked code or anything illegal. I have a program called VLC that plays media files. I'm interested in how it plays vorbis and theora files. The code is really messed up and that's why I needed to know the functions the exe calls (in sequence) as it executes then I refer to the code.
I only have the release version of the exe and dlls.

If you can't get it to compile you'll have a lot of difficulty debugging it. In release mode, lots of functions will be inlined, reduced, reordered, etc., making it extremely difficult to follow the code flow. Work on getting a debuggable version built, and the rest will be much easier.

This topic is closed to new replies.

Advertisement