alleyoop r326 - in trunk: . src



Author: fejj
Date: Sun Mar  8 23:36:21 2009
New Revision: 326
URL: http://svn.gnome.org/viewvc/alleyoop?rev=326&view=rev

Log:
2009-03-08  Jeffrey Stedfast  <fejj novell com>

	* src/alleyoop.schemas: Updated.

	* src/vghelgrindprefs.c (helgrind_prefs_get_argv): Changed the
	trace-level gconf key to store an int instead of string.



Modified:
   trunk/ChangeLog
   trunk/src/alleyoop.schemas
   trunk/src/vghelgrindprefs.c
   trunk/src/vgmemcheckprefs.c

Modified: trunk/src/alleyoop.schemas
==============================================================================
--- trunk/src/alleyoop.schemas	(original)
+++ trunk/src/alleyoop.schemas	Sun Mar  8 23:36:21 2009
@@ -116,7 +116,7 @@
     </schema>
 
     <schema>
-      <key>/schemas/apps/alleyoop/valgrind/general/suppresions</key>
+      <key>/schemas/apps/alleyoop/valgrind/general/suppressions</key>
       <applyto>/apps/alleyoop/valgrind/general/suppressions</applyto>
       <owner>alleyoop</owner>
       <type>string</type>
@@ -184,24 +184,46 @@
     </schema>
 
     <schema>
-      <key>/schemas/apps/alleyoop/valgrind/memcheck/workaround-gcc296-bugs</key>
-      <applyto>/apps/alleyoop/valgrind/memcheck/workaround-gcc296-bugs</applyto>
+      <key>/schemas/apps/alleyoop/valgrind/memcheck/ignore-ranges</key>
+      <applyto>/apps/alleyoop/valgrind/memcheck/ignore-ranges</applyto>
       <owner>alleyoop</owner>
-      <type>bool</type>
-      <default>false</default>
+      <type>string</type>
+      <default></default>
       <locale name="C">
-         <short>Work around gcc 2.96 bugs</short>
+         <short>Assume given addresses are OK</short>
+      </locale>
+    </schema>
+
+    <schema>
+      <key>/schemas/apps/alleyoop/valgrind/memcheck/malloc-fill</key>
+      <applyto>/apps/alleyoop/valgrind/memcheck/malloc-fill</applyto>
+      <owner>alleyoop</owner>
+      <type>string</type>
+      <default></default>
+      <locale name="C">
+         <short>Fill malloc()'d areas with the given value</short>
+      </locale>
+    </schema>
+
+    <schema>
+      <key>/schemas/apps/alleyoop/valgrind/memcheck/free-fill</key>
+      <applyto>/apps/alleyoop/valgrind/memcheck/free-fill</applyto>
+      <owner>alleyoop</owner>
+      <type>string</type>
+      <default></default>
+      <locale name="C">
+         <short>Fill free()'d areas with the given value</short>
       </locale>
     </schema>
 
     <schema>
-      <key>/schemas/apps/alleyoop/valgrind/memcheck/avoid-strlen-errors</key>
-      <applyto>/apps/alleyoop/valgrind/memcheck/avoid-strlen-errors</applyto>
+      <key>/schemas/apps/alleyoop/valgrind/memcheck/workaround-gcc296-bugs</key>
+      <applyto>/apps/alleyoop/valgrind/memcheck/workaround-gcc296-bugs</applyto>
       <owner>alleyoop</owner>
       <type>bool</type>
-      <default>true</default>
+      <default>false</default>
       <locale name="C">
-         <short>Suppress errors from inlined strlen</short>
+         <short>Work around gcc 2.96 bugs</short>
       </locale>
     </schema>
 
@@ -276,24 +298,46 @@
     <!-- Helgrind settings -->
 
     <schema>
-      <key>/schemas/apps/alleyoop/valgrind/helgrind/private-stacks</key>
-      <applyto>/apps/alleyoop/valgrind/helgrind/private-stacks</applyto>
+      <key>/schemas/apps/alleyoop/valgrind/helgrind/happens-before</key>
+      <applyto>/apps/alleyoop/valgrind/helgrind/happens-before</applyto>
+      <owner>alleyoop</owner>
+      <type>string</type>
+      <default>all</default>
+      <locale name="C">
+         <short>Events to consider as sync events</short>
+      </locale>
+    </schema>
+
+    <schema>
+      <key>/schemas/apps/alleyoop/valgrind/helgrind/enable-trace-addr</key>
+      <applyto>/apps/alleyoop/valgrind/helgrind/enable-trace-addr</applyto>
       <owner>alleyoop</owner>
       <type>bool</type>
       <default>false</default>
       <locale name="C">
