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: Memory search increased/decreased/changed + results count #10837

Conversation

Daniel-McCarthy
Copy link
Contributor

@Daniel-McCarthy Daniel-McCarthy commented Feb 21, 2024

Description of Changes

  • For Int/Float types, adds the following search comparisons: Increased, Increased By, Decreased, Decreased By, Changed, Changed By, Not Changed.
  • For String/Array types, adds the following search comparisons (when filtering): Not Equals, Changed, Not Changed
  • Shows Searching... when a memory search is in progress, and <number> results found on search completion.
  • Now only displays the comparison types that are valid for the given selected search state. If a comparison type is not supported for a type it will not appear, and if a comparison type requires search results to filter, it will not appear until a search has been performed.
  • Switching search types disables filter search until a new search is performed. (Can't search for ints, then filter by float or string. If you want to filter, stick to the same type you did your initial search with).

Refactors how search results are stored so that we can identify the prior value of a search result to compare against when filtering (as is required for all of the new search comparisons).

Adds a 2 way lookup table so that we can manage which comparison types are in the QComboBox since we can no longer convert the selection index directly to an enum since the options change depending on the selected search type and if there are existing results that match the current search type.

Rationale behind Changes

  • Being able to search for increased/decreased/changed/not changed makes it significantly easier to filter to find the memory addresses one is looking for.
  • Displaying results count makes it easier to see if your filters are making an impact, and makes it more clear when the debugger is still searching.
  • Displaying only the currently use-able comparison types reduces visual pollution when selecting a comparison and avoids confusing warnings that a comparison can't be used for X or Y reason. There are a lot of comparison types now, and few apply to string/array for example (and about half only apply once an initial search occurs). (Also fixes [Feature Request]: Debugger: Force to use Equals search comparisons for search type Array of byte and String #10480)

Suggested Testing Steps

This impacts all search types/comparisons. Thorough testing/sanity checking of search results would be excellent.
I highly recommend testing with at least one integer type (e.g. 16 bit), at least one decimal type (decimal or float), and at least one array style type (string or array) as these are each handled different from each other in some ways.

Note:

Some minor cleanup of comments, and renaming of some .ui components that had generic names.

Quick Demonstrations

Increased/Decreased/Changed (and results count)
Array/String comparison options when filtering
Showing comparisons that are for filtering only *only after* initial search

Copy link
Member

@F0bes F0bes left a comment

Choose a reason for hiding this comment

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

Wasn't able to test, but I gave the code a look through and found some warnings.

pcsx2-qt/Debugger/MemorySearchWidget.cpp Outdated Show resolved Hide resolved
pcsx2-qt/Debugger/MemorySearchWidget.cpp Outdated Show resolved Hide resolved
pcsx2-qt/Debugger/MemorySearchWidget.cpp Show resolved Hide resolved
@Daniel-McCarthy Daniel-McCarthy force-pushed the DebuggerSearch-ChangedIncreasedDecreased branch 2 times, most recently from e3958f1 to 0fde029 Compare February 24, 2024 05:08
Adds memory search comparisons for Increased, Increased By, Decreased, Decreased By, Changed, Not Changed, Changed By.
For arrays, adds not equals, changed, not changed for filter searches.
Now only shows the comparison types that are currently valid for the given search type and if there's prior search results.

Also refactors to allow holding the prior set of search results rather than just the addresses, needed for these search comparisons to work.

Also adds a ui label to show that the debugger is searching after clicking the search button which then gets replaced with the results count when the search completes.
@Daniel-McCarthy Daniel-McCarthy force-pushed the DebuggerSearch-ChangedIncreasedDecreased branch from 0fde029 to 9c5fc16 Compare February 29, 2024 23:47
@refractionpcsx2 refractionpcsx2 merged commit bd032bb into PCSX2:master Mar 2, 2024
12 checks passed
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.

[Feature Request]: Debugger: Force to use Equals search comparisons for search type Array of byte and String
5 participants