|
From: John R. <jr...@bi...> - 2011-07-07 13:50:37
|
> I have a binary file what i compile it with -g.So i need to perform a > set of action in my computer and see behavior of my file, This mean , i > need to see functions of run when i perform those set of actions, This sounds like some kind of profiling. Re-compile and re-link with "gcc -p" or "gcc -pg". If you cannot re-compile, then perhaps try "strace -i" or "ltrace -i" which will give you partial information. You'll need to do some work to process the instruction addresses, and you might have to perform a short backtrace (either dynamic or static) to get interesting intformation. More generally, write a utility program which reads your original binary program, then writes a new binary program having each static call: call subr1 replaced with an indirection: call *indir1 .section indir_section indir1: .addr subr1 Then change the contents of location indir1 dynamically at run time: point it to a logging subroutine for a while, etc. [This won't track existing indirect calls, but perhaps those can be ignored for a while.] -- |