mirror of
https://github.com/edg-l/edlang.git
synced 2024-11-10 01:58:23 +00:00
125 lines
26 KiB
HTML
125 lines
26 KiB
HTML
|
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="A section holding unwind information: either `.debug_frame` or `.eh_frame`. See `DebugFrame` and `EhFrame` respectively."><title>UnwindSection in gimli::read - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../static.files/rustdoc-ac92e1bbe349e143.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="gimli" data-themes="" data-resource-suffix="" data-rustdoc-version="1.76.0 (07dca489a 2024-02-04)" data-channel="1.76.0" data-search-js="search-2b6ce74ff89ae146.js" data-settings-js="settings-4313503d2e1961c2.js" ><script src="../../static.files/storage-f2adc0d6ca4d09fb.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-305769736d49e732.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-feafe1bb7466e4bd.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-16x16-8b506e7a72182f1c.png"><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-422f7d1d52889060.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-2c020d218678b618.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">☰</button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../gimli/index.html">gimli</a><span class="version">0.28.1</span></h2></div><h2 class="location"><a href="#">UnwindSection</a></h2><div class="sidebar-elems"><section><h3><a href="#required-associated-types">Required Associated Types</a></h3><ul class="block"><li><a href="#associatedtype.Offset">Offset</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.cie_from_offset">cie_from_offset</a></li><li><a href="#method.entries">entries</a></li><li><a href="#method.fde_for_address">fde_for_address</a></li><li><a href="#method.fde_from_offset">fde_from_offset</a></li><li><a href="#method.partial_fde_from_offset">partial_fde_from_offset</a></li><li><a href="#method.unwind_info_for_address">unwind_info_for_address</a></li></ul><h3><a href="#object-safety">Object Safety</a></h3><h3><a href="#implementors">Implementors</a></h3></section><h2><a href="index.html">In gimli::read</a></h2></div></nav><div class="sidebar-resizer"></div>
|
|||
|
<main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><div id="sidebar-button" tabindex="-1"><a href="../../gimli/all.html" title="show sidebar"></a></div><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" tabindex="-1"><a href="../../help.html" title="help">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Trait <a href="../index.html">gimli</a>::<wbr><a href="index.html">read</a>::<wbr><a class="trait" href="#">UnwindSection</a><button id="copy-path" title="Copy item path to clipboard"><img src="../../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="src" href="../../src/gimli/read/cfi.rs.html#644-794">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>−</span>]</button></span></div><pre class="rust item-decl"><code>pub trait UnwindSection<R: <a class="trait" href="trait.Reader.html" title="trait gimli::read::Reader">Reader</a>>: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> + <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> + _UnwindSectionPrivate<R> {
|
|||
|
type <a href="#associatedtype.Offset" class="associatedtype">Offset</a>: <a class="trait" href="trait.UnwindOffset.html" title="trait gimli::read::UnwindOffset">UnwindOffset</a><R::<a class="associatedtype" href="trait.Reader.html#associatedtype.Offset" title="type gimli::read::Reader::Offset">Offset</a>>;
|
|||
|
|
|||
|
// Provided methods
|
|||
|
fn <a href="#method.entries" class="fn">entries</a><'bases>(
|
|||
|
&self,
|
|||
|
bases: &'bases <a class="struct" href="struct.BaseAddresses.html" title="struct gimli::read::BaseAddresses">BaseAddresses</a>
|
|||
|
) -> <a class="struct" href="struct.CfiEntriesIter.html" title="struct gimli::read::CfiEntriesIter">CfiEntriesIter</a><'bases, Self, R> { ... }
|
|||
|
<span class="item-spacer"></span> fn <a href="#method.cie_from_offset" class="fn">cie_from_offset</a>(
|
|||
|
&self,
|
|||
|
bases: &<a class="struct" href="struct.BaseAddresses.html" title="struct gimli::read::BaseAddresses">BaseAddresses</a>,
|
|||
|
offset: Self::<a class="associatedtype" href="trait.UnwindSection.html#associatedtype.Offset" title="type gimli::read::UnwindSection::Offset">Offset</a>
|
|||
|
) -> <a class="type" href="type.Result.html" title="type gimli::read::Result">Result</a><<a class="struct" href="struct.CommonInformationEntry.html" title="struct gimli::read::CommonInformationEntry">CommonInformationEntry</a><R>> { ... }
|
|||
|
<span class="item-spacer"></span> fn <a href="#method.partial_fde_from_offset" class="fn">partial_fde_from_offset</a><'bases>(
|
|||
|
&self,
|
|||
|
bases: &'bases <a class="struct" href="struct.BaseAddresses.html" title="struct gimli::read::BaseAddresses">BaseAddresses</a>,
|
|||
|
offset: Self::<a class="associatedtype" href="trait.UnwindSection.html#associatedtype.Offset" title="type gimli::read::UnwindSection::Offset">Offset</a>
|
|||
|
) -> <a class="type" href="type.Result.html" title="type gimli::read::Result">Result</a><<a class="struct" href="struct.PartialFrameDescriptionEntry.html" title="struct gimli::read::PartialFrameDescriptionEntry">PartialFrameDescriptionEntry</a><'bases, Self, R>> { ... }
|
|||
|
<span class="item-spacer"></span> fn <a href="#method.fde_from_offset" class="fn">fde_from_offset</a><F>(
|
|||
|
&self,
|
|||
|
bases: &<a class="struct" href="struct.BaseAddresses.html" title="struct gimli::read::BaseAddresses">BaseAddresses</a>,
|
|||
|
offset: Self::<a class="associatedtype" href="trait.UnwindSection.html#associatedtype.Offset" title="type gimli::read::UnwindSection::Offset">Offset</a>,
|
|||
|
get_cie: F
|
|||
|
) -> <a class="type" href="type.Result.html" title="type gimli::read::Result">Result</a><<a class="struct" href="struct.FrameDescriptionEntry.html" title="struct gimli::read::FrameDescriptionEntry">FrameDescriptionEntry</a><R>>
|
|||
|
<span class="where">where F: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(<a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.reference.html">&Self</a>, &<a class="struct" href="struct.BaseAddresses.html" title="struct gimli::read::BaseAddresses">BaseAddresses</a>, Self::<a class="associatedtype" href="trait.UnwindSection.html#associatedtype.Offset" title="type gimli::read::UnwindSection::Offset">Offset</a>) -> <a class="type" href="type.Result.html" title="type gimli::read::Result">Result</a><<a class="struct" href="struct.CommonInformationEntry.html" title="struct gimli::read::CommonInformationEntry">CommonInformationEntry</a><R>></span> { ... }
|
|||
|
<span class="item-spacer"></span> fn <a href="#method.fde_for_address" class="fn">fde_for_address</a><F>(
|
|||
|
&self,
|
|||
|
bases: &<a class="struct" href="struct.BaseAddresses.html" title="struct gimli::read::BaseAddresses">BaseAddresses</a>,
|
|||
|
address: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u64.html">u64</a>,
|
|||
|
get_cie: F
|
|||
|
) -> <a class="type" href="type.Result.html" title="type gimli::read::Result">Result</a><<a class="struct" href="struct.FrameDescriptionEntry.html" title="struct gimli::read::FrameDescriptionEntry">FrameDescriptionEntry</a><R>>
|
|||
|
<span class="where">where F: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(<a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.reference.html">&Self</a>, &<a class="struct" href="struct.BaseAddresses.html" title="struct gimli::read::BaseAddresses">BaseAddresses</a>, Self::<a class="associatedtype" href="trait.UnwindSection.html#associatedtype.Offset" title="type gimli::read::UnwindSection::Offset">Offset</a>) -> <a class="type" href="type.Result.html" title="type gimli::read::Result">Result</a><<a class="struct" href="struct.CommonInformationEntry.html" title="struct gimli::read::CommonInformationEntry">CommonInformationEntry</a><R>></span> { ... }
|
|||
|
<span class="item-spacer"></span> fn <a href="#method.unwind_info_for_address" class="fn">unwind_info_for_address</a><'ctx, F, A: <a class="trait" href="trait.UnwindContextStorage.html" title="trait gimli::read::UnwindContextStorage">UnwindContextStorage</a><R>>(
|
|||
|
&self,
|
|||
|
bases: &<a class="struct" href="struct.BaseAddresses.html" title="struct gimli::read::BaseAddresses">BaseAddresses</a>,
|
|||
|
ctx: &'ctx mut <a class="struct" href="struct.UnwindContext.html" title="struct gimli::read::UnwindContext">UnwindContext</a><R, A>,
|
|||
|
address: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u64.html">u64</a>,
|
|||
|
get_cie: F
|
|||
|
) -> <a class="type" href="type.Result.html" title="type gimli::read::Result">Result</a><&'ctx <a class="struct" href="struct.UnwindTableRow.html" title="struct gimli::read::UnwindTableRow">UnwindTableRow</a><R, A>>
|
|||
|
<span class="where">where F: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(<a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.reference.html">&Self</a>, &<a class="struct" href="struct.BaseAddresses.html" title="struct gimli::read::BaseAddresses">BaseAddresses</a>, Self::<a class="associatedtype" href="trait.UnwindSection.html#associatedtype.Offset" title="type gimli::read::UnwindSection::Offset">Offset</a>) -> <a class="type" href="type.Result.html" title="type gimli::read::Result">Result</a><<a class="struct" href="struct.CommonInformationEntry.html" title="struct gimli::read::CommonInformationEntry">CommonInformationEntry</a><R>></span> { ... }
|
|||
|
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A section holding unwind information: either <code>.debug_frame</code> or
|
|||
|
<code>.eh_frame</code>. See <a href="./struct.DebugFrame.html"><code>DebugFrame</code></a> and
|
|||
|
<a href="./struct.EhFrame.html"><code>EhFrame</code></a> respectively.</p>
|
|||
|
</div></details><h2 id="required-associated-types" class="section-header">Required Associated Types<a href="#required-associated-types" class="anchor">§</a></h2><div class="methods"><details class="toggle" open><summary><section id="associatedtype.Offset" class="method"><a class="src rightside" href="../../src/gimli/read/cfi.rs.html#647">source</a><h4 class="code-header">type <a href="#associatedtype.Offset" class="associatedtype">Offset</a>: <a class="trait" href="trait.UnwindOffset.html" title="trait gimli::read::UnwindOffset">UnwindOffset</a><R::<a class="associatedtype" href="trait.Reader.html#associatedtype.Offset" title="type gimli::read::Reader::Offset">Offset</a>></h4></section></summary><div class="docblock"><p>The offset type associated with this CFI section. Either
|
|||
|
<code>DebugFrameOffset</code> or <code>EhFrameOffset</code>.</p>
|
|||
|
</div></details></div><h2 id="provided-methods" class="section-header">Provided Methods<a href="#provided-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="method.entries" class="method"><a class="src rightside" href="../../src/gimli/read/cfi.rs.html#654-660">source</a><h4 class="code-header">fn <a href="#method.entries" class="fn">entries</a><'bases>(
|
|||
|
&self,
|
|||
|
bases: &'bases <a class="struct" href="struct.BaseAddresses.html" title="struct gimli::read::BaseAddresses">BaseAddresses</a>
|
|||
|
) -> <a class="struct" href="struct.CfiEntriesIter.html" title="struct gimli::read::CfiEntriesIter">CfiEntriesIter</a><'bases, Self, R></h4></section></summary><div class="docblock"><p>Iterate over the <code>CommonInformationEntry</code>s and <code>FrameDescriptionEntry</code>s
|
|||
|
in this <code>.debug_frame</code> section.</p>
|
|||
|
<p>Can be <a href="./index.html#using-with-fallibleiterator">used with
|
|||
|
<code>FallibleIterator</code></a>.</p>
|
|||
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.cie_from_offset" class="method"><a class="src rightside" href="../../src/gimli/read/cfi.rs.html#663-672">source</a><h4 class="code-header">fn <a href="#method.cie_from_offset" class="fn">cie_from_offset</a>(
|
|||
|
&self,
|
|||
|
bases: &<a class="struct" href="struct.BaseAddresses.html" title="struct gimli::read::BaseAddresses">BaseAddresses</a>,
|
|||
|
offset: Self::<a class="associatedtype" href="trait.UnwindSection.html#associatedtype.Offset" title="type gimli::read::UnwindSection::Offset">Offset</a>
|
|||
|
) -> <a class="type" href="type.Result.html" title="type gimli::read::Result">Result</a><<a class="struct" href="struct.CommonInformationEntry.html" title="struct gimli::read::CommonInformationEntry">CommonInformationEntry</a><R>></h4></section></summary><div class="docblock"><p>Parse the <code>CommonInformationEntry</code> at the given offset.</p>
|
|||
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.partial_fde_from_offset" class="method"><a class="src rightside" href="../../src/gimli/read/cfi.rs.html#675-684">source</a><h4 class="code-header">fn <a href="#method.partial_fde_from_offset" class="fn">partial_fde_from_offset</a><'bases>(
|
|||
|
&self,
|
|||
|
bases: &'bases <a class="struct" href="struct.BaseAddresses.html" title="struct gimli::read::BaseAddresses">BaseAddresses</a>,
|
|||
|
offset: Self::<a class="associatedtype" href="trait.UnwindSection.html#associatedtype.Offset" title="type gimli::read::UnwindSection::Offset">Offset</a>
|
|||
|
) -> <a class="type" href="type.Result.html" title="type gimli::read::Result">Result</a><<a class="struct" href="struct.PartialFrameDescriptionEntry.html" title="struct gimli::read::PartialFrameDescriptionEntry">PartialFrameDescriptionEntry</a><'bases, Self, R>></h4></section></summary><div class="docblock"><p>Parse the <code>PartialFrameDescriptionEntry</code> at the given offset.</p>
|
|||
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.fde_from_offset" class="method"><a class="src rightside" href="../../src/gimli/read/cfi.rs.html#687-698">source</a><h4 class="code-header">fn <a href="#method.fde_from_offset" class="fn">fde_from_offset</a><F>(
|
|||
|
&self,
|
|||
|
bases: &<a class="struct" href="struct.BaseAddresses.html" title="struct gimli::read::BaseAddresses">BaseAddresses</a>,
|
|||
|
offset: Self::<a class="associatedtype" href="trait.UnwindSection.html#associatedtype.Offset" title="type gimli::read::UnwindSection::Offset">Offset</a>,
|
|||
|
get_cie: F
|
|||
|
) -> <a class="type" href="type.Result.html" title="type gimli::read::Result">Result</a><<a class="struct" href="struct.FrameDescriptionEntry.html" title="struct gimli::read::FrameDescriptionEntry">FrameDescriptionEntry</a><R>><div class="where">where
|
|||
|
F: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(<a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.reference.html">&Self</a>, &<a class="struct" href="struct.BaseAddresses.html" title="struct gimli::read::BaseAddresses">BaseAddresses</a>, Self::<a class="associatedtype" href="trait.UnwindSection.html#associatedtype.Offset" title="type gimli::read::UnwindSection::Offset">Offset</a>) -> <a class="type" href="type.Result.html" title="type gimli::read::Result">Result</a><<a class="struct" href="struct.CommonInformationEntry.html" title="struct gimli::read::CommonInformationEntry">CommonInformationEntry</a><R>>,</div></h4></section></summary><div class="docblock"><p>Parse the <code>FrameDescriptionEntry</code> at the given offset.</p>
|
|||
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.fde_for_address" class="method"><a class="src rightside" href="../../src/gimli/read/cfi.rs.html#711-733">source</a><h4 class="code-header">fn <a href="#method.fde_for_address" class="fn">fde_for_address</a><F>(
|
|||
|
&self,
|
|||
|
bases: &<a class="struct" href="struct.BaseAddresses.html" title="struct gimli::read::BaseAddresses">BaseAddresses</a>,
|
|||
|
address: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u64.html">u64</a>,
|
|||
|
get_cie: F
|
|||
|
) -> <a class="type" href="type.Result.html" title="type gimli::read::Result">Result</a><<a class="struct" href="struct.FrameDescriptionEntry.html" title="struct gimli::read::FrameDescriptionEntry">FrameDescriptionEntry</a><R>><div class="where">where
|
|||
|
F: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(<a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.reference.html">&Self</a>, &<a class="struct" href="struct.BaseAddresses.html" title="struct gimli::read::BaseAddresses">BaseAddresses</a>, Self::<a class="associatedtype" href="trait.UnwindSection.html#associatedtype.Offset" title="type gimli::read::UnwindSection::Offset">Offset</a>) -> <a class="type" href="type.Result.html" title="type gimli::read::Result">Result</a><<a class="struct" href="struct.CommonInformationEntry.html" title="struct gimli::read::CommonInformationEntry">CommonInformationEntry</a><R>>,</div></h4></section></summary><div class="docblock"><p>Find the <code>FrameDescriptionEntry</code> for the given address.</p>
|
|||
|
<p>If found, the FDE is returned. If not found,
|
|||
|
<code>Err(gimli::Error::NoUnwindInfoForAddress)</code> is returned.
|
|||
|
If parsing fails, the error is returned.</p>
|
|||
|
<p>You must provide a function to get its associated CIE. See
|
|||
|
<code>PartialFrameDescriptionEntry::parse</code> for more information.</p>
|
|||
|
<p>Note: this iterates over all FDEs. If available, it is possible
|
|||
|
to do a binary search with <code>EhFrameHdr::fde_for_address</code> instead.</p>
|
|||
|
</div></details><details class="toggle method-toggle" open><summary><section id="method.unwind_info_for_address" class="method"><a class="src rightside" href="../../src/gimli/read/cfi.rs.html#781-793">source</a><h4 class="code-header">fn <a href="#method.unwind_info_for_address" class="fn">unwind_info_for_address</a><'ctx, F, A: <a class="trait" href="trait.UnwindContextStorage.html" title="trait gimli::read::UnwindContextStorage">UnwindContextStorage</a><R>>(
|
|||
|
&self,
|
|||
|
bases: &<a class="struct" href="struct.BaseAddresses.html" title="struct gimli::read::BaseAddresses">BaseAddresses</a>,
|
|||
|
ctx: &'ctx mut <a class="struct" href="struct.UnwindContext.html" title="struct gimli::read::UnwindContext">UnwindContext</a><R, A>,
|
|||
|
address: <a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.u64.html">u64</a>,
|
|||
|
get_cie: F
|
|||
|
) -> <a class="type" href="type.Result.html" title="type gimli::read::Result">Result</a><&'ctx <a class="struct" href="struct.UnwindTableRow.html" title="struct gimli::read::UnwindTableRow">UnwindTableRow</a><R, A>><div class="where">where
|
|||
|
F: <a class="trait" href="https://doc.rust-lang.org/1.76.0/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(<a class="primitive" href="https://doc.rust-lang.org/1.76.0/core/primitive.reference.html">&Self</a>, &<a class="struct" href="struct.BaseAddresses.html" title="struct gimli::read::BaseAddresses">BaseAddresses</a>, Self::<a class="associatedtype" href="trait.UnwindSection.html#associatedtype.Offset" title="type gimli::read::UnwindSection::Offset">Offset</a>) -> <a class="type" href="type.Result.html" title="type gimli::read::Result">Result</a><<a class="struct" href="struct.CommonInformationEntry.html" title="struct gimli::read::CommonInformationEntry">CommonInformationEntry</a><R>>,</div></h4></section></summary><div class="docblock"><p>Find the frame unwind information for the given address.</p>
|
|||
|
<p>If found, the unwind information is returned. If not found,
|
|||
|
<code>Err(gimli::Error::NoUnwindInfoForAddress)</code> is returned. If parsing or
|
|||
|
CFI evaluation fails, the error is returned.</p>
|
|||
|
|
|||
|
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>gimli::{BaseAddresses, EhFrame, EndianSlice, NativeEndian, UnwindContext,
|
|||
|
UnwindSection};
|
|||
|
|
|||
|
<span class="comment">// Get the `.eh_frame` section from the object file. Alternatively,
|
|||
|
// use `EhFrame` with the `.eh_frame` section of the object file.
|
|||
|
</span><span class="kw">let </span>eh_frame = EhFrame::new(read_eh_frame_section(), NativeEndian);
|
|||
|
|
|||
|
<span class="comment">// Get the address of the PC for a frame you'd like to unwind.
|
|||
|
</span><span class="kw">let </span>address = get_frame_pc();
|
|||
|
|
|||
|
<span class="comment">// This context is reusable, which cuts down on heap allocations.
|
|||
|
</span><span class="kw">let </span>ctx = UnwindContext::new();
|
|||
|
|
|||
|
<span class="comment">// Optionally provide base addresses for any relative pointers. If a
|
|||
|
// base address isn't provided and a pointer is found that is relative to
|
|||
|
// it, we will return an `Err`.
|
|||
|
</span><span class="kw">let </span>bases = BaseAddresses::default()
|
|||
|
.set_text(address_of_text_section_in_memory)
|
|||
|
.set_got(address_of_got_section_in_memory);
|
|||
|
|
|||
|
<span class="kw">let </span>unwind_info = eh_frame.unwind_info_for_address(
|
|||
|
<span class="kw-2">&</span>bases,
|
|||
|
<span class="kw-2">&mut </span>ctx,
|
|||
|
address,
|
|||
|
EhFrame::cie_from_offset,
|
|||
|
)<span class="question-mark">?</span>;
|
|||
|
|
|||
|
do_stuff_with(unwind_info);</code></pre></div>
|
|||
|
</div></details></div><h2 id="object-safety" class="section-header">Object Safety<a href="#object-safety" class="anchor">§</a></h2><div class="object-safety-info">This trait is <b>not</b> <a href="https://doc.rust-lang.org/1.76.0/reference/items/traits.html#object-safety">object safe</a>.</div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><details class="toggle implementors-toggle"><summary><section id="impl-UnwindSection%3CR%3E-for-DebugFrame%3CR%3E" class="impl"><a class="src rightside" href="../../src/gimli/read/cfi.rs.html#840-842">source</a><a href="#impl-UnwindSection%3CR%3E-for-DebugFrame%3CR%3E" class="anchor">§</a><h3 class="code-header">impl<R: <a class="trait" href="trait.Reader.html" title="trait gimli::read::Reader">Reader</a>> <a class="trait" href="trait.UnwindSection.html" title="trait gimli::read::UnwindSection">UnwindSection</a><R> for <a class="struct" href="struct.DebugFrame.html" title="struct gimli::read::DebugFrame">DebugFrame</a><R></h3></section></summary><div class="impl-items"><section id="associatedtype.Offset-1" class="associatedtype trait-impl"><a href="#associatedtype.Offset-1" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Offset" class="associatedtype">Offset</a> = <a class="struct" href="../struct.DebugFrameOffset.html" title="struct gimli::DebugFrameOffset">DebugFrameOffset</a><<R as <a class="trait" href="trait.Reader.html" title="trait gimli::read::Reader">Reader</a>>::<a class="associatedtype" href="trait.Reader.html#associatedtype.Offset" title="type gimli::read::Reader::Offset">Offset</a>></h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-UnwindSection%3CR%3E-for-EhFrame%3CR%3E" class="impl"><a class="src rightside" href="../../src/gimli/read/cfi.rs.html#884-886">source</a><a href="#impl-UnwindSection%3CR%3E-for-EhFrame%3CR%3E" class="anchor">§</a><h3 class="code-header">impl<R: <a class="trait" href="trait.Reader.html" title="trait gimli::read::Reader">Reader</a>> <a class="trait" href="trait.UnwindSection.html" title="trait gimli::read::UnwindSection">UnwindSection</a><R> for <a class="struct" href="struct.EhFrame.html" title="struct gimli::read::EhFrame">EhFrame</a><R></h3></section></summary><div class="impl-items"><section id="associatedtype.Offset-2" class="associatedtype trait-impl"><a href="#associatedtype.Offset-2" class="anchor">§</a><h4 class="code-header">type <a href="#associatedtype.Offset" class="associatedtype">Offset</a> = <a class="struct" href="../struct.EhFrameOffset.html" title="struct gimli::EhFrameOffset">EhFrameOffset</a><<R as <a class="trait" href="trait.Reader.html" title="trait gimli::read::Reader">Reader</a>>::<a class="associatedtype" href="trait.Reader.html#associatedtype.Offset" title="type gimli::read::Reader::Offset">Offset</a>></h4></section></div></details></div><script src="../../trait.impl/gimli/read/cfi/trait.UnwindSection.js" async></script></section></div></main></body></html>
|