Skip to content

StackFrames

Description

Vec-flavoured handle for stack frames. The Vec form of every public capture / format function consumes this.

Usage example (Cross-references)

Usage examples (Cross-references)
    // Vec-form versions of the capture helpers; same call shape as the
    // raw helpers above, just routed through the StackFrames overload.
    static __attribute__((noinline)) bool bt_vec_capture_with_helper(StackFrames *out) {
        return CaptureStackTrace(out, 0);
    }
    }
    
    static __attribute__((noinline)) bool bt_vec_capture_outer(StackFrames *out) {
        return bt_vec_capture_with_helper(out);
    }
        Allocator       *alloc_base = ALLOCATOR_OF(&alloc);
    
        StackFrames frames = VecInitT(frames, alloc_base);
        bool        ok     = bt_vec_capture_outer(&frames);
        ok                 = ok && frames.length >= 2;
    
    typedef struct VecSinkCtx {
        StackFrames *vec;
        bool         oom;
    } VecSinkCtx;
    }
    
    bool capture_stack_trace_vec(StackFrames *out, size skip_frames) {
        if (!out || !out->allocator)
            return false;
    }
    
    void format_stack_trace_vec(Str *out, const StackFrames *frames, Allocator *alloc) {
        if (!out || !frames)
            return;
    }
    
    bool capture_stack_trace_vec(StackFrames *out, size skip_frames) {
        if (!out || !out->allocator)
            return false;
    }
    
    void format_stack_trace_vec(Str *out, const StackFrames *frames, Allocator *alloc) {
        if (!out || !frames || !alloc)
            return;
    }
    
    bool capture_stack_trace_vec(StackFrames *out, size skip_frames) {
        if (!out || !out->allocator)
            return false;
    }
    
    void format_stack_trace_with_vec(Str *out, const StackFrames *frames, SymbolResolver *resolver) {
        if (!out || !frames || !resolver)
            return;
    }
    
    void format_stack_trace_vec(Str *out, const StackFrames *frames, Allocator *alloc) {
        if (!out || !frames || !alloc)
            return;
    }
    
    bool capture_stack_trace_cfi_vec(StackFrames *out, size skip_frames, SymbolResolver *resolver) {
        if (!out || !out->allocator || !resolver)
            return false;
        return 0;
    }
    bool capture_stack_trace_cfi_vec(StackFrames *out, size skip_frames, SymbolResolver *resolver) {
        (void)out;
        (void)skip_frames;
    /// FAILURE : Returns false on allocator OOM during the walk.
    ///
    bool capture_stack_trace_vec(StackFrames *out, size skip_frames);
    
    #if MISRA_HAVE_SYS_SYMRESOLVE && MISRA_HAVE_PARSER_DWARF
    ///
    size capture_stack_trace_cfi_raw(StackFrame *out, size max_frames, size skip_frames, SymbolResolver *resolver);
    bool capture_stack_trace_cfi_vec(StackFrames *out, size skip_frames, SymbolResolver *resolver);
    #endif
    /// Vec formatter: same as raw but consumes a `StackFrames *`.
    ///
    void format_stack_trace_vec(Str *out, const StackFrames *frames, Allocator *alloc);
    
    #if MISRA_HAVE_SYS_SYMRESOLVE
    ///
    void format_stack_trace_with_raw(Str *out, const StackFrame *frames, size count, SymbolResolver *resolver);
    void format_stack_trace_with_vec(Str *out, const StackFrames *frames, SymbolResolver *resolver);
    #endif
Last updated on