add pst_handler_new()
This commit is contained in:
@@ -268,6 +268,19 @@ void pst_handler_init(pst_handler* h, ucontext_t* hctx)
|
|||||||
{
|
{
|
||||||
pst_context_init(&h->ctx, hctx);
|
pst_context_init(&h->ctx, hctx);
|
||||||
list_head_init(&h->functions);
|
list_head_init(&h->functions);
|
||||||
|
h->allocated = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
pst_handler* pst_handler_new(ucontext_t* hctx)
|
||||||
|
{
|
||||||
|
pst_handler* handler = pst_alloc(pst_handler);
|
||||||
|
|
||||||
|
if(handler) {
|
||||||
|
pst_handler_init(handler, hctx);
|
||||||
|
handler->allocated = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
void pst_handler_fini(pst_handler* h)
|
void pst_handler_fini(pst_handler* h)
|
||||||
|
|||||||
@@ -15,14 +15,14 @@
|
|||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "context.h"
|
#include "context.h"
|
||||||
|
|
||||||
typedef struct pst_context pst_context;
|
|
||||||
|
|
||||||
typedef struct pst_handler {
|
typedef struct pst_handler {
|
||||||
pst_context ctx; // context of unwinding
|
pst_context ctx; // context of unwinding
|
||||||
list_head functions; // list of functions in stack frame
|
list_head functions; // list of functions in stack frame
|
||||||
|
bool allocated; // whether this object was allocated or not
|
||||||
} pst_handler;
|
} pst_handler;
|
||||||
|
|
||||||
void pst_handler_init(pst_handler* h, ucontext_t* hctx);
|
void pst_handler_init(pst_handler* h, ucontext_t* hctx);
|
||||||
|
pst_handler* pst_handler_new(ucontext_t* hctx);
|
||||||
void pst_handler_fini(pst_handler* h);
|
void pst_handler_fini(pst_handler* h);
|
||||||
|
|
||||||
bool pst_handler_handle_dwarf(pst_handler* h);
|
bool pst_handler_handle_dwarf(pst_handler* h);
|
||||||
|
|||||||
Reference in New Issue
Block a user