Ejemplo n.º 1
0
static Bool cg_process_cmd_line_option(Char* arg)
{
   // 5 is length of "--I1="
   if      (VG_CLO_STREQN(5, arg, "--I1="))
      parse_cache_opt(&clo_I1_cache, &arg[5]);
   else if (VG_CLO_STREQN(5, arg, "--D1="))
      parse_cache_opt(&clo_D1_cache, &arg[5]);
   else if (VG_CLO_STREQN(5, arg, "--L2="))
      parse_cache_opt(&clo_L2_cache, &arg[5]);
   else
      return False;

   return True;
}
Ejemplo n.º 2
0
Bool VG_(replacement_malloc_process_cmd_line_option)(Char* arg)
{
   if      (VG_CLO_STREQN(12, arg, "--alignment=")) {
      VG_(clo_alignment) = (Int)VG_(atoll)(&arg[12]);

      if (VG_(clo_alignment) < 4 
          || VG_(clo_alignment) > 4096
          || VG_(log2)( VG_(clo_alignment) ) == -1 /* not a power of 2 */) {
         VG_(message)(Vg_UserMsg, "");
         VG_(message)(Vg_UserMsg, 
            "Invalid --alignment= setting.  "
            "Should be a power of 2, >= 4, <= 4096.");
         VG_(bad_option)("--alignment");
      }
   }

   else if (VG_CLO_STREQ(arg, "--sloppy-malloc=yes"))
      VG_(clo_sloppy_malloc) = True;
   else if (VG_CLO_STREQ(arg, "--sloppy-malloc=no"))
      VG_(clo_sloppy_malloc) = False;

   else if (VG_CLO_STREQ(arg, "--trace-malloc=yes"))
      VG_(clo_trace_malloc) = True;
   else if (VG_CLO_STREQ(arg, "--trace-malloc=no"))
      VG_(clo_trace_malloc) = False;

   else 
      return False;

   return True;
}
Ejemplo n.º 3
0
static Bool cg_process_cmd_line_option(Char* arg)
{
   // 5 is length of "--I1="
   if      (VG_CLO_STREQN(5, arg, "--I1="))
      parse_cache_opt(&clo_I1_cache, &arg[5]);
   else if (VG_CLO_STREQN(5, arg, "--D1="))
      parse_cache_opt(&clo_D1_cache, &arg[5]);
   else if (VG_CLO_STREQN(5, arg, "--L2="))
      parse_cache_opt(&clo_L2_cache, &arg[5]);
   else if (VG_CLO_STREQN(22, arg, "--cachegrind-out-file=")) {
      cachegrind_out_file_basename = &arg[22];
   }
   else
      return False;

   return True;
}
Ejemplo n.º 4
0
Bool MAC_(process_common_cmd_line_option)(Char* arg)
{
   if      (VG_CLO_STREQ(arg, "--partial-loads-ok=yes"))
      MAC_(clo_partial_loads_ok) = True;
   else if (VG_CLO_STREQ(arg, "--partial-loads-ok=no"))
      MAC_(clo_partial_loads_ok) = False;

   else if (VG_CLO_STREQN(15, arg, "--freelist-vol=")) {
      MAC_(clo_freelist_vol) = (Int)VG_(atoll)(&arg[15]);
      if (MAC_(clo_freelist_vol) < 0) MAC_(clo_freelist_vol) = 0;
   }

   else if (VG_CLO_STREQ(arg, "--leak-check=yes"))
      MAC_(clo_leak_check) = True;
   else if (VG_CLO_STREQ(arg, "--leak-check=no"))
      MAC_(clo_leak_check) = False;

   else if (VG_CLO_STREQ(arg, "--leak-resolution=low"))
      MAC_(clo_leak_resolution) = Vg_LowRes;
   else if (VG_CLO_STREQ(arg, "--leak-resolution=med"))
      MAC_(clo_leak_resolution) = Vg_MedRes;
   else if (VG_CLO_STREQ(arg, "--leak-resolution=high"))
      MAC_(clo_leak_resolution) = Vg_HighRes;
   
   else if (VG_CLO_STREQ(arg, "--show-reachable=yes"))
      MAC_(clo_show_reachable) = True;
   else if (VG_CLO_STREQ(arg, "--show-reachable=no"))
      MAC_(clo_show_reachable) = False;

   else if (VG_CLO_STREQ(arg, "--workaround-gcc296-bugs=yes"))
      MAC_(clo_workaround_gcc296_bugs) = True;
   else if (VG_CLO_STREQ(arg, "--workaround-gcc296-bugs=no"))
      MAC_(clo_workaround_gcc296_bugs) = False;

   else
      return VG_(replacement_malloc_process_cmd_line_option)(arg);

   return True;
}
Ejemplo n.º 5
0
Bool VG_(replacement_malloc_process_cmd_line_option)(Char* arg)
{
   if (VG_CLO_STREQN(12, arg, "--alignment=")) {
      VG_(clo_alignment) = (UInt)VG_(atoll)(&arg[12]);

      if (VG_(clo_alignment) < VG_MIN_MALLOC_SZB
          || VG_(clo_alignment) > 4096
          || VG_(log2)( VG_(clo_alignment) ) == -1 /* not a power of 2 */) {
         VG_(message)(Vg_UserMsg, "");
         VG_(message)(Vg_UserMsg, 
            "Invalid --alignment= setting.  "
            "Should be a power of 2, >= %d, <= 4096.", VG_MIN_MALLOC_SZB);
         VG_(err_bad_option)("--alignment");
      }
   }

   else VG_BOOL_CLO(arg, "--trace-malloc",  VG_(clo_trace_malloc))
   else 
      return False;

   return True;
}