handle synthetic frames produced by GDB FrameFilter without a level#1605
Open
tzcnt wants to merge 1 commit into
Open
handle synthetic frames produced by GDB FrameFilter without a level#1605tzcnt wants to merge 1 commit into
tzcnt wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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
DebuggedThreadis 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-variableswith--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.