Skip to content

[BUG] DAP stops wherever it wants and throws errors on continuing thread #402

@weissmall

Description

@weissmall

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Current debugger configuration for flutter-tools looks like this

--
	debugger = {
		enabled = true,
		exception_breakpoints = {},
		evaluate_to_string_in_debug_views = false,
	},
--

In process of running application with DAP in any moment it can stop on some internal files as on breakpoint. As I've noticed almost every stop is related to some @pragma('entry-point') or such annotated functions.

If continuing a thread after it can work fine, but in some cases it's impossible to debug some things, because before it will stop at your breakpoint it will stop anywhere else while your main thread will skip breakpoint and work further.

Expected Behavior

Stopping only at specified breakpoints or related to DAP config

Steps To Reproduce

Have no clue how to reproduce but can notice that it's mostly started after moving from flutter version 3.16.3/3.17.* to 3.24.*

Here's my setup of flutter-tools

flutter.setup({
	ui = {
		border = "rounded",
		notification_style = "plugin",
	},
	decorations = {
		statusline = {
			app_version = true,
			device = true,
			project_config = false,
		},
	},
	debugger = {
		enabled = true,
		-- run_via_dap = true,
		exception_breakpoints = {},
		evaluate_to_string_in_debug_views = false,
	},
	fvm = false,
	dev_log = {
		enabled = false,
	},
	lsp = {
		color = {
			enabled = false,
			background = true,
			background_color = nil,
			foreground = false,
			virtual_text = true,
			virtual_text_str = "",
		},
		on_attach = on_attach,
		capabilities = capabilities,
		settings = {
			showTodos = true,
			completeFunctionCalls = true,
			renameFilesWithClasses = "always",
			enableSnippets = false,
			updateImportsOnRename = true,
		},
	},
})

Environment

- OS: Manjaro Linux x86_64
- Flutter version: 3.24.3 (through fvm)
- Is flutter in $PATH: Yes, on $PATH it resolves through symlink to fvm's bin folder (aka /home/uname/fvm/default/bin)
- neovim version: v0.10.0 from AUR

Anything else?

There maybe some problem with flutter itself like on issue #309.

One of the error messages after resuming thread which was stopped by DAP itself:

Error retrieving stack traces: [Sentinel kind: Collected, valueAsString: <collected>] from getObject()

UPD:
As an example of stopping point:

/// file: ~/fvm/versions/stable/bin/cache/pkg/sky_engine
...
  @pragma('vm:entry-point') // <-- Stopped here
  static int _ffi_resolver_function(Object a, Object s, int n) =>
      _ffi_resolver(a, s, n);
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions