how to get a programs current function?

677 Views Asked by At

is it possible in assembly using the ollydbg debugger program to find a programs current function thats it's executing?

the reason for this is because my application that i've created is running at 70 % computer usage during a specific time and i would like to see why that is and what its doing to gain that computer usage

i know i could use the source debugger which would be easier but in this case i can't unfortunately and need to use a debugger like ollydbg to figure this one out, how can this be done?

2

There are 2 best solutions below

1
On

As one of the previous comments mentions, this is really a better job for a profiler (Such as Intel's VTune, AMD CodeAnalyst or Visual Studio's profiling tools).

However, if you still wish to find the source in OllyDbg, an executable correctly compiled with debugging symbols will have the executing line of code displayed below the main disassembly area.

The OllyDbg source display for an executable with debugging symbols

1
On

Depends, if your code is a compiled one (.exe) to find the exact function you'll need to compile it with debugging information like for GCC compiler the -g option

after doing this you can use GDB to read the exact code that you wrote and debug it typing list after loading the program

example:

gcc -g test test.c
gdb -q ./test
[...]
(gdb) list