Engee documentation

Stack tracing

StackFrame

Stack information that represents the execution context, containing the following fields:

  • func::Symbol

    The name of the function that contains the execution context.

  • linfo::Union{Core.MethodInstance, Method, Module, Core.CodeInfo, Nothing}

    A MethodInstance or CodeInfo object that contains the execution context (if available during the search), or a Module object (for extending macros).

  • file::Symbol

    The path to the file that contains the execution context.

  • line::Int

    The line number in the file that contains the execution context.

  • from_c::Bool

    The value is set to true if the code from C.

  • inlined::Bool

    The value is set to true if the code from the embedded frame is used.

  • pointer::UInt64

    The representation of the address reference to the execution context is returned by `backtrace'.

StackTrace

Alias for Vector{StackFrame}, provided for convenience; returned by calls to `stacktrace'.

stacktrace([trace::Vector{Ptr{Cvoid}},] [c_funcs::Bool=false]) -> StackTrace

Returns a stack trace in the form of a vector of StackFrame objects (stack trace does not return C functions by default, but this feature can be enabled separately). When called without specifying a trace, stacktrace first calls `backtrace'.

The methods and types listed below are in Base.StackTraces are not exported, and they must be called, for example, like this: `StackTraces.lookup(ptr)'.

lookup(pointer::Ptr{Cvoid}) -> Vector{StackFrame}

For a given reference to the execution context (usually created by calling backtrace), it searches through the context information of the stack frame. Returns an array of information about the frame for all functions that are embedded at this stage (the farthest internal function goes first).

remove_frames!(stack::StackTrace, name::Symbol)

Accepts 'StackTrace' (vector StackFrames'), as well as the function name (`Symbol) and deletes the StackFrame specified by the function name from StackTrace (all frames above the specified function are also deleted). It is mainly used to remove StackTraces' functions from `StackTrace before they are returned.


remove_frames!(stack::StackTrace, m::Module)

Returns StackTrace with all 'stackframes` removed from the provided `Module'.