Skip to content
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

Use dap-codelldb get deserialization error but works for VSCode. #810

Open
zw963 opened this issue Sep 22, 2024 · 0 comments
Open

Use dap-codelldb get deserialization error but works for VSCode. #810

zw963 opened this issue Sep 22, 2024 · 0 comments

Comments

@zw963
Copy link

zw963 commented Sep 22, 2024

I tested dap-codelldb on a Crystal lucky project recently. it works on my arch linux with lldb/llvm 18.1.18, crystal 1.13.2, codelldb plugin version 1.10.0 on VSCode 1.93.1

Following is screenshot.

image


.vscode/launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "lldb",
            "request": "launch",
            "name": "crystal: debug current file",
            "preLaunchTask": "crystal: build current file (debug)",
            "program": "${workspaceFolder}/bin/website",
            "args": [],
            "cwd": "${workspaceFolder}",
            "initCommands": [
                "command script import /home/zw963/Crystal/crystal-lang/crystal/etc/lldb/crystal_formatters.py"
            ]
        }
    ]
}

.vscode/tasks.json

{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "crystal: build current file (debug)",
      "type": "shell",
      "command": "crystal build --debug src/website.cr -o bin/website"
    }
  ]
}

Then, i tried it use emacs with dap-codelldb, like following.

(setq dap-utils-extension-path (expand-file-name ".extension" (file-name-directory (or load-file-name buffer-file-name))))

(setq dap-codelldb-extension-version "1.10.0")
(require 'dap-mouse)
(require 'dap-ui)
(require 'dap-mode)
(require 'dap-codelldb)

After run dap-debug, select the configuration template crystal: debug current file, wait it build successful, then, i get error message like following:

/home/zw963/Dropbox/common/.emacs.d/plugins/dap-mode/.extension/vscode/codelldb/extension/adapter/codelldb --port 17977
[ERROR codelldb::dap_session] Deserialization error: data did not match any variant of untagged enum ResponseResult at line 1 column 84

i don't understand dap well, i guess the issue is, emacs dap-codelldb not respect my following initCommands config, right?

 "initCommands": [
                "command script import /home/zw963/Crystal/crystal-lang/crystal/etc/lldb/crystal_formatters.py"
            ]

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant