Skip to content

handle synthetic frames produced by GDB FrameFilter without a level#1605

Open
tzcnt wants to merge 1 commit into
microsoft:mainfrom
tzcnt:missing_level_fix
Open

handle synthetic frames produced by GDB FrameFilter without a level#1605
tzcnt wants to merge 1 commit into
microsoft:mainfrom
tzcnt:missing_level_fix

Conversation

@tzcnt

@tzcnt tzcnt commented Jul 2, 2026

Copy link
Copy Markdown

Synthetic frames produced by GDB's FrameFilter, e.g. async stack backtraces for C++20 coroutines produced by a GDB script do not have a Level, and cannot be assigned a Level with the current version of GDB. Attempting to set a breakpoint inside of an async stack then causes an error when walking the synthetic backtrace:

ERROR: Error while trying to enter break state. Debugging will now stop. Unrecognized format of field "level" in result: {addr=0x000055555555fef0,func=[async] main::$_0::operator()(unsigned long) const [clone .destroy],file=<file>,line=80,arch=i386:x86-64}

I'm considering an upstream patch to GDB to allow producing levels for these synthetic frames. But in the short term, there is a simple fix we can do to handle them here: allow frames without a level.

The way the proposed renumbering works in DebuggedThread is that frames without a level get a sequential level, whereas frames with a level keep their real level. This has the effect of causing async frames to display the locals of the real frame below them. This is a necessary workaround for another GDB FrameFilter limitation - we must pass a real frame number to -stack-list-variables with --frame. So GDB does not support querying back locals for synthetic frames either. I'm working on a fix for that also (either by a patch to MIEngine to allow querying from a script, or a VSCode extension, or another GDB patch).

But for now, this fix is a small step that at least makes it possible to debug with a synthetic-frame producing FrameFilter and see a backtrace without crashing.

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

Successfully merging this pull request may close these issues.

1 participant