12
#include "utils/allocator.h"
13
#include "dwarf/dwarf_handler.h"
14
#include "dwarf/dwarf_parameter.h"
17
pst_handler* pst_lib_init(ucontext_t* hctx, void* buff, uint32_t size)
21
pst_alloc_init(&allocator);
23
pst_alloc_init_custom(&allocator, buff, size);
26
pst_log_init_console(&pstlogger);
28
pst_new(pst_handler, handler, hctx);
34
void pst_lib_fini(pst_handler* h)
40
pst_log_fini(&pstlogger);
41
pst_alloc_fini(&allocator);
45
int pst_unwind_simple(pst_handler* h)
47
return pst_handler_unwind_simple(h);
51
int pst_unwind_pretty(pst_handler* h)
53
return pst_handler_handle_dwarf(h);
56
pst_parameter_info* pst_get_parameter_info(pst_parameter* parameter)
58
return ¶meter->info;
61
pst_function_info* pst_get_function_info(pst_function* function)
63
return &function->info;
66
pst_function* pst_function_next(pst_handler* handler, pst_function* current)
68
return pst_handler_next_function(handler, current);
71
int pst_get_register(pst_function* fn, int regno, unw_word_t* val)
73
if(regno == UNW_X86_64_CFA) {
79
return unw_get_reg(&fn->context, regno, val);
82
pst_parameter* pst_parameter_next(pst_function* function, pst_parameter* current)
84
return function_next_parameter(function, current);
87
pst_parameter* pst_parameter_next_child(pst_parameter* parent, pst_parameter* current)
89
return parameter_next_child(parent, current);