Visual studio code 在VSCode上调试WSL时,由于共享库事件而停止
我要走了Visual studio code 在VSCode上调试WSL时,由于共享库事件而停止,visual-studio-code,gdb,windows-subsystem-for-linux,Visual Studio Code,Gdb,Windows Subsystem For Linux,我要走了 Stopped due to shared library event (no libraries added or removed) Loaded '/lib64/ld-linux-x86-64.so.2'. Symbols loaded. Stopped due to shared library event: Inferior loaded /lib/x86_64-linux-gnu/libc.so.6 Loaded '/lib/x86_64-linux-gnu/libc.s
Stopped due to shared library event (no libraries added or removed)
Loaded '/lib64/ld-linux-x86-64.so.2'. Symbols loaded.
Stopped due to shared library event:
Inferior loaded /lib/x86_64-linux-gnu/libc.so.6
Loaded '/lib/x86_64-linux-gnu/libc.so.6'. Symbols loaded.
尝试在WSL上调试我的C项目时在VSCode上
我有以下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": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "/mnt/c/Coding/tau-cs-projects/chessproj/bin/chessprog",
"args": [],
"stopAtEntry": false,
"cwd": "/mnt/c/Coding/tau-cs-projects/chessproj",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"miDebuggerPath": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"pipeTransport": {
"pipeCwd": "",
"pipeProgram": "c:\\windows\\sysnative\\bash.exe",
"pipeArgs": ["-c"],
"debuggerPath": "/usr/bin/gdb"
},
"sourceFileMap": {
"/mnt/c": "c:\\"
}
}
]
}
我的makefile包含以下内容:
...
CC := gcc
CFLAGS := -std=c99 -Wall -Wextra -Werror -pedantic-errors -g
SDLINC_NOVA := -I/usr/local/lib/sdl_2.0.5/include/SDL2 -D_REENTRANT
SDLLIB_NOVA := -L/usr/local/lib/sdl_2.0.5/lib -Wl,-rpath,/usr/local/lib/sdl_2.0.5/lib -Wl,--enable-new-dtags -lSDL2 -lSDL2main
...
此外,我能够使用gdb
(从终端)进行“手动”调试。
原因是什么
原因是什么
VSCode中的某些东西在solibevents 1上设置了stop(停止)(我不知道该设置来自哪里)
您可以在solib事件0上使用
(gdb)set stop撤消此操作我在执行getaddrinfo(ipAddress,…)时遇到此问题
事实证明,问题是由于ipAddress作为带引号的字符串而不是字符串传递引起的。gdb会话中止,并显示“由于库事件而停止”错误消息,而不仅仅返回错误。由于进程正在运行,我无法执行此操作。
在何处运行此(gdb)在solib事件0上设置停止。
?命令提示符?