函数中的 gdb 局部变量

发布于 2024-10-20 14:23:08 字数 80 浏览 7 评论 0原文

gdb 有没有办法检查成员函数的局部变量以及类私有成员。有时,我需要知道哪些变量是函数的局部变量,哪些是类变量。

最好的, 乌穆特

Is there a way in gdb to check the local variables of a member function and also the class private members. Sometimes, I need to know which variables are local to the function and which ones are class variables.

Best,
Umut

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

仅冇旳回忆 2024-10-27 14:23:09

info local

将打印所有局部变量的值(如果您还需要函数参数,请参阅 info args)

print *这

将显示成员变量。

info local

will print the values of all local variables (see info args if you also want function parameters)

print *this

will show the member variables.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文