|
From: <sv...@va...> - 2008-02-07 11:58:19
|
Author: sewardj
Date: 2008-02-07 11:58:22 +0000 (Thu, 07 Feb 2008)
New Revision: 7375
Log:
Allow tools to extract the ThreadId associated with an Error, so they
can then enquire as to the IP/SP/FP at error, which are necessary for
building better source-level descriptions of data addresses.
Modified:
branches/DATASYMS/coregrind/m_errormgr.c
branches/DATASYMS/include/pub_tool_errormgr.h
Modified: branches/DATASYMS/coregrind/m_errormgr.c
===================================================================
--- branches/DATASYMS/coregrind/m_errormgr.c 2008-02-07 11:53:55 UTC (rev 7374)
+++ branches/DATASYMS/coregrind/m_errormgr.c 2008-02-07 11:58:22 UTC (rev 7375)
@@ -119,9 +119,9 @@
// NULL if unsuppressed; or ptr to suppression record.
Supp* supp;
Int count;
- ThreadId tid;
// The tool-specific part
+ ThreadId tid; // Initialised by core
ExeContext* where; // Initialised by core
ErrorKind ekind; // Used by ALL. Must be in the range (0..)
Addr addr; // Used frequently
@@ -129,6 +129,17 @@
void* extra; // For any tool-specific extras
};
+
+
+/* Note, VG_(get_error_tid) only produces a meaningful result at the
+ time that the error is handed to VG_(maybe_record_error), since the
+ same tid may be reassigned later to a new thread. Caveat
+ Caller. */
+ThreadId VG_(get_error_tid) ( Error* err )
+{
+ return err->tid;
+}
+
ExeContext* VG_(get_error_where) ( Error* err )
{
return err->where;
Modified: branches/DATASYMS/include/pub_tool_errormgr.h
===================================================================
--- branches/DATASYMS/include/pub_tool_errormgr.h 2008-02-07 11:53:55 UTC (rev 7374)
+++ branches/DATASYMS/include/pub_tool_errormgr.h 2008-02-07 11:58:22 UTC (rev 7375)
@@ -55,7 +55,11 @@
Error;
/* Useful in VG_(tdict).tool_error_matches_suppression(),
- * VG_(tdict).tool_pp_Error(), etc */
+ * VG_(tdict).tool_pp_Error(), etc. Note, VG_(get_error_tid) only
+ produces a meaningful result at the time that the error is
+ handed to VG_(maybe_record_error), since the same tid may be
+ reassigned later to a new thread. Caveat Caller. */
+ThreadId VG_(get_error_tid) ( Error* err );
ExeContext* VG_(get_error_where) ( Error* err );
ErrorKind VG_(get_error_kind) ( Error* err );
Addr VG_(get_error_address) ( Error* err );
|