调试基于 Linux 的 C++ 代码 Visual Studio Code 时出现问题

2023-12-27

我正在尝试调试我的代码视觉工作室代码在 Linux - Ubuntu 中。我已经按照规范配置了调试配置。但是当尝试调试时,我收到以下错误。

=thread-group-added,id="i1" GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1 版权所有 (C) 2016 Free Software Foundation, Inc. 许可证 GPLv3+:GNU GPL 版本 3 或更高版本http://gnu.org/licenses/gpl.html http://gnu.org/licenses/gpl.html这是免费软件:您可以自由更改和重新分发它。 在法律允许的范围内,不提供任何保证。输入“显示 复制”和“显示保修”以了解详细信息。此 GDB 配置为 “x86_64-linux-gnu”。键入“显示配置”进行配置 细节。有关错误报告说明,请参阅:http://www.gnu.org/software/gdb/bugs/ http://www.gnu.org/software/gdb/bugs/。查找GDB手册等 在线文档资源:http://www.gnu.org/software/gdb/documentation/ http://www.gnu.org/software/gdb/documentation/。如需帮助,请输入 “帮助”。输入“apropos word”来搜索与“word”相关的命令。 =cmd-param-changed,param="pagination",value="off" 由于共享库事件而停止(未添加或删除库)已加载 '/lib64/ld-linux-x86-64.so.2'。符号已加载。 [下级1(过程 18634) 退出,代码为 0177] 程序 “/home/source/src/.libs/main”已退出,代码为 177 (0x000000b1)。

   launch.json

        {
            // Use IntelliSense to learn about possible attributes.
            // Hover to view descriptions of existing attributes.
            // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
            "version": "0.2.0",
            "configurations": 
            [
                {
                    "name": "C++ Launch",
                    "type": "cppdbg",
                    "request": "launch",
                    "targetArchitecture": "x64",
                    "program": "${workspaceFolder}/src/.libs/main",
                    "args": [],
                    "stopAtEntry": false,
                    "cwd": "${workspaceRoot}",
                    "environment": [],
                    "externalConsole": true,
                    "linux": {
                        "MIMode": "gdb"
                    },
                    "osx": {
                        "MIMode": "lldb"
                    },
                    "windows": {
                        "MIMode": "gdb"
                    }
                },
            ]
        }

因为并非所有库(.a、.so)都链接到您的项目。我有同样的问题。当 gdb 遇到对未链接的库的库调用时,它会输出此错误。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

调试基于 Linux 的 C++ 代码 Visual Studio Code 时出现问题 的相关文章

随机推荐