|
From: <sv...@va...> - 2009-07-15 14:52:27
|
Author: sewardj
Date: 2009-07-15 15:52:18 +0100 (Wed, 15 Jul 2009)
New Revision: 10476
Log:
Merge include/ changes from branches/MESSAGING_TIDYUP r10464.
See trunk r10465 commit message for details.
Modified:
trunk/include/pub_tool_debuginfo.h
trunk/include/pub_tool_libcprint.h
trunk/include/pub_tool_options.h
trunk/include/pub_tool_tooliface.h
trunk/include/pub_tool_wordfm.h
Modified: trunk/include/pub_tool_debuginfo.h
===================================================================
--- trunk/include/pub_tool_debuginfo.h 2009-07-15 14:52:02 UTC (rev 10475)
+++ trunk/include/pub_tool_debuginfo.h 2009-07-15 14:52:18 UTC (rev 10476)
@@ -95,16 +95,25 @@
/*OUT*/Char* dname, Int n_dname,
/*OUT*/PtrdiffT* offset );
-/* Try to form some description of data_addr by looking at the DWARF3
+/* Try to form some description of DATA_ADDR by looking at the DWARF3
debug info we have. This considers all global variables, and all
- frames in the stacks of all threads. Result (or as much as will
- fit) is put into into dname{1,2}[0 .. n_dname-1] and is guaranteed
- to be zero terminated. */
-extern Bool VG_(get_data_description)( /*OUT*/Char* dname1,
- /*OUT*/Char* dname2,
- Int n_dname,
- Addr data_addr );
+ frames in the stacks of all threads. Result is written at the ends
+ of DNAME{1,2}V, which are XArray*s of HChar, that have been
+ initialised by the caller, and True is returned. If no description
+ is created, False is returned. Regardless of the return value,
+ DNAME{1,2}V are guaranteed to be zero terminated after the call.
+ Note that after the call, DNAME{1,2} may have more than one
+ trailing zero, so callers should establish the useful text length
+ using VG_(strlen) on the contents, rather than VG_(sizeXA) on the
+ XArray itself.
+*/
+Bool VG_(get_data_description)(
+ /*MOD*/ void* /* really, XArray* of HChar */ dname1v,
+ /*MOD*/ void* /* really, XArray* of HChar */ dname2v,
+ Addr data_addr
+ );
+
/* Succeeds if the address is within a shared object or the main executable.
It doesn't matter if debug info is present or not. */
extern Bool VG_(get_objname) ( Addr a, Char* objname, Int n_objname );
Modified: trunk/include/pub_tool_libcprint.h
===================================================================
--- trunk/include/pub_tool_libcprint.h 2009-07-15 14:52:02 UTC (rev 10475)
+++ trunk/include/pub_tool_libcprint.h 2009-07-15 14:52:18 UTC (rev 10476)
@@ -50,28 +50,58 @@
------------------------------------------------------------------ */
/* Note that they all output to the file descriptor given by the
- * --log-fd/--log-file/--log-socket argument, which defaults to 2 (stderr).
- * Hence no need for VG_(fprintf)().
- */
-extern UInt VG_(printf) ( const HChar *format, ... ) PRINTF_CHECK(1, 2);
-extern UInt VG_(vprintf) ( const HChar *format, va_list vargs ) PRINTF_CHECK(1, 0);
-extern UInt VG_(sprintf) ( Char* buf, const HChar* format, ... ) PRINTF_CHECK(2, 3);
-extern UInt VG_(vsprintf) ( Char* buf, const HChar* format, va_list vargs ) PRINTF_CHECK(2, 0);
+ --log-fd/--log-file/--log-socket argument, which defaults to 2
+ (stderr). Hence no need for VG_(fprintf)().
+*/
+extern UInt VG_(printf) ( const HChar *format, ... )
+ PRINTF_CHECK(1, 2);
+
+extern UInt VG_(vprintf) ( const HChar *format, va_list vargs )
+ PRINTF_CHECK(1, 0);
+
+extern UInt VG_(sprintf) ( Char* buf, const HChar* format, ... )
+ PRINTF_CHECK(2, 3);
+
+extern UInt VG_(vsprintf) ( Char* buf, const HChar* format, va_list vargs )
+ PRINTF_CHECK(2, 0);
+
extern UInt VG_(snprintf) ( Char* buf, Int size,
- const HChar *format, ... ) PRINTF_CHECK(3, 4);
+ const HChar *format, ... )
+ PRINTF_CHECK(3, 4);
+
extern UInt VG_(vsnprintf)( Char* buf, Int size,
- const HChar *format, va_list vargs ) PRINTF_CHECK(3, 0);
+ const HChar *format, va_list vargs )
+ PRINTF_CHECK(3, 0);
+/* Yet another, totally general, version of vprintf, which hands all
+ output bytes to CHAR_SINK, passing it OPAQUE as the second arg. */
+extern void VG_(vcbprintf)( void(*char_sink)(HChar, void* opaque),
+ void* opaque,
+ const HChar* format, va_list vargs );
+
+/* These are the same as the non "_xml" versions above, except the
+ output goes on the selected XML output channel instead of the
+ normal one.
+*/
+extern UInt VG_(printf_xml) ( const HChar *format, ... )
+ PRINTF_CHECK(1, 2);
+
+extern UInt VG_(vprintf_xml) ( const HChar *format, va_list vargs )
+ PRINTF_CHECK(1, 0);
+
+extern UInt VG_(printf_xml_no_f_c) ( const HChar *format, ... );
+
// Percentify n/m with d decimal places. Includes the '%' symbol at the end.
// Right justifies in 'buf'.
extern void VG_(percentify)(ULong n, ULong m, UInt d, Int n_buf, char buf[]);
+
/* ---------------------------------------------------------------------
Messages for the user
------------------------------------------------------------------ */
/* No, really. I _am_ that strange. */
-#define OINK(nnn) VG_(message)(Vg_DebugMsg, "OINK %d",nnn)
+#define OINK(nnn) VG_(message)(Vg_DebugMsg, "OINK %d\n",nnn)
/* Print a message prefixed by "??<pid>?? "; '?' depends on the VgMsgKind.
Should be used for all user output. */
@@ -84,14 +114,14 @@
}
VgMsgKind;
-/* Send a single-part message. Appends a newline. The format
- specification may contain any ISO C format specifier or %t.
- No attempt is made to let the compiler verify consistency of the
- format string and the argument list. */
+/* Send a single-part message. The format specification may contain
+ any ISO C format specifier or %t. No attempt is made to let the
+ compiler verify consistency of the format string and the argument
+ list. */
extern UInt VG_(message_no_f_c)( VgMsgKind kind, const HChar* format, ... );
-/* Send a single-part message. Appends a newline. The format
- specification may contain any ISO C format specifier. The gcc compiler
- will verify consistency of the format string and the argument list. */
+/* Send a single-part message. The format specification may contain
+ any ISO C format specifier. The gcc compiler will verify
+ consistency of the format string and the argument list. */
extern UInt VG_(message)( VgMsgKind kind, const HChar* format, ... )
PRINTF_CHECK(2, 3);
@@ -99,11 +129,13 @@
PRINTF_CHECK(2, 0);
// Short-cuts for VG_(message)().
-#define VG_UMSG( format, args... ) VG_(message)(Vg_UserMsg, format, ##args)
-#define VG_DMSG( format, args... ) VG_(message)(Vg_DebugMsg, format, ##args)
-#define VG_EMSG( format, args... ) VG_(message)(Vg_DebugExtraMsg, \
- format, ##args)
+extern UInt VG_(umsg)( const HChar* format, ... ) PRINTF_CHECK(1, 2);
+extern UInt VG_(dmsg)( const HChar* format, ... ) PRINTF_CHECK(1, 2);
+extern UInt VG_(emsg)( const HChar* format, ... ) PRINTF_CHECK(1, 2);
+/* Flush any output cached by previous calls to VG_(message) et al. */
+extern void VG_(message_flush) ( void );
+
#endif // __PUB_TOOL_LIBCPRINT_H
/*--------------------------------------------------------------------*/
Modified: trunk/include/pub_tool_options.h
===================================================================
--- trunk/include/pub_tool_options.h 2009-07-15 14:52:02 UTC (rev 10475)
+++ trunk/include/pub_tool_options.h 2009-07-15 14:52:18 UTC (rev 10476)
@@ -97,7 +97,7 @@
/* Check bounds. */ \
if ((qq_var) < (qq_lo) || (qq_var) > (qq_hi)) { \
VG_(message)(Vg_UserMsg, \
- "'%s' argument must be between %lld and %lld", \
+ "'%s' argument must be between %lld and %lld\n", \
(qq_option), (Long)(qq_lo), (Long)(qq_hi)); \
VG_(err_bad_option)(qq_arg); \
} \
Modified: trunk/include/pub_tool_tooliface.h
===================================================================
--- trunk/include/pub_tool_tooliface.h 2009-07-15 14:52:02 UTC (rev 10475)
+++ trunk/include/pub_tool_tooliface.h 2009-07-15 14:52:18 UTC (rev 10476)
@@ -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),
@@ -434,7 +444,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)( void );
+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
Property changes on: trunk/include/pub_tool_wordfm.h
___________________________________________________________________
Name: svn:mergeinfo
-
|