OSDN Git Service

2006-09-27 Dave Brolley <brolley@redhat.com>
authorbrolley <brolley>
Wed, 27 Sep 2006 20:28:47 +0000 (20:28 +0000)
committerbrolley <brolley>
Wed, 27 Sep 2006 20:28:47 +0000 (20:28 +0000)
        * commonCfg.cxx (profile_opt_gprof_value): Handle "gprof=<file>,cycles".

sid/main/dynamic/ChangeLog
sid/main/dynamic/commonCfg.cxx

index 09c7b59..524d075 100644 (file)
@@ -1,3 +1,7 @@
+2006-09-27  Dave Brolley  <brolley@redhat.com>
+
+       * commonCfg.cxx (profile_opt_gprof_value): Handle "gprof=<file>,cycles".
+
 2006-09-19  Dave Brolley  <brolley@redhat.com>
 
        * commonCfg.cxx (MemCfg::set_size): Use make_numeric_attribute and pass
index 9aae47a..2687ddc 100644 (file)
@@ -776,18 +776,25 @@ SessionCfg::profile_opt_gprof_value (const string& opt, const vector<string>& op
     profile_config_error (opt); // doesn't return
 
   vector<string> sub_parts = sidutil::tokenize (opt_parts[1], ",");
+  if (sub_parts.size () > 2)
+    profile_config_error (opt); // doesn't return
+
   string value = sub_parts[0];
-  if (size == 3)
+  if (sub_parts.size () == 2)
     {
-      if (sub_parts.size () != 2 || sub_parts[1] != "cycles")
-       profile_config_error (opt); // doesn't return
-
-      unsigned n;
-      sid::component::status s = sidutil::parse_attribute (opt_parts[2], n);
-      if (s != sid::component::ok)
+      if (sub_parts[1] != "cycles")
        profile_config_error (opt); // doesn't return
 
-      value += "," + opt_parts[2];
+      if (size == 3)
+       {
+         unsigned n;
+         sid::component::status s = sidutil::parse_attribute (opt_parts[2], n);
+         if (s != sid::component::ok)
+           profile_config_error (opt); // doesn't return
+         value += "," + opt_parts[2];
+       }
+      else
+       value += ",1";
     }
 
   need_gprof = true;