局部变量和函数参数
Locals 视图由Locals 窗格和Return Value 窗格(空时隐藏)组成。
每当应用程序在调试器控制下停止时,调试器都会检索最顶层堆栈帧的信息,并将其显示在Locals 视图中。Locals 窗格显示了该帧中函数参数以及局部变量的信息。如果调试器中的最后一次操作是在按下Shift+F11 后从函数返回,则Return Value 窗格会显示函数返回的值。
您可以展开视图内容,检查应用程序是否正确设置了局部值。
本地视图操作
右键单击Locals 视图可选择以下操作:
- 添加和删除表达式求值器
- 更改值显示格式
- 展开和折叠视图内容
- 将视图内容或表达式值复制到剪贴板
- 在编辑器中打开视图内容
- 打开内存编辑器
- 设置数据断点
- 使用调试助手
- 调试时在视图中显示和隐藏工具提示
- 自动取消引用指针
- 按字母顺序排列类和结构体的成员
- 使用动态对象类型显示
- 设置调试器首选项
选择显示对象类型
使用 GDB 时,可以指定显示动态或静态类型的对象。在右键菜单中选择Use dynamic object type for display 。请注意,选择动态类型可能会比较慢。
Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.