libdragon
Loading...
Searching...
No Matches
backtrace.h
Go to the documentation of this file.
1
29#ifndef __LIBDRAGON_BACKTRACE_H
30#define __LIBDRAGON_BACKTRACE_H
31
32#include <stdbool.h>
33#include <stdio.h>
34
35#ifdef __cplusplus
36extern "C" {
37#endif
38
42typedef struct {
43 uint32_t addr;
44
45 const char *func;
46 uint32_t func_offset;
47
48 const char *source_file;
50
51 bool is_inline;
53
54
74void backtrace_frame_print(backtrace_frame_t *frame, FILE *out);
75
103void backtrace_frame_print_compact(backtrace_frame_t *frame, FILE *out, int width);
104
126int backtrace(void **buffer, int size);
127
156char** backtrace_symbols(void **buffer, int size);
157
187bool backtrace_symbols_cb(void **buffer, int size, uint32_t flags,
188 void (*cb)(void *, backtrace_frame_t*), void *cb_arg);
189
190#ifdef __cplusplus
191}
192#endif
193
196#endif
const char * source_file
Name of the source file (if known, or "???" otherwise)
Definition backtrace.h:48
const char * func
Name of the function (this should always be present)
Definition backtrace.h:45
int source_line
Line number in the source file (if known, or 0 otherwise)
Definition backtrace.h:49
bool is_inline
True if this frame refers to an inlined function.
Definition backtrace.h:51
uint32_t func_offset
Byte offset of the address within the function.
Definition backtrace.h:46
uint32_t addr
PC address of the frame (MIPS virtual address)
Definition backtrace.h:43
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:764
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:684
int backtrace(void **buffer, int size)
Walk the stack and return the current call stack.
Definition backtrace.c:622
void backtrace_frame_print(backtrace_frame_t *frame, FILE *out)
Print a single frame of a backtrace.
Definition backtrace.c:756
char ** backtrace_symbols(void **buffer, int size)
Translate the buffer returned by backtrace into a list of strings.
Definition backtrace.c:733
A stack frame, part of a backtrace.
Definition backtrace.h:42