调试时,本地变量在VS代码中没有显示

发布于 2025-02-02 23:42:18 字数 1108 浏览 2 评论 0原文

我真的很抱歉,如果以前问这个问题,但我无法找到解决方案。 以下是我的启动。json并添加图片。我真的确定程序文件路径和调试器路径是正确的。主要问题是,即使我已经标记了断点,我也看不到局部变量的值。

{

"configurations": [

{

    "name": "(gdb) Launch",

    "type": "cppdbg",

    "request": "launch",

    "program": "${workspaceFolder}/a.exe",//Program File path is correct

    "args": [],

    "stopAtEntry": true,

    "cwd": "${fileDirname}",

    "environment": [],

    "externalConsole": false,

    "MIMode": "gdb",

    "miDebuggerPath": "C:/MinGW/bin/gdb.exe",//And I am sure this is correct as well

    "setupCommands": [

        {

            "description": "Enable pretty-printing for gdb",

            "text": "-enable-pretty-printing",

            "ignoreFailures": true

        },

        {

            "description":  "Set Disassembly Flavor to Intel",

            "text": "-gdb-set disassembly-flavor intel",

            "ignoreFailures": true

        }

    ]

}

]

}

I am really sorry if this question is been asked before, but I couldn't get a solution.
The following is my launch.json and Adding a picture as well. And I am really sure about it that the Program file path and debugger path is correct. The main issue is that I can not see the values of local variables even though I have marked breakpoints.

{

"configurations": [

{

    "name": "(gdb) Launch",

    "type": "cppdbg",

    "request": "launch",

    "program": "${workspaceFolder}/a.exe",//Program File path is correct

    "args": [],

    "stopAtEntry": true,

    "cwd": "${fileDirname}",

    "environment": [],

    "externalConsole": false,

    "MIMode": "gdb",

    "miDebuggerPath": "C:/MinGW/bin/gdb.exe",//And I am sure this is correct as well

    "setupCommands": [

        {

            "description": "Enable pretty-printing for gdb",

            "text": "-enable-pretty-printing",

            "ignoreFailures": true

        },

        {

            "description":  "Set Disassembly Flavor to Intel",

            "text": "-gdb-set disassembly-flavor intel",

            "ignoreFailures": true

        }

    ]

}

]

}As we can see the registers variables, but can not see the local variable which I've used in my program.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文