44 lines
1.1 KiB
C
44 lines
1.1 KiB
C
#ifndef LIBELFIN_WRAP_H_
|
|
#define LIBELFIN_WRAP_H_
|
|
|
|
#ifdef __cplusplus
|
|
# define DEBUGUS_EXTERNC extern "C"
|
|
#else
|
|
# define DEBUGUS_EXTERNC
|
|
#endif // __cplusplus
|
|
|
|
#include <stddef.h>
|
|
#include <stdbool.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
|
|
#include "da.h"
|
|
|
|
typedef struct {
|
|
ssize_t line;
|
|
const char *file;
|
|
uintptr_t addr;
|
|
} AddrInfo;
|
|
|
|
typedef struct {
|
|
const char *name;
|
|
AddrInfo *ai;
|
|
} Func;
|
|
|
|
typedef struct {
|
|
Func *items;
|
|
size_t count, capacity;
|
|
} Funcs;
|
|
|
|
typedef void * PLibelfinBinding;
|
|
|
|
DEBUGUS_EXTERNC PLibelfinBinding libelfin_wrap_get_binding(int fd, uintptr_t loadoffset);
|
|
DEBUGUS_EXTERNC void libelfin_wrap_free_binding(PLibelfinBinding pbind);
|
|
DEBUGUS_EXTERNC AddrInfo *libelfin_wrap_info_from_rip(PLibelfinBinding pbind, uint64_t rip);
|
|
DEBUGUS_EXTERNC void libelfin_wrap_free_info(AddrInfo *ai);
|
|
DEBUGUS_EXTERNC void libelfin_wrap_get_funcs(PLibelfinBinding pbind, Funcs *funcs);
|
|
DEBUGUS_EXTERNC uintptr_t libelfin_wrap_func_addr(PLibelfinBinding pbind, Func *f);
|
|
DEBUGUS_EXTERNC AddrInfo *libelfin_wrap_info_from_line(PLibelfinBinding pbind, const char *file, size_t line);
|
|
|
|
#endif // LIBELFIN_WRAP_H_
|