调试时,在“Variables”页面查看变量,支持查看全局/静态变量、寄存器变量和局部变量。
点击“Edit Configurations...”打开调试配置,在 native 调试配置界面中勾选“Show static/global variables in the Variables Pane”,调试过程中变量列表会展示全局/静态变量。
在菜单栏点击“File > Settings(macOS为DevEco Studio > Preferences/Settings) > Build, Execution, Deployment > Debugger > C++ Debugger”,通过勾选“Display STL variables as visualization in the Variables Pane”在变量列表中展示简化后的 STL 变量值,或去掉勾选以展示其原始结构。
在"Watches"列表中输入表达式,然后点击Add to Watches 图标
,或在某个变量右键菜单中的“Add to Watches”添加监视的表达式,在每次程序停住之后会计算表达式的值。
