X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/4980d4cb7fd8b75fbb6ab9619b73b536da24ca93..ae7eb908102a9049410dd066d4a6c521344bac28:/src/mc/mc_private.h diff --git a/src/mc/mc_private.h b/src/mc/mc_private.h index 6e36d0a699..caff24d421 100644 --- a/src/mc/mc_private.h +++ b/src/mc/mc_private.h @@ -20,6 +20,7 @@ #include "xbt/hash.h" #include "msg/msg.h" #include "msg/datatypes.h" +#include "xbt/strbuff.h" /****************************** Snapshots ***********************************/ @@ -33,9 +34,13 @@ typedef struct s_mc_mem_region{ typedef struct s_mc_snapshot{ unsigned int num_reg; mc_mem_region_t *regions; + xbt_dynar_t stacks; } s_mc_snapshot_t, *mc_snapshot_t; -extern char *prog_name; +typedef struct s_mc_snapshot_stack{ + xbt_strbuff_t local_variables; + void *stack_pointer; +}s_mc_snapshot_stack_t, *mc_snapshot_stack_t; void MC_take_snapshot(mc_snapshot_t); void MC_take_snapshot_liveness(mc_snapshot_t s); @@ -184,8 +189,10 @@ typedef struct s_memory_map { memory_map_t get_memory_map(void); void free_memory_map(memory_map_t map); -void get_plt_section(void); +void get_libsimgrid_plt_section(void); +void get_binary_plt_section(void); +extern void *start_data_libsimgrid; /********************************** DPOR for safety **************************************/ typedef enum { @@ -193,6 +200,7 @@ typedef enum { e_mc_reduce_none, e_mc_reduce_dpor } e_mc_reduce_t; + extern e_mc_reduce_t mc_reduce_kind; void MC_dpor_init(void); @@ -203,9 +211,14 @@ void MC_init_safety(void); /********************************** Double-DFS for liveness property**************************************/ +extern xbt_fifo_t mc_stack_liveness; extern mc_snapshot_t initial_snapshot_liveness; extern xbt_automaton_t _mc_property_automaton; extern int compare; +extern void *start_plt_libsimgrid; +extern void *end_plt_libsimgrid; +extern void *start_plt_binary; +extern void *end_plt_binary; typedef struct s_mc_pair{ mc_snapshot_t system_state; @@ -238,8 +251,6 @@ typedef struct s_mc_pair_stateless{ int requests; }s_mc_pair_stateless_t, *mc_pair_stateless_t; -extern xbt_fifo_t mc_stack_liveness; - mc_pair_stateless_t new_pair_stateless(mc_state_t sg, xbt_state_t st, int r); void MC_ddfs_init(void); void MC_ddfs(int search_cycle); @@ -257,5 +268,101 @@ extern char* _surf_mc_property_file; int create_dump(int pair); +/****** Local variables with DWARF ******/ + +typedef enum { + e_dw_loclist, + e_dw_register, + e_dw_bregister_op, + e_dw_lit, + e_dw_fbregister_op, + e_dw_piece, + e_dw_arithmetic, + e_dw_plus_uconst, + e_dw_compose, + e_dw_deref, + e_dw_uconstant, + e_dw_sconstant, + e_dw_unsupported +} e_dw_location_type; + +typedef struct s_dw_location{ + e_dw_location_type type; + union{ + + xbt_dynar_t loclist; + + int reg; + + struct{ + unsigned int reg; + int offset; + }breg_op; + + unsigned int lit; + + int fbreg_op; + + int piece; + + unsigned short int deref_size; + + xbt_dynar_t compose; + + char *arithmetic; + + struct{ + int bytes; + long unsigned int value; + }uconstant; + + struct{ + int bytes; + long signed int value; + }sconstant; + + unsigned int plus_uconst; + + }location; +}s_dw_location_t, *dw_location_t; + +typedef struct s_dw_location_entry{ + long lowpc; + long highpc; + dw_location_t location; +}s_dw_location_entry_t, *dw_location_entry_t; + +typedef struct s_dw_local_variable{ + char *name; + dw_location_t location; +}s_dw_local_variable_t, *dw_local_variable_t; + +typedef struct s_dw_frame{ + char *name; + void *low_pc; + void *high_pc; + dw_location_t frame_base; + xbt_dict_t variables; + unsigned long int start; + unsigned long int end; +}s_dw_frame_t, *dw_frame_t; + +/* FIXME : implement free functions for each structure */ + +extern xbt_dict_t mc_local_variables; + +typedef struct s_variable_value{ + char *type; + + union{ + void *address; + long int res; + }value; +}s_variable_value_t, *variable_value_t; + +void MC_get_local_variables(const char *elf_file, xbt_dict_t location_list, xbt_dict_t *variables); +void print_local_variables(xbt_dict_t list); +char *get_libsimgrid_path(void); +xbt_dict_t MC_get_location_list(const char *elf_file); #endif