Convert address to source line in C program -
inside c program i'm getting function call stack using backtrace , function names backtrace_symbols, using output of backtrace. resulting strings contain function names , addresses of call initiating code, withing function. there way convert addresses file names , line numbers? mean using c library (linux work) of gcc extensions. in advance!
outside of application, can convert address source file name , line number using addr2line
utility. (this utility linux-specific; mac os x has similar atos
utility.)
within application, can use dladdr
function resolve address shared object , symbol name. i'm not aware of way access debug information line number within application, though.
Comments
Post a Comment