pub struct Function { /* private fields */ }
Expand description
This structure represents an editable DWARF function (DW_TAG_subprogram
)
Implementations§
§impl Function
impl Function
pub fn set_address(&mut self, addr: u64) -> &mut Self
pub fn set_address(&mut self, addr: u64) -> &mut Self
Set the address of this function by defining DW_AT_entry_pc
pub fn set_low_high(&mut self, low: u64, high: u64) -> &mut Self
pub fn set_low_high(&mut self, low: u64, high: u64) -> &mut Self
Set the upper and lower bound addresses for this function. This assumes
that the function is contiguous between low
and high
.
Underneath, the function defines DW_AT_low_pc
and DW_AT_high_pc
pub fn set_ranges(&mut self, ranges: &[Range]) -> &mut Self
pub fn set_ranges(&mut self, ranges: &[Range]) -> &mut Self
Set the ranges of addresses owned by the implementation of this function
by setting the DW_AT_ranges
attribute.
This setter should be used for non-contiguous function.
pub fn set_external(&mut self) -> &mut Self
pub fn set_external(&mut self) -> &mut Self
Set the function as external by defining DW_AT_external
to true.
This means that the function is imported by the current compilation unit.
pub fn set_return_type(&mut self, ty: &dyn EditorType) -> &mut Self
pub fn set_return_type(&mut self, ty: &dyn EditorType) -> &mut Self
Set the return type of this function
pub fn add_parameter(&mut self, name: &str, ty: &dyn EditorType) -> Parameter
pub fn add_parameter(&mut self, name: &str, ty: &dyn EditorType) -> Parameter
Add a parameter to the current function
pub fn create_stack_variable(&mut self, name: &str) -> Variable
pub fn create_stack_variable(&mut self, name: &str) -> Variable
Create a stack-based variable owned by the current function
pub fn add_lexical_block(&mut self, start: u64, end: u64) -> LexicalBlock
pub fn add_lexical_block(&mut self, start: u64, end: u64) -> LexicalBlock
Add a lexical block with the given range