Stackdb
Stackdb is a stackable, multi-target and -level source debugger and memory forensics library.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Data Structures | Macros | Functions | Variables
dumptarget.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <sys/user.h>
#include <sys/ptrace.h>
#include <inttypes.h>
#include <signal.h>
#include <argp.h>
#include <glib.h>
#include "glib_wrapper.h"
#include "log.h"
#include "dwdebug.h"
#include "target_api.h"
#include "target.h"
#include "target_linux_userproc.h"
#include "probe_api.h"
#include "probe.h"
#include "alist.h"
Include dependency graph for dumptarget.c:

Go to the source code of this file.

Data Structures

struct  overlay_spec
 
struct  dt_argp_state
 

Macros

#define __TARGET_OVERLAY   0x200000
 

Functions

error_t dt_argp_parse_opt (int key, char *arg, struct argp_state *state)
 
void cleanup_probes ()
 
void cleanup ()
 
void sigh (int signo)
 
result_t at_handler (struct probe *probe, tid_t tid, void *handler_data, struct probe *trigger, struct probe *base)
 
result_t until_handler (struct probe *probe, tid_t tid, void *handler_data, struct probe *trigger, struct probe *base)
 
result_t function_dump_args (struct probe *probe, tid_t tid, void *handler_data, struct probe *trigger, struct probe *base)
 
result_t function_post (struct probe *probe, tid_t tid, void *handler_data, struct probe *trigger, struct probe *base)
 
result_t addr_code_pre (struct probe *probe, tid_t tid, void *handler_data, struct probe *trigger, struct probe *base)
 
result_t addr_code_post (struct probe *probe, tid_t tid, void *handler_data, struct probe *trigger, struct probe *base)
 
result_t addr_var_pre (struct probe *probe, tid_t tid, void *handler_data, struct probe *trigger, struct probe *base)
 
result_t addr_var_post (struct probe *probe, tid_t tid, void *handler_data, struct probe *trigger, struct probe *base)
 
result_t var_pre (struct probe *probe, tid_t tid, void *handler_data, struct probe *trigger, struct probe *base)
 
result_t var_post (struct probe *probe, tid_t tid, void *handler_data, struct probe *trigger, struct probe *base)
 
result_t ss_handler (struct action *action, struct target_thread *thread, struct probe *probe, struct probepoint *probepoint, handler_msg_t msg, int msg_detail, void *handler_data)
 
int main (int argc, char **argv)
 

Variables

struct targett = NULL
 
unsigned int ots_len = 0
 
struct target ** ots = NULL
 
int len = 0
 
struct bsymbol ** symbols = NULL
 
GHashTable * probes = NULL
 
GHashTable * disfuncs = NULL
 
struct array_listshadow_stack
 
int doit = 0
 
int at_symbol_hit = 0
 
char * at_symbol = NULL
 
struct bsymbolat_bsymbol = NULL
 
int until_symbol_hit = 0
 
char * until_symbol = NULL
 
struct bsymboluntil_bsymbol = NULL
 
struct probeuntil_probe = NULL
 
int nonrootsethits = 0
 
struct argp_option dt_argp_opts []
 
struct argp dt_argp
 
struct dt_argp_state opts
 
struct target_spectspec
 

Macro Definition Documentation

#define __TARGET_OVERLAY   0x200000

Definition at line 93 of file dumptarget.c.

Function Documentation

result_t addr_code_post ( struct probe probe,
tid_t  tid,
void *  handler_data,
struct probe trigger,
struct probe base 
)

Definition at line 606 of file dumptarget.c.

result_t addr_code_pre ( struct probe probe,
tid_t  tid,
void *  handler_data,
struct probe trigger,
struct probe base 
)

Definition at line 592 of file dumptarget.c.

result_t addr_var_post ( struct probe probe,
tid_t  tid,
void *  handler_data,
struct probe trigger,
struct probe base 
)

Definition at line 638 of file dumptarget.c.

result_t addr_var_pre ( struct probe probe,
tid_t  tid,
void *  handler_data,
struct probe trigger,
struct probe base 
)

Definition at line 620 of file dumptarget.c.

result_t at_handler ( struct probe probe,
tid_t  tid,
void *  handler_data,
struct probe trigger,
struct probe base 
)

Definition at line 443 of file dumptarget.c.

void cleanup ( void  )

Definition at line 134 of file dumptarget.c.

void cleanup_probes ( void  )

Definition at line 115 of file dumptarget.c.

