|
From: <sv...@va...> - 2008-09-14 12:50:27
|
Author: sewardj
Date: 2008-09-14 13:50:34 +0100 (Sun, 14 Sep 2008)
New Revision: 8613
Log:
Relax the tests for detection of duplicate global blocks in the debug info.
Modified:
branches/PTRCHECK/exp-ptrcheck/sg_main.c
Modified: branches/PTRCHECK/exp-ptrcheck/sg_main.c
===================================================================
--- branches/PTRCHECK/exp-ptrcheck/sg_main.c 2008-09-14 11:49:30 UTC (rev 8612)
+++ branches/PTRCHECK/exp-ptrcheck/sg_main.c 2008-09-14 12:50:34 UTC (rev 8613)
@@ -672,7 +672,8 @@
{
Bool already_present;
GlobalTreeNode *nyu, *nd;
- UWord keyW, valW;
+ UWord keyW, valW;
+
tl_assert(descr->szB > 0);
nyu = sg_malloc( "di.sg_main.abtG.1", sizeof(GlobalTreeNode) );
nyu->addr = descr->addr;
@@ -692,7 +693,18 @@
tl_assert(nd->descr);
tl_assert(nyu->descr);
if (nd->addr == nyu->addr && nd->szB == nyu->szB
- && 0 == VG_(strcmp)(nd->descr->name, nyu->descr->name)
+ /* && 0 == VG_(strcmp)(nd->descr->name, nyu->descr->name) */
+ /* Although it seems reasonable to demand that duplicate
+ blocks have identical names, that is too strict. For
+ example, reading debuginfo from glibc produces two
+ otherwise identical blocks with names "tzname" and
+ "__tzname". A constraint of the form "must be identical,
+ or one must be a substring of the other" would fix that.
+ However, such trickery is scuppered by the fact that we
+ truncate all variable names to 15 characters to make
+ storage management simpler, hence giving pairs like
+ "__EI___pthread_[TRUCATED]" vs "__pthread_keys". So it's
+ simplest just to skip the name comparison completely. */
&& 0 == VG_(strcmp)(nd->descr->soname, nyu->descr->soname)) {
/* exact duplicate; ignore it */
sg_free(nyu);
|