|
From: <sv...@va...> - 2005-07-02 21:16:34
|
Author: sewardj
Date: 2005-07-02 22:16:30 +0100 (Sat, 02 Jul 2005)
New Revision: 4091
Log:
Make the unique tags printed on XML errors actually unique.
Modified:
trunk/coregrind/m_errormgr.c
Modified: trunk/coregrind/m_errormgr.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_errormgr.c 2005-07-02 21:14:19 UTC (rev 4090)
+++ trunk/coregrind/m_errormgr.c 2005-07-02 21:16:30 UTC (rev 4091)
@@ -99,6 +99,10 @@
*/
struct _Error {
struct _Error* next;
+ // Unique tag. This gives the error a unique identity (handle) by
+ // which it can be referred to afterwords. Currently only used for
+ // XML printing.
+ UInt unique;
// NULL if unsuppressed; or ptr to suppression record.
Supp* supp;
Int count;
@@ -269,8 +273,8 @@
{
if (VG_(clo_xml)) {
VG_(message)(Vg_UserMsg, "<error>");
- VG_(message)(Vg_UserMsg, " <unique>0x%llx</unique>",
- Ptr_to_ULong(err));
+ VG_(message)(Vg_UserMsg, " <unique>0x%x</unique>",
+ err->unique);
VG_(message)(Vg_UserMsg, " <tid>%d</tid>", err->tid);
}
=20
@@ -352,9 +356,13 @@
void construct_error ( Error* err, ThreadId tid, ErrorKind ekind, Addr a=
,
Char* s, void* extra, ExeContext* where )
{
+ /* DO NOT MAKE unique_counter NON-STATIC */
+ static UInt unique_counter =3D 0;
+
tl_assert(tid < VG_N_THREADS);
=20
/* Core-only parts */
+ err->unique =3D unique_counter++;
err->next =3D NULL;
err->supp =3D NULL;
err->count =3D 1;
|