Commit Graph

112 Commits

Author SHA1 Message Date
chaoticgd efb43ac7f9 Debugger: Make the expression parser thread safe 2024-11-16 11:50:19 -05:00
chaoticgd 7d63a9e51c Debugger: Avoid resetting symbol trees while single stepping 2024-10-23 09:58:02 -04:00
chaoticgd f77bf1ec6b Debugger: Be smarter about deciding when functions should be hashed 2024-10-18 13:57:05 -04:00
chaoticgd ed4fbb4f5a Debugger: Hash functions scanned in by the MIPS analyst 2024-10-18 13:57:05 -04:00
chaoticgd f963291970 Debugger: Cache hash match results on symbol tree nodes 2024-10-18 13:57:05 -04:00
chaoticgd 2c3abe33d5 Debugger: Add settings to control the analysis passes 2024-10-18 13:57:05 -04:00
chaoticgd 0fd7e1d7c2 Debugger: Split out SymbolImporter into its own class 2024-10-18 13:57:05 -04:00
chaoticgd 60abebb3a5 Debugger: Fix crash in symbol tree menu code 2024-10-08 09:47:41 -04:00
chaoticgd 8d3f4fac23 Debugger: Prevent flicker when resetting symbol tree node children 2024-09-15 08:57:12 -04:00
chaoticgd 93b18412f5 Debugger: Make check box widgets in the symbol tree more responsive 2024-09-15 08:57:12 -04:00
chaoticgd 90463a4a6c Debugger: Bring back the expression parser 2024-09-02 16:16:05 -04:00
chaoticgd 42e4a47bfc DebugTools: Fix some compiler warnings 2024-08-28 23:29:35 +02:00
chaoticgd 79dbc272b8 Debugger: Add symbol tree widgets for functions and variables
This adds three new tabs in the debugger: The Globals tab, the Locals
tab and the Parameters tab. In addition, it rewrites the Functions tab.

All four of these tabs use the new symbol tree widgets and the
associated model. This allows the user the inspect complex data
structures in memory with full type information.

Lastly, new dialogs have been added for creating symbols.
2024-08-27 12:48:40 -04:00
chaoticgd 44b50bee26 Debugger: Replace SymbolMap class with new SymbolGuardian class
This new class uses the CCC library I added in the last commit and
parses the symbol tables on a worker thread.
2024-08-27 12:48:40 -04:00
chaoticgd b43e05a8fc Debugger: Remove the Avast demangler
This library doesn't support the demangling scheme used by GCC 2.x
compilers and hence doesn't work in lots of cases.
2024-08-27 12:48:40 -04:00
GovanifY 132431b7c8 headers: relicense to GPL-3.0+
also update to 2024 while i'm at it
2024-07-30 17:17:13 -04:00
lightningterror 473df8dad4 Debugger: Cleanup warnings and casts.
MemoryViewWidget.cpp
BreakpointModel.cpp
2024-07-20 23:09:51 +02:00
gooosedev 4bf8b23204 Debugger: change how the nullbyte (0x00) are displayed in the memoryview widget. 2024-07-17 21:55:04 +02:00
Ty Lamontagne 951780b43d Debugger: Implement little endian memory view support 2024-07-17 21:55:04 +02:00
Ty Lamontagne de020978e4 Debugger: Use std::string for bp conditions. Implement memory bp conditions 2024-07-11 11:21:39 -04:00
Ty Lamontagne bdeb0fcb76 Debugger: Disable pseudo ops 2024-06-13 09:56:58 +01:00
Ty Lamontagne f75a0df449 Debugger: Disable the debugger toolbar ctx menu
The context menu by default has a checkbox to hide the toolbar. The
issue is, once the toolbar is hidden you can no longer un-hide it.
2024-04-20 11:56:51 +10:00
Silent 91f16ae45a Debugger/CPUWidget: Make "Go to in Memory View" open the Memory View 2024-04-08 19:54:46 +01:00
Silent 272c0369f1 Debugger: Untangle the breakpoints data flow to resolve races
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
2024-04-08 19:54:46 +01:00
Silent 5e1009b4fb Debugger: Unbind the BP UpdateHandler on destructing DebuggerWindow
Prevents an use-after-free on the DebuggerWindow object
2024-04-08 19:54:46 +01:00
Dan McCarthy a2a6a98635 Debugger: Fixes crash selecting a filter search with new search button
Fixes crash issues when trying to use a search comparison that requires prior results with the New Search button instead of Filter Search.
2024-03-14 01:42:11 +01:00
Dan McCarthy d309e24e60 Debugger: Reduces RAM useage for searches (Act 1)
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.
2024-03-14 01:42:11 +01:00
Dan McCarthy bd032bbcb8 Debugger: Memory search expansions + results count
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.
2024-03-02 14:49:15 +00:00
Dan McCarthy a903387182 Debugger: Add automatic refresh on 1 second interval
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.
2024-02-28 17:07:56 +00:00
Ty Lamontagne 4919f9b18c DebugTools: Add noreturn heuristic 2024-02-28 16:48:54 +00:00
Dan McCarthy f00f0cc846 Debugger: Fixes crash on debugger open when cpu not alive
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.
2024-02-23 11:36:41 +00:00
Ty Lamontagne 78b6323272 DisassemblyWidget: Allow showing opcodes & some key bind modification 2024-02-23 01:28:44 +00:00
Dan McCarthy ce5e66a2d5 Debugger: Migrates Memory Search tab to it's own widget
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.
2024-02-21 00:25:40 +00:00
TheTechnician27 88672dc38f Debugger: Create check for successful QString conversion in MemoryViewerWidget.cpp 2024-02-06 22:02:01 +00:00
Dan McCarthy bc7b0e53f0 Debugger: Adds editing register values via double click
Double clicking a register segment will open the segment edit dialogue that normally has to be accessed by the right click menu.
2024-01-31 14:46:28 +00:00
KamFretoZ 3695862368 Qt/BPM: Minor icon tweaks 2024-01-31 14:45:03 +00:00
lightningterror 2b90451c4a Qt: Fix more compiler warnings.
-Wsign-compare, -Wunused-variable.
2024-01-27 13:30:45 +10:00
Dan McCarthy be208df11b Debugger: Allow copying address of memory search results
Adds the ability to copy the address directly of a memory search result through the right click context menu.
2024-01-25 16:55:43 +10:00
Dan McCarthy 52ccc609cd Debugger: Adds loading breakpoints/saved addresses from settings
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.
2024-01-24 20:06:20 +10:00
Stenzek ef76666e5a Misc: Warning fixes 2024-01-08 23:33:43 +10:00
psykose ab68c570a9 Debugger: initialise SavedAddress.address with 0 instead of NULL 2024-01-08 20:44:26 +10:00
KamFretoZ eef53f1b54 Qt: Minor Translation Fixes 2024-01-06 16:03:19 +00:00
Dan McCarthy 00137c3031 Misc: Uses Qt::UserRole for hardcoded literals & const changes
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.
2024-01-06 13:17:39 +10:00
Dan McCarthy b9c7dacbd1 Debugger: Double clicking Memory Search result switches to memory view tab
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.
2024-01-06 13:17:39 +10:00
Dan McCarthy 3a03b579d2 Debugger: Add Saved Addresses tab widget for bookmarking mem addresses
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.
2024-01-06 13:17:39 +10:00
Dan McCarthy dd55887f4b Debugger: Add support for Not Equals Array filter searches
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.
2024-01-04 20:24:38 +00:00
Dan McCarthy 39b7b29af8 Debugger: Combine Start & End addresses to 1 line & add comparison label
- 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.
2024-01-04 20:24:38 +00:00
Dan McCarthy ecd3b87cc0
Debugger: Fix Importing Breakpoints CSV functionality (#10486)
* 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.
2023-12-30 14:01:30 +10:00
KamFretoZ b0ae2caef8 Qt/Translation: Attempt to fill in missing descriptions in settings 2023-12-28 13:34:06 +10:00
Stenzek d9abe10308 Misc: Remove explicit PCH include, switch to SPDX 2023-12-24 14:03:14 +10:00