-
-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Debugging with lldb-vscode on windows raises an exception and displays disassembly #307
Comments
does not look like a dap issue im not on windows but i'd try to overwrite the |
Tried hardcoding all the paths to no avail. I've simplified the issue to some python/extension related crash on lldb-vscode by creating an empty rust project and running
|
I can confirm when resolving the python issues, it reverts back to raising an exception and dumping out the assembly. |
I can also reliably reproduce this with a hello world program written in C. Here is the dap log:
|
CodeLLDB is also using the debug adapter protocol, so it should be possible to get it working with nvim-dap as well. (I guess the issues encountered here are part of the reason why vimspector recommends CodeLLDB) |
Yes, after looking at the source code structure, I found CodeLLDB using dap with its own rust implementation, there may be some way to get it to work with I think building |
Is there a source for this? The reason why I ask is I have already tried building lldb-vscode using Visual Studio/MSVC toolchain with the exact same result. Unless there is some LLDB compile flag I am missing that specifically enables MSVC toolchain debugging and I cannot find any mention of it. |
I've managed to get CodeLLDB to work with
local lldb_host = "127.0.0.1"
local lldb_port = 34567
dap.configurations.rust = {
{
name = "Debug",
type = "lldb",
request = "launch",
host = lldb_host,
port = lldb_port,
program = function()
return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file")
end,
cwd = "${workspaceFolder}",
stopOnEntry = false,
args = {},
},
}
dap.adapters.lldb = function(callback, config)
callback({ type = "server", host = config.host, port = config.port })
end Open /path/to/codelldb.exe --liblldb /path/to/liblldb.dll --port 34567 You can write some trivial functions to make it start automatically when executing Some screenshots: |
This CodeLLDB configuration I can confirm works just fine in windows. Thanks! |
can we close this ? |
Sorry to further use this thread, but i found some (marginally) related info. Showing disassembly is intended by CodeLLDB (here). Normally this option would be set by the various configuration files in Visual Studio Code. One can however pass parameters to the ./codelldb --params '{"showDisassembly" : "never"} They are concatenated with the other options, so my guess is that they override previous set options, but I did not test this. BTW, there is also the option of PS: |
Sounds like the issue is resolved? I created a wiki page for codelldb: https://github.com/mfussenegger/nvim-dap/wiki/C-C---Rust-(via--codelldb) |
I got this error with the configurations posted on wiki: |
|
I edited the Wiki page. Please have a read through it. Also, there is a similar issue on the |
Debug adapter definition and debug configuration
-- Adapter
local lldb_executable = 'C:/Program Files/LLVM/bin/lldb-vscode.exe'
dap.adapters.lldb = {
type = 'executable',
command = lldb_executable,
name = "lldb",
}
-- Rust Configuration
dap.configurations.rust = {
{
name = "Launch Rust",
type = "lldb",
request = "launch",
program = "C:/Projects/rust/rlox/target/debug/rlox.exe",
cwd = '${workspaceFolder}',
stopOnEntry = true,
args = {},
runInTerminal = false,
},
}
Debug adapter version
12.0.1
Steps to Reproduce
cargo create
, can be a simple hello world appExpected Result
Debugger to break on line specified.
Actual Result
[ DEBUG ] 2021-09-17T20:29:20Z-0400 ] ...data\site\pack\packer\start\nvim-dap\lua\dap\session.lua:750 ] "request" {
arguments = {
adapterID = "nvim-dap",
clientId = "neovim",
clientname = "neovim",
columnsStartAt1 = true,
linesStartAt1 = true,
locale = "en_US",
pathFormat = "path",
supportsRunInTerminalRequest = true,
supportsVariableType = true
},
command = "initialize",
seq = 0,
type = "request"
}
[ DEBUG ] 2021-09-17T20:29:20Z-0400 ] ...data\site\pack\packer\start\nvim-dap\lua\dap\session.lua:510 ] {
body = {
exceptionBreakpointFilters = { {
default = false,
filter = "cpp_catch",
label = "C++ Catch"
}, {
default = false,
filter = "cpp_throw",
label = "C++ Throw"
}, {
default = false,
filter = "objc_catch",
label = "Objective C Catch"
}, {
default = false,
filter = "objc_throw",
label = "Objective C Throw"
}, {
default = false,
filter = "swift_catch",
label = "Swift Catch"
}, {
default = false,
filter = "swift_throw",
label = "Swift Throw"
} },
supportTerminateDebuggee = true,
supportsCompletionsRequest = false,
supportsConditionalBreakpoints = true,
supportsConfigurationDoneRequest = true,
supportsDelayedStackTraceLoading = true,
supportsEvaluateForHovers = true,
supportsExceptionInfoRequest = true,
supportsExceptionOptions = true,
supportsFunctionBreakpoints = true,
supportsGotoTargetsRequest = false,
supportsHitConditionalBreakpoints = true,
supportsLoadedSourcesRequest = false,
supportsModulesRequest = false,
supportsRestartFrame = false,
supportsRestartRequest = false,
supportsRunInTerminalRequest = true,
supportsSetVariable = true,
supportsStepBack = false,
supportsStepInTargetsRequest = false,
supportsValueFormattingOptions = true
},
command = "initialize",
request_seq = 0,
seq = 0,
success = true,
type = "response"
}
[ DEBUG ] 2021-09-17T20:29:20Z-0400 ] ...data\site\pack\packer\start\nvim-dap\lua\dap\session.lua:750 ] "request" {
arguments = {
args = {},
cwd = "C:\Projects\rust\rlox",
name = "Launch Rust",
program = "C:/Projects/rust/rlox/target/debug/rlox.exe",
request = "launch",
runInTerminal = false,
stopOnEntry = true,
type = "lldb"
},
command = "launch",
seq = 1,
type = "request"
}
[ DEBUG ] 2021-09-17T20:29:20Z-0400 ] ...data\site\pack\packer\start\nvim-dap\lua\dap\session.lua:510 ] {
command = "launch",
request_seq = 1,
seq = 0,
success = true,
type = "response"
}
[ DEBUG ] 2021-09-17T20:29:20Z-0400 ] ...data\site\pack\packer\start\nvim-dap\lua\dap\session.lua:510 ] {
body = {
isLocalProcess = true,
name = "C:\Projects\rust\rlox\target\debug\rlox.exe",
startMethod = "launch",
systemProcessId = 5984
},
event = "process",
seq = 0,
type = "event"
}
[ DEBUG ] 2021-09-17T20:29:20Z-0400 ] ...data\site\pack\packer\start\nvim-dap\lua\dap\session.lua:510 ] {
event = "initialized",
seq = 0,
type = "event"
}
[ DEBUG ] 2021-09-17T20:29:20Z-0400 ] ...data\site\pack\packer\start\nvim-dap\lua\dap\session.lua:510 ] {
body = {
allThreadsStopped = true,
preserveFocusHint = false,
reason = "exception",
threadCausedFocus = true,
threadId = 10320
},
event = "stopped",
seq = 0,
type = "event"
}
[ DEBUG ] 2021-09-17T20:29:20Z-0400 ] ...data\site\pack\packer\start\nvim-dap\lua\dap\session.lua:750 ] "request" {
arguments = {
breakpoints = { {
line = 11
} },
lines = { 11 },
source = {
name = "main.rs",
path = "C:\Projects\rust\rlox\src\main.rs"
}
},
command = "setBreakpoints",
seq = 2,
type = "request"
}
[ DEBUG ] 2021-09-17T20:29:20Z-0400 ] ...data\site\pack\packer\start\nvim-dap\lua\dap\session.lua:750 ] "request" {
command = "threads",
seq = 3,
type = "request"
}
[ DEBUG ] 2021-09-17T20:29:20Z-0400 ] ...data\site\pack\packer\start\nvim-dap\lua\dap\session.lua:510 ] {
body = {
breakpoints = { {
id = 1,
line = 11,
source = {
name = "main.rs",
path = "C:\Projects\rust\rlox\src\main.rs"
},
verified = false
} }
},
command = "setBreakpoints",
request_seq = 2,
seq = 0,
success = true,
type = "response"
}
[ INFO ] 2021-09-17T20:29:20Z-0400 ] ...data\site\pack\packer\start\nvim-dap\lua\dap\session.lua:434 ] "Server rejected breakpoint" {
id = 1,
line = 11,
source = {
name = "main.rs",
path = "C:\Projects\rust\rlox\src\main.rs"
},
verified = false
}
[ DEBUG ] 2021-09-17T20:29:20Z-0400 ] ...data\site\pack\packer\start\nvim-dap\lua\dap\session.lua:750 ] "request" {
arguments = {
filters = {}
},
command = "setExceptionBreakpoints",
seq = 4,
type = "request"
}
[ DEBUG ] 2021-09-17T20:29:20Z-0400 ] ...data\site\pack\packer\start\nvim-dap\lua\dap\session.lua:510 ] {
body = {
threads = { {
id = 4400,
name = "Thread #4"
}, {
id = 10320,
name = "Thread #1"
}, {
id = 15348,
name = "Thread #3"
}, {
id = 21032,
name = "Thread #2"
} }
},
command = "threads",
request_seq = 3,
seq = 0,
success = true,
type = "response"
}
[ DEBUG ] 2021-09-17T20:29:20Z-0400 ] ...data\site\pack\packer\start\nvim-dap\lua\dap\session.lua:750 ] "request" {
arguments = {
threadId = 10320
},
command = "exceptionInfo",
seq = 5,
type = "request"
}
[ DEBUG ] 2021-09-17T20:29:20Z-0400 ] ...data\site\pack\packer\start\nvim-dap\lua\dap\session.lua:750 ] "request" {
arguments = {
threadId = 10320
},
command = "stackTrace",
seq = 6,
type = "request"
}
[ DEBUG ] 2021-09-17T20:29:20Z-0400 ] ...data\site\pack\packer\start\nvim-dap\lua\dap\session.lua:510 ] {
command = "setExceptionBreakpoints",
request_seq = 4,
seq = 0,
success = true,
type = "response"
}
[ DEBUG ] 2021-09-17T20:29:20Z-0400 ] ...data\site\pack\packer\start\nvim-dap\lua\dap\session.lua:750 ] "request" {
command = "configurationDone",
seq = 7,
type = "request"
}
[ DEBUG ] 2021-09-17T20:29:20Z-0400 ] ...data\site\pack\packer\start\nvim-dap\lua\dap\session.lua:510 ] {
body = {
breakMode = "always",
description = "Exception 0x80000003 encountered at address 0x7ffc321606b0",
exceptionId = "exception"
},
command = "exceptionInfo",
request_seq = 5,
seq = 0,
success = true,
type = "response"
}
[ DEBUG ] 2021-09-17T20:29:20Z-0400 ] ...data\site\pack\packer\start\nvim-dap\lua\dap\session.lua:510 ] {
body = {
stackFrames = { {
column = 0,
id = 524288,
line = 215,
name = "LdrInitShimEngineDynamic",
source = {
name = "LdrInitShimEngineDynamic",
sourceReference = 1
}
}, {
column = 0,
id = 524289,
line = 3291,
name = "LdrInitShimEngineDynamic",
source = {
sourceReference = 1
}
}, {
column = 0,
id = 524290,
line = 123,
name = "LdrInitializeThunk",
source = {
name = "LdrInitializeThunk",
sourceReference = 2
}
}, {
column = 0,
id = 524291,
line = 33,
name = "LdrInitializeThunk",
source = {
sourceReference = 2
}
}, {
column = 0,
id = 524292,
line = 5,
name = "LdrInitializeThunk",
source = {
sourceReference = 2
}
} },
totalFrames = 5
},
command = "stackTrace",
request_seq = 6,
seq = 0,
success = true,
type = "response"
}
[ DEBUG ] 2021-09-17T20:29:20Z-0400 ] ...data\site\pack\packer\start\nvim-dap\lua\dap\session.lua:750 ] "request" {
arguments = {
source = {
name = "LdrInitShimEngineDynamic",
sourceReference = 1
},
sourceReference = 1
},
command = "source",
seq = 8,
type = "request"
}
[ DEBUG ] 2021-09-17T20:29:20Z-0400 ] ...data\site\pack\packer\start\nvim-dap\lua\dap\session.lua:750 ] "request" {
arguments = {
frameId = 524288
},
command = "scopes",
seq = 9,
type = "request"
}
[ DEBUG ] 2021-09-17T20:29:20Z-0400 ] ...data\site\pack\packer\start\nvim-dap\lua\dap\session.lua:510 ] {
command = "configurationDone",
request_seq = 7,
seq = 0,
success = true,
type = "response"
}
[ DEBUG ] 2021-09-17T20:29:20Z-0400 ] ...data\site\pack\packer\start\nvim-dap\lua\dap\session.lua:510 ] {
body = {
allThreadsStopped = true,
preserveFocusHint = false,
reason = "exception",
threadCausedFocus = true,
threadId = 10320
},
event = "stopped",
seq = 0,
type = "event"
}
[ DEBUG ] 2021-09-17T20:29:20Z-0400 ] ...data\site\pack\packer\start\nvim-dap\lua\dap\session.lua:270 ] "Thread stopped, but another thread is already stopped, telling thread to continue"
[ DEBUG ] 2021-09-17T20:29:20Z-0400 ] ...data\site\pack\packer\start\nvim-dap\lua\dap\session.lua:750 ] "request" {
arguments = {
threadId = 10320
},
command = "continue",
seq = 10,
type = "request"
}
[ DEBUG ] 2021-09-17T20:29:20Z-0400 ] ...data\site\pack\packer\start\nvim-dap\lua\dap\session.lua:510 ] {
body = {
content = "0x7FFC32160350: <0> movq %rsp, %rax\n0x7FFC32160353: <3> movq %rbx,
** CUT OUT LOTS OF DISSASSEMBLY HERE *
int3 \n0x7FFC3216483F: <17647> int3 \n",
mimeType = "text/x-lldb.disassembly"
},
command = "source",
request_seq = 8,
seq = 0,
success = true,
type = "response"
}
[ DEBUG ] 2021-09-17T20:29:20Z-0400 ] ...data\site\pack\packer\start\nvim-dap\lua\dap\session.lua:510 ] {
body = {
scopes = { {
expensive = false,
name = "Locals",
namedVariables = 0,
variablesReference = 1
}, {
expensive = false,
name = "Globals",
namedVariables = 0,
variablesReference = 2
}, {
expensive = false,
name = "Registers",
namedVariables = 2,
variablesReference = 3
} }
},
command = "scopes",
request_seq = 9,
seq = 0,
success = true,
type = "response"
}
[ DEBUG ] 2021-09-17T20:29:20Z-0400 ] ...data\site\pack\packer\start\nvim-dap\lua\dap\session.lua:510 ] {
body = {
allThreadsContinued = true
},
command = "continue",
request_seq = 10,
seq = 0,
success = true,
type = "response"
}
[ WARN ] 2021-09-17T20:29:20Z-0400 ] ...data\site\pack\packer\start\nvim-dap\lua\dap\session.lua:518 ] "No callback for " {
body = {
allThreadsContinued = true
},
command = "continue",
request_seq = 10,
seq = 0,
success = true,
type = "response"
}
[ DEBUG ] 2021-09-17T20:29:20Z-0400 ] ...data\site\pack\packer\start\nvim-dap\lua\dap\session.lua:750 ] "request" {
arguments = {
variablesReference = 1
},
command = "variables",
seq = 11,
type = "request"
}
[ DEBUG ] 2021-09-17T20:29:20Z-0400 ] ...data\site\pack\packer\start\nvim-dap\lua\dap\session.lua:750 ] "request" {
arguments = {
variablesReference = 2
},
command = "variables",
seq = 12,
type = "request"
}
[ DEBUG ] 2021-09-17T20:29:20Z-0400 ] ...data\site\pack\packer\start\nvim-dap\lua\dap\session.lua:750 ] "request" {
arguments = {
variablesReference = 3
},
command = "variables",
seq = 13,
type = "request"
}
The text was updated successfully, but these errors were encountered: