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: Bring back the expression parser #11769

Merged
merged 1 commit into from
Sep 2, 2024

Conversation

chaoticgd
Copy link
Contributor

@chaoticgd chaoticgd commented Sep 1, 2024

Description of Changes

The old wxWidgets debugger used the expression parser for the Go To In Memory View and Go To In Disassembly dialogs, however previously the Qt debugger did not. This brings back that missing functionality.

In addition, I've made it so it should now be possible to translate the error messages generated by the expression parser. I've made some changes to its logic to fix an annoyance where it wouldn't accept a hex value starting with a letter (e.g. "f0000") without a base suffx, and to fix some stack buffer overflows.

It fixes an issue introduced by my symbol table PR where it would try to lookup symbols by their demangled names, even though the expression parser only supports parsing mangled/C-style symbol names. The approach I've taken is to build maps of the mangled names in MipsExpressionFunctions::MipsExpressionFunctions since while this restores the previous functionality, I don't think it's ideal. Improving this behaviour would require a more substantial rewrite of the expression parser.

To make the behaviour explained above more practical, I've added an option in the function and global variable symbol trees to copy the mangled name of a symbol to the clipboard.

Rationale behind Changes

This was a very useful feature.

Suggested Testing Steps

  • Make sure the go to dialogs still work.
  • Make sure the breakpoints dialog still works.
  • Try entering expressions containing really long tokens (more than 255 characters) in the breakpoint dialog and observe that PCSX2 doesn't crash now.

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.

LGTM

@F0bes F0bes merged commit 90463a4 into PCSX2:master Sep 2, 2024
12 checks passed
@chaoticgd chaoticgd deleted the qt_expression_parser branch September 2, 2024 20:29
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.

2 participants