Skip to content

bug: Python error under watched variables when stepping through code #31

@Shock9616

Description

@Shock9616

Did you check docs and existing issues?

  • I have read all the plugin docs
  • I have searched the existing issues
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

v0.11.0

Operating system/version

macOS 15.3.2

Describe the bug

When I start a debugging session, I can select variables to watch as usual and their values are correctly displayed. However, when I begin to step through the code, the variables' values are replaced with the following python error:

Traceback (most recent call last):
    File "/Users/myusername/.local/share/nvim/mason/packages/codelldb/extension/adapter/scripts/codelldb/interface.pv". line 204, in evaluate_as_sbvalue
        value = evaluate_in_context(pycode, exec_context, eval_context)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

There's definitely more to the error but I can't see it as you can see in this picture (I maxxed my display's resolution to get this much) and I can't figure out any way to see the rest of it

Image

If there's a way to get the full error I'll happily get it for you.

Steps To Reproduce

  1. Use the following minimal config
-- repro.lua
local root = vim.fn.fnamemodify("./.repro", ":p")

for _, name in ipairs({ "config", "data", "state", "cache" }) do
	vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

local lazypath = root .. "/plugins/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", lazypath })
end
vim.opt.runtimepath:prepend(lazypath)

local plugins = {
	"folke/LazyVim",
	{
		"mfussenegger/nvim-dap",
		dependencies = {
			{
				"igorlfs/nvim-dap-view",
				opts = {},
			},
		},
		config = function()
			local dap = require("dap")

			dap.adapters.codelldb = {
				type = "executable",
				command = "codelldb",
			}

			dap.configurations.c = {
				{
					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,
				},
			}
		end,
	},
	{
		"williamboman/mason.nvim",
		opts = {},
	},
}
require("lazy").setup(plugins, {
	root = root .. "/plugins",
})
  1. Open Mason and install codelldb
  2. Open a C program and compile with debug info
  3. Set a breakpoint and start the debugger
  4. Watch a variable
  5. Step through the program
  6. See the error in watch window

Here's a video example:

error.mp4

Expected Behavior

The variable's value should continue to be displayed/updated with no error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions