change expternal interface function names and description
This commit is contained in:
+6
-7
@@ -17,11 +17,11 @@
|
|||||||
|
|
||||||
typedef struct pst_handler pst_handler;
|
typedef struct pst_handler pst_handler;
|
||||||
|
|
||||||
// allocate and initialize libpst handler.
|
// allocate libpst handler and initialize the library
|
||||||
pst_handler* pst_new_handler(ucontext_t* hctx);
|
pst_handler* pst_lib_init(ucontext_t* hctx);
|
||||||
|
|
||||||
// deallocate libpst handler
|
// deallocate libpst handler and deinitialize the library
|
||||||
void pst_del_handler(pst_handler* h);
|
void pst_lib_fini(pst_handler* h);
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -35,10 +35,9 @@ int pst_unwind_simple_fd(pst_handler* h, FILE* fd);
|
|||||||
// save stack trace information to provided buffer in RAM
|
// save stack trace information to provided buffer in RAM
|
||||||
int pst_unwind_simple(pst_handler* h, char* buff, uint32_t buff_size);
|
int pst_unwind_simple(pst_handler* h, char* buff, uint32_t buff_size);
|
||||||
|
|
||||||
|
//
|
||||||
// Advanced unwind routines.
|
// Advanced unwind routines.
|
||||||
// Unwinds current stack trace using DWARF debug sections in file if they present and print it to provided file descriptor.
|
// Additionally to pst_unwind_simple(...) provides types of parameters and variables in functions and their values if possible
|
||||||
// Additionally to pst_unwind_simple(...) provides types of parameters and variables in functions and their values
|
|
||||||
//
|
//
|
||||||
|
|
||||||
// write stack trace information to provided file descriptor
|
// write stack trace information to provided file descriptor
|
||||||
|
|||||||
+4
-4
@@ -12,8 +12,8 @@
|
|||||||
#include "utils/allocator.h"
|
#include "utils/allocator.h"
|
||||||
#include "dwarf/dwarf_handler.h"
|
#include "dwarf/dwarf_handler.h"
|
||||||
|
|
||||||
// allocate and initialize libpst handler.
|
// allocate and initialize libpst library
|
||||||
pst_handler* pst_new_handler(ucontext_t* hctx)
|
pst_handler* pst_lib_init(ucontext_t* hctx)
|
||||||
{
|
{
|
||||||
// global
|
// global
|
||||||
pst_alloc_init(&allocator);
|
pst_alloc_init(&allocator);
|
||||||
@@ -23,8 +23,8 @@ pst_handler* pst_new_handler(ucontext_t* hctx)
|
|||||||
return handler;
|
return handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
// deallocate libpst handler
|
// deallocate libpst handler and library
|
||||||
void pst_del_handler(pst_handler* h)
|
void pst_lib_fini(pst_handler* h)
|
||||||
{
|
{
|
||||||
pst_free(h);
|
pst_free(h);
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -62,7 +62,7 @@ void FatalSignalHandler(int sig, siginfo_t* info, void* context)
|
|||||||
printf("%s signal handled\n", strsignal(sig));
|
printf("%s signal handled\n", strsignal(sig));
|
||||||
if((context != 0) && (sig == SIGSEGV || sig == SIGABRT || sig == SIGBUS || sig == SIGFPE))
|
if((context != 0) && (sig == SIGSEGV || sig == SIGABRT || sig == SIGBUS || sig == SIGFPE))
|
||||||
{
|
{
|
||||||
pst_handler* handler = pst_new_handler((ucontext_t*)context);
|
pst_handler* handler = pst_lib_init((ucontext_t*)context);
|
||||||
if(!handler) {
|
if(!handler) {
|
||||||
printf("Failed to allocate pst handler\n");
|
printf("Failed to allocate pst handler\n");
|
||||||
return;
|
return;
|
||||||
@@ -75,7 +75,7 @@ void FatalSignalHandler(int sig, siginfo_t* info, void* context)
|
|||||||
printf("No stack trace obtained\n");
|
printf("No stack trace obtained\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
pst_del_handler(handler);
|
pst_lib_fini(handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user