I know that you donβt want to add something to each function, but if it is as simple as changing {to {_, will it beat you? Few scripts can do this automatically - ping me if you need it. If this works, look at this little utility that I have compiled - just one header file to include, and then you get a nice portable trace
https://github.com/goblinhack/callstack
void my_function (void) {_ // rest of code } : void my_function (void) {_ // rest of code }
Call CALLSTACK_DUMP () at any time to reset the current column.
Just do
make ./callstack Stack dump: (stack) 1 main.cpp void foo3(int, int), line 7 (stack) 2 main.cpp void foo2(int), line 12 (stack) 3 main.cpp void foo1(), line 17 (stack) 4 main.cpp int main(int32_t, char **), line 22
source share