|
From: <sv...@va...> - 2009-05-17 16:29:24
|
Author: sewardj
Date: 2009-05-17 17:29:20 +0100 (Sun, 17 May 2009)
New Revision: 9864
Log:
In the core/tool iface, move the .before_pp_Error method from
VG_(needs_xml_output) to VG_(needs_tool_errors), and restore
VG_(needs_xml_output) to what it needs originally. .before_pp_Error
now becomes mandatory for functions which report errors. It doesn't
have anything to do with XML output, and so putting it in the
VG_(needs_xml_output) dictionary was a mistake, which this commit
corrects.
Modified:
branches/MESSAGING_TIDYUP/coregrind/m_tooliface.c
branches/MESSAGING_TIDYUP/coregrind/pub_core_tooliface.h
branches/MESSAGING_TIDYUP/drd/drd_error.c
branches/MESSAGING_TIDYUP/exp-ptrcheck/pc_main.c
branches/MESSAGING_TIDYUP/helgrind/hg_main.c
branches/MESSAGING_TIDYUP/include/pub_tool_tooliface.h
branches/MESSAGING_TIDYUP/memcheck/mc_main.c
Modified: branches/MESSAGING_TIDYUP/coregrind/m_tooliface.c
===================================================================
--- branches/MESSAGING_TIDYUP/coregrind/m_tooliface.c 2009-05-17 16:26:48 UTC (rev 9863)
+++ branches/MESSAGING_TIDYUP/coregrind/m_tooliface.c 2009-05-17 16:29:20 UTC (rev 9864)
@@ -225,6 +225,7 @@
void VG_(needs_tool_errors)(
Bool (*eq) (VgRes, Error*, Error*),
+ void (*before_pp) (Error*),
void (*pp) (Error*),
Bool show_TIDs,
UInt (*update) (Error*),
@@ -237,6 +238,7 @@
{
VG_(needs).tool_errors = True;
VG_(tdict).tool_eq_Error = eq;
+ VG_(tdict).tool_before_pp_Error = before_pp;
VG_(tdict).tool_pp_Error = pp;
VG_(tdict).tool_show_ThreadIDs_for_errors = show_TIDs;
VG_(tdict).tool_update_extra = update;
@@ -315,12 +317,9 @@
VG_(tdict).tool_client_redzone_szB = client_malloc_redzone_szB;
}
-void VG_(needs_xml_output)(
- void (*before_pp_Error)( Error* )
-)
+void VG_(needs_xml_output)( void )
{
VG_(needs).xml_output = True;
- VG_(tdict).tool_before_pp_Error = before_pp_Error;
}
void VG_(needs_final_IR_tidy_pass)(
Modified: branches/MESSAGING_TIDYUP/coregrind/pub_core_tooliface.h
===================================================================
--- branches/MESSAGING_TIDYUP/coregrind/pub_core_tooliface.h 2009-05-17 16:26:48 UTC (rev 9863)
+++ branches/MESSAGING_TIDYUP/coregrind/pub_core_tooliface.h 2009-05-17 16:29:20 UTC (rev 9864)
@@ -117,6 +117,7 @@
// VG_(needs).tool_errors
Bool (*tool_eq_Error) (VgRes, Error*, Error*);
+ void (*tool_before_pp_Error) (Error*);
void (*tool_pp_Error) (Error*);
Bool tool_show_ThreadIDs_for_errors;
UInt (*tool_update_extra) (Error*);
@@ -162,7 +163,7 @@
IRSB* (*tool_final_IR_tidy_pass) (IRSB*);
// VG_(needs).xml_output
- void (*tool_before_pp_Error) (Error*);
+ // (none)
// -- Event tracking functions ------------------------------------
void (*track_new_mem_startup) (Addr, SizeT, Bool, Bool, Bool, ULong);
Modified: branches/MESSAGING_TIDYUP/drd/drd_error.c
===================================================================
--- branches/MESSAGING_TIDYUP/drd/drd_error.c 2009-05-17 16:26:48 UTC (rev 9863)
+++ branches/MESSAGING_TIDYUP/drd/drd_error.c 2009-05-17 16:29:20 UTC (rev 9864)
@@ -194,6 +194,12 @@
return False;
}
+static void drd_tool_error_before_pp(Error* const e)
+{
+ /* No need to do anything; drd_tool_error_pp does all
+ the work. */
+}
+
static void drd_tool_error_pp(Error* const e)
{
switch (VG_(get_error_kind)(e))
@@ -450,6 +456,7 @@
{
// Tool error reporting.
VG_(needs_tool_errors)(drd_tool_error_eq,
+ drd_tool_error_before_pp,
drd_tool_error_pp,
True,
drd_tool_error_update_extra,
Modified: branches/MESSAGING_TIDYUP/exp-ptrcheck/pc_main.c
===================================================================
--- branches/MESSAGING_TIDYUP/exp-ptrcheck/pc_main.c 2009-05-17 16:26:48 UTC (rev 9863)
+++ branches/MESSAGING_TIDYUP/exp-ptrcheck/pc_main.c 2009-05-17 16:29:20 UTC (rev 9864)
@@ -176,6 +176,7 @@
VG_(needs_core_errors) ();
VG_(needs_tool_errors) (pc_eq_Error,
+ pc_before_pp_Error,
pc_pp_Error,
True,/*show TIDs for errors*/
pc_update_Error_extra,
@@ -185,7 +186,7 @@
pc_get_error_name,
pc_print_extra_suppression_info);
- VG_(needs_xml_output) (pc_before_pp_Error);
+ VG_(needs_xml_output) ();
VG_(needs_syscall_wrapper)( h_pre_syscall,
h_post_syscall );
Modified: branches/MESSAGING_TIDYUP/helgrind/hg_main.c
===================================================================
--- branches/MESSAGING_TIDYUP/helgrind/hg_main.c 2009-05-17 16:26:48 UTC (rev 9863)
+++ branches/MESSAGING_TIDYUP/helgrind/hg_main.c 2009-05-17 16:29:20 UTC (rev 9864)
@@ -4195,6 +4195,7 @@
VG_(needs_core_errors) ();
VG_(needs_tool_errors) (HG_(eq_Error),
+ HG_(before_pp_Error),
HG_(pp_Error),
False,/*show TIDs for errors*/
HG_(update_extra),
@@ -4204,7 +4205,7 @@
HG_(get_error_name),
HG_(print_extra_suppression_info));
- VG_(needs_xml_output) (HG_(before_pp_Error));
+ VG_(needs_xml_output) ();
VG_(needs_command_line_options)(hg_process_cmd_line_option,
hg_print_usage,
Modified: branches/MESSAGING_TIDYUP/include/pub_tool_tooliface.h
===================================================================
--- branches/MESSAGING_TIDYUP/include/pub_tool_tooliface.h 2009-05-17 16:26:48 UTC (rev 9863)
+++ branches/MESSAGING_TIDYUP/include/pub_tool_tooliface.h 2009-05-17 16:29:20 UTC (rev 9864)
@@ -284,6 +284,16 @@
// similar errors occurring.
Bool (*eq_Error)(VgRes res, Error* e1, Error* e2),
+ // We give tools a chance to have a look at errors
+ // just before they are printed. That is, before_pp_Error is
+ // called just before pp_Error itself. This gives the tool a
+ // chance to look at the just-about-to-be-printed error, so as to
+ // emit any arbitrary output if wants to, before the error itself
+ // is printed. This functionality was added to allow Helgrind to
+ // print thread-announcement messages immediately before the
+ // errors that refer to them.
+ void (*before_pp_Error)(Error* err),
+
// Print error context.
void (*pp_Error)(Error* err),
@@ -424,17 +434,7 @@
/* 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)(
- // We give tools a chance to have a look at errors
- // just before they are printed. That is, before_pp_Error is
- // called just before pp_Error itself. This gives the tool a chance
- // to look at the just-about-to-be-printed error, so as to emit any
- // arbitrary output they want to, before the error itself is
- // printed. This functionality was added to allow Helgrind to print
- // thread-announcement messages in XML form, but is in fact called
- // regardless of whether or not we're in XML mode.
- void (*before_pp_Error)( Error* )
-);
+extern void VG_(needs_xml_output) ( void );
/* Does the tool want to have one final pass over the IR after tree
building but before instruction selection? If so specify the
Modified: branches/MESSAGING_TIDYUP/memcheck/mc_main.c
===================================================================
--- branches/MESSAGING_TIDYUP/memcheck/mc_main.c 2009-05-17 16:26:48 UTC (rev 9863)
+++ branches/MESSAGING_TIDYUP/memcheck/mc_main.c 2009-05-17 16:29:20 UTC (rev 9864)
@@ -5690,6 +5690,7 @@
VG_(needs_core_errors) ();
VG_(needs_tool_errors) (MC_(eq_Error),
+ MC_(before_pp_Error),
MC_(pp_Error),
True,/*show TIDs for errors*/
MC_(update_Error_extra),
@@ -5717,7 +5718,7 @@
MC_(malloc_usable_size),
MC_MALLOC_REDZONE_SZB );
- VG_(needs_xml_output) (MC_(before_pp_Error));
+ VG_(needs_xml_output) ();
VG_(track_new_mem_startup) ( mc_new_mem_startup );
VG_(track_new_mem_stack_signal)( make_mem_undefined_w_tid );
|