-         <short>Assume thread stacks are used privately</short>
+         <short>Enable the --trace-addr option</short>
       </locale>
     </schema>
 
     <schema>
-      <key>/schemas/apps/alleyoop/valgrind/helgrind/show-last-access</key>
-      <applyto>/apps/alleyoop/valgrind/helgrind/show-last-access</applyto>
+      <key>/schemas/apps/alleyoop/valgrind/helgrind/trace-addr</key>
+      <applyto>/apps/alleyoop/valgrind/helgrind/trace-addr</applyto>
       <owner>alleyoop</owner>
       <type>string</type>
-      <default>no</default>
+      <default></default>
+      <locale name="C">
+         <short>Address to trace</short>
+      </locale>
+    </schema>
+
+    <schema>
+      <key>/schemas/apps/alleyoop/valgrind/helgrind/trace-level</key>
+      <applyto>/apps/alleyoop/valgrind/helgrind/trace-level</applyto>
+      <owner>alleyoop</owner>
+      <type>int</type>
+      <default>1</default>
       <locale name="C">
-         <short>Show location of last word access on error</short>
+         <short>Logging verbosity level</short>
       </locale>
     </schema>
 

Modified: trunk/src/vghelgrindprefs.c
==============================================================================
--- trunk/src/vghelgrindprefs.c	(original)
+++ trunk/src/vghelgrindprefs.c	Sun Mar  8 23:36:21 2009
@@ -30,10 +30,10 @@
 #include "vghelgrindprefs.h"
 
 
-#define HAPPENS_BEFORE_KEY    "/apps/alleyoop/valgrind/helgrind/happens_before"
-#define ENABLE_TRACE_ADDR_KEY "/apps/alleyoop/valgrind/helgrind/enable_trace_addr"
-#define TRACE_ADDR_KEY        "/apps/alleyoop/valgrind/helgrind/trace_addr"
-#define TRACE_LEVEL_KEY       "/apps/alleyoop/valgrind/helgrind/trace_level"
+#define HAPPENS_BEFORE_KEY    "/apps/alleyoop/valgrind/helgrind/happens-before"
+#define ENABLE_TRACE_ADDR_KEY "/apps/alleyoop/valgrind/helgrind/enable-trace-addr"
+#define TRACE_ADDR_KEY        "/apps/alleyoop/valgrind/helgrind/trace-addr"
+#define TRACE_LEVEL_KEY       "/apps/alleyoop/valgrind/helgrind/trace-level"
 
 static void vg_helgrind_prefs_class_init (VgHelgrindPrefsClass *klass);
 static void vg_helgrind_prefs_init (VgHelgrindPrefs *prefs);
@@ -152,11 +152,18 @@
 {
 	GConfClient *gconf;
 	const char *str;
+	int val;
 	
 	gconf = gconf_client_get_default ();
 	
 	str = g_object_get_data ((GObject *) item, "value");
-	gconf_client_set_string (gconf, key, str, NULL);
+	
+	if (key == TRACE_LEVEL_KEY) {
+		val = strtol (str, NULL, 10);
+		gconf_client_set_int (gconf, key, val, NULL);
+	} else {
+		gconf_client_set_string (gconf, key, str, NULL);
+	}
 	
 	g_object_unref (gconf);
 }
