Open xgroleau opened 3 years ago
Could you try checking out my bugfix branch ("bugfix/launch-json-empty-array" of this repository) and check if it works? This is indeed a bug in dap-mode
, probably caused due to the empty arrays. If you cannot do that, a workaround would be to remove empty arrays ("args", ...).
These are the git command you'll need:
$ cd $PATH_TO_DAP_GIT_CHECKOUT
$ git fetch --all
$ git checkout bugfix/launch-json-empty-array
Then you'll have to make your Emacs use the new version of dap-mode
somehow, which I'll assume you know how to do (if not, you may ask, in which case I'll provide additional guidance).
I can confirm that the fix works! Thanks for the fast response. Should I close the issue now or after the PR?
I'd leave it open, given that the fix isn't in master. The problem here is that using arrays might break something else, which will need more testing.
Are you referring to my bugfix branch or to my workaround of deleting "args"?
Sorry I wasn't clear. I've pulled your bugfix branch and it works.
Great. More testing will be necessary before this can go into master.
Hello @nbfalcon,
I'm hitting this same issue now and was wondering why the bugfix branch is gone but not merged into master? Did you find any issues with it?
In my case, the problematic launch.json
file was:
{
"version": "0.2.0",
"configurations": [
{
"name": "C++ launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/pretty_printers_test/main.out",
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
For the record, empty arrays ("args": [],
and "environment": [],
) were working fine on master
for me. The thing that triggered the exception was adding the "setupCommands"
block.
I've tested the fix proposed in 096ba8b, that makes the exception go away and I do get pretty printing (i.e. the "setupCommands"
block does what it's supposed to, so the fix works OK for my toy example test.
My Emacs version is
GNU Emacs 27.0.50 (build 6, x86_64-pc-linux-gnu, GTK+ Version 3.24.9) of 2019-07-11
I can provide any extra information if you need it or help doing any specific tests on the patched version of `dap-launch.el. Thanks
I have no idea why the branch was deleted, and I have recreated it in my fork.
@yyoncho do you think something might break in dap-mode
if an array is passed instead of a list, e.g. for some :args
field?
Specifically dap-java
.
in general, an empty vector will be serialized to []
in json while empty list will end up nil. So this might potentially break the java server.
I'm trying to launch a vscode debug configuration on emacs, the configuration works on vscode without any issues.
When I launch dap-debug, then select the C++ Launch configuration, an error occurred the error "Debug session process exited with status: Killed" is shown in the bottom mini buffer.
I'm a bit confused to why it works on vscode and not emacs. The error seems to be related to the C# Json library used, so maybe the cpptools-setup is outdated compared to vscode. I'm pretty new to elisp so I've had some trouble finding more information.
I've enabled cpptools using
and then
The .vscode/launch.json file
The exception in the output buffer
I'm not sure if this is the right place to post the issue since it comes from an external library, but it works on vscode. If not, I will close the issue.