停止由于共享的库事件 - Visual Studio代码

问题描述 投票:2回答:1

我是Visual Studio代码的初学者,我尝试调试就可以了我的C ++代码。我有一个示例代码在这里:

#include "iostream"    
using namespace std;

int main() {
    cout << "hello world";
    return 0;
}

设置我的launch.json如下:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "(gdb) Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}/hello",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": true,
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ]
        }
    ]
}

当我运行调试,Visual Studio代码显示错误如下:

Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
=cmd-param-changed,param="pagination",value="off"
Stopped due to shared library event (no libraries added or removed)
Loaded '/lib64/ld-linux-x86-64.so.2'. Symbols loaded.

Breakpoint 1, 0x000000000040077a in main ()
[Inferior 1 (process 4504) exited normally]
The program '/media/sf_E_DRIVE/Downloads/radixSA/test_vsc/hello' has exited with code 0 (0x00000000).

我从谷歌搜索一下这个错误,有的帖子说,这是关于“共享库事件”的问题。我怎么能忽略这个错误?

c++ debugging visual-studio-code
1个回答
0
投票

复制粘贴从here

假设使用"additionalSOLibSearchPath"没有帮助的launch.json选项,以下设置可以添加一个共享库到gdb的考虑:

"setupCommands":[
    {
        "description": "Additional libs for gdb",
        "text": "set solib-search-path sharedLibraryPath/lib"
    }
]

PS:gdb仍可能提高Stopped due to shared library event (no libraries added or removed)警告,不过。

© www.soinside.com 2019 - 2024. All rights reserved.