pub struct Function<'a> { /* private fields */ }
Expand description
This structure represents a DWARF function which can be associated with either:
DW_TAG_subprogram
or DW_TAG_inlined_subroutine
.
Implementations§
§impl Function<'_>
impl Function<'_>
pub fn linkage_name(&self) -> String
pub fn linkage_name(&self) -> String
The name of the function which is used for linking (DW_AT_linkage_name
).
This name differs from Function::name
as it is usually mangled. The function
return an empty string if the linkage name is not available.
pub fn address(&self) -> Result<u64, Error>
pub fn address(&self) -> Result<u64, Error>
Return the address of the function (DW_AT_entry_pc
or DW_AT_low_pc
).
pub fn variables(&self) -> Variables<'_> ⓘ
pub fn variables(&self) -> Variables<'_> ⓘ
Return an iterator of variables (DW_TAG_variable
) defined within the
scope of this function. This includes regular stack-based variables as
well as static ones.
pub fn is_artificial(&self) -> bool
pub fn is_artificial(&self) -> bool
Whether this function is created by the compiler and not present in the original source code
pub fn is_external(&self) -> bool
pub fn is_external(&self) -> bool
Whether the function is defined outside the compilation unit (DW_AT_external
)
pub fn debug_location(&self) -> DebugLocation
pub fn debug_location(&self) -> DebugLocation
Original source code location
pub fn return_type(&self) -> Option<Type<'_>>
pub fn return_type(&self) -> Option<Type<'_>>
Return the Type
associated with the return type of this function.
pub fn parameters(&self) -> ParametersIt<'_> ⓘ
pub fn parameters(&self) -> ParametersIt<'_> ⓘ
Return an iterator over the Parameters
of this function
pub fn thrown_types(&self) -> ThrownTypes<'_> ⓘ
pub fn thrown_types(&self) -> ThrownTypes<'_> ⓘ
List of exceptions (types) that can be thrown by the function.
For instance, given this Swift code:
func summarize(_ ratings: [Int]) throws(StatisticsError) {
// ...
}
Function::thrown_types
returns one element associated with the Type
:
StatisticsError
.