예제 #1
0
파일: mv_main.c 프로젝트: giraldeau/memview
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;
}
예제 #2
0
// Processes command-line options and sets the values of the
// appropriate global variables (Called from
// MAC_(process_common_cmd_line_option)() in mac_shared.c)
Bool fjalar_process_cmd_line_option(const HChar* arg)
{

  if VG_YESNO_CLO(arg, "fjalar-debug", fjalar_debug) {}
  else if VG_YESNO_CLO(arg, "fjalar-debug-dump", fjalar_debug_dump) {}
  else if VG_YESNO_CLO(arg, "fjalar-print-dwarf", fjalar_print_dwarf) {}
  else if VG_YESNO_CLO(arg, "fjalar-print-ir", fjalar_print_IR) {}
  else if VG_YESNO_CLO(arg, "with-gdb", fjalar_with_gdb) {}
  else if VG_YESNO_CLO(arg, "ignore-globals", fjalar_ignore_globals) {}
  else if VG_YESNO_CLO(arg, "ignore-constants", fjalar_ignore_constants) {}
  else if VG_YESNO_CLO(arg, "merge-constants", fjalar_merge_constants) {}
  else if VG_YESNO_CLO(arg, "ignore-static-vars", fjalar_ignore_static_vars) {}
  else if VG_YESNO_CLO(arg, "all-static-vars", fjalar_all_static_vars) {}
  else if VG_YESNO_CLO(arg, "gcc3", fjalar_gcc3) {}
  else if VG_YESNO_CLO(arg, "disambig", fjalar_default_disambig) {}
  else if VG_YESNO_CLO(arg, "smart-disambig", fjalar_smart_disambig) {}
  else if VG_YESNO_CLO(arg, "output-struct-vars", fjalar_output_struct_vars) {}
  else if VG_YESNO_CLO(arg, "flatten-arrays", fjalar_flatten_arrays) {}
  else if VG_YESNO_CLO(arg, "func-disambig-ptrs", fjalar_func_disambig_ptrs) {}
  else if VG_YESNO_CLO(arg, "disambig-ptrs", fjalar_disambig_ptrs) {}
  else if VG_BINT_CLO(arg, "--array-length-limit", fjalar_array_length_limit,
		      -1, 0x7fffffff) {}

  /* else if VG_BINT_CLO(arg, "--struct-depth",  fjalar_max_visit_struct_depth, 0, 100)  {} // [0 to 100]
     else if VG_BINT_CLO(arg, "--nesting-depth", fjalar_max_visit_nesting_depth, 0, 100) {} // [0 to 100] */
  else if VG_INT_CLO(arg, "--struct-depth",  fjalar_max_visit_struct_depth) {}
  else if VG_INT_CLO(arg, "--nesting-depth", fjalar_max_visit_nesting_depth) {}

  else if VG_STR_CLO(arg, "--dump-ppt-file",
		     fjalar_dump_prog_pt_names_filename) {}
  else if VG_STR_CLO(arg, "--dump-var-file",  fjalar_dump_var_names_filename){}
  else if VG_STR_CLO(arg, "--ppt-list-file",  fjalar_trace_prog_pts_filename){}
  else if VG_STR_CLO(arg, "--var-list-file",  fjalar_trace_vars_filename) {}
  else if VG_STR_CLO(arg, "--disambig-file",  fjalar_disambig_filename) {}
  else if VG_STR_CLO(arg, "--xml-output-file", fjalar_xml_output_filename) {}
  else
    return fjalar_tool_process_cmd_line_option(arg);

  return True;
}
예제 #3
0
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;
}
예제 #4
0
/**
 * 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;
}