]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Remove tool-specific code (which says which tools allow XML) from the core
authorNicholas Nethercote <njn@valgrind.org>
Sun, 16 Apr 2006 10:25:43 +0000 (10:25 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Sun, 16 Apr 2006 10:25:43 +0000 (10:25 +0000)
by introducing a new "need":  VG_(needs_xml_output)().

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5854

coregrind/m_main.c
coregrind/m_tooliface.c
coregrind/pub_core_tooliface.h
docs/xml/manual-core.xml
include/pub_tool_tooliface.h
memcheck/mc_main.c
none/tests/cmdline1.stdout.exp
none/tests/cmdline2.stdout.exp

index bc0b591fb50cf8540910ce1c9e4e1543c51a417d..8b5a1d3e07c0ef3ade6dc1818dc6aaa06c920b8c 100644 (file)
@@ -912,7 +912,7 @@ static void usage_NORETURN ( Bool debug_help )
 "                              handle non-standard kernel variants\n"
 "\n"
 "  user options for Valgrind tools that report errors:\n"
-"    --xml=yes                 all output is in XML (Memcheck/Nulgrind only)\n"
+"    --xml=yes                 all output is in XML (some tools only)\n"
 "    --xml-user-comment=STR    copy STR verbatim to XML output\n"
 "    --demangle=no|yes         automatically demangle C++ names? [yes]\n"
 "    --num-callers=<number>    show <number> callers in stack traces [12]\n"
@@ -1457,11 +1457,10 @@ static Bool process_cmd_line_options( UInt* client_auxv, const char* toolname )
 
 
    /* Check that the requested tool actually supports XML output. */
-   if (VG_(clo_xml) && !VG_STREQ(toolname, "memcheck")
-                    && !VG_STREQ(toolname, "none")) {
+   if (VG_(clo_xml) && !VG_(needs).xml_output) {
       VG_(clo_xml) = False;
       VG_(message)(Vg_UserMsg, 
-         "Currently only Memcheck|None supports XML output."); 
+         "%s does not support XML output.", VG_(details).name); 
       VG_(bad_option)("--xml=yes");
       /*NOTREACHED*/
    }
index 359408bbee7aa4a4209e8a382827e77d8c881fe3..dd941efad5b635527a64b12d13f419c366da10c4 100644 (file)
@@ -93,6 +93,7 @@ VgNeeds VG_(needs) = {
    .sanity_checks        = False,
    .data_syms           = False,
    .malloc_replacement   = False,
+   .xml_output           = False,
 };
 
 /* static */
@@ -161,6 +162,7 @@ Bool VG_(sanity_check_needs)(Char** failmsg)
 NEEDS(libc_freeres)
 NEEDS(core_errors)
 NEEDS(data_syms)
+NEEDS(xml_output)
 
 void VG_(needs_basic_block_discards)(
    void (*discard)(Addr64, VexGuestExtents)
index 58666287ebc0fc7688985bf7f1b91bdbca42edc9..7746fee0e6448517b77aee910bdc6acd1ee9218a 100644 (file)
@@ -90,6 +90,7 @@ typedef
       Bool sanity_checks;
       Bool data_syms;
       Bool malloc_replacement;
+      Bool xml_output;
    } 
    VgNeeds;
 
index b059ae18279a3954f2ec685edf715ee78cf8e523..f33375676b22c532e2206e23045942401153163c 100644 (file)
@@ -766,7 +766,7 @@ that can report errors, e.g. Memcheck, but not Cachegrind.</para>
       <para>When enabled, output will be in XML format.  This is aimed
       at making life easier for tools that consume Valgrind's output as
       input, such as GUI front ends.  Currently this option only works
-      with Memcheck and Nulgrind.</para>
+      with Memcheck.</para>
     </listitem>
   </varlistentry>
 
index 7ae35d10639a17d9104a44adaa3487c7f3cdbb99..6f70836bfda3904213dadca37e99a3594e57491c 100644 (file)
@@ -138,9 +138,6 @@ extern void VG_(details_bug_reports_to)   ( Char* bug_reports_to );
 /* ------------------------------------------------------------------ */
 /* Needs */
 
-/* Booleans that decide core behaviour, but don't require extra
-   operations to be defined if `True' */
-
 /* Should __libc_freeres() be run?  Bugs in it can crash the tool. */
 extern void VG_(needs_libc_freeres) ( void );
 
@@ -299,6 +296,11 @@ extern void VG_(needs_malloc_replacement)(
    SizeT client_malloc_redzone_szB
 );
 
+/* Can the tool do XML output?  This is a slight misnomer, because the tool
+ * is not requesting the core to do anything, rather saying "I can handle
+ * it". */
+extern void VG_(needs_xml_output)( void );
+
 /* ------------------------------------------------------------------ */
 /* Core events to track */
 
index 6286dbdeb3c05ba3206a5bc7572fba6af3d16f2e..0ee073b25ad10ef511d133b3d94c4b6c1f7bd471 100644 (file)
@@ -4330,7 +4330,6 @@ static void mc_pre_clo_init(void)
    VG_(needs_client_requests)     (mc_handle_client_request);
    VG_(needs_sanity_checks)       (mc_cheap_sanity_check,
                                    mc_expensive_sanity_check);
-
    VG_(needs_malloc_replacement)  (MC_(malloc),
                                    MC_(__builtin_new),
                                    MC_(__builtin_vec_new),
@@ -4341,6 +4340,7 @@ static void mc_pre_clo_init(void)
                                    MC_(__builtin_vec_delete),
                                    MC_(realloc),
                                    MC_MALLOC_REDZONE_SZB );
+   VG_(needs_xml_output)          ();
 
    VG_(track_new_mem_startup)     ( mc_new_mem_startup );
    VG_(track_new_mem_stack_signal)( MC_(make_mem_undefined) );
index 6ceb817e17e57c1f7fd087d7639cea9410e65f70..1338d918e31c56aaba12aad9ea4a69d4888846bc 100644 (file)
@@ -27,7 +27,7 @@ usage: valgrind [options] prog-and-args
                               handle non-standard kernel variants
 
   user options for Valgrind tools that report errors:
-    --xml=yes                 all output is in XML (Memcheck/Nulgrind only)
+    --xml=yes                 all output is in XML (some tools only)
     --xml-user-comment=STR    copy STR verbatim to XML output
     --demangle=no|yes         automatically demangle C++ names? [yes]
     --num-callers=<number>    show <number> callers in stack traces [12]
index 69a4e27ccebfa015e21c9158104073bb62f6adc3..f1fc904abd3f083bd6a665fb5d5e0e286cb9f6f3 100644 (file)
@@ -27,7 +27,7 @@ usage: valgrind [options] prog-and-args
                               handle non-standard kernel variants
 
   user options for Valgrind tools that report errors:
-    --xml=yes                 all output is in XML (Memcheck/Nulgrind only)
+    --xml=yes                 all output is in XML (some tools only)
     --xml-user-comment=STR    copy STR verbatim to XML output
     --demangle=no|yes         automatically demangle C++ names? [yes]
     --num-callers=<number>    show <number> callers in stack traces [12]