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
Debug adpater reported a frame at line 74, cursor position outside buffer. #956
Comments
Part of the idea behind reproduction steps is that one can follow them to reproduce the problem. Could you please provide a short code snippet, the steps you used to compile it and logs? And also minimize your config. Does the same issue occur without stuff like This is likely a debug-adapter/configuration problem, as the message already indicates. |
I tried to skip stl and other .h files , so that it's doesn't step into unnecessary implementation, It's disturbing and overwhelming during debugging process because unnecessary files open randomly. Unlike vscode and visual studio debugger JusMyCode feature doesn't work well, I think it's still not fully implemented yet even on windows also , it tried many times but failed. So the last option was using .gdbinit file.my .gdbinit file skip -gfi /usr/include/c++/12/*/*/*
skip -gfi /usr/include/c++/12/*/*
skip -gfi /usr/include/c++/12/* Dap log file
After removing miDebuggerArgs = "-x ./.gdbinit" same thing appears. Results of log file after removing that part.
my configuration remains same as provided above. |
Screencast.from.2023-05-24.19-18-56.webm |
Same issue with codelldb installed. Any C++ simple file: set breakpoint After the error the source file is closed and neovim plugins become unresponsive. Only solution is to quit. |
I think the issue might be here in session.lua: function switchbuf_fn.uselast()
if vim.bo[cur_buf].buftype == '' or vim.bo[cur_buf].filetype == filetype then
api.nvim_win_set_buf(cur_win, bufnr)
set_cursor(cur_win, line, column)
else
local win = vim.fn.win_getid(vim.fn.winnr('#'))
api.nvim_win_set_buf(win, bufnr)
set_cursor(win, line, column)
end
return true I believe the disassembly buffer is type nofile and is therefore going to the else branch when it shouldn't. If you haven't switched windows it probably won't cause issues, but if you have, the "Cursor outside buffer" error will occur. I haven't tested it, but it looks like there might be another issue here if you switch between multiple windows. The call to "vim.fn.winnr('#')" will get the last accessed window, but couldn't this potentially be the wrong window? Especially if you use nvim-dap-ui. |
I'd still need minimal and complete reproduction steps. "Any c++ file" is not sufficient. |
A test file could be (test.cpp):
And the CMakeLists.txt
My neovim configuration: And steps to reproduce:
|
The zip file is empty (?) and this doesn't look minimal. Ideally it would be a simple file, some |
I have the same problem (also using the cmake tools plugin as the poster above). I'd be willing to try to produce a minimal config, but I don't know how to use nvim-dap without the help of cmake tools. Can someone point me to somewhere I can see how to do that? Also I think it's probably a cmake tools problem because debugging works when I use it for my rust code with a different plugin... I cannot be sure though. |
I am getting the same error while doing this with rust local dap = require('dap')
dap.adapters.codelldb = {
type = 'server',
port = "${port}",
executable = {
command = '/home/bret/Downloads/extension/adapter/codelldb',
args = {"--port", "${port}"},
},
}
dap.configurations.cpp = {
{
name = "Launch file",
type = "codelldb",
request = "launch",
program = function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd()..'/', 'file')
end,
cwd = '${workspaceFolder}',
stopOnEntry = false,
},
}
dap.configurations.rust = dap.configurations.cpp This is how you can reproduce the error
fn patter(a: &mut i64) -> i64 {
-> B for _i in 1..10{
*a +=1;
-> B println!("The value of a is {}",a);
}
return *a;
}
fn main(){
let mut x: i64 = 0;
pattern(&mut x);
}
the "- > B" this indicates where i put my breakpoints. edit : sorry but i have tried editing the code so that it looks better but cant do it. |
Your example works fine for me and doesn't produce any errors. |
Would you be kind enough to check my dot files they are on my GitHub maybe I haven't configured nvim-dap correctly otherwise I will try again and post the screen recording of what happens in the morning I can't right now because of load shedding. |
cut.webmThis is what i get i have just realized this that if i keep pressing F1 which is the key to step into the program techinically keeps debugging but you can see in the vid that the code turns into assembly but keeps running until it is done. |
@bret-walda, if you try it without nvim-dap-ui, does the error still occur? |
I haven't tried I will let you know in some time. |
i just tried it without nvim-dap-ui i just didn't press the key to start it and added the break points stepped into it and it still happened. I don't know if i should uninstall nvim-dap-ui and try again but it did the same thing without nvim-dap-ui. |
Please try with a minimal config: E.g.:
local dap = require("dap")
dap.adapters.codelldb = {
type = 'server',
port = "${port}",
executable = {
command = os.getenv("HOME") .. "/apps/codelldb/extension/adapter/codelldb",
args = {"--port", "${port}"},
}
}
dap.configurations.rust = {
{
name = "codelldb: Launch",
type = "codelldb",
request = "launch",
program = function()
return vim.fn.input({
prompt = "Path to executable: ",
default = vim.fn.getcwd() .. "/",
completion = "file"
})
end,
cwd = '${workspaceFolder}',
args = {},
},
} And then start |
Doesn't change anything but if i stepover instead of stepping in the code doesn't turn into assembly and the debugger runs fine until the control flow goes out of the breakpoints and into the main function and at that point the process exits with code 0. |
I found that if I turn off stopAtEntry, the whole dap can work normally, otherwise the cursor position outside buffer will appear |
I'm running into the same problem with firefox adapter. Only with step into, stepover works fine. |
I have the same problem with C++ and lldb-vscode. Minimal local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
{
"mfussenegger/nvim-dap",
config = function()
local dap = require('dap')
dap.adapters.lldb = {
type = 'executable',
command = '/sbin/lldb-vscode', --Change to your path
name = 'lldb',
}
dap.configurations.cpp = {
{
name = "Launch file",
type = "lldb",
request = "launch",
program = function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
end,
cwd = '${workspaceFolder}',
stopOnEntry = false,
},
}
vim.keymap.set('n', '<F5>', require 'dap'.continue)
vim.keymap.set('n', '<F9>', require 'dap'.step_into)
end
}
}) Steps to reproduce almost the same problem:
int main() {
// breakpoint here
}
Assembly will appear in both windows |
Debug adapter definition and debug configuration
C/C++ Debugger Doesn't exit properly.
Debug adapter version
0.6.0
Steps to Reproduce
Just step into the debugger until ends and the error appears.This problem basically appears while using vscode-cpptools extension.
Expected Result
Debugger should stop and exit.
Actual Result
Screencast.from.2023-05-21.22-23-51_trimmed.webm
The text was updated successfully, but these errors were encountered: