libdragon
backtrace.h
Go to the documentation of this file.
1
28#ifndef __LIBDRAGON_BACKTRACE_H
29#define __LIBDRAGON_BACKTRACE_H
30
31#include <stdbool.h>
32#include <stdio.h>
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
41typedef struct {
42 uint32_t addr;
43
44 const char *func;
45 uint32_t func_offset;
46
47 const char *source_file;
49
50 bool is_inline;
52
53
73void backtrace_frame_print(backtrace_frame_t *frame, FILE *out);
74
102void backtrace_frame_print_compact(backtrace_frame_t *frame, FILE *out, int width);
103
125int backtrace(void **buffer, int size);
126
155char** backtrace_symbols(void **buffer, int size);
156
186bool backtrace_symbols_cb(void **buffer, int size, uint32_t flags,
187 void (*cb)(void *, backtrace_frame_t*), void *cb_arg);
188
189#ifdef __cplusplus
190}
191#endif
192
195#endif
const char * source_file
Name of the source file (if known, or "???" otherwise)
Definition: backtrace.h:47
const char * func
Name of the function (this should always be present)
Definition: backtrace.h:44
int source_line
Line number in the source file (if known, or 0 otherwise)
Definition: backtrace.h:48
bool is_inline
True if this frame refers to an inlined function.
Definition: backtrace.h:50
uint32_t func_offset
Byte offset of the address within the function.
Definition: backtrace.h:45
uint32_t addr
PC address of the frame (MIPS virtual address)
Definition: backtrace.h:42
void backtrace_frame_print_compact(backtrace_frame_t *frame, FILE *out, int width)
Print a single frame of a backtrace, in a compact format.
Definition: backtrace.c:707
bool backtrace_symbols_cb(void **buffer, int size, uint32_t flags, void(*cb)(void *, backtrace_frame_t *), void *cb_arg)
Symbolize the buffer returned by backtrace, calling a callback for each frame.
Definition: backtrace.c:626
int backtrace(void **buffer, int size)
Walk the stack and return the current call stack.
Definition: backtrace.c:595
void backtrace_frame_print(backtrace_frame_t *frame, FILE *out)
Print a single frame of a backtrace.
Definition: backtrace.c:699
char ** backtrace_symbols(void **buffer, int size)
Translate the buffer returned by backtrace into a list of strings.
Definition: backtrace.c:676
A stack frame, part of a backtrace.
Definition: backtrace.h:41