Skip to content
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

Support frame conds #3520

Closed
wants to merge 2 commits into from

Conversation

derekparker
Copy link
Member

This patch allows a user to set a breakpoint condition targeting a specific frame.

This is more of a partial implementation of the referenced issue because it does
not allow for setting multiple conditions. That, in my opinion, is a separate feature
request and can be implemented independently.

Fixes #3515

This patch allows a user to set a breakpoint condition targeting a specific frame.

Fixes go-delve#3515
Copy link
Member

@aarzilli aarzilli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO the simplest way to do this would be to integrate it into the expression evaluator, something like runtime.frame(N).a gets you variable a from the N-th frame.

@@ -447,6 +449,10 @@ func evalBreakpointCondition(tgt *Target, thread Thread, cond ast.Expr) (bool, e
return true, err
}
}
scope, err = ConvertEvalScope(tgt, scope.g.ID, int(frameCond), 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is going to break if the thread isn't running a goroutine. This could be the reason for all the new test failures.

@derekparker
Copy link
Member Author

IMO the simplest way to do this would be to integrate it into the expression evaluator, something like runtime.frame(N).a gets you variable a from the N-th frame.

That's interesting, I like that approach. That would mean landing this after your PR #3508. I can close this out for now and we can move forward with that approach.

@derekparker derekparker closed this Oct 9, 2023
@derekparker derekparker deleted the support-frame-conds branch November 7, 2023 14:08
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.

breakpoint condition on other frames
2 participants