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

Exception table diff view #82

Merged
merged 34 commits into from
Jul 22, 2024
Merged

Exception table diff view #82

merged 34 commits into from
Jul 22, 2024

Conversation

CelestialAmber
Copy link
Contributor

This adds a new view which shows the decoded exception tables (extab) for functions which have them, accessible via an option in the right click context menu. The decoded data is listed out as plain text on both sides for both objects, much like the other diff views. No form of diffing is implemented yet, but to start out with we could use text diffing for now, and maybe later on transition to displaying the data in a fancier way that could more easily be diffed.

@CelestialAmber CelestialAmber marked this pull request as draft July 13, 2024 16:48
@CelestialAmber CelestialAmber marked this pull request as ready for review July 13, 2024 17:14
@CelestialAmber CelestialAmber changed the title [DRAFT] Exception table diff view Exception table diff view Jul 13, 2024
@CelestialAmber CelestialAmber marked this pull request as draft July 13, 2024 17:29
@CelestialAmber CelestialAmber marked this pull request as ready for review July 13, 2024 17:33
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 for this! Looks great overall, just a few nits

/* Get the function symbol and extab symbol from the extabindex relocations array. Each extabindex
entry has two relocations (the first for the function, the second for the extab entry) */
let extab_func = extabindex_section.relocations[i * 2].target.clone();
let extab = &extabindex_section.relocations[(i * 2) + 1].target;
Copy link
Owner

Choose a reason for hiding this comment

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

Seems dangerous to assume the index of relocations. Can we fetch these by either source address or target symbol?

let mut dtors: Vec<ObjSymbol> = vec![];

while extab_reloc_index < extab_reloc_count {
let extab_reloc = &extab_section.relocations[extab_reloc_index];
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 also sanity check that these are Absolute relocations? In case something else sneaks in... not sure how though

@encounter
Copy link
Owner

One lingering issue is that this will break builds without feature ppc enabled, but I'll handle that as a part of upcoming refactoring work. Thanks for the feature!

@encounter encounter merged commit 75b0e7d into encounter:main Jul 22, 2024
10 checks passed
@CelestialAmber CelestialAmber deleted the extab branch September 25, 2024 19:56
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