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

write: implement .debug_frame #412

Merged
merged 2 commits into from
Apr 5, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions src/read/cfi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1386,6 +1386,22 @@ impl<R: Reader> CommonInformationEntry<R> {
self.augmentation.as_ref()
}

/// True if this CIE's FDEs have a LSDA.
pub fn has_lsda(&self) -> bool {
self.augmentation.map_or(false, |a| a.lsda.is_some())
}

/// Return the address of the personality routine handler
/// for this CIE's FDEs.
pub fn personality(&self) -> Option<Pointer> {
self.augmentation.as_ref().and_then(|a| a.personality)
}

/// True if this CIE's FDEs are trampolines for signal handlers.
pub fn is_signal_trampoline(&self) -> bool {
self.augmentation.map_or(false, |a| a.is_signal_trampoline)
}

/// > A constant that is factored out of all advance location instructions
/// > (see Section 6.4.2.1).
pub fn code_alignment_factor(&self) -> u64 {
Expand Down Expand Up @@ -1702,17 +1718,17 @@ impl<R: Reader> FrameDescriptionEntry<R> {
}

/// Return true if this FDE's function is a trampoline for a signal handler.
#[inline]
pub fn is_signal_trampoline(&self) -> bool {
self.cie()
.augmentation
.map_or(false, |a| a.is_signal_trampoline)
self.cie().is_signal_trampoline()
}

/// Return the address of the FDE's function's personality routine
/// handler. The personality routine does language-specific clean up when
/// unwinding the stack frames with the intent to not run them again.
#[inline]
pub fn personality(&self) -> Option<Pointer> {
self.cie().augmentation.as_ref().and_then(|a| a.personality)
self.cie().personality()
}
}

Expand Down
Loading