I'm trying to debug my C code in vscode, and I'm having some problems.
I'm using ubuntu and have gcc and gdb debugger installed. when I start debugging my code and reach to a line with `printf` or `scanf`, I get this error:
`Unable to open 'libc-start.c': Unable to read file '/build/glibc-eX1tMB/glibc-2.31/csu/libc-start.c' (Error: Unable to resolve nonexistent file '/build/glibc-eX1tMB/glibc-2.31/csu/libc-start.c').`
I read some answers to this question saying I have to install `glibc-source`, and I did that. then I added this to my launch.json:
"sourceFileMap": {
"/build/glibc-S7xCS9": "/usr/src/glibc"
}
still nothing's changed.
do you know anything that could help me? I could provide more information if needed.
CodePudding user response:
I did that. then I added this to my launch.json:
"sourceFileMap": { "/build/glibc-S7xCS9": "/usr/src/glibc" }
Your error mentions /build/glibc-eX1tMB/...
. You should change glibc-S7xCS9
to glibc-eX1tMB
in your .json
file.
(The directory /build/glibc-....
is a temporary directory created for each separate build. You would need to change it every time you update your GLIBC version.)
I'm having some problems.
Note that there isn't an actual problem here, unless you need to debug GLIBC internals.