@@ -168,11 +175,16 @@
 option_menu_new (GConfClient *gconf, const char **opts, int nopts, const char *key)
 {
 	GtkWidget *omenu, *menu, *item;
-	int history = 0;
+	int history, i;
 	char *str;
-	int i;
 	
-	str = gconf_client_get_string (gconf, key, NULL);
+	if (key == TRACE_LEVEL_KEY) {
+		history = gconf_client_get_int (gconf, key, NULL);
+		str = NULL;
+	} else {
+		str = gconf_client_get_string (gconf, key, NULL);
+		history = 0;
+	}
 	
 	menu = gtk_menu_new ();
 	for (i = 0; i < nopts; i++) {
@@ -279,15 +291,21 @@
 	;
 }
 
+enum {
+	ARG_TYPE_INT,
+	ARG_TYPE_STRING
+};
+
 static struct {
 	const char *key;
 	const char *arg;
 	gboolean depends;
 	char *buf;
+	int type;
 } helgrind_args[] = {
-	{ HAPPENS_BEFORE_KEY,   "--happens-before",   FALSE, NULL },
-	{ TRACE_ADDR_KEY,       "--trace-addr",       TRUE,  NULL },
-	{ TRACE_LEVEL_KEY,      "--trace-level",      TRUE,  NULL },
+	{ HAPPENS_BEFORE_KEY, "--happens-before", FALSE, NULL, ARG_TYPE_STRING },
+	{ TRACE_ADDR_KEY,     "--trace-addr",     TRUE,  NULL, ARG_TYPE_STRING },
+	{ TRACE_LEVEL_KEY,    "--trace-level",    TRUE,  NULL, ARG_TYPE_INT    },
 };
 
 static void
@@ -296,6 +314,7 @@
 	gboolean enable_trace_addr;
 	GConfClient *gconf;
 	char *str;
+	int val;
 	int i;
 	
 	gconf = gconf_client_get_default ();
@@ -312,17 +331,22 @@
 		if (helgrind_args[i].depends && !enable_trace_addr)
 			continue;
 		
-		if (!(str = gconf_client_get_string (gconf, key, NULL)) || *str == '\0') {
-			if (key == TRACE_ADDR_KEY)
-				enable_trace_addr = FALSE;
+		if (helgrind_args[i].type == ARG_TYPE_STRING) {
+			if (!(str = gconf_client_get_string (gconf, key, NULL)) || *str == '\0') {
+				if (key == TRACE_ADDR_KEY)
+					enable_trace_addr = FALSE;
+				
+				g_free (str);
+				continue;
+			}
 			
+			helgrind_args[i].buf = g_strdup_printf ("%s=%s", arg, str);
 			g_free (str);
-			continue;
+		} else if (helgrind_args[i].type == ARG_TYPE_INT) {
+			val = gconf_client_get_int (gconf, key, NULL);
+			helgrind_args[i].buf = g_strdup_printf ("%s=%d", arg, val);
 		}
 		
-		helgrind_args[i].buf = g_strdup_printf ("%s=%s", arg, str);
-		g_free (str);
-		
 		g_ptr_array_add (argv, helgrind_args[i].buf);
 	}
 	

Modified: trunk/src/vgmemcheckprefs.c
==============================================================================
--- trunk/src/vgmemcheckprefs.c	(original)
+++ trunk/src/vgmemcheckprefs.c	Sun Mar  8 23:36:21 2009
@@ -36,12 +36,12 @@
 #define SHOW_REACHABLE_KEY         "/apps/alleyoop/valgrind/memcheck/show-reachable"
 #define LEAK_RESOLUTION_KEY        "/apps/alleyoop/valgrind/memcheck/leak-resolution"
 #define FREELIST_VOL_KEY           "/apps/alleyoop/valgrind/memcheck/freelist-vol"
-//#define ENABLE_IGNORE_RANGES_KEY   "/apps/alleyoop/valgrind/memcheck/enable_ignore_ranges"
-#define IGNORE_RANGES_KEY          "/apps/alleyoop/valgrind/memcheck/ignore_ranges"
-//#define ENABLE_MALLOC_FILL_KEY     "/apps/alleyoop/valgrind/memcheck/enable_malloc_fill"
-#define MALLOC_FILL_KEY            "/apps/alleyoop/valgrind/memcheck/malloc_fill"
-//#define ENABLE_FREE_FILL_KEY       "/apps/alleyoop/valgrind/memcheck/enable_free_fill"
-#define FREE_FILL_KEY              "/apps/alleyoop/valgrind/memcheck/free_fill"
+//#define ENABLE_IGNORE_RANGES_KEY   "/apps/alleyoop/valgrind/memcheck/enable-ignore-ranges"
+#define IGNORE_RANGES_KEY          "/apps/alleyoop/valgrind/memcheck/ignore-ranges"
+//#define ENABLE_MALLOC_FILL_KEY     "/apps/alleyoop/valgrind/memcheck/enable-malloc-fill"
+#define MALLOC_FILL_KEY            "/apps/alleyoop/valgrind/memcheck/malloc-fill"
+//#define ENABLE_FREE_FILL_KEY       "/apps/alleyoop/valgrind/memcheck/enable-free-fill"
+#define FREE_FILL_KEY              "/apps/alleyoop/valgrind/memcheck/free-fill"
 #define WORKAROUND_GCC296_BUGS_KEY "/apps/alleyoop/valgrind/memcheck/workaround-gcc296-bugs"
 
 static void vg_memcheck_prefs_class_init (VgMemcheckPrefsClass *klass);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]