-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add debugging instructions #94
Comments
For future reference, one can use the Microsoft provided C++ Debug extension to debug nimsuggest: Below is a snippet showing me launching nimsuggest against the vscode extension, feel free to adjust it to your needs. Either in "configurations": [
{
"name": "(gdb) nimsuggest",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/bin/nimsuggest",
"args": ["--stdin", "--find", "--debug", "--backend:js", "~/Development/nim/vscode-nim/src/nimvscode.nim"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "nim-gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
] A few notes:
Breakpoints work and most variable value formatting works. There are cases where {
"name": "(gdb) nimsuggest",
"...": "... all the previous config ...",
"logging": {
"engineLogging": true,
"trace": true,
"traceResponse": true
}
} |
/cc @Araq
I was trying to debug #93 but ran into a number of issues;
it turns out debugging nimsuggest is tricky, we should add instructions in
doc/nimsuggest.rst
one gotcha is that
-o:/tmp/nimsuggest_dbg
won't work, see miscellaneous nimsuggest issues #91 (comment)this works:
at least with that we get proper stacktraces (eg #93 (comment) instead of just
SIGSEGV: Illegal storage access
)gdb
currently doesn't work for OSX on latest OS (mojave), see https://stackoverflow.com/questions/52529838/gdb-8-2-cant-recognized-executable-file-on-macos-mojave-10-14I got
BFD "unknown load command 0x32"
which led me there; it has nothing to do with Nim but affects all programsif you're not affected by this issue, you may try your luck with:
although the caveat below (stdin) may apply
lldb
doesn't work with--stdin
this will block forever:
in another terminal, get pid:
now you can type commands in 1st terminal and it'll break in 2nd terminal if an error happens:
with the bug in #93 I'm finally getting a proper lldb debug session, see example output here: #93 (comment)
The text was updated successfully, but these errors were encountered: