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 options to load extra symbol files conditionally and/or with a base address and more #12002

Merged
merged 7 commits into from
Nov 16, 2024

Conversation

chaoticgd
Copy link
Contributor

@chaoticgd chaoticgd commented Nov 12, 2024

Description of Changes

  • The analysis settings dialog (and the tab in the per-game settings dialog) now lets you specify a base address expression and a load condition expression for each extra symbol file loaded.
  • The start and end addresses for function scanning can now also be expressions.
  • While working on the above item, I moved the function scanner back to running on the main database rather than the temporary database for the importer. I made the reverse change a while back, but this introduced an issue where user-defined functions would be ignored by the function scanner on repeated analysis runs, so I've reverted it back.
  • This exposed a performance issue with running the function scanner on a large invalid address range, hence I've also updated some error handling code in CCC to be more performant.
  • The expression parser now accepts symbols with names starting with an underscore.
  • CCC now generates a name map for label symbols, allowing them to be used in expressions.
  • The expression parser has been updated so that it no longer uses a global variable to report errors.
  • The "Remove" button for extra symbol files is now enabled/disabled depending on if a row is actually selected.
  • If the specified path for loading an extra symbol file is relative, it is now assumed to be relative to the game settings directory.
  • Symbol file paths stored the config file can have either forward slashes or back slashes now, as they are converted into the native operating system format on the fly.

This PR has increased in scope a tad bit since I created it. I will of course incorporate the changes made to CCC here into v2.2 to keep it in sync.

Rationale behind Changes

This is useful for reverse engineering games that use an overlay or dynamic linking system. For example:

Screenshot_20241115_022013

Suggested Testing Steps

Someone should make sure all the path handling code works correctly on Windows, including both absolute paths and paths relative to the game settings directory.

@github-actions github-actions bot added Debugger Dependencies Pull requests that update a dependency file GUI/Qt labels Nov 12, 2024
@chaoticgd chaoticgd force-pushed the more_extra_symbol_files branch 2 times, most recently from 1b3cf3f to ac0a6d9 Compare November 14, 2024 23:37
@chaoticgd chaoticgd changed the title Debugger: Add options to load extra symbol files conditionally and/or with a base address Debugger: Add options to load extra symbol files conditionally and/or with a base address and more Nov 14, 2024
@chaoticgd chaoticgd marked this pull request as ready for review November 15, 2024 17:10
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.

Looks good.
I don't have a test case on me for the overlay condition feature but I am still able to load my external ELF and have the symbols properly imported.

@F0bes F0bes merged commit a507964 into PCSX2:master Nov 16, 2024
12 checks passed
@chaoticgd chaoticgd deleted the more_extra_symbol_files branch November 22, 2024 02:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Debugger Dependencies Pull requests that update a dependency file GUI/Qt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants