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

Breakpoint from string flag parsing using token #9456

Merged
merged 1 commit into from
Jan 27, 2021

Conversation

trevor403
Copy link
Contributor

@trevor403 trevor403 commented Jan 19, 2021

When searching the breakpoint string for "b" for the break_on_hit flag you can get a false hit because the hex address may include the letter b. For example, 80,0cb,46c nl was incorrectly enabling break on hit.

If you read the next token from the string stream, you will have the flags alone. You can then search these for each letter and you won't get a false hit.

This is quite a neat bug 😄

Copy link
Contributor

@sepalani sepalani left a comment

Choose a reason for hiding this comment

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

This change make sense to me. By "80,0cb,46c nl" you meant 800cb46c nl, right? I'm not sure we support comma separated hex values.

Untested, will test later today.

Source/Core/Core/PowerPC/BreakPoints.cpp Outdated Show resolved Hide resolved
@trevor403
Copy link
Contributor Author

This change make sense to me. By "80,0cb,46c nl" you meant 800cb46c nl, right? I'm not sure we support comma separated hex values.

Untested, will test later today.

For some reason when saving breakpoints, my GameSettings contains comma separated hex values. They Load just fine too. Maybe this is a quirk of std::hex? I am not sure.

Copy link
Contributor

@sepalani sepalani left a comment

Choose a reason for hiding this comment

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

Tested and LGTM.

I suspect the comma is coming from your locale, that would explain why you have no issues when saving and loading.

This locale/comma issue should be addressed in its own PR as it needs to fix loading and saving BPs, on top of other saved config I guess. I'll probably address it by next week if I manage to find some time.

@lioncash
Copy link
Member

LGTM once changes are squashed into a single commit

Since the string includes hex, the break_on_hit 'b' flag can be pulled from the address by accident

istringstream for BreakPoint parsing
@trevor403
Copy link
Contributor Author

@lioncash should be ready to merge once the checks run

@trevor403
Copy link
Contributor Author

It seems as though checks are not running on my squashed commit

@trevor403
Copy link
Contributor Author

The Pending pr-android status check seems to have run successfully on the Buildbot. Maybe it did not properly report the test status back to GitHub

@smurf3tte
Copy link
Contributor

This bug was also fixed in #9334...

@leoetlino
Copy link
Member

#9334 will take longer to review so I think we should merge this first

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants