Stackdb
Stackdb is a stackable, multi-target and -level source debugger and memory forensics library.
|
Go to the source code of this file.
Data Structures | |
struct | probe_ops |
Macros | |
#define | PROBE_VALUE_NAME_RETURN "__RETURN__" |
#define | SINGLESTEP_INFINITE -1 |
#define | SINGLESTEP_NEXTBP -2 |
Typedefs | |
typedef result_t(* | probe_handler_t )(struct probe *probe, tid_t tid, void *handler_data, struct probe *trigger, struct probe *base) |
typedef result_t(* | action_handler_t )(struct action *action, struct target_thread *thread, struct probe *probe, struct probepoint *probepoint, handler_msg_t msg, int msg_detail, void *handler_data) |
#define PROBE_VALUE_NAME_RETURN "__RETURN__" |
Definition at line 159 of file probe_api.h.
#define SINGLESTEP_INFINITE -1 |
Definition at line 871 of file probe_api.h.
#define SINGLESTEP_NEXTBP -2 |
Definition at line 872 of file probe_api.h.
typedef result_t(* action_handler_t)(struct action *action, struct target_thread *thread, struct probe *probe, struct probepoint *probepoint, handler_msg_t msg, int msg_detail, void *handler_data) |
Definition at line 76 of file probe_api.h.
typedef result_t(* probe_handler_t)(struct probe *probe, tid_t tid, void *handler_data, struct probe *trigger, struct probe *base) |
Definition at line 70 of file probe_api.h.
enum action_flag_t |
Enumerator | |
---|---|
ACTION_FLAG_NONE | |
ACTION_FLAG_NOINT | |
ACTION_FLAG_SAVECTX | |
ACTION_FLAG_CALL | |
ACTION_FLAG_NORET |
Definition at line 267 of file probe_api.h.
enum action_type_t |
Enumerator | |
---|---|
ACTION_RETURN | |
ACTION_REGMOD | |
ACTION_MEMMOD | |
ACTION_CUSTOMCODE | |
ACTION_SINGLESTEP |
Definition at line 249 of file probe_api.h.
enum action_whence_t |
Enumerator | |
---|---|
ACTION_UNSCHED | |
ACTION_ONESHOT | |
ACTION_REPEATPRE | |
ACTION_REPEATPOST |
Definition at line 257 of file probe_api.h.
enum handler_msg_t |
Enumerator | |
---|---|
MSG_NONE | |
MSG_SUCCESS | |
MSG_FAILURE | |
MSG_STEPPING | |
MSG_STEPPING_AT_BP | |
MSG_INTERRUPTED |
Definition at line 52 of file probe_api.h.
Enumerator | |
---|---|
PHASE_PRE_START | |
PHASE_PRE_END | |
PHASE_POST_START | |
PHASE_POST_END |
Definition at line 83 of file probe_api.h.
enum probepoint_style_t |
Enumerator | |
---|---|
PROBEPOINT_HW | |
PROBEPOINT_SW | |
PROBEPOINT_FASTEST |
Definition at line 228 of file probe_api.h.
enum probepoint_type_t |
Enumerator | |
---|---|
PROBEPOINT_BREAK | |
PROBEPOINT_WATCH |
Definition at line 213 of file probe_api.h.
Enumerator | |
---|---|
PROBEPOINT_LAUTO | |
PROBEPOINT_L0 | |
PROBEPOINT_L2 | |
PROBEPOINT_L4 | |
PROBEPOINT_L8 |
Definition at line 241 of file probe_api.h.
enum probepoint_whence_t |
Enumerator | |
---|---|
PROBEPOINT_WAUTO | |
PROBEPOINT_EXEC | |
PROBEPOINT_WRITE | |
PROBEPOINT_READWRITE |
Definition at line 234 of file probe_api.h.
struct action* action_code | ( | char * | buf, |
uint32_t | len, | ||
uint32_t | flags | ||
) |
void action_hold | ( | struct action * | action | ) |
int action_sched | ( | struct probe * | probe, |
struct action * | action, | ||
action_whence_t | whence, | ||
action_handler_t | handler, | ||
void * | handler_data | ||
) |
struct probe* probe_create | ( | struct target * | target, |
tid_t | tid, | ||
struct probe_ops * | pops, | ||
const char * | name, | ||
probe_handler_t | pre_handler, | ||
probe_handler_t | post_handler, | ||
void * | handler_data, | ||
int | autofree, | ||
int | tracked | ||
) |
struct probe* probe_create_filtered | ( | struct target * | target, |
tid_t | tid, | ||
struct probe_ops * | pops, | ||
const char * | name, | ||
probe_handler_t | pre_handler, | ||
struct target_nv_filter * | pre_filter, | ||
probe_handler_t | post_handler, | ||
struct target_nv_filter * | post_filter, | ||
struct target_nv_filter * | thread_filter, | ||
void * | handler_data, | ||
int | autofree, | ||
int | tracked | ||
) |
Probe Filter functions. If you attach a filter probe to a value probe, it uses the value probe as a source, and each time its pre/posthandlers are called, compares the named values to the filter value expressions, and fires the pre/post handlers if there is a match.
Filter probes should also have a notion of context, but they don't really have that yet. The only context initially is – if you set it to TID_GLOBAL, you'll get everything; otherwise, your filter won't be checked unless the probe event happened in .
Definition at line 95 of file probe_filter.c.
int probe_enable_all | ( | struct probe * | probe | ) |
Definition at line 35 of file probe_filter.c.
struct probe* probe_register_addr | ( | struct probe * | probe, |
ADDR | addr, | ||
probepoint_type_t | type, | ||
probepoint_style_t | style, | ||
probepoint_whence_t | whence, | ||
probepoint_watchsize_t | watchsize, | ||
struct bsymbol * | bsymbol | ||
) |
int probe_register_batch | ( | struct target * | target, |
tid_t | tid, | ||
ADDR * | addrlist, | ||
int | count, | ||
probepoint_type_t | type, | ||
probepoint_style_t | style, | ||
probepoint_whence_t | whence, | ||
probepoint_watchsize_t | watchsize, | ||
probe_handler_t | pre_handler, | ||
probe_handler_t | post_handler, | ||
void * | handler_data, | ||
struct probe ** | probelist, | ||
int | failureaction | ||
) |
struct probe* probe_register_inlined_symbol | ( | struct probe * | probe, |
struct bsymbol * | bsymbol, | ||
int | do_primary, | ||
probepoint_style_t | style, | ||
probepoint_whence_t | whence, | ||
probepoint_watchsize_t | watchsize | ||
) |
Definition at line 1089 of file probe_lib.c.
struct probe* probe_register_line | ( | struct probe * | probe, |
char * | filename, | ||
int | line, | ||
probepoint_style_t | style, | ||
probepoint_whence_t | whence, | ||
probepoint_watchsize_t | watchsize | ||
) |
struct probe* probe_register_symbol | ( | struct probe * | probe, |
struct bsymbol * | bsymbol, | ||
probepoint_style_t | style, | ||
probepoint_whence_t | whence, | ||
probepoint_watchsize_t | watchsize | ||
) |
struct probe* probe_register_symbol_name | ( | struct probe * | probe, |
char * | name, | ||
const char * | delim, | ||
probepoint_style_t | style, | ||
probepoint_whence_t | whence, | ||
probepoint_watchsize_t | watchsize | ||
) |
Definition at line 51 of file probe_lib.c.
void probe_rename | ( | struct probe * | probe, |
const char * | name | ||
) |
struct probe* probe_simple | ( | struct target * | target, |
tid_t | tid, | ||
char * | name, | ||
probe_handler_t | pre_handler, | ||
probe_handler_t | post_handler, | ||
void * | handler_data | ||
) |
Useful higher-level library functions.
Definition at line 37 of file probe_lib.c.
probepoint_style_t probe_style | ( | struct probe * | probe | ) |
probepoint_type_t probe_type | ( | struct probe * | probe | ) |
int probe_unregister_one | ( | struct probe * | probe, |
int | force | ||
) |
void probe_value_clear | ( | struct probe_value * | pv | ) |
Probe Value core functions that might be useful to others in constructing per-probe type probe_ops.
Definition at line 41 of file probe_value.c.
struct probe_value* probe_value_create | ( | probe_handler_phase_t | phase | ) |
Definition at line 79 of file probe_value.c.
void probe_value_free | ( | struct probe_value * | pv | ) |
Definition at line 66 of file probe_value.c.
Definition at line 633 of file probe_value.c.
Definition at line 551 of file probe_value.c.
Definition at line 467 of file probe_value.c.
Definition at line 639 of file probe_value.c.
Definition at line 561 of file probe_value.c.
Definition at line 477 of file probe_value.c.
Definition at line 636 of file probe_value.c.
Definition at line 566 of file probe_value.c.
Definition at line 482 of file probe_value.c.
Definition at line 627 of file probe_value.c.
Definition at line 604 of file probe_value.c.
Definition at line 384 of file probe_value.c.
Definition at line 624 of file probe_value.c.
Definition at line 593 of file probe_value.c.
Definition at line 380 of file probe_value.c.
Definition at line 630 of file probe_value.c.
Definition at line 556 of file probe_value.c.
Definition at line 472 of file probe_value.c.
Definition at line 621 of file probe_value.c.
Definition at line 582 of file probe_value.c.
Definition at line 376 of file probe_value.c.
The API wrappers.
Definition at line 618 of file probe_value.c.
Definition at line 571 of file probe_value.c.
Definition at line 372 of file probe_value.c.
void probe_value_notify_phase_function_ee | ( | struct probe * | probe, |
tid_t | tid, | ||
probe_handler_phase_t | phase | ||
) |
Definition at line 96 of file probe_value.c.
void probe_value_notify_phase_watchedvar | ( | struct probe * | probe, |
tid_t | tid, | ||
probe_handler_phase_t | phase | ||
) |
Definition at line 124 of file probe_value.c.
int probe_value_record_basic | ( | struct probe * | probe, |
tid_t | tid, | ||
char * | name, | ||
struct value * | value, | ||
int | israw | ||
) |
Definition at line 235 of file probe_value.c.
int probe_value_record_stacked | ( | struct probe * | probe, |
tid_t | tid, | ||
char * | name, | ||
struct value * | value, | ||
int | israw | ||
) |
Definition at line 187 of file probe_value.c.
struct probe* probe_value_symbol | ( | struct target * | target, |
tid_t | tid, | ||
struct bsymbol * | bsymbol, | ||
probe_handler_t | pre_handler, | ||
probe_handler_t | post_handler, | ||
void * | handler_data | ||
) |
Definition at line 660 of file probe_value.c.
struct probe * probe_value_var | ( | struct target * | target, |
tid_t | tid, | ||
struct bsymbol * | bsymbol, | ||
probe_handler_t | pre_handler, | ||
probe_handler_t | post_handler, | ||
void * | handler_data | ||
) |
Probe Value functions. If your probe supports value loading functions, you can use these on it when your pre/post handlers are called.
The idea here is that often probes can store loaded values. For instance, a watchpoint stores the last value of the watched var and returns that in the prehandler, and loads the new value and returns that in the posthandler. For a function entry/exit metaprobe, the prehandler might load all the arguments; and the posthandler might load/get all the arguments, and load the return value.
A couple simple default value probe implementations. Watchpoints and function entry/exit.
Definition at line 701 of file probe_value.c.
void probe_values_free_basic | ( | struct probe * | probe | ) |
Definition at line 172 of file probe_value.c.
void probe_values_free_stacked | ( | struct probe * | probe | ) |
Definition at line 149 of file probe_value.c.
probepoint_whence_t probe_whence | ( | struct probe * | probe | ) |
probepoint_watchsize_t probepoint_closest_watchsize | ( | int | size | ) |