Closed ezaquarii closed 1 month ago
I'm experiencing the same issue with dape while using Emacs 30 with native JSON support. The problem is that dape is unable to execute the stopAtBeginningOfMainSubprogram
. I noticed that the variable dape--connection-selected
is set to nil, despite the fact that JSON-RPC appears to be functioning correctly.
@ezaquarii Have you compiled your binary with -g
flag?
Depending on your gdb version (and dape) you might have to flip defer-launch-attach
to nil in gdb configuration, this is an workaround for an gdb bug.
@luluman
dape--connection-selected
should be nil, its used to manage adapters which use several connections so its unfortunately an red herring. What gdb version are you using and are you using dape from github or melpa?
emacs version: 30.0.91 (with commit 52746ceb ) gdb version: 14.2 dape version: dape-0.15.0.0.20241006.212252
emacs version: 30.0.91 (with commit 52746ceb ) gdb version: 14.2 dape version: dape-0.15.0.0.20241006.212252
And dape does not hit the breakpoint when I execute the command:
gdb command-cwd "/workspace/test/" :program "/workspace/test/test" :stopAtBeginningOfMainSubprogram t
The dape-repl buffer:
* Welcome to Dape REPL! *
Available Dape commands: debug, next, continue, pause, step, out, up, down, restart, kill, disconnect, quit
Empty input will rerun last command.
* Adapter started with "gdb --interpreter=dap" *
GNU gdb (GDB) 14.2
Copyright (C) 2023 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-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://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".
The dape-connection events log:
[jsonrpc] e[02:45:00.549] --> initialize[1] {"type":"request","seq":1,"command":"initialize","arguments":{"clientID":"dape","adapterID":null,"pathFormat":"path","linesStartAt1":true,"columnsStartAt1":true,"supportsRunIn\
TerminalRequest":true,"supportsProgressReporting":true,"supportsStartDebuggingRequest":true}}
[stderr]
[stderr]
[stderr] nil
[stderr] nil
[stderr] Process dape adapter stderr finished
[jsonrpc] e[02:45:00.712] <-- output {"type": "event", "event": "output", "body": {"category": "stdout", "output": "GNU gdb (GDB) 14.2\n"}, "seq": 1}
[jsonrpc] e[02:45:00.714] <-- output {"type": "event", "event": "output", "body": {"category": "stdout", "output": "Copyright (C) 2023 Free Software Foundation, Inc.\n"}, "seq": 2}
[jsonrpc] e[02:45:00.714] <-- output {"type": "event", "event": "output", "body": {"category": "stdout", "output": "License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\n"}, "seq": 3}
[jsonrpc] e[02:45:00.715] <-- output {"type": "event", "event": "output", "body": {"category": "stdout", "output": "This is free software: you are free to change and redistribute it.\n"}, "seq": 4}
[jsonrpc] e[02:45:00.715] <-- output {"type": "event", "event": "output", "body": {"category": "stdout", "output": "There is NO WARRANTY, to the extent permitted by law.\n"}, "seq": 5}
[jsonrpc] e[02:45:00.716] <-- output {"type": "event", "event": "output", "body": {"category": "stdout", "output": "Type \"show copying\" and \"show warranty\" for details.\n"}, "seq": 6}
[jsonrpc] e[02:45:00.716] <-- output {"type": "event", "event": "output", "body": {"category": "stdout", "output": "This GDB was configured as \"x86_64-pc-linux-gnu\".\n"}, "seq": 7}
[jsonrpc] e[02:45:00.716] <-- output {"type": "event", "event": "output", "body": {"category": "stdout", "output": "Type \"show configuration\" for configuration details.\n"}, "seq": 8}
[jsonrpc] e[02:45:00.716] <-- output {"type": "event", "event": "output", "body": {"category": "stdout", "output": "For bug reporting instructions, please see:\n"}, "seq": 9}
[jsonrpc] e[02:45:00.717] <-- output {"type": "event", "event": "output", "body": {"category": "stdout", "output": "<https://www.gnu.org/software/gdb/bugs/>.\n"}, "seq": 10}
[jsonrpc] e[02:45:00.717] <-- output {"type": "event", "event": "output", "body": {"category": "stdout", "output": "Find the GDB manual and other documentation resources online at:\n"}, "seq": 11}
[jsonrpc] e[02:45:00.717] <-- output {"type": "event", "event": "output", "body": {"category": "stdout", "output": " <http://www.gnu.org/software/gdb/documentation/>.\n"}, "seq": 12}
[jsonrpc] e[02:45:00.718] <-- output {"type": "event", "event": "output", "body": {"category": "stdout", "output": "\n"}, "seq": 13}
[jsonrpc] e[02:45:00.718] <-- output {"type": "event", "event": "output", "body": {"category": "stdout", "output": "For help, type \"help\".\n"}, "seq": 14}
[jsonrpc] e[02:45:00.718] <-- output {"type": "event", "event": "output", "body": {"category": "stdout", "output": "Type \"apropos word\" to search for commands related to \"word\".\n"}, "seq": 15}
[jsonrpc] e[02:45:00.719] <-- initialize[1] {"request_seq": 1, "type": "response", "command": "initialize", "body": {"supportsTerminateRequest": true, "supportTerminateDebuggee": true, "supportsLoadedSourcesRequest": tr\
ue, "supportsLogPoints": true, "supportsConditionalBreakpoints": true, "supportsHitConditionalBreakpoints": true, "supportsFunctionBreakpoints": true, "supportsInstructionBreakpoints": true, "exceptionBreakpointFilters"\
: [{"filter": "assert", "label": "Ada assertions", "supportsCondition": true}, {"filter": "exception", "label": "Ada exceptions", "supportsCondition": true}, {"filter": "throw", "label": "C++ exceptions, when thrown", "\
supportsCondition": true}, {"filter": "rethrow", "label": "C++ exceptions, when re-thrown", "supportsCondition": true}, {"filter": "catch", "label": "C++ exceptions, when caught", "supportsCondition": true}], "supportsE\
xceptionFilterOptions": true, "supportsModulesRequest": true, "supportsDelayedStackTraceLoading": true, "supportsDisassembleRequest": true, "supportsValueFormattingOptions": true, "supportsEvaluateForHovers": true, "sup\
portsSetExpression": true, "supportsSetVariable": true, "supportsConfigurationDoneRequest": true, "supportsBreakpointLocationsRequest": true, "supportsReadMemoryRequest": true, "supportsWriteMemoryRequest": true, "suppo\
rtsSingleThreadExecutionRequests": true, "supportsSteppingGranularity": true}, "success": true, "seq": 16}
[jsonrpc] e[02:45:00.719] <-- initialized {"type": "event", "event": "initialized", "seq": 17}
[jsonrpc] e[02:45:00.719] --> setExceptionBreakpoints[2] {"type":"request","seq":2,"command":"setExceptionBreakpoints","arguments":{"filters":[]}}
[jsonrpc] e[02:45:00.721] <-- setExceptionBreakpoints[2] {"request_seq": 2, "type": "response", "command": "setExceptionBreakpoints", "body": {"breakpoints": []}, "success": true, "seq": 18}
[jsonrpc] e[02:45:00.721] --> configurationDone[3] {"type":"request","seq":3,"command":"configurationDone"}
[jsonrpc] e[02:45:00.722] <-- configurationDone[3] {"request_seq": 3, "type": "response", "command": "configurationDone", "success": true, "seq": 19}
[jsonrpc] e[02:45:00.722] --> launch[4] {"type":"request","seq":4,"command":"launch","arguments":{"request":"launch","program":"/workspace/test/test","args":[],"stopAtBeginningOfMainSubprogram":true}}
[jsonrpc] e[02:45:00.723] <-- launch[4] {"request_seq": 4, "type": "response", "command": "launch", "success": true, "seq": 20}
[jsonrpc] e[02:45:00.725] <-- module {"type": "event", "event": "module", "body": {"reason": "new", "module": {"id": "/workspace/test/test", "name": "/workspace/test/test", "path": "/workspace/test/test"}}, "seq": 21}
[jsonrpc] e[02:45:00.726] <-- breakpoint {"type": "event", "event": "breakpoint", "body": {"reason": "new", "breakpoint": {"id": 1, "verified": true, "source": {"name": "test.c", "path": "/workspace/test/test.c"}, "line\
": 10, "instructionReference": "0x1196"}}, "seq": 22}
@svaante Not happening anymore on Fedora 40, Dape 0.15.0 stable, gdb 15.1.1. Since I upgraded my workstation, I won't be able to add anything new here.
@luluman try with newer GDB, it worked for me.
Shortly after
dape
gdb
is started, it dies with[jsonrpc] Server exited with status 9
*dape-repl*
:*dape-connection events*
:Dape version 0.15.0