由于共享库事件而停止-Visual Studio代码 [英] Stopped due to shared library event - Visual Studio Code

查看:449
本文介绍了由于共享库事件而停止-Visual Studio代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Visual Studio Code的初学者,我尝试在其上Dedug我的C ++代码。
我在这里有一个示例代码:

I am a beginner of Visual Studio Code and I try to Dedug my C++ code on it. I have a sample code here:

#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
                }
            ]
        }
    ]
}

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

When I run debug, Visual Studio Code show an error as below:

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

我从Google搜索此错误,有些帖子说这与共享库事件问题有关。如何忽略该错误?

I search from Google about this error, some posts said that it's about the "Shared library event" issue. How can I ignore that error ?

推荐答案

此处复制粘贴

假定使用启动的 additionalSOLibSearchPath 选项。 json 没有帮助,以下设置可能将共享库添加到 gdb 的考虑中:

Assuming the use of "additionalSOLibSearchPath" option of launch.json did not help, the following setting might add a shared library into gdb's consideration:

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

PS: gdb 可能仍会提高由于共享库事件而停止(未添加或删除库)警告,不过。

PS: gdb may still raise Stopped due to shared library event (no libraries added or removed) warning, nevertheless.

这篇关于由于共享库事件而停止-Visual Studio代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