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
PPCSymbolDB: Fix getting symbol for the last function #10924
PPCSymbolDB: Fix getting symbol for the last function #10924
Conversation
|
FifoCI detected that this change impacts graphical rendering. Here are the behavior differences detected by the system:
automated-fifoci-reporter |
|
It took me a minute to understand why this works for the very first address: It hits the |
|
I think this would be clearer as: |
|
That has the exact same bug as the old code; |
|
Aaah yup you're right, lower_bound is confusing me. I guess this is fine as-is then. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
| if (it != m_functions.end()) | ||
| { | ||
| // If the address is exactly the start address of a symbol, we're done. | ||
| if (it->second.address == addr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This if statement can be combined with the above one: it != m_functions.end() && it->second.address == addr. Feel free to ignore this comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's a bit more readable this way since the one below needs to be two separate statements, so having this one be two makes it a bit more consistent.
It's easiest to illustrate the bug that I fixed with an example from System Menu 4.3U (the functions I'm using here are arbitrary, chosen just because they're short):
(In the debugger, to set the address, use the top-left text field labeled search address, and to add a function, right-click the specified address and select "add function" (2nd entry in the bottom group, below "run to here").)
This is an issue I ran into on #10923, and doesn't just affect "add function".