Stackdb
Stackdb is a stackable, multi-target and -level source debugger and memory forensics library.
|
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <glib.h>
#include <pthread.h>
#include <inttypes.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <assert.h>
#include "log.h"
#include "alist.h"
#include "waitpipe.h"
#include "evloop.h"
#include "monitor.h"
Go to the source code of this file.
Macros | |
#define | __M_SAFE_IO(fn, fns, fd, buf, buflen, frc) |
Functions | |
void | monitor_init (void) |
void | monitor_fini (void) |
int | monitor_get_unique_objid (void) |
int | monitor_lookup_objid (int objid, int *objtype, void **obj, struct monitor **monitor) |
int | __monitor_lock_objtype (int objtype) |
int | monitor_lock_objtype (int objtype) |
int | __monitor_unlock_objtype (int objtype) |
int | monitor_unlock_objtype (int objtype) |
int | monitor_unlock_objtype_unsafe (int objtype) |
struct array_list * | monitor_list_objids_by_objtype_lock_objtype (int objtype, int include_null) |
struct array_list * | monitor_list_objs_by_objtype_lock_objtype (int objtype, int include_null) |
int | monitor_lookup_objid_lock_objtype (int objid, int objtype, void **obj, struct monitor **monitor) |
int | monitor_lookup_objid_lock_objtype_and_monitor (int objid, int objtype, void **obj, struct monitor **monitor) |
int | monitor_lookup_objid_lock_monitor (int objid, int *objtype, void **obj, struct monitor **monitor) |
int | monitor_lookup_obj (void *obj, int *objtype, int *objid, struct monitor **monitor) |
int | monitor_lookup_obj_lock_monitor (void *obj, int *objtype, int *objid, struct monitor **monitor) |
int | monitor_add_obj (struct monitor *monitor, int objid, int objtype, void *obj, void *objstate) |
int | monitor_close_obj (struct monitor *monitor, void *obj, int kill, int kill_sig) |
int | monitor_close_objid (struct monitor *monitor, int objid, int kill, int kill_sig) |
int | monitor_del_obj (struct monitor *monitor, void *obj) |
int | monitor_del_objid (struct monitor *monitor, int objid) |
int | monitor_shutdown (struct monitor *monitor) |
int | monitor_destroy (struct monitor *monitor) |
int | monitor_register_objtype (int objtype, struct monitor_objtype_ops *ops, pthread_mutex_t *mutex) |
int | __monitor_recv_evh (int fd, int fdtype, void *state) |
int | __monitor_child_recv_evh (int fd, int fdtype, void *state) |
int | __safe_write (int fd, char *buf, int count) |
int | __monitor_add_primary_obj (struct monitor *monitor, int objid, int objtype, void *obj, void *objstate) |
struct monitor * | monitor_create_custom (monitor_type_t type, monitor_flags_t flags, int objid, int objtype, void *obj, void *objstate, evloop_handler_t custom_recv_evh, evloop_handler_t custom_child_recv_evh) |
int | monitor_add_primary_obj (struct monitor *monitor, int objid, int objtype, void *obj, void *objstate) |
struct monitor * | monitor_create (monitor_type_t type, monitor_flags_t flags, int objid, int objtype, void *obj, void *objstate) |
int | monitor_can_attach (void) |
int | monitor_can_attach_bidi (void) |
struct monitor * | monitor_attach (monitor_type_t type, monitor_flags_t flags, int objtype, void *obj, void *objstate, evloop_handler_t custom_child_recv_evh, monitor_stdio_callback_t stdin_callback, void *callback_state) |
int | __monitor_send_stdin_evh (int fd, int fdtype, void *state) |
int | monitor_setup_stdin (struct monitor *monitor, char *stdin_buf, int stdin_buflen) |
int | monitor_setup_stdout (struct monitor *monitor, int maxbufsiz, char *stdout_logfile, monitor_stdio_callback_t stdout_callback, void *callback_state) |
int | monitor_setup_stderr (struct monitor *monitor, int maxbufsiz, char *stderr_logfile, monitor_stdio_callback_t stderr_callback, void *callback_state) |
int | monitor_spawn (struct monitor *monitor, char *filename, char *const argv[], char *const envp[], char *dir) |
int | monitor_is_done (struct monitor *monitor) |
int | monitor_live_children (struct monitor *monitor) |
int | monitor_live_objects (struct monitor *monitor) |
int | monitor_objects (struct monitor *monitor) |
int | monitor_run (struct monitor *monitor) |
void | monitor_store_msg_obj (struct monitor *monitor, struct monitor_msg *msg) |
void | monitor_msg_free (struct monitor_msg *msg) |
void | monitor_msg_free_save_buffer (struct monitor_msg *msg) |
struct monitor_msg * | monitor_msg_create (int objid, int id, short cmd, short seqno, int buflen, char *buf, void *msg_obj) |
int | monitor_send (struct monitor_msg *msg) |
struct monitor_msg * | monitor_recv (struct monitor *monitor) |
int | monitor_child_send (struct monitor_msg *msg, struct monitor *monitor) |
struct monitor_msg * | monitor_child_recv (struct monitor *monitor) |
Variables | |
char ** | environ |
int __monitor_add_primary_obj | ( | struct monitor * | monitor, |
int | objid, | ||
int | objtype, | ||
void * | obj, | ||
void * | objstate | ||
) |
int __monitor_child_recv_evh | ( | int | fd, |
int | fdtype, | ||
void * | state | ||
) |
int __monitor_recv_evh | ( | int | fd, |
int | fdtype, | ||
void * | state | ||
) |
int __monitor_send_stdin_evh | ( | int | fd, |
int | fdtype, | ||
void * | state | ||
) |
int monitor_add_obj | ( | struct monitor * | monitor, |
int | objid, | ||
int | objtype, | ||
void * | obj, | ||
void * | objstate | ||
) |
int monitor_add_primary_obj | ( | struct monitor * | monitor, |
int | objid, | ||
int | objtype, | ||
void * | obj, | ||
void * | objstate | ||
) |
struct monitor* monitor_attach | ( | monitor_type_t | type, |
monitor_flags_t | flags, | ||
int | objtype, | ||
void * | obj, | ||
void * | objstate, | ||
evloop_handler_t | custom_child_recv_evh, | ||
monitor_stdio_callback_t | stdin_callback, | ||
void * | callback_state | ||
) |
struct monitor_msg* monitor_child_recv | ( | struct monitor * | monitor | ) |
int monitor_child_send | ( | struct monitor_msg * | msg, |
struct monitor * | monitor | ||
) |
int monitor_close_obj | ( | struct monitor * | monitor, |
void * | obj, | ||
int | kill, | ||
int | kill_sig | ||
) |
int monitor_close_objid | ( | struct monitor * | monitor, |
int | objid, | ||
int | kill, | ||
int | kill_sig | ||
) |
struct monitor* monitor_create | ( | monitor_type_t | type, |
monitor_flags_t | flags, | ||
int | objid, | ||
int | objtype, | ||
void * | obj, | ||
void * | objstate | ||
) |
struct monitor* monitor_create_custom | ( | monitor_type_t | type, |
monitor_flags_t | flags, | ||
int | objid, | ||
int | objtype, | ||
void * | obj, | ||
void * | objstate, | ||
evloop_handler_t | custom_recv_evh, | ||
evloop_handler_t | custom_child_recv_evh | ||
) |
int monitor_del_obj | ( | struct monitor * | monitor, |
void * | obj | ||
) |
int monitor_del_objid | ( | struct monitor * | monitor, |
int | objid | ||
) |
struct array_list* monitor_list_objids_by_objtype_lock_objtype | ( | int | objtype, |
int | include_null | ||
) |
struct array_list* monitor_list_objs_by_objtype_lock_objtype | ( | int | objtype, |
int | include_null | ||
) |
int monitor_lookup_obj | ( | void * | obj, |
int * | objtype, | ||
int * | objid, | ||
struct monitor ** | monitor | ||
) |
int monitor_lookup_obj_lock_monitor | ( | void * | obj, |
int * | objtype, | ||
int * | objid, | ||
struct monitor ** | monitor | ||
) |
int monitor_lookup_objid | ( | int | objid, |
int * | objtype, | ||
void ** | obj, | ||
struct monitor ** | monitor | ||
) |
int monitor_lookup_objid_lock_monitor | ( | int | objid, |
int * | objtype, | ||
void ** | obj, | ||
struct monitor ** | monitor | ||
) |
int monitor_lookup_objid_lock_objtype | ( | int | objid, |
int | objtype, | ||
void ** | obj, | ||
struct monitor ** | monitor | ||
) |
int monitor_lookup_objid_lock_objtype_and_monitor | ( | int | objid, |
int | objtype, | ||
void ** | obj, | ||
struct monitor ** | monitor | ||
) |
struct monitor_msg* monitor_msg_create | ( | int | objid, |
int | id, | ||
short | cmd, | ||
short | seqno, | ||
int | buflen, | ||
char * | buf, | ||
void * | msg_obj | ||
) |
void monitor_msg_free | ( | struct monitor_msg * | msg | ) |
void monitor_msg_free_save_buffer | ( | struct monitor_msg * | msg | ) |
struct monitor_msg* monitor_recv | ( | struct monitor * | monitor | ) |
int monitor_register_objtype | ( | int | objtype, |
struct monitor_objtype_ops * | ops, | ||
pthread_mutex_t * | mutex | ||
) |
int monitor_send | ( | struct monitor_msg * | msg | ) |
int monitor_setup_stderr | ( | struct monitor * | monitor, |
int | maxbufsiz, | ||
char * | stderr_logfile, | ||
monitor_stdio_callback_t | stderr_callback, | ||
void * | callback_state | ||
) |
int monitor_setup_stdin | ( | struct monitor * | monitor, |
char * | stdin_buf, | ||
int | stdin_buflen | ||
) |
int monitor_setup_stdout | ( | struct monitor * | monitor, |
int | maxbufsiz, | ||
char * | stdout_logfile, | ||
monitor_stdio_callback_t | stdout_callback, | ||
void * | callback_state | ||
) |
int monitor_spawn | ( | struct monitor * | monitor, |
char * | filename, | ||
char *const | argv[], | ||
char *const | envp[], | ||
char * | dir | ||
) |
void monitor_store_msg_obj | ( | struct monitor * | monitor, |
struct monitor_msg * | msg | ||
) |
char** environ |