Tightens the data flow between the CPU and UI threads
to resolve multiple race conditions, such as:
1. Unbinding a debug interface update CB while it's in use,
causing a possible use-after-free.
2. Binding breakpoints via the disassembly widget that would read
a stale local variable, and bind the breakpoint to a bogus address
+ probably more subtle races that are now resolved
Reduces memory useage during memory searching process.
- Minimizes passing by copy, uses references to avoid causing copies
- Deletes FutureWatcher ptr when no longer needed to avoid leaking memory (thanks Fobes)
- Updates the search results vector in-place so that no extra copies are needed.
- Makes use of std::move to transfer resources instead of keeping two copies.
- No longer keeps a copy of prior search results in addition to the active search, the stored results are transferred to the search worker and then transferred back.
More improvements to be made, but making a first that should make a
decent impact.
Also: Updates storage of prior results a s a vector now.
Prior since the results were stored in a hashmap, the .keys() function needed to be used to index at an arbitrary point when loading results into the UI.
This caused a big spike in memory usage when the results count is particularly large.
Using a vector optimizes this as we don't need to add any memory when indexing in this way.
Also unlike before when we used vector, we're also removing elements in place when doing filter searches so we don't need two vectors.
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.
The debugger now refreshes/updates it's widgets once a second so that the user does not need to interact with the debugger to know when data/state changes.
The debugger was crashing on open if no game was running due to failing to read from the CPU while the cpu was not alive.
The opcode was read before checking if it should be shown, so I have moved it to only read if the showOpcode boolean is true, and set it to not show opcodes of the cpu is not alive.
Moves the Memory Search fucntionality to it's own widget so as to not pollute the CpuWidget with search related functionality, especially as it is intended to grow in scope. CpuWidget is fairly general and as such everything tends to get tossed together which makes it harder to navigate/understand/maintain.
Renames Disable Depth Emulation to Disable Depth Conversion as it is both more correct to what it does and less likely for a user to think it is free performance.
This was an oversight for the Wizard Setup where it didn't list with the supported formats and the GameList when you don't have any games added. It already works when you click open file among supported formats.
Adds `/inis/debuggersettings/` settings folder to contain settings specifically for the debugger. Adds functionality to manually save (to settings) Breakpoints/Saved addresses and automatically load them upon launching the debugger.
This non-printable character (U+FE0F, VARIATION SELECTOR 16) has been added for seemingly no reason to multiple strings and have polluted Translation Memory on Crowdin for some languages (👀).
Let's get rid of it.
Make manual releases create this file, and make it contain
#define DEFAULT_UPDATER_CHANNEL "stable"
So that the release defaults to the stable update channel.
Adds const to variables that could use them but currently don't and replaces 256 literal uses with Qt::UserRole to be clear what it is for and how this number is used as currently it's a bit confusing.
Previously when double clicking a memory search result it would go to the address but not switch to the memory view tab if the user wasn't already on it.
Now it ensures the user moves to the memory view widget, as this is almost always going to be the user's intention.
Adds a tab widget to the debugger that allows saving/bookmarking memory addresses and giving them labels/descriptions for convenience. Includes the ability to jump back to memory addresses from the Saved Addresses tab, and adding Saved Addresses from memory search search results context menu and the memory view context menu.
Also supports importing and exporting the saved addresses as CSV format.
This used to be off by default, but was changed to show found patches/cheats for all CRCs for a game serial. However, this also clutters and shows cheats for CRCs that may not be applicable without a way to hide them.
This puts this setting behind a toggle to choose if this should be enabled/disabled so the user has choice. Still defaults to enabled to keep current behavior.
Adds the ability to do Not Equals filter searches for arrays and strings. Refactors array search function for easily adding new search types.
Adds error message that informs the user that Not Equals can not be used for initial searches and can only be used for filter searches.
- Combines the start and end address inputs for memory search into a single line to not take up unnecessary space and allow room for other UI elements.
- Adds 'Comparison' label to memory search UI to describe the comparison input dropdown.
The 'Clear Settings' button will now disable all cheats and patches from the configuration. This will allow quickly resetting to having no game altering pnach patches/cheats.
* Debugger: Fix Importing Breakpoints CSV functionality
This resolves a few issues with the Breakpoint CSV importing functionality.
Makes the following changes/fixes:
- Assembly instructions with commas caused part of the instruction text to be considered the start of a new column (comma is the CSV delimiter), resulting in "too many columns errors" and failing to import. Now puts values in quotes and detects the true start and end of the values, so that no extra columns are created.
- The import function was using the incorrect columns to load since the Enabled column was moved to be the first one but the import function had not been updated. Fixed this by using the column enum values instead of hardcoded numbers, so if ordering in the model changes it will still import fine.
- Updates the beginRemoveRows function to not remove an extra row. With this function you would want a "count" of 0 to remove 1, so "row, row" deletes one, "row, row+1" deletes 2. Updates it to subtract one so that the range is not including one more than it is intended to.
-
* Misc: Cleanup regex string & add explicit imports
Uses raw string literal to make the regular expression easier to read since regex is ugly enough as it is, we really don't need escaping characters in a string on top.
Also explicitly includes used Qt classes.
* 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.
- Adding translation support for all the substrings related to the single/multiframe GS Dump message.
- Correcting the None option in the Deinterlacing settings according to what was talked about in Crowdin, unified that string with the Big Picture mode.
- Minor English text fixes reported in Crowdin.
Second attempt at doing this PR after the former, https://github.com/PCSX2/pcsx2/pull/10253 , was mangled by bad squashing and rebasing.
Adds the ability to remove individual search results from the Memory Search results list. Right clicking a result will give the "Remove Result" option in the context menu.
Allows user to right click a memory search result in order to go to that memory address location in the disassembly view. This saves several step and makes it easier to do.
Also adds precedent for the memory search result context menu which will be used in future features.
Addresses feedback to use consistent naming conventions as most variables are using snake_case. Also no longer passes string_view by reference as per feedback.