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

PPC: Guess reloc data type based on the instruction. #108

Merged
merged 3 commits into from
Sep 26, 2024

Conversation

SquareMan
Copy link
Contributor

Adds an entry to the reloc tooltip to show the inferred data type and value.

This is potentially somewhat rough. I'm opening this get early feedback on the implementation. If this is deemed acceptable as is, it currently only implements PowerPC and I would be planning to follow up with a similar implementation for MIPS. I would also like to followup with an extension to the right-click context menu to copy the value of a reloc.
For integers: Unsigned and Signed interpretations are displayed (signed is only shown when value would be negative)

Arguably the string display should be removed as it may be somewhat confusing that it doesn't necessarily correspond to the string being used by the code.

Images:
image
image
image
image
image
image

Adds an entry to the reloc tooltip to show the inferred data type
and value.
Copy link
Owner

@encounter encounter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a ton for this! Great start. I'm happy to merge as-is, just let me know if you're interested in making any of these changes

objdiff-core/src/arch/mod.rs Show resolved Hide resolved
objdiff-core/src/arch/ppc.rs Outdated Show resolved Hide resolved
.and_then(|ty| arch.display_data_type(ty, &reloc.target.bytes))
{
ui.colored_label(appearance.highlight_color, s);
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add this to the context menu as well? So you can copy the float value. Would require splitting out the label and value for display

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was one of the things I wanted to do in a followup. It might be a bit before I can get the time again to figure it out.

@SquareMan
Copy link
Contributor Author

@encounter What is your opinion on the stringBase thing? Leave it in or take it out to avoid confusion. Personally I'm somewhat leaning towards the latter unless we can figure out a better UX for the string pool

@encounter
Copy link
Owner

I'm okay with either, though I agree it's a little confusing.

@SquareMan
Copy link
Contributor Author

@encounter I really don't like this solution to the matching on opcode problem. Do you have a better solution than transmuting?

@encounter
Copy link
Owner

Transmuting is fine for now. Thanks for the work on this!

@encounter encounter merged commit a43320a into encounter:main Sep 26, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants