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

fix(macho): Parse debug_str_offs section #895

Merged
merged 4 commits into from
Feb 4, 2025
Merged

Conversation

jjbayer
Copy link
Member

@jjbayer jjbayer commented Feb 3, 2025

For Mach-O files, we need to map the section header name for debug_str_offsets:

https://shadow.github.io/docs/rust/object/read/trait.Object.html#provided-methods

• if “.debug_str_offsets” is requested for a Mach-O object file, then the actual section name that is searched for is “__debug_str_offs”.

Fixes: getsentry/sentry#79268

let obj = MachObject::parse(&data).unwrap();

let sections = DwarfSections::from_dwarf(&obj);
assert_eq!(sections.debug_str_offsets.data.len(), 48);
Copy link
Member Author

Choose a reason for hiding this comment

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

This assertion fails without map_section_name.

@jjbayer jjbayer marked this pull request as ready for review February 4, 2025 12:35
@jjbayer jjbayer requested a review from loewenheim February 4, 2025 12:35
@jjbayer jjbayer changed the title fix(macho): Map section header name fix(macho): Parse debug_str_offs section Feb 4, 2025
@jjbayer jjbayer merged commit 07ad880 into master Feb 4, 2025
17 checks passed
@jjbayer jjbayer deleted the fix/macho-debug-str-offs branch February 4, 2025 12:59
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.

Missing stack frame titles
2 participants