error_t dt_argp_parse_opt ( int  key,
char *  arg,
struct argp_state *  state 
)

Definition at line 771 of file dumptarget.c.

result_t function_dump_args ( struct probe probe,
tid_t  tid,
void *  handler_data,
struct probe trigger,
struct probe base 
)

Definition at line 487 of file dumptarget.c.

result_t function_post ( struct probe probe,
tid_t  tid,
void *  handler_data,
struct probe trigger,
struct probe base 
)

Definition at line 567 of file dumptarget.c.

int main ( int  argc,
char **  argv 
)

Definition at line 957 of file dumptarget.c.

void sigh ( int  signo)

Definition at line 178 of file dumptarget.c.

result_t ss_handler ( 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 741 of file dumptarget.c.

result_t until_handler ( struct probe probe,
tid_t  tid,
void *  handler_data,
struct probe trigger,
struct probe base 
)

Definition at line 465 of file dumptarget.c.

result_t var_post ( struct probe probe,
tid_t  tid,
void *  handler_data,
struct probe trigger,
struct probe base 
)

Definition at line 699 of file dumptarget.c.

result_t var_pre ( struct probe probe,
tid_t  tid,
void *  handler_data,
struct probe trigger,
struct probe base 
)

Definition at line 656 of file dumptarget.c.

Variable Documentation

struct bsymbol* at_bsymbol = NULL

Definition at line 62 of file dumptarget.c.

char* at_symbol = NULL

Definition at line 61 of file dumptarget.c.

int at_symbol_hit = 0

Definition at line 60 of file dumptarget.c.

GHashTable* disfuncs = NULL

Definition at line 55 of file dumptarget.c.

int doit = 0

Definition at line 58 of file dumptarget.c.

struct argp dt_argp
Initial value:
= {
dt_argp_opts,dt_argp_parse_opt,NULL,NULL,NULL,NULL,NULL,
}
error_t dt_argp_parse_opt(int key, char *arg, struct argp_state *state)
Definition: dumptarget.c:771
struct argp_option dt_argp_opts[]
Definition: dumptarget.c:95

Definition at line 107 of file dumptarget.c.

struct argp_option dt_argp_opts[]
Initial value:
= {
{ "overlay",__TARGET_OVERLAY,"[<target_id>:]<thread_name_or_id>:<spec_opts>",0,"Lookup name or id as an overlay target once the main target is instantiated, and try to open it. All dumptarget options then apply to the overlay.",0 },
{ "at-symbol",'A',"SYMBOL",0,"Wait for a probe on this symbol/address to be hit before inserting all the other probes.",0 },
{ "until-symbol",'U',"SYMBOL",0,"Remove all probes once a probe on this symbol/address is hit.",0 },
{ "bts",'B',0,0,"Enable BTS (if XenTT) (starting at at-symbol if one was provided; otherwise, enable immediately).",0 },
{ "stop-at-until",'S',0,0,"Stop probing once the until symbol/address is reached.",0 },
{ "raw",'v',0,0,"Enable raw mode.",0 },
{ "post",'P',0,0,"Enable post handlers.",0 },
{ "quiet",'q',0,0,"Silent but deadly.",0 },
{ 0,0,0,0,0,0 },
}
#define __TARGET_OVERLAY
Definition: dumptarget.c:93

Definition at line 95 of file dumptarget.c.

int len = 0

Definition at line 52 of file dumptarget.c.

int nonrootsethits = 0

Definition at line 69 of file dumptarget.c.

struct dt_argp_state opts

Definition at line 111 of file dumptarget.c.

struct target** ots = NULL

Definition at line 50 of file dumptarget.c.

unsigned int ots_len = 0

Definition at line 49 of file dumptarget.c.

GHashTable* probes = NULL

Definition at line 54 of file dumptarget.c.

struct array_list* shadow_stack

Definition at line 56 of file dumptarget.c.

struct bsymbol** symbols = NULL

Definition at line 53 of file dumptarget.c.

struct target* t = NULL

Definition at line 48 of file dumptarget.c.

struct target_spec* tspec

Definition at line 113 of file dumptarget.c.

struct bsymbol* until_bsymbol = NULL

Definition at line 66 of file dumptarget.c.

struct probe* until_probe = NULL

Definition at line 67 of file dumptarget.c.

char* until_symbol = NULL

Definition at line 65 of file dumptarget.c.

int until_symbol_hit = 0

Definition at line 64 of file dumptarget.c.