Bool ca_process_cmd_line_option(Char* arg) { char * ca_memregions_path; char * ca_origins_path; ca_memregions_path = NULL; ca_origins_path = NULL; if VG_STR_CLO(arg, "--mem-regions",ca_memregions_path) {} else if VG_STR_CLO(arg,"--origins",ca_origins_path) {} else if VG_STR_CLO(arg,"--input-file", inputfilename) {} else if VG_BOOL_CLO(arg,"--output-comments", ca_output_comment) {} else if VG_BOOL_CLO(arg,"--type-inference", ca_type_inference) {} else if VG_BOOL_CLO(arg,"--inline-path-queries", inlinePathQueriesP) {} else if (VG_XACT_CLO(arg, "--concretize-indices=yes", ca_mem_handling, CA_concretize_indices)) { } else if (VG_XACT_CLO(arg, "--suppress-arrays=yes", ca_mem_handling, CA_suppress_arrays)) { } else if (VG_XACT_CLO(arg, "--full-mem=yes", ca_mem_handling, CA_full)) {} else { return False; /* unrecognized arg => error */ } if (ca_origins_path) ca_read_origins_from_file(ca_origins_path); if (ca_memregions_path) ca_read_memregions_from_file(ca_memregions_path); return True; }
Bool pc_process_cmd_line_options(Char* arg) { if VG_BOOL_CLO(arg, "--partial-loads-ok", h_clo_partial_loads_ok) {} /* else if VG_BOOL_CLO(arg, "--lossage-check", h_clo_lossage_check) {} */ else if VG_BOOL_CLO(arg, "--enable-sg-checks", sg_clo_enable_sg_checks) {} else return VG_(replacement_malloc_process_cmd_line_option)(arg); return True; }
static Bool lk_process_cmd_line_option(Char* arg) { if VG_STR_CLO(arg, "--fnname", clo_fnname) {} else if VG_BOOL_CLO(arg, "--basic-counts", clo_basic_counts) {} else if VG_BOOL_CLO(arg, "--detailed-counts", clo_detailed_counts) {} else if VG_BOOL_CLO(arg, "--trace-mem", clo_trace_mem) {} else if VG_BOOL_CLO(arg, "--trace-superblocks", clo_trace_sbs) {} else return False; tl_assert(clo_fnname); tl_assert(clo_fnname[0]); return True; }
static Bool fr_process_cmd_line_option(Char* arg) { if (VG_BOOL_CLO(arg, "--frverb", clo_fr_verb)) {} else if (VG_STR_CLO(arg, "--config", clo_config)) {} else if (VG_BOOL_CLO(arg, "--mmap", clo_mmap)) {} else if (VG_BOOL_CLO(arg, "--crossfree", clo_cross_free)) {} else if (VG_BINT_CLO(arg, "--trace", clo_trace, 10, MAX_TRACE)) {} else if (VG_BINT_CLO(arg, "--report", clo_report, 5, MAX_TRACE)) {} else if (VG_BINT_CLO(arg, "--min", clo_min, 0, 1024*1024*1024)) {} else return VG_(replacement_malloc_process_cmd_line_option)(arg); return True; }
static Bool mv_process_cmd_line_option(const HChar* arg) { if VG_INT_CLO(arg, "--pipe", clo_pipe) {} else if VG_INT_CLO(arg, "--inpipe", clo_inpipe) {} else if VG_STR_CLO(arg, "--shared-mem", clo_shared_mem) {} else if VG_BOOL_CLO(arg, "--trace-instrs", clo_trace_instrs) {} else // Malloc wrapping supports --trace-malloc but not other malloc // replacement options. return VG_(replacement_malloc_process_cmd_line_option)(arg); return True; }
static Bool oa_process_cmd_line_option(Char* argv) { if (VG_BOOL_CLO(argv, "--aggr", OA_(options).isAggr)) { return True; } else if (VG_INT_CLO(argv, "--stacktrace", OA_(options).stacktraceDepth)) { return True; } else if (VG_BOOL_CLO(argv, "--i32", OA_(options).i32)) { return True; } else if (VG_BOOL_CLO(argv, "--f32", OA_(options).f32)) { return True; } else if (VG_BOOL_CLO(argv, "--f64", OA_(options).f64)) { return True; } else if (VG_BOOL_CLO(argv, "--i16", OA_(options).i16)) { return True; } else if (VG_BOOL_CLO(argv, "--i64", OA_(options).i64)) { return True; } else if (VG_BOOL_CLO(argv, "--castToI16", OA_(options).castToI16)) { return True; } return False; }
/** * Implement the needs_command_line_options for drd. */ static Bool DRD_(process_cmd_line_option)(Char* arg) { int check_stack_accesses = -1; int exclusive_threshold_ms = -1; int first_race_only = -1; int report_signal_unlocked = -1; int segment_merging = -1; int segment_merge_interval = -1; int shared_threshold_ms = -1; int show_confl_seg = -1; int trace_barrier = -1; int trace_clientobj = -1; int trace_cond = -1; int trace_csw = -1; int trace_fork_join = -1; int trace_conflict_set = -1; int trace_conflict_set_bm = -1; int trace_mutex = -1; int trace_rwlock = -1; int trace_segment = -1; int trace_semaphore = -1; int trace_suppression = -1; Char* trace_address = 0; if VG_BOOL_CLO(arg, "--check-stack-var", check_stack_accesses) {} else if VG_BOOL_CLO(arg, "--drd-stats", DRD_(s_print_stats)) {} else if VG_BOOL_CLO(arg, "--first-race-only", first_race_only) {} else if VG_BOOL_CLO(arg,"--report-signal-unlocked",report_signal_unlocked) {} else if VG_BOOL_CLO(arg, "--segment-merging", segment_merging) {} else if VG_INT_CLO (arg, "--segment-merging-interval", segment_merge_interval) {} else if VG_BOOL_CLO(arg, "--show-confl-seg", show_confl_seg) {} else if VG_BOOL_CLO(arg, "--show-stack-usage", DRD_(s_show_stack_usage)) {} else if VG_BOOL_CLO(arg, "--trace-barrier", trace_barrier) {} else if VG_BOOL_CLO(arg, "--trace-clientobj", trace_clientobj) {} else if VG_BOOL_CLO(arg, "--trace-cond", trace_cond) {} else if VG_BOOL_CLO(arg, "--trace-conflict-set", trace_conflict_set) {} else if VG_BOOL_CLO(arg, "--trace-conflict-set-bm", trace_conflict_set_bm){} else if VG_BOOL_CLO(arg, "--trace-csw", trace_csw) {} else if VG_BOOL_CLO(arg, "--trace-fork-join", trace_fork_join) {} else if VG_BOOL_CLO(arg, "--trace-mutex", trace_mutex) {} else if VG_BOOL_CLO(arg, "--trace-rwlock", trace_rwlock) {} else if VG_BOOL_CLO(arg, "--trace-segment", trace_segment) {} else if VG_BOOL_CLO(arg, "--trace-semaphore", trace_semaphore) {} else if VG_BOOL_CLO(arg, "--trace-suppr", trace_suppression) {} else if VG_BOOL_CLO(arg, "--var-info", DRD_(s_var_info)) {} else if VG_INT_CLO (arg, "--exclusive-threshold", exclusive_threshold_ms) {} else if VG_INT_CLO (arg, "--shared-threshold", shared_threshold_ms) {} else if VG_STR_CLO (arg, "--trace-addr", trace_address) {} else return VG_(replacement_malloc_process_cmd_line_option)(arg); if (check_stack_accesses != -1) DRD_(set_check_stack_accesses)(check_stack_accesses); if (exclusive_threshold_ms != -1) { DRD_(mutex_set_lock_threshold)(exclusive_threshold_ms); DRD_(rwlock_set_exclusive_threshold)(exclusive_threshold_ms); } if (first_race_only != -1) { DRD_(set_first_race_only)(first_race_only); } if (report_signal_unlocked != -1) { DRD_(cond_set_report_signal_unlocked)(report_signal_unlocked); } if (shared_threshold_ms != -1) { DRD_(rwlock_set_shared_threshold)(shared_threshold_ms); } if (segment_merging != -1) DRD_(thread_set_segment_merging)(segment_merging); if (segment_merge_interval != 1) DRD_(thread_set_segment_merge_interval)(segment_merge_interval); if (show_confl_seg != -1) DRD_(set_show_conflicting_segments)(show_confl_seg); if (trace_address) { const Addr addr = VG_(strtoll16)(trace_address, 0); DRD_(start_tracing_address_range)(addr, addr + 1); } if (trace_barrier != -1) DRD_(barrier_set_trace)(trace_barrier); if (trace_clientobj != -1) DRD_(clientobj_set_trace)(trace_clientobj); if (trace_cond != -1) DRD_(cond_set_trace)(trace_cond); if (trace_csw != -1) DRD_(thread_trace_context_switches)(trace_csw); if (trace_fork_join != -1) DRD_(thread_set_trace_fork_join)(trace_fork_join); if (trace_conflict_set != -1) DRD_(thread_trace_conflict_set)(trace_conflict_set); if (trace_conflict_set_bm != -1) DRD_(thread_trace_conflict_set_bm)(trace_conflict_set_bm); if (trace_mutex != -1) DRD_(mutex_set_trace)(trace_mutex); if (trace_rwlock != -1) DRD_(rwlock_set_trace)(trace_rwlock); if (trace_segment != -1) DRD_(sg_set_trace)(trace_segment); if (trace_semaphore != -1) DRD_(semaphore_set_trace)(trace_semaphore); if (trace_suppression != -1) DRD_(suppression_set_trace)(trace_suppression); return True; }