Gdb Complaining About Missing Raise.C

C/C++ debugger failing to create and write to raise.c in WSL using VSCode

According to the GDB skip function:https://sourceware.org/gdb/onlinedocs/gdb/Skipping-Over-Functions-and-Files.html#Skipping-Over-Functions-and-FilesPuede add it to "SetupCommands" under "configurations" in Launch.json:

{
"description": "Skip glibc files",
"text": "-interpreter-exec console \"skip -gfi build/glibc-YYA7BZ/glibc-2.31//**/*\""
}

But no problem, add WSL + Ubuntu / or VSL + ubuntu, it will ignore the path, it does not solve the problem, which may be valid for other environments, but it is not valid if VSCode uses remote connection. According to article number 811:Disable "Unable to open file" during debugThe developers say that the "Skip" command is also looking online, currently (January 27, 2019) I do not know of any other way. But there are other solutions under this issue, no need to compile Glibc library:

Execute this:

$ sudo apt install glibc-source
$ cd /usr/src/glibc
$ sudo tar xvf glibc-2.31.tar.xz

The "2.31" should be changed to the actual version number Source, and can be seen through the "LS" command. Then add that in "settings" in Launch.json

"sourceFileMap": {
"/build/glibc-YYA7BZ": "/usr/src/glibc"
}

The "YYA7BZ" is changed to the GLIBC suffix appears in the error message. If this method is not valid, you can change the path to: c:/users//AppData/ / / /local packages canonicalGroupLimited.ubuntuonWindows_79RHKP1FNDGSC / /localstate / / rootfs usr/src/glibc, where 79RHKP1FNDGSC should change the folder name on your own system.

Now searching for terminal error information:

Done "/usr/bin/gdb" --interpreter=mi --tty=${DbgTerm} 0<"/tmp/Microsoft-MIEngine-In-p3q623bu.gbr" 1>"/tmp/Microsoft-MIEngine-Out-s4xm3p6g.lqk"

Sample Image

according to the error when executing: ends Call After launching an instance of 'std :: logic_error'This is caused by an empty pointer. One of the possible causes of this problem is that I forgot to add the necessary parameters to add a run program in the "Args" list in "Configurations" in Launch.json.

Source:https://programmerclick.com/article/54012533450/

Python Segmentation Fault, ../sysdeps/unix/sysv/linux/raise.c: No such file or directory

Looks like the problem was caused by the library darkdetect. The error occured only at runtime, because after

    pub.sendMessage("loginListener", message="logged in")
self.Destroy()

a new window is created, and the background colour depends on the system theme chosen by the user (and maybe my code is not authorized to access such information).

How can I run a c++ script in debug in visual studio code?

Good evening Tanozar,

the problems are probably due to:
- task.json

    "tasks": [
{
"type": "shell",
"label": "g++ build active file",
"command": "/usr/bin/g++",
"args": [
"-g",
"${file}",
"`pkg-config", "--cflags", "--libs", "opencv4`",
"-lcfitsio", "-lcurl",
"-o",
"${fileDirname}/${fileBasenameNoExtension}",
"-lboost_iostreams", "-lboost_system", "-lboost_filesystem", "-lpython2.7", "-lm", "-L/usr/lib/python2.7/config/", "-I/usr/include/python2.7/ ",
],
"options": {
"cwd": "/usr/bin"
},
"problemMatcher": [
"$gcc"
],
"group": "build"
}
]

this is an example of my task.json for a program that include opencv and python. Probably a first error is that the argument is not quoted. This task.json "correspond to" "g++ -Os -std=c++11 main2.cpp pkg-config --cflags --libs opencv4 -lcfitsio -lcurl -o ~/blabla/main2 -lboost_iostreams -lboost_system -lboost_filesystem -lpython2.7 -lm -L/usr/lib/python2.7/config/ -I/usr/include/python2.7/"

  • launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "g++ build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}/${fileBasenameNoExtension}",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "g++ build active file",
"miDebuggerPath": "/usr/bin/gdb"
}
]
}

you have to check this line "program": "${fileDirname}/${fileBasenameNoExtension}",

  • in the program code
int main(int argc, char* argv[]) 
{
string folder = argv[1];
}

if you write in this way you get the error "Unable to open 'raise.c': Unable to read file (Error: File not found (/build/glibc-B9XfQf/glibc-2.28/sysdeps/unix/sysv/linux/raise.c))."

string folder = "/home/.../pathofyourprogram";

in this way the problem not occured.

I hope that is useful, but i don't know the detail of this problem sorry.



Related Topics



Leave a reply



Submit