由于共享库事件 - Visual Studio Code 而停止

Stopped due to shared library event - Visual Studio Code

本文关键字:Studio Visual Code 事件 于共享 共享      更新时间:2023-10-16

我是Visual Studio Code的初学者,我尝试在其上挖掘我的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 Code显示如下错误:

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).

我从谷歌搜索这个错误,一些帖子说这是关于"共享图书馆事件"的问题。我怎样才能忽略这个错误?

从这里复制粘贴:

假设使用launch.json选项没有帮助"additionalSOLibSearchPath"以下设置可能会将共享库添加到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)警告。