Example #1
0
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; 
}
Example #2
0
static Bool pg_process_cmd_line_option(const HChar* arg)
{
   if VG_STR_CLO(arg, "--python", clo_python) {}
   if VG_STR_CLO(arg, "--module", clo_module) {}
   else
	  return False;

   tl_assert(clo_module);
   tl_assert(clo_module[0]);
   tl_assert(clo_python);
   tl_assert(clo_python[0]);
   return True;
}
Example #3
0
static Bool lk_process_cmd_line_option(const HChar* 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 if VG_STR_CLO(arg, "--pname", clo_program_name) {}
   else if VG_STR_CLO(arg, "--outputdir", clo_output_dir) {}
   else
      return False;

   tl_assert(clo_fnname);
   tl_assert(clo_fnname[0]);
   return True;
}
Example #4
0
static Bool fz_process_cmd_line_option(Char* arg)
{
    if VG_STR_CLO(arg, "--fname", clo_fnname) {}

    tl_assert(clo_fnname);
    tl_assert(clo_fnname[0]);
    return True;
}
Example #5
0
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;
}
Example #6
0
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;
}
Example #7
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;
}
Example #8
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;
}