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

Debugger: Add memory search types: GreaterThan(OrEqual), LesserThan(OrEqual), and Not Equal #10441

Merged
merged 4 commits into from
Dec 23, 2023

Conversation

Daniel-McCarthy
Copy link
Contributor

Description of Changes

Implements #10266
Adds the ability to do debugger memory searches for values that are not equal to, greater than (or equal), or less than (or equal) to the search value.

PCSX2-LessThanGreaterNotEqualTypes

Does not tackle [Not] Changed, [De/In]creased, or [De/In]creased By in this PR as it increases the scope of the issue and the changes required. Adding this as the initial step + refactoring to make it easier to add more in the future.


Rationale behind Changes

Currently it is not possible to search for a value that is not exactly known. Adding the ability to do > or < searches allows finding a bulk of values and narrow down results. Not Equals also helps filter out/narrow down results lists for values we know we don't need or don't want.


Suggested Testing Steps

I highly recommend validating > and < (and >=, <=) with float and double, and any int type. Ensuring each search type is behaving as expected for integers, floats, decimals.

Adds an enum class to represent the Search type used in a memory search. Prior, this was just handled with an integer to represent each type, but it was very unclear what corresponded to which type at first glance.

Made this easier to follow by using an enum to represent the type.
Adds support for basic greater than/greater than or equal/less than/less than or equal/not equal search types for the debugger's Memory Scan.

This adds a new input to allow selecting the search comparison type, which defaults to Equals, and allows switching to the above mentioned comparisons.
It's set up to allow for adding more easily. Restructures some of the functions to make having multiple comparisons quite manageable.
Adds an enum for search comparison types for easy logic handling.
…ng Not Equals

Currently array/string searches don't support Not Equals searches, so this needs to be removed.
Copy link
Contributor

@stenzek stenzek left a comment

Choose a reason for hiding this comment

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

Mostly stylistic nitpicks, nothing major

pcsx2-qt/Debugger/CpuWidget.cpp Outdated Show resolved Hide resolved
pcsx2-qt/Debugger/CpuWidget.cpp Outdated Show resolved Hide resolved
pcsx2-qt/Debugger/CpuWidget.cpp Outdated Show resolved Hide resolved
Sets up if expressions to use constexpr for compile time evaluation and makes the is greater/less than logic simpler to read for int. Also removes an unneeded QPushButton cast and simply compares the pointers directly.
@stenzek stenzek merged commit ade6a6c into PCSX2:master Dec 23, 2023
12 checks passed
vertver pushed a commit to vertver/pcsx2-gdbserver that referenced this pull request Apr 4, 2024
…rEqual), and Not Equal (PCSX2#10441)

* Make memory search search type handling more clear with enum

Adds an enum class to represent the Search type used in a memory search. Prior, this was just handled with an integer to represent each type, but it was very unclear what corresponded to which type at first glance.

Made this easier to follow by using an enum to represent the type.

* Debugger : Add support for greater than/less than/not equal search types

Adds support for basic greater than/greater than or equal/less than/less than or equal/not equal search types for the debugger's Memory Scan.

This adds a new input to allow selecting the search comparison type, which defaults to Equals, and allows switching to the above mentioned comparisons.
It's set up to allow for adding more easily. Restructures some of the functions to make having multiple comparisons quite manageable.
Adds an enum for search comparison types for easy logic handling.

* Debugger: Update Array/String search type error to mention not handling Not Equals

Currently array/string searches don't support Not Equals searches, so this needs to be removed.

* Debugger: Code cleanup + feedback changes

Sets up if expressions to use constexpr for compile time evaluation and makes the is greater/less than logic simpler to read for int. Also removes an unneeded QPushButton cast and simply compares the pointers directly.
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.

4 participants