19 #ifndef __TARGET_OS_H__
20 #define __TARGET_OS_H__
32 #define THREAD_CTXT_KERNEL 0
33 #define THREAD_CTXT_USER 1
66 #define SAFE_TARGET_OS_OP(target,op,errval,...) \
68 if (target->personality != TARGET_PERSONALITY_OS) { \
69 verror("target %s is not an OS!\n",target->name); \
73 else if (!target->os_ops || !target->os_ops->op) { \
74 verror("target %s does not support OS operation '%s'!\n", \
80 return target->os_ops->op(__VA_ARGS__); \
84 #define SAFE_TARGET_OS_OP_NORET(target,op,errval,outvar,...) \
86 if (target->personality != TARGET_PERSONALITY_OS) { \
87 verror("target %s is not an OS!\n",target->name); \
91 else if (!target->os_ops || !target->os_ops->op) { \
92 verror("target %s does not support OS operation '%s'!\n", \
98 outvar = target->os_ops->op(__VA_ARGS__); \
126 struct target *overlay,
int force_emulate);
128 struct target *overlay,
int force_emulate);
140 int signo,
void *data);
200 struct target *overlay,
int force_emulate);
202 struct target *overlay,
int force_emulate);
207 GHashTable *(*processes_get)(
struct target *target);
214 const char *(*signal_to_name)(
struct target *target,
int signo);
217 int signo,
void *data);
221 unsigned char **maskbytes,
int *masklen);
223 unsigned char *maskbytes,
int masklen);
231 GHashTable *(*syscall_table_get)(
struct target *target);
275 struct probe *(*syscall_probe)(
struct target *target,
tid_t tid,
280 struct probe *(*syscall_probe_all)(
struct target *target,
tid_t tid,
struct target_os_syscall_state * target_os_syscall_probe_last(struct target *target, tid_t tid)
int target_os_syscall_table_reload(struct target *target, int force)
int target_os_syscall_table_unload(struct target *target)
GHashTable * target_os_process_table_get(struct target *target)
result_t pre_handler(struct probe *probe, tid_t tid, void *data, struct probe *trigger, struct probe *base)
struct probe * target_os_syscall_probe_all(struct target *target, tid_t tid, probe_handler_t pre_handler, probe_handler_t post_handler, void *handler_data)
int(* signal_from_name)(struct target *target, const char *name)
int target_os_syscall_record_argv(struct target *target, tid_t tid, struct array_list *regvals, struct array_list *argvals)
int(* thread_singlestep)(struct target *target, tid_t tid, int isbp, struct target *overlay, int force_emulate)
struct target_process * target_os_process_get(struct target *target, tid_t tid)
int target_os_syscall_table_get_max_num(struct target *target)
int(* os_version_cmp)(struct target *target, uint64_t vers)
int(* syscall_table_reload)(struct target *target, int force)
struct array_list * argvals
int target_os_syscall_record_return(struct target *target, tid_t tid, REGVAL retval)
int(* syscall_table_unload)(struct target *target)
int(* fini)(struct target *target)
uint64_t(* os_version)(struct target *target)
struct probe_ops target_os_syscall_ret_probe_ops
int(* signal_get_mask)(struct target *target, struct target_thread *tthread, unsigned char **maskbytes, int *masklen)
struct target_os_syscall * target_os_syscall_lookup_name(struct target *target, char *name)
void * target_os_syscall_probe_summarize_tid(struct probe *probe, tid_t tid)
int(* thread_singlestep_end)(struct target *target, tid_t tid, struct target *overlay, int force_emulate)
result_t(* probe_handler_t)(struct probe *probe, tid_t tid, void *handler_data, struct probe *trigger, struct probe *base)
struct target_os_syscall_state * target_os_syscall_record_entry(struct target *target, tid_t tid, struct target_os_syscall *syscall)
int(* syscall_table_load)(struct target *target)
int(* thread_is_user)(struct target *target, struct target_thread *tthread)
struct bsymbol * wrapped_bsymbol
int target_os_thread_singlestep_end(struct target *target, tid_t tid, struct target *overlay, int force_emulate)
struct target_os_syscall * syscall
int target_os_thread_get_pgd_phys(struct target *target, tid_t tid, ADDR *pgdp)
int(* signal_enqueue)(struct target *target, struct target_thread *tthread, int signo, void *data)
void * target_os_syscall_probe_summarize(struct probe *probe)
struct target_os_syscall * target_os_syscall_lookup_num(struct target *target, int num)
result_t target_os_emulate_bp_handler(struct target *target, tid_t tid, thread_ctxt_t tidctxt, struct target_memmod *mmod)
const char * target_os_signal_to_name(struct target *target, int signo)
int(* thread_get_pgd_phys)(struct target *target, struct target_thread *tthread, ADDR *pgdp)
int(* signal_set_mask)(struct target *target, struct target_thread *tthread, unsigned char *maskbytes, int masklen)
target_os_type_t target_os_type(struct target *target)
target_os_type_t(* os_type)(struct target *target)
int(* syscall_table_store)(struct target *target)
GHashTable * target_os_syscall_table_get(struct target *target)
result_t post_handler(struct probe *probe, tid_t tid, void *data, struct probe *trigger, struct probe *base)
int target_os_update_process_threads_generic(struct target_process *process, int no_event_send)
unsigned int thread_ctxt_t
int target_os_thread_is_user(struct target *target, tid_t tid)
result_t target_os_emulate_ss_handler(struct target *target, tid_t tid, thread_ctxt_t tidctxt, struct target_memmod *mmod)
int target_os_signal_from_name(struct target *target, const char *name)
int(* init)(struct target *target)
int(* signal_dequeue)(struct target *target, struct target_thread *tthread, int signo)
int target_os_thread_singlestep(struct target *target, tid_t tid, int isbp, struct target *overlay, int force_emulate)
struct target_os_syscall * target_os_syscall_lookup_addr(struct target *target, ADDR addr)
tid_t target_os_thread_get_leader(struct target *target, tid_t tid)
uint64_t target_os_version(struct target *target)
int target_os_version_cmp(struct target *target, uint64_t vers)
struct array_list * regvals
int target_os_syscall_table_store(struct target *target)
int target_os_syscall_record_clear(struct target *target, tid_t tid)
int target_os_signal_enqueue(struct target *target, tid_t tid, int signo, void *data)
int target_os_syscall_table_load(struct target *target)
struct probe * target_os_syscall_probe(struct target *target, tid_t tid, struct target_os_syscall *syscall, probe_handler_t pre_handler, probe_handler_t post_handler, void *handler_data)