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

[3.x] Fix local variables not showing when breaking on final line #71093

Merged
merged 1 commit into from
Jan 9, 2023

Conversation

Banderi
Copy link

@Banderi Banderi commented Jan 9, 2023

Backported #58201 from 4.0 to 3.x as discussed in #38608:
Changed the scoping check in debug_get_stack_member_state from > to >=, so that local variables are no longer prevented from appearing in the debugger messages when the code execution is paused on the last line of a code block.

Closes #53442

@Banderi Banderi requested a review from a team as a code owner January 9, 2023 02:05
@akien-mga
Copy link
Member

This looks good, but it would be better if the author details and commit message from the original fix #58201 were preserved when backporting.

This is typically done by using git cherry-pick -x <hash> and solving merge conflicts if any.

@akien-mga akien-mga added this to the 3.6 milestone Jan 9, 2023
@akien-mga akien-mga added the cherrypick:3.5 Considered for cherry-picking into a future 3.5.x release label Jan 9, 2023
@Banderi
Copy link
Author

Banderi commented Jan 9, 2023

I see, thanks! - that's really handy to know.
Should I revert my commit and replace it with the cherry-pick or can I just add it on top?

@akien-mga
Copy link
Member

akien-mga commented Jan 9, 2023

The best would be to reset your local branch (so not revert - which adds a second commit - but remove) and then do the cherry-pick. It would look something like this (assuming you have upstream remote pointing to this repo, i.e. `git remote add upstream https://github.com/godotengine/godot):

git fetch upstream 3.x
git checkout debugger_locals_3.x
git reset --hard upstream/3.x
git cherry-pick -x 657b9b659680194f6d3aa546a4b20246bb51fb39
// There's a small merge conflict as the `for` loop syntax changed. Keep the existing code (old syntax) and just redo the `>` -> `>=` change.
git add modules/gdscript/gdscript_function.cpp
git cherry-pick --continue
// You should now have a single commit on top of the current 3.x branch, authored by Saracen and committed by you, with "(cherry picked from 657b9b659680194f6d3aa546a4b20246bb51fb39)" added to the commit message.
git push --force origin debugger_locals_3.x

(that's assuming your origin remote is your fork)

@akien-mga akien-mga changed the title Backported #58201 to 3.x - fix local variables not appearing in the debugger when breaking on the last line [3.x] Fix local variables not showing when breaking on final line Jan 9, 2023
@akien-mga akien-mga merged commit 106bfce into godotengine:3.x Jan 9, 2023
@akien-mga
Copy link
Member

Thanks! And congrats for your first merged Godot contribution 🎉

@akien-mga
Copy link
Member

Cherry-picked for 3.5.2.

@akien-mga akien-mga removed the cherrypick:3.5 Considered for cherry-picking into a future 3.5.x release label Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants