开发者

A way to list each called function along with its parameters and return value for debugging c++

开发者 https://www.devze.com 2023-01-29 10:08 出处:网络
Is there a way to ease the debugging process by getting each function call along with the parameter and return values automatically output, as the program execution is progressing?

Is there a way to ease the debugging process by getting each function call along with the parameter and return values automatically output, as the program execution is progressing?

Maybe a tool that adds that outputting code before and after each function, which I can use while debugging and then cancel afterwards?

I'm writing the code in Eclipse on Windows and compiling with GNU C++ on a Linux server witho开发者_开发百科ut a graphical interface — so no KCachegrind available. Valgrind + callgrind alone produces a mass of text that does not seems very usable to me…

The GDB debugger is somewhat an option, but it's slow and too detailed if I want data per (my) function call, not each statement.

When searched for this, I remember reading that there are two special functions that can be defined that would automatically execute upon starting and ending of each function, which could then be defined to output the variables. However, it was for some other programming language or specific C++ IDE.


I would say valgrind + callgrind, you can control the output while the program is running and you can use kcachegrind to check the output in kde.


You can use valgrind for this.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号