|
From: <sv...@va...> - 2011-05-04 09:06:24
|
Author: sewardj
Date: 2011-05-04 10:06:17 +0100 (Wed, 04 May 2011)
New Revision: 11723
Log:
calling format_message: when passing frameNo == -1, also pass
tid == VG_INVALID_THREADID rather than an uninitialised ThreadId.
Also in format_message, improve precondition assertions for
frameNo and tid.
There's no error in the current code since if frameNo == -1 then
tid is unused, but it caused IBM's BEAM checker to complain.
Modified:
trunk/coregrind/m_debuginfo/debuginfo.c
Modified: trunk/coregrind/m_debuginfo/debuginfo.c
===================================================================
--- trunk/coregrind/m_debuginfo/debuginfo.c 2011-05-04 09:03:41 UTC (rev 11722)
+++ trunk/coregrind/m_debuginfo/debuginfo.c 2011-05-04 09:06:17 UTC (rev 11723)
@@ -2665,7 +2665,16 @@
UChar* basetag = "auxwhat"; /* a constant */
UChar tagL[32], tagR[32], xagL[32], xagR[32];
- vg_assert(frameNo >= -1);
+ if (frameNo < -1) {
+ vg_assert(0); /* Not allowed */
+ }
+ else if (frameNo == -1) {
+ vg_assert(tid == VG_INVALID_THREADID);
+ }
+ else /* (frameNo >= 0) */ {
+ vg_assert(tid != VG_INVALID_THREADID);
+ }
+
vg_assert(dn1 && dn2);
vg_assert(described);
vg_assert(var && var->name);
@@ -3152,7 +3161,8 @@
var->typeR, offset );
format_message( dname1, dname2,
data_addr, var, offset, residual_offset,
- described, -1/*frameNo*/, tid );
+ described, -1/*frameNo*/,
+ VG_INVALID_THREADID );
VG_(deleteXA)( described );
zterm_XA( dname1 );
zterm_XA( dname2 );
|