pub struct Function {
pub range: AddressRange,
pub name: Vec<u8>,
pub lines: Vec<LineEntry>,
pub inline: Option<InlineNode>,
pub merged: Vec<Self>,
pub call_sites: Vec<CallSite>,
}Expand description
Owned semantic function data accepted by a GSYM builder.
Only range and name are required;
Function::new fills in the rest as empty. A function with no line rows
and no inline tree still resolves an address to a name and an offset.
use gsym::{AddressRange, Function, LineEntry, FileIndex};
let plain = Function::new(AddressRange::new(0x1000, 0x1010), b"plain");
assert!(plain.lines.is_empty());
let with_lines = Function {
lines: vec![LineEntry::new(0x1000, FileIndex::new(1), 42)],
..Function::new(AddressRange::new(0x1000, 0x1010), b"detailed")
};
assert_eq!(with_lines.lines.len(), 1);merged holds aliases that share this function’s address
range, which identical-code folding produces. They are written only when
FunctionSetPolicy::MergeEqualRanges is
enabled.
Fields§
§range: AddressRangeFunction address range.
name: Vec<u8>Function name as raw string-table bytes.
lines: Vec<LineEntry>Sorted source-line rows belonging to this function.
inline: Option<InlineNode>Root of the inline-call tree, when present.
merged: Vec<Self>Equal-range aliases stored as merged FunctionInfo records.
call_sites: Vec<CallSite>Call-site metadata for this function.
Implementations§
Trait Implementations§
impl Eq for Function
Source§impl Ord for Function
impl Ord for Function
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Function
impl PartialOrd for Function
impl StructuralPartialEq for Function
Auto Trait Implementations§
impl Freeze for Function
impl RefUnwindSafe for Function
impl Send for Function
impl Sync for Function
impl Unpin for Function
impl UnsafeUnpin for Function
impl UnwindSafe for Function
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more