Is there any library in C like python's inspect?
def myfunction():
import inspect
inspect.stack()开发者_StackOverflow中文版: # this give you complete stack up to this function call
It's very useful to debug python program.
Actually I want to debug GTK Combobox widget, to understand complete flow I need complete function call stack.
So is there any similar library of Technic in C language like python inspect package?
No such portable library exists. There's a solution specific to GNU libc
.
If you are using gcc you can have a look at this (old) blog about getting the stacktrace in runtime.
C++ stack traces with GCC
精彩评论