Stopped due to shared library event - Visual Studio Code

2

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;
}

I setup my launch.json as below:

{
    "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
                }
            ]
        }
    ]
}

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

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 ?

c++
debugging
visual-studio-code

1 Answer

0

Copy-pasted from here:

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 may still raise Stopped due to shared library event (no libraries added or removed) warning, nevertheless.

answered on Stack Overflow Feb 4, 2019 by KutalmisB

User contributions licensed under CC BY-SA 3.0