you come across cases print applications activity such cases have gotten source code , in order set of methods invoked, variables initialized , activity of program. suggested , practical tool obtain stack trace through report of applications activity?
the first sentence of question long understandable me; cannot parse entirely , guessing want ask.
the appropriate tool such things called debugger. details build-chain i.e. implementation specific. i'm focusing on linux tools using gcc.
on linux, you'll compile g++ -wall -wextra -g3 (or g++ -wall -g) , use gdb debugger. perhaps want watchpoints.
recent versions of gdb scriptable (or extensible) in python , in guile. if system's gdb old extensible, building recent gdb downloaded source code may worthwhile.
if question related programmatic introspection program of current continuation or call stack or stack trace (or other reflection-like activities), not doable in standard c++11, might consider backtracing functions of gnu glibc or use libbacktrace ian taylor in gcc or maybe return address related builtins of gcc.
you might want use profiler (perf, oprofile, gprof) ...
Comments
Post a Comment