Mark Wielaard c288cf
commit 81d24c396c66dde7db2d9b567451f99081a2eab7
Mark Wielaard c288cf
Author: philippe <philippe@a5019735-40e9-0310-863c-91ae7b9d1cf9>
Mark Wielaard c288cf
Date:   Wed Dec 5 21:08:24 2012 +0000
Mark Wielaard c288cf
Mark Wielaard c288cf
    fix 310424  --read-var-info does not properly describe static variables
Mark Wielaard c288cf
    
Mark Wielaard c288cf
    This patch changes the way static variables are
Mark Wielaard c288cf
    recorded by readdwarf3.c (when giving --read-var-info=yes),
Mark Wielaard c288cf
    improving the way such variables are described.
Mark Wielaard c288cf
    
Mark Wielaard c288cf
    Currently:
Mark Wielaard c288cf
    A static variable does not have the DW_AT_external tag.
Mark Wielaard c288cf
    So, readdwarf3.c does not consider it a global variable.
Mark Wielaard c288cf
    It is rather considered a "local" variable.
Mark Wielaard c288cf
    When it is recorded, it is associated to a range of program counters
Mark Wielaard c288cf
    (the functions in the file where it is visible).
Mark Wielaard c288cf
    However, even if the static variable is only visible
Mark Wielaard c288cf
    in the source file where it is declared, it can in reality
Mark Wielaard c288cf
    be used by any range of program counters, typically
Mark Wielaard c288cf
    by having the address of the local variable passed
Mark Wielaard c288cf
    to other functions.
Mark Wielaard c288cf
    
Mark Wielaard c288cf
    Such local variable can then only be described
Mark Wielaard c288cf
    when the program counter is in the range of program
Mark Wielaard c288cf
    counters for which it has been recorded.
Mark Wielaard c288cf
    However, this (local) description is obtained
Mark Wielaard c288cf
    by a kludge in debuginfo.c (around line 3285).
Mark Wielaard c288cf
    
Mark Wielaard c288cf
    This kludge then produces a strange description,
Mark Wielaard c288cf
    telling that the variable has been declared in
Mark Wielaard c288cf
    frame 0 of a thread (see second example below).
Mark Wielaard c288cf
    
Mark Wielaard c288cf
    The kludge is not always able to describe
Mark Wielaard c288cf
    the address (if the IP of the tid is in another file than
Mark Wielaard c288cf
    where the variable has been declared).
Mark Wielaard c288cf
    
Mark Wielaard c288cf
    I suspect the kludge can sometimes describe the var as being
Mark Wielaard c288cf
    declared in an unrelated thread
Mark Wielaard c288cf
    (e.g. if an error is triggered by tid 5, but tid1 is by
Mark Wielaard c288cf
    luck in an IP corresponding to the recorded range).
Mark Wielaard c288cf
    
Mark Wielaard c288cf
    
Mark Wielaard c288cf
    The patch changes the way a static variable is recorded:
Mark Wielaard c288cf
    if DW_AT_external tag is found, a variable is marked as global.
Mark Wielaard c288cf
    If a variable is not external, but is seen when level is 1,
Mark Wielaard c288cf
    then we record the variable as a global variable (i.e.
Mark Wielaard c288cf
    with a full IP range).
Mark Wielaard c288cf
    This improves the way such static variable are described:
Mark Wielaard c288cf
    * they are described even if being accessed by other files.
Mark Wielaard c288cf
    * their description is not in an artificial "thread frame".
Mark Wielaard c288cf
    
Mark Wielaard c288cf
    
Mark Wielaard c288cf
    
Mark Wielaard c288cf
    
Mark Wielaard c288cf
    First example:
Mark Wielaard c288cf
    **************
Mark Wielaard c288cf
    a variable cannot be described because it is
Mark Wielaard c288cf
    accessed by a function in another file:
Mark Wielaard c288cf
    
Mark Wielaard c288cf
    with the trunk:
Mark Wielaard c288cf
    ==20410== ----------------------------------------------------------------
Mark Wielaard c288cf
    ==20410==
Mark Wielaard c288cf
    ==20410== Possible data race during read of size 4 at 0x600F54 by thread #1
Mark Wielaard c288cf
    ==20410== Locks held: none
Mark Wielaard c288cf
    ==20410==    at 0x4007E4: a (abc.c:42)
Mark Wielaard c288cf
    ==20410==    by 0x4006BC: main (mabc.c:24)
Mark Wielaard c288cf
    ==20410==
Mark Wielaard c288cf
    ==20410== This conflicts with a previous write of size 4 by thread #2
Mark Wielaard c288cf
    ==20410== Locks held: none
Mark Wielaard c288cf
    ==20410==    at 0x4007ED: a (abc.c:42)
Mark Wielaard c288cf
    ==20410==    by 0x400651: brussels_fn (mabc.c:9)
Mark Wielaard c288cf
    ==20410==    by 0x4C2B54E: mythread_wrapper (hg_intercepts.c:219)
Mark Wielaard c288cf
    ==20410==    by 0x4E348C9: start_thread (pthread_create.c:300)
Mark Wielaard c288cf
    ==20410==
Mark Wielaard c288cf
    ==20410== ----------------------------------------------------------------
Mark Wielaard c288cf
    
Mark Wielaard c288cf
    
Mark Wielaard c288cf
    with the patch:
Mark Wielaard c288cf
    ==4515== ----------------------------------------------------------------
Mark Wielaard c288cf
    ==4515==
Mark Wielaard c288cf
    ==4515== Possible data race during read of size 4 at 0x600F54 by thread #1
Mark Wielaard c288cf
    ==4515== Locks held: none
Mark Wielaard c288cf
    ==4515==    at 0x4007E4: a (abc.c:42)
Mark Wielaard c288cf
    ==4515==    by 0x4006BC: main (mabc.c:24)
Mark Wielaard c288cf
    ==4515==
Mark Wielaard c288cf
    ==4515== This conflicts with a previous write of size 4 by thread #2
Mark Wielaard c288cf
    ==4515== Locks held: none
Mark Wielaard c288cf
    ==4515==    at 0x4007ED: a (abc.c:42)
Mark Wielaard c288cf
    ==4515==    by 0x400651: brussels_fn (mabc.c:9)
Mark Wielaard c288cf
    ==4515==    by 0x4C2B54E: mythread_wrapper (hg_intercepts.c:219)
Mark Wielaard c288cf
    ==4515==    by 0x4E348C9: start_thread (pthread_create.c:300)
Mark Wielaard c288cf
    ==4515==
Mark Wielaard c288cf
    ==4515== Location 0x600f54 is 0 bytes inside global var "static_global"
Mark Wielaard c288cf
    ==4515== declared at mabc.c:4
Mark Wielaard c288cf
    ==4515==
Mark Wielaard c288cf
    ==4515== ----------------------------------------------------------------
Mark Wielaard c288cf
    
Mark Wielaard c288cf
    
Mark Wielaard c288cf
    Second example:
Mark Wielaard c288cf
    ***************
Mark Wielaard c288cf
    When the kludge can describe the variable, it is strangely described
Mark Wielaard c288cf
    as being declared in a frame of a thread, while for sure the declaration
Mark Wielaard c288cf
    has nothing to do with a thread
Mark Wielaard c288cf
    With the trunk:
Mark Wielaard c288cf
    ==20410== Location 0x600f68 is 0 bytes inside local var "static_global_a"
Mark Wielaard c288cf
    ==20410== declared at abc.c:3, in frame #0 of thread 1
Mark Wielaard c288cf
    
Mark Wielaard c288cf
    With the patch:
Mark Wielaard c288cf
    ==4515== Location 0x600f68 is 0 bytes inside global var "static_global_a"
Mark Wielaard c288cf
    ==4515== declared at abc.c:3
Mark Wielaard c288cf
    
Mark Wielaard c288cf
    #include <stdio.h>
Mark Wielaard c288cf
    
Mark Wielaard c288cf
    static int static_global_a = 0; //// <<<< this is abc.c:3
Mark Wielaard c288cf
    
Mark Wielaard c288cf
    
Mark Wielaard c288cf
    
Mark Wielaard c288cf
    
Mark Wielaard c288cf
    git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13153 a5019735-40e9-0310-863c-91ae7b9d1cf9
Mark Wielaard c288cf
Mark Wielaard c288cf
diff --git a/coregrind/m_debuginfo/debuginfo.c b/coregrind/m_debuginfo/debuginfo.c
Mark Wielaard c288cf
index 59f920d..d3b8ef4 100644
Mark Wielaard c288cf
--- a/coregrind/m_debuginfo/debuginfo.c
Mark Wielaard c288cf
+++ b/coregrind/m_debuginfo/debuginfo.c
Mark Wielaard c288cf
@@ -3282,28 +3282,6 @@ Bool VG_(get_data_description)(
Mark Wielaard c288cf
       in the stacks of all the threads.  First try to figure out which
Mark Wielaard c288cf
       thread's stack data_addr is in. */
Mark Wielaard c288cf
 
Mark Wielaard c288cf
-   /* --- KLUDGE --- Try examining the top frame of all thread stacks.
Mark Wielaard c288cf
-      This finds variables which are not stack allocated but are not
Mark Wielaard c288cf
-      globally visible either; specifically it appears to pick up
Mark Wielaard c288cf
-      variables which are visible only within a compilation unit.
Mark Wielaard c288cf
-      These will have the address range of the compilation unit and
Mark Wielaard c288cf
-      tend to live at Scope level 1. */
Mark Wielaard c288cf
-   VG_(thread_stack_reset_iter)(&tid;;
Mark Wielaard c288cf
-   while ( VG_(thread_stack_next)(&tid, &stack_min, &stack_max) ) {
Mark Wielaard c288cf
-      if (stack_min >= stack_max)
Mark Wielaard c288cf
-         continue; /* ignore obviously stupid cases */
Mark Wielaard c288cf
-      if (consider_vars_in_frame( dname1, dname2,
Mark Wielaard c288cf
-                                  data_addr,
Mark Wielaard c288cf
-                                  VG_(get_IP)(tid),
Mark Wielaard c288cf
-                                  VG_(get_SP)(tid), 
Mark Wielaard c288cf
-                                  VG_(get_FP)(tid), tid, 0 )) {
Mark Wielaard c288cf
-         zterm_XA( dname1 );
Mark Wielaard c288cf
-         zterm_XA( dname2 );
Mark Wielaard c288cf
-         return True;
Mark Wielaard c288cf
-      }
Mark Wielaard c288cf
-   }
Mark Wielaard c288cf
-   /* --- end KLUDGE --- */
Mark Wielaard c288cf
-
Mark Wielaard c288cf
    /* Perhaps it's on a thread's stack? */
Mark Wielaard c288cf
    found = False;
Mark Wielaard c288cf
    VG_(thread_stack_reset_iter)(&tid;;
Mark Wielaard c288cf
@@ -3328,9 +3306,6 @@ Bool VG_(get_data_description)(
Mark Wielaard c288cf
    n_frames = VG_(get_StackTrace)( tid, ips, N_FRAMES,
Mark Wielaard c288cf
                                    sps, fps, 0/*first_ip_delta*/ );
Mark Wielaard c288cf
 
Mark Wielaard c288cf
-   /* As a result of KLUDGE above, starting the loop at j = 0
Mark Wielaard c288cf
-      duplicates examination of the top frame and so isn't necessary.
Mark Wielaard c288cf
-      Oh well. */
Mark Wielaard c288cf
    vg_assert(n_frames >= 0 && n_frames <= N_FRAMES);
Mark Wielaard c288cf
    for (j = 0; j < n_frames; j++) {
Mark Wielaard c288cf
       if (consider_vars_in_frame( dname1, dname2,
Mark Wielaard c288cf
diff --git a/drd/tests/annotate_ignore_rw.stderr.exp b/drd/tests/annotate_ignore_rw.stderr.exp
Mark Wielaard c288cf
index 24684da..416be80 100644
Mark Wielaard c288cf
--- a/drd/tests/annotate_ignore_rw.stderr.exp
Mark Wielaard c288cf
+++ b/drd/tests/annotate_ignore_rw.stderr.exp
Mark Wielaard c288cf
@@ -1,8 +1,8 @@
Mark Wielaard c288cf
 
Mark Wielaard c288cf
 Conflicting load by thread 1 at 0x........ size 1
Mark Wielaard c288cf
    at 0x........: main (annotate_ignore_rw.c:?)
Mark Wielaard c288cf
-Location 0x........ is 0 bytes inside local var "s_c"
Mark Wielaard c288cf
-declared at annotate_ignore_rw.c:12, in frame #? of thread 1
Mark Wielaard c288cf
+Location 0x........ is 0 bytes inside global var "s_c"
Mark Wielaard c288cf
+declared at annotate_ignore_rw.c:12
Mark Wielaard c288cf
 
Mark Wielaard c288cf
 Finished.
Mark Wielaard c288cf
 
Mark Wielaard c288cf
diff --git a/drd/tests/annotate_ignore_rw2.stderr.exp b/drd/tests/annotate_ignore_rw2.stderr.exp
Mark Wielaard c288cf
index ffdb76f..4e96bf3 100644
Mark Wielaard c288cf
--- a/drd/tests/annotate_ignore_rw2.stderr.exp
Mark Wielaard c288cf
+++ b/drd/tests/annotate_ignore_rw2.stderr.exp
Mark Wielaard c288cf
@@ -1,18 +1,18 @@
Mark Wielaard c288cf
 
Mark Wielaard c288cf
 Conflicting load by thread 1 at 0x........ size 1
Mark Wielaard c288cf
    at 0x........: main (annotate_ignore_rw.c:?)
Mark Wielaard c288cf
-Location 0x........ is 0 bytes inside local var "s_b"
Mark Wielaard c288cf
-declared at annotate_ignore_rw.c:11, in frame #? of thread 1
Mark Wielaard c288cf
+Location 0x........ is 0 bytes inside global var "s_b"
Mark Wielaard c288cf
+declared at annotate_ignore_rw.c:11
Mark Wielaard c288cf
 
Mark Wielaard c288cf
 Conflicting store by thread 1 at 0x........ size 1
Mark Wielaard c288cf
    at 0x........: main (annotate_ignore_rw.c:?)
Mark Wielaard c288cf
-Location 0x........ is 0 bytes inside local var "s_a"
Mark Wielaard c288cf
-declared at annotate_ignore_rw.c:10, in frame #? of thread 1
Mark Wielaard c288cf
+Location 0x........ is 0 bytes inside global var "s_a"
Mark Wielaard c288cf
+declared at annotate_ignore_rw.c:10
Mark Wielaard c288cf
 
Mark Wielaard c288cf
 Conflicting load by thread 1 at 0x........ size 1
Mark Wielaard c288cf
    at 0x........: main (annotate_ignore_rw.c:?)
Mark Wielaard c288cf
-Location 0x........ is 0 bytes inside local var "s_c"
Mark Wielaard c288cf
-declared at annotate_ignore_rw.c:12, in frame #? of thread 1
Mark Wielaard c288cf
+Location 0x........ is 0 bytes inside global var "s_c"
Mark Wielaard c288cf
+declared at annotate_ignore_rw.c:12
Mark Wielaard c288cf
 
Mark Wielaard c288cf
 Finished.
Mark Wielaard c288cf
 
Mark Wielaard c288cf
diff --git a/drd/tests/annotate_ignore_write.stderr.exp b/drd/tests/annotate_ignore_write.stderr.exp
Mark Wielaard c288cf
index f26242e..2204d5b 100644
Mark Wielaard c288cf
--- a/drd/tests/annotate_ignore_write.stderr.exp
Mark Wielaard c288cf
+++ b/drd/tests/annotate_ignore_write.stderr.exp
Mark Wielaard c288cf
@@ -1,18 +1,18 @@
Mark Wielaard c288cf
 
Mark Wielaard c288cf
 Conflicting load by thread 1 at 0x........ size 1
Mark Wielaard c288cf
    at 0x........: main (annotate_ignore_write.c:?)
Mark Wielaard c288cf
-Location 0x........ is 0 bytes inside local var "s_b"
Mark Wielaard c288cf
-declared at annotate_ignore_write.c:11, in frame #? of thread 1
Mark Wielaard c288cf
+Location 0x........ is 0 bytes inside global var "s_b"
Mark Wielaard c288cf
+declared at annotate_ignore_write.c:11
Mark Wielaard c288cf
 
Mark Wielaard c288cf
 Conflicting load by thread 1 at 0x........ size 1
Mark Wielaard c288cf
    at 0x........: main (annotate_ignore_write.c:?)
Mark Wielaard c288cf
-Location 0x........ is 0 bytes inside local var "s_c"
Mark Wielaard c288cf
-declared at annotate_ignore_write.c:12, in frame #? of thread 1
Mark Wielaard c288cf
+Location 0x........ is 0 bytes inside global var "s_c"
Mark Wielaard c288cf
+declared at annotate_ignore_write.c:12
Mark Wielaard c288cf
 
Mark Wielaard c288cf
 Conflicting store by thread 1 at 0x........ size 1
Mark Wielaard c288cf
    at 0x........: main (annotate_ignore_write.c:?)
Mark Wielaard c288cf
-Location 0x........ is 0 bytes inside local var "s_a"
Mark Wielaard c288cf
-declared at annotate_ignore_write.c:10, in frame #? of thread 1
Mark Wielaard c288cf
+Location 0x........ is 0 bytes inside global var "s_a"
Mark Wielaard c288cf
+declared at annotate_ignore_write.c:10
Mark Wielaard c288cf
 
Mark Wielaard c288cf
 Finished.
Mark Wielaard c288cf
 
Mark Wielaard c288cf
diff --git a/drd/tests/annotate_ignore_write2.stderr.exp b/drd/tests/annotate_ignore_write2.stderr.exp
Mark Wielaard c288cf
index 03c7766..9b58325 100644
Mark Wielaard c288cf
--- a/drd/tests/annotate_ignore_write2.stderr.exp
Mark Wielaard c288cf
+++ b/drd/tests/annotate_ignore_write2.stderr.exp
Mark Wielaard c288cf
@@ -1,23 +1,23 @@
Mark Wielaard c288cf
 
Mark Wielaard c288cf
 Conflicting load by thread 1 at 0x........ size 1
Mark Wielaard c288cf
    at 0x........: main (annotate_ignore_write.c:?)
Mark Wielaard c288cf
-Location 0x........ is 0 bytes inside local var "s_b"
Mark Wielaard c288cf
-declared at annotate_ignore_write.c:11, in frame #? of thread 1
Mark Wielaard c288cf
+Location 0x........ is 0 bytes inside global var "s_b"
Mark Wielaard c288cf
+declared at annotate_ignore_write.c:11
Mark Wielaard c288cf
 
Mark Wielaard c288cf
 Conflicting store by thread 1 at 0x........ size 1
Mark Wielaard c288cf
    at 0x........: main (annotate_ignore_write.c:?)
Mark Wielaard c288cf
-Location 0x........ is 0 bytes inside local var "s_a"
Mark Wielaard c288cf
-declared at annotate_ignore_write.c:10, in frame #? of thread 1
Mark Wielaard c288cf
+Location 0x........ is 0 bytes inside global var "s_a"
Mark Wielaard c288cf
+declared at annotate_ignore_write.c:10
Mark Wielaard c288cf
 
Mark Wielaard c288cf
 Conflicting load by thread 1 at 0x........ size 1
Mark Wielaard c288cf
    at 0x........: main (annotate_ignore_write.c:?)
Mark Wielaard c288cf
-Location 0x........ is 0 bytes inside local var "s_c"
Mark Wielaard c288cf
-declared at annotate_ignore_write.c:12, in frame #? of thread 1
Mark Wielaard c288cf
+Location 0x........ is 0 bytes inside global var "s_c"
Mark Wielaard c288cf
+declared at annotate_ignore_write.c:12
Mark Wielaard c288cf
 
Mark Wielaard c288cf
 Conflicting store by thread 1 at 0x........ size 1
Mark Wielaard c288cf
    at 0x........: main (annotate_ignore_write.c:?)
Mark Wielaard c288cf
-Location 0x........ is 0 bytes inside local var "s_a"
Mark Wielaard c288cf
-declared at annotate_ignore_write.c:10, in frame #? of thread 1
Mark Wielaard c288cf
+Location 0x........ is 0 bytes inside global var "s_a"
Mark Wielaard c288cf
+declared at annotate_ignore_write.c:10
Mark Wielaard c288cf
 
Mark Wielaard c288cf
 Finished.
Mark Wielaard c288cf
 
Mark Wielaard c288cf
diff --git a/drd/tests/atomic_var.stderr.exp b/drd/tests/atomic_var.stderr.exp
Mark Wielaard c288cf
index 7fa1e0e..ad05687 100644
Mark Wielaard c288cf
--- a/drd/tests/atomic_var.stderr.exp
Mark Wielaard c288cf
+++ b/drd/tests/atomic_var.stderr.exp
Mark Wielaard c288cf
@@ -3,8 +3,8 @@ Start of test.
Mark Wielaard c288cf
 Conflicting load by thread x at 0x........ size 4
Mark Wielaard c288cf
    at 0x........: thread_func_2 (atomic_var.c:?)
Mark Wielaard c288cf
    by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?)
Mark Wielaard c288cf
-Location 0x........ is 0 bytes inside local var "s_y"
Mark Wielaard c288cf
-declared at atomic_var.c:35, in frame #? of thread x
Mark Wielaard c288cf
+Location 0x........ is 0 bytes inside global var "s_y"
Mark Wielaard c288cf
+declared at atomic_var.c:35
Mark Wielaard c288cf
 
Mark Wielaard c288cf
 y = 1
Mark Wielaard c288cf
 Test finished.
Mark Wielaard c288cf
diff --git a/drd/tests/fp_race.stderr.exp b/drd/tests/fp_race.stderr.exp
Mark Wielaard c288cf
index 23873d2..68bd254 100644
Mark Wielaard c288cf
--- a/drd/tests/fp_race.stderr.exp
Mark Wielaard c288cf
+++ b/drd/tests/fp_race.stderr.exp
Mark Wielaard c288cf
@@ -1,8 +1,8 @@
Mark Wielaard c288cf
 
Mark Wielaard c288cf
 Conflicting load by thread 1 at 0x........ size 8
Mark Wielaard c288cf
    at 0x........: main (fp_race.c:?)
Mark Wielaard c288cf
-Location 0x........ is 0 bytes inside local var "s_d3"
Mark Wielaard c288cf
-declared at fp_race.c:24, in frame #? of thread 1
Mark Wielaard c288cf
+Location 0x........ is 0 bytes inside global var "s_d3"
Mark Wielaard c288cf
+declared at fp_race.c:24
Mark Wielaard c288cf
 Other segment start (thread 2)
Mark Wielaard c288cf
    (thread finished, call stack no longer available)
Mark Wielaard c288cf
 Other segment end (thread 2)
Mark Wielaard c288cf
@@ -10,8 +10,8 @@ Other segment end (thread 2)
Mark Wielaard c288cf
 
Mark Wielaard c288cf
 Conflicting store by thread 1 at 0x........ size 8
Mark Wielaard c288cf
    at 0x........: main (fp_race.c:?)
Mark Wielaard c288cf
-Location 0x........ is 0 bytes inside local var "s_d3"
Mark Wielaard c288cf
-declared at fp_race.c:24, in frame #? of thread 1
Mark Wielaard c288cf
+Location 0x........ is 0 bytes inside global var "s_d3"
Mark Wielaard c288cf
+declared at fp_race.c:24
Mark Wielaard c288cf
 Other segment start (thread 2)
Mark Wielaard c288cf
    (thread finished, call stack no longer available)
Mark Wielaard c288cf
 Other segment end (thread 2)
Mark Wielaard c288cf
diff --git a/drd/tests/fp_race_xml.stderr.exp b/drd/tests/fp_race_xml.stderr.exp
Mark Wielaard c288cf
index 73a530e..05ffe71 100644
Mark Wielaard c288cf
--- a/drd/tests/fp_race_xml.stderr.exp
Mark Wielaard c288cf
+++ b/drd/tests/fp_race_xml.stderr.exp
Mark Wielaard c288cf
@@ -48,8 +48,8 @@
Mark Wielaard c288cf
       <line>...</line>
Mark Wielaard c288cf
     </frame>
Mark Wielaard c288cf
   </stack>
Mark Wielaard c288cf
-  <auxwhat>Location 0x........ is 0 bytes inside local var "s_d3"</auxwhat>
Mark Wielaard c288cf
-  <xauxwhat><text>declared at fp_race.c:24, in frame #? of thread x</text> <file>fp_race.c</file> <line>...</line> </xauxwhat>
Mark Wielaard c288cf
+  <auxwhat>Location 0x........ is 0 bytes inside global var "s_d3"</auxwhat>
Mark Wielaard c288cf
+  <xauxwhat><text>declared at fp_race.c:24</text> <file>fp_race.c</file> <line>...</line> </xauxwhat>
Mark Wielaard c288cf
   <other_segment_start>
Mark Wielaard c288cf
   </other_segment_start>
Mark Wielaard c288cf
   <other_segment_end>
Mark Wielaard c288cf
@@ -71,8 +71,8 @@
Mark Wielaard c288cf
       <line>...</line>
Mark Wielaard c288cf
     </frame>
Mark Wielaard c288cf
   </stack>
Mark Wielaard c288cf
-  <auxwhat>Location 0x........ is 0 bytes inside local var "s_d3"</auxwhat>
Mark Wielaard c288cf
-  <xauxwhat><text>declared at fp_race.c:24, in frame #? of thread x</text> <file>fp_race.c</file> <line>...</line> </xauxwhat>
Mark Wielaard c288cf
+  <auxwhat>Location 0x........ is 0 bytes inside global var "s_d3"</auxwhat>
Mark Wielaard c288cf
+  <xauxwhat><text>declared at fp_race.c:24</text> <file>fp_race.c</file> <line>...</line> </xauxwhat>
Mark Wielaard c288cf
   <other_segment_start>
Mark Wielaard c288cf
   </other_segment_start>
Mark Wielaard c288cf
   <other_segment_end>
Mark Wielaard c288cf
diff --git a/drd/tests/hg03_inherit.stderr.exp b/drd/tests/hg03_inherit.stderr.exp
Mark Wielaard c288cf
index 62a8d5d..72eb236 100644
Mark Wielaard c288cf
--- a/drd/tests/hg03_inherit.stderr.exp
Mark Wielaard c288cf
+++ b/drd/tests/hg03_inherit.stderr.exp
Mark Wielaard c288cf
@@ -4,13 +4,13 @@ Conflicting store by thread 3 at 0x........ size 4
Mark Wielaard c288cf
    at 0x........: t2 (hg03_inherit.c:28)
Mark Wielaard c288cf
    by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?)
Mark Wielaard c288cf
 Location 0x........ is 0 bytes inside shared[1],
Mark Wielaard c288cf
-declared at hg03_inherit.c:11, in frame #? of thread 3
Mark Wielaard c288cf
+a global variable declared at hg03_inherit.c:11
Mark Wielaard c288cf
 
Mark Wielaard c288cf
 Conflicting store by thread 3 at 0x........ size 4
Mark Wielaard c288cf
    at 0x........: t2 (hg03_inherit.c:29)
Mark Wielaard c288cf
    by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?)
Mark Wielaard c288cf
 Location 0x........ is 0 bytes inside shared[1],
Mark Wielaard c288cf
-declared at hg03_inherit.c:11, in frame #? of thread 3
Mark Wielaard c288cf
+a global variable declared at hg03_inherit.c:11
Mark Wielaard c288cf
 
Mark Wielaard c288cf
 
Mark Wielaard c288cf
 ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
Mark Wielaard c288cf
diff --git a/drd/tests/hg04_race.stderr.exp b/drd/tests/hg04_race.stderr.exp
Mark Wielaard c288cf
index 9ea3ccd..5b5969c 100644
Mark Wielaard c288cf
--- a/drd/tests/hg04_race.stderr.exp
Mark Wielaard c288cf
+++ b/drd/tests/hg04_race.stderr.exp
Mark Wielaard c288cf
@@ -3,8 +3,8 @@ Thread 3:
Mark Wielaard c288cf
 Conflicting load by thread 3 at 0x........ size 4
Mark Wielaard c288cf
    at 0x........: th (hg04_race.c:10)
Mark Wielaard c288cf
    by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?)
Mark Wielaard c288cf
-Location 0x........ is 0 bytes inside local var "shared"
Mark Wielaard c288cf
-declared at hg04_race.c:6, in frame #? of thread 2
Mark Wielaard c288cf
+Location 0x........ is 0 bytes inside global var "shared"
Mark Wielaard c288cf
+declared at hg04_race.c:6
Mark Wielaard c288cf
 Other segment start (thread 2)
Mark Wielaard c288cf
    (thread finished, call stack no longer available)
Mark Wielaard c288cf
 Other segment end (thread 2)
Mark Wielaard c288cf
@@ -13,8 +13,8 @@ Other segment end (thread 2)
Mark Wielaard c288cf
 Conflicting store by thread 3 at 0x........ size 4
Mark Wielaard c288cf
    at 0x........: th (hg04_race.c:10)
Mark Wielaard c288cf
    by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?)
Mark Wielaard c288cf
-Location 0x........ is 0 bytes inside local var "shared"
Mark Wielaard c288cf
-declared at hg04_race.c:6, in frame #? of thread 2
Mark Wielaard c288cf
+Location 0x........ is 0 bytes inside global var "shared"
Mark Wielaard c288cf
+declared at hg04_race.c:6
Mark Wielaard c288cf
 Other segment start (thread 2)
Mark Wielaard c288cf
    (thread finished, call stack no longer available)
Mark Wielaard c288cf
 Other segment end (thread 2)
Mark Wielaard c288cf
diff --git a/drd/tests/rwlock_race.stderr.exp b/drd/tests/rwlock_race.stderr.exp
Mark Wielaard c288cf
index 8350b50..d3e0b37 100644
Mark Wielaard c288cf
--- a/drd/tests/rwlock_race.stderr.exp
Mark Wielaard c288cf
+++ b/drd/tests/rwlock_race.stderr.exp
Mark Wielaard c288cf
@@ -2,14 +2,14 @@
Mark Wielaard c288cf
 Conflicting load by thread x at 0x........ size 4
Mark Wielaard c288cf
    at 0x........: thread_func (rwlock_race.c:?)
Mark Wielaard c288cf
    by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?)
Mark Wielaard c288cf
-Location 0x........ is 0 bytes inside local var "s_racy"
Mark Wielaard c288cf
-declared at rwlock_race.c:18, in frame #? of thread x
Mark Wielaard c288cf
+Location 0x........ is 0 bytes inside global var "s_racy"
Mark Wielaard c288cf
+declared at rwlock_race.c:18
Mark Wielaard c288cf
 
Mark Wielaard c288cf
 Conflicting store by thread x at 0x........ size 4
Mark Wielaard c288cf
    at 0x........: thread_func (rwlock_race.c:?)
Mark Wielaard c288cf
    by 0x........: vgDrd_thread_wrapper (drd_pthread_intercepts.c:?)
Mark Wielaard c288cf
-Location 0x........ is 0 bytes inside local var "s_racy"
Mark Wielaard c288cf
-declared at rwlock_race.c:18, in frame #? of thread x
Mark Wielaard c288cf
+Location 0x........ is 0 bytes inside global var "s_racy"
Mark Wielaard c288cf
+declared at rwlock_race.c:18
Mark Wielaard c288cf
 
Mark Wielaard c288cf
 Result: 2
Mark Wielaard c288cf
 
Mark Wielaard c288cf
diff --git a/drd/tests/sem_as_mutex.stderr.exp b/drd/tests/sem_as_mutex.stderr.exp
Mark Wielaard c288cf
index 1646a6c..1fbd91a 100644
Mark Wielaard c288cf
--- a/drd/tests/sem_as_mutex.stderr.exp
Mark Wielaard c288cf
+++ b/drd/tests/sem_as_mutex.stderr.exp
Mark Wielaard c288cf
@@ -1,8 +1,8 @@
Mark Wielaard c288cf
 
Mark Wielaard c288cf
 Conflicting load by thread 1 at 0x........ size 8
Mark Wielaard c288cf
    at 0x........: main (sem_as_mutex.c:?)
Mark Wielaard c288cf
-Location 0x........ is 0 bytes inside local var "s_d3"
Mark Wielaard c288cf
-declared at sem_as_mutex.c:25, in frame #? of thread 1
Mark Wielaard c288cf
+Location 0x........ is 0 bytes inside global var "s_d3"
Mark Wielaard c288cf
+declared at sem_as_mutex.c:25
Mark Wielaard c288cf
 Other segment start (thread 2)
Mark Wielaard c288cf
    (thread finished, call stack no longer available)
Mark Wielaard c288cf
 Other segment end (thread 2)
Mark Wielaard c288cf
@@ -10,8 +10,8 @@ Other segment end (thread 2)
Mark Wielaard c288cf
 
Mark Wielaard c288cf
 Conflicting store by thread 1 at 0x........ size 8
Mark Wielaard c288cf
    at 0x........: main (sem_as_mutex.c:?)
Mark Wielaard c288cf
-Location 0x........ is 0 bytes inside local var "s_d3"
Mark Wielaard c288cf
-declared at sem_as_mutex.c:25, in frame #? of thread 1
Mark Wielaard c288cf
+Location 0x........ is 0 bytes inside global var "s_d3"
Mark Wielaard c288cf
+declared at sem_as_mutex.c:25
Mark Wielaard c288cf
 Other segment start (thread 2)
Mark Wielaard c288cf
    (thread finished, call stack no longer available)
Mark Wielaard c288cf
 Other segment end (thread 2)
Mark Wielaard c288cf
diff --git a/drd/tests/sem_as_mutex3.stderr.exp b/drd/tests/sem_as_mutex3.stderr.exp
Mark Wielaard c288cf
index 97b09a1..efd47ff 100644
Mark Wielaard c288cf
--- a/drd/tests/sem_as_mutex3.stderr.exp
Mark Wielaard c288cf
+++ b/drd/tests/sem_as_mutex3.stderr.exp
Mark Wielaard c288cf
@@ -1,8 +1,8 @@
Mark Wielaard c288cf
 
Mark Wielaard c288cf
 Conflicting load by thread 1 at 0x........ size 8
Mark Wielaard c288cf
    at 0x........: main (sem_as_mutex.c:?)
Mark Wielaard c288cf
-Location 0x........ is 0 bytes inside local var "s_d3"
Mark Wielaard c288cf
-declared at sem_as_mutex.c:25, in frame #? of thread 1
Mark Wielaard c288cf
+Location 0x........ is 0 bytes inside global var "s_d3"
Mark Wielaard c288cf
+declared at sem_as_mutex.c:25
Mark Wielaard c288cf
 Other segment start (thread 2)
Mark Wielaard c288cf
    (thread finished, call stack no longer available)
Mark Wielaard c288cf
 Other segment end (thread 2)
Mark Wielaard c288cf
diff --git a/drd/tests/sem_open.stderr.exp b/drd/tests/sem_open.stderr.exp
Mark Wielaard c288cf
index 4e769e5..e926d05 100644
Mark Wielaard c288cf
--- a/drd/tests/sem_open.stderr.exp
Mark Wielaard c288cf
+++ b/drd/tests/sem_open.stderr.exp
Mark Wielaard c288cf
@@ -1,8 +1,8 @@
Mark Wielaard c288cf
 
Mark Wielaard c288cf
 Conflicting load by thread 1 at 0x........ size 8
Mark Wielaard c288cf
    at 0x........: main (sem_open.c:?)
Mark Wielaard c288cf
-Location 0x........ is 0 bytes inside local var "s_d3"
Mark Wielaard c288cf
-declared at sem_open.c:25, in frame #? of thread 1
Mark Wielaard c288cf
+Location 0x........ is 0 bytes inside global var "s_d3"
Mark Wielaard c288cf
+declared at sem_open.c:25
Mark Wielaard c288cf
 Other segment start (thread 2)
Mark Wielaard c288cf
    (thread finished, call stack no longer available)
Mark Wielaard c288cf
 Other segment end (thread 2)
Mark Wielaard c288cf
@@ -10,8 +10,8 @@ Other segment end (thread 2)
Mark Wielaard c288cf
 
Mark Wielaard c288cf
 Conflicting store by thread 1 at 0x........ size 8
Mark Wielaard c288cf
    at 0x........: main (sem_open.c:?)
Mark Wielaard c288cf
-Location 0x........ is 0 bytes inside local var "s_d3"
Mark Wielaard c288cf
-declared at sem_open.c:25, in frame #? of thread 1
Mark Wielaard c288cf
+Location 0x........ is 0 bytes inside global var "s_d3"
Mark Wielaard c288cf
+declared at sem_open.c:25
Mark Wielaard c288cf
 Other segment start (thread 2)
Mark Wielaard c288cf
    (thread finished, call stack no longer available)
Mark Wielaard c288cf
 Other segment end (thread 2)
Mark Wielaard c288cf
diff --git a/drd/tests/sem_open3.stderr.exp b/drd/tests/sem_open3.stderr.exp
Mark Wielaard c288cf
index 3c2d392..fb994f5 100644
Mark Wielaard c288cf
--- a/drd/tests/sem_open3.stderr.exp
Mark Wielaard c288cf
+++ b/drd/tests/sem_open3.stderr.exp
Mark Wielaard c288cf
@@ -1,8 +1,8 @@
Mark Wielaard c288cf
 
Mark Wielaard c288cf
 Conflicting load by thread 1 at 0x........ size 8
Mark Wielaard c288cf
    at 0x........: main (sem_open.c:?)
Mark Wielaard c288cf
-Location 0x........ is 0 bytes inside local var "s_d3"
Mark Wielaard c288cf
-declared at sem_open.c:25, in frame #? of thread 1
Mark Wielaard c288cf
+Location 0x........ is 0 bytes inside global var "s_d3"
Mark Wielaard c288cf
+declared at sem_open.c:25
Mark Wielaard c288cf
 Other segment start (thread 2)
Mark Wielaard c288cf
    (thread finished, call stack no longer available)
Mark Wielaard c288cf
 Other segment end (thread 2)
Mark Wielaard c288cf
diff --git a/helgrind/tests/hg03_inherit.stderr.exp b/helgrind/tests/hg03_inherit.stderr.exp
Mark Wielaard c288cf
index 1c4a91e..ee21cf0 100644
Mark Wielaard c288cf
--- a/helgrind/tests/hg03_inherit.stderr.exp
Mark Wielaard c288cf
+++ b/helgrind/tests/hg03_inherit.stderr.exp
Mark Wielaard c288cf
@@ -24,7 +24,7 @@ Locks held: none
Mark Wielaard c288cf
    at 0x........: main (hg03_inherit.c:60)
Mark Wielaard c288cf
 
Mark Wielaard c288cf
 Location 0x........ is 0 bytes inside shared[1],
Mark Wielaard c288cf
-declared at hg03_inherit.c:11, in frame #x of thread x
Mark Wielaard c288cf
+a global variable declared at hg03_inherit.c:11
Mark Wielaard c288cf
 
Mark Wielaard c288cf
 
Mark Wielaard c288cf
 ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
Mark Wielaard c288cf
diff --git a/helgrind/tests/hg04_race.stderr.exp b/helgrind/tests/hg04_race.stderr.exp
Mark Wielaard c288cf
index 982f940..bf2a185 100644
Mark Wielaard c288cf
--- a/helgrind/tests/hg04_race.stderr.exp
Mark Wielaard c288cf
+++ b/helgrind/tests/hg04_race.stderr.exp
Mark Wielaard c288cf
@@ -29,8 +29,8 @@ Locks held: none
Mark Wielaard c288cf
    by 0x........: mythread_wrapper (hg_intercepts.c:...)
Mark Wielaard c288cf
    ...
Mark Wielaard c288cf
 
Mark Wielaard c288cf
-Location 0x........ is 0 bytes inside local var "shared"
Mark Wielaard c288cf
-declared at hg04_race.c:6, in frame #x of thread x
Mark Wielaard c288cf
+Location 0x........ is 0 bytes inside global var "shared"
Mark Wielaard c288cf
+declared at hg04_race.c:6
Mark Wielaard c288cf
 
Mark Wielaard c288cf
 ----------------------------------------------------------------
Mark Wielaard c288cf
 
Mark Wielaard c288cf
@@ -46,8 +46,8 @@ Locks held: none
Mark Wielaard c288cf
    by 0x........: mythread_wrapper (hg_intercepts.c:...)
Mark Wielaard c288cf
    ...
Mark Wielaard c288cf
 
Mark Wielaard c288cf
-Location 0x........ is 0 bytes inside local var "shared"
Mark Wielaard c288cf
-declared at hg04_race.c:6, in frame #x of thread x
Mark Wielaard c288cf
+Location 0x........ is 0 bytes inside global var "shared"
Mark Wielaard c288cf
+declared at hg04_race.c:6
Mark Wielaard c288cf
 
Mark Wielaard c288cf
 
Mark Wielaard c288cf
 ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
Mark Wielaard c288cf
diff --git a/helgrind/tests/rwlock_race.stderr.exp b/helgrind/tests/rwlock_race.stderr.exp
Mark Wielaard c288cf
index 4a44713..47c3bd5 100644
Mark Wielaard c288cf
--- a/helgrind/tests/rwlock_race.stderr.exp
Mark Wielaard c288cf
+++ b/helgrind/tests/rwlock_race.stderr.exp
Mark Wielaard c288cf
@@ -29,8 +29,8 @@ Locks held: none
Mark Wielaard c288cf
    by 0x........: mythread_wrapper (hg_intercepts.c:...)
Mark Wielaard c288cf
    ...
Mark Wielaard c288cf
 
Mark Wielaard c288cf
-Location 0x........ is 0 bytes inside local var "s_racy"
Mark Wielaard c288cf
-declared at rwlock_race.c:18, in frame #x of thread x
Mark Wielaard c288cf
+Location 0x........ is 0 bytes inside global var "s_racy"
Mark Wielaard c288cf
+declared at rwlock_race.c:18
Mark Wielaard c288cf
 
Mark Wielaard c288cf
 Result: 2
Mark Wielaard c288cf
 
Mark Wielaard c288cf
diff --git a/helgrind/tests/tc21_pthonce.stderr.exp b/helgrind/tests/tc21_pthonce.stderr.exp
Mark Wielaard c288cf
index 3e7d241..700b492 100644
Mark Wielaard c288cf
--- a/helgrind/tests/tc21_pthonce.stderr.exp
Mark Wielaard c288cf
+++ b/helgrind/tests/tc21_pthonce.stderr.exp
Mark Wielaard c288cf
@@ -29,8 +29,8 @@ Locks held: none
Mark Wielaard c288cf
    by 0x........: mythread_wrapper (hg_intercepts.c:...)
Mark Wielaard c288cf
    ...
Mark Wielaard c288cf
 
Mark Wielaard c288cf
-Location 0x........ is 0 bytes inside local var "unprotected2"
Mark Wielaard c288cf
-declared at tc21_pthonce.c:51, in frame #x of thread x
Mark Wielaard c288cf
+Location 0x........ is 0 bytes inside global var "unprotected2"
Mark Wielaard c288cf
+declared at tc21_pthonce.c:51
Mark Wielaard c288cf
 
Mark Wielaard c288cf
 ----------------------------------------------------------------
Mark Wielaard c288cf
 
Mark Wielaard c288cf
@@ -46,8 +46,8 @@ Locks held: none
Mark Wielaard c288cf
    by 0x........: mythread_wrapper (hg_intercepts.c:...)
Mark Wielaard c288cf
    ...
Mark Wielaard c288cf
 
Mark Wielaard c288cf
-Location 0x........ is 0 bytes inside local var "unprotected2"
Mark Wielaard c288cf
-declared at tc21_pthonce.c:51, in frame #x of thread x
Mark Wielaard c288cf
+Location 0x........ is 0 bytes inside global var "unprotected2"
Mark Wielaard c288cf
+declared at tc21_pthonce.c:51
Mark Wielaard c288cf
 
Mark Wielaard c288cf
 
Mark Wielaard c288cf
 ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
Mark Wielaard c288cf
diff --git a/memcheck/tests/varinfo3.stderr.exp b/memcheck/tests/varinfo3.stderr.exp
Mark Wielaard c288cf
index d24ddb8..73130b7 100644
Mark Wielaard c288cf
--- a/memcheck/tests/varinfo3.stderr.exp
Mark Wielaard c288cf
+++ b/memcheck/tests/varinfo3.stderr.exp
Mark Wielaard c288cf
@@ -3,7 +3,7 @@ Uninitialised byte(s) found during client check request
Mark Wielaard c288cf
    by 0x........: foo (varinfo3.c:54)
Mark Wielaard c288cf
    by 0x........: main (varinfo3.c:66)
Mark Wielaard c288cf
  Location 0x........ is 0 bytes inside static_global_def[1],
Mark Wielaard c288cf
- declared at varinfo3.c:35, in frame #0 of thread 1
Mark Wielaard c288cf
+ a global variable declared at varinfo3.c:35
Mark Wielaard c288cf
 
Mark Wielaard c288cf
 Uninitialised byte(s) found during client check request
Mark Wielaard c288cf
    at 0x........: croak (varinfo3.c:28)
Mark Wielaard c288cf
@@ -17,7 +17,7 @@ Uninitialised byte(s) found during client check request
Mark Wielaard c288cf
    by 0x........: foo (varinfo3.c:56)
Mark Wielaard c288cf
    by 0x........: main (varinfo3.c:66)
Mark Wielaard c288cf
  Location 0x........ is 0 bytes inside static_global_undef[3],
Mark Wielaard c288cf
- declared at varinfo3.c:37, in frame #0 of thread 1
Mark Wielaard c288cf
+ a global variable declared at varinfo3.c:37
Mark Wielaard c288cf
 
Mark Wielaard c288cf
 Uninitialised byte(s) found during client check request
Mark Wielaard c288cf
    at 0x........: croak (varinfo3.c:28)
Mark Wielaard c288cf
diff --git a/memcheck/tests/varinfo3.stderr.exp-ppc64 b/memcheck/tests/varinfo3.stderr.exp-ppc64
Mark Wielaard c288cf
index e02a3c8..8dff370 100644
Mark Wielaard c288cf
--- a/memcheck/tests/varinfo3.stderr.exp-ppc64
Mark Wielaard c288cf
+++ b/memcheck/tests/varinfo3.stderr.exp-ppc64
Mark Wielaard c288cf
@@ -3,7 +3,7 @@ Uninitialised byte(s) found during client check request
Mark Wielaard c288cf
    by 0x........: foo (varinfo3.c:54)
Mark Wielaard c288cf
    by 0x........: main (varinfo3.c:66)
Mark Wielaard c288cf
  Location 0x........ is 0 bytes inside static_global_def[1],
Mark Wielaard c288cf
- declared at varinfo3.c:35, in frame #0 of thread 1
Mark Wielaard c288cf
+ a global variable declared at varinfo3.c:35
Mark Wielaard c288cf
 
Mark Wielaard c288cf
 Uninitialised byte(s) found during client check request
Mark Wielaard c288cf
    at 0x........: croak (varinfo3.c:29)
Mark Wielaard c288cf
@@ -17,7 +17,7 @@ Uninitialised byte(s) found during client check request
Mark Wielaard c288cf
    by 0x........: foo (varinfo3.c:56)
Mark Wielaard c288cf
    by 0x........: main (varinfo3.c:66)
Mark Wielaard c288cf
  Location 0x........ is 0 bytes inside static_global_undef[3],
Mark Wielaard c288cf
- declared at varinfo3.c:37, in frame #0 of thread 1
Mark Wielaard c288cf
+ a global variable declared at varinfo3.c:37
Mark Wielaard c288cf
 
Mark Wielaard c288cf
 Uninitialised byte(s) found during client check request
Mark Wielaard c288cf
    at 0x........: croak (varinfo3.c:29)
Mark Wielaard c288cf
diff --git a/memcheck/tests/varinfo5.stderr.exp b/memcheck/tests/varinfo5.stderr.exp
Mark Wielaard c288cf
index 3be0984..5fa9d97 100644
Mark Wielaard c288cf
--- a/memcheck/tests/varinfo5.stderr.exp
Mark Wielaard c288cf
+++ b/memcheck/tests/varinfo5.stderr.exp
Mark Wielaard c288cf
@@ -83,7 +83,7 @@ Uninitialised byte(s) found during client check request
Mark Wielaard c288cf
    by 0x........: varinfo5_main (varinfo5so.c:156)
Mark Wielaard c288cf
    by 0x........: main (varinfo5.c:5)
Mark Wielaard c288cf
  Location 0x........ is 0 bytes inside static_global_def[1],
Mark Wielaard c288cf
- declared at varinfo5so.c:87, in frame #0 of thread 1
Mark Wielaard c288cf
+ a global variable declared at varinfo5so.c:87
Mark Wielaard c288cf
 
Mark Wielaard c288cf
 Uninitialised byte(s) found during client check request
Mark Wielaard c288cf
    at 0x........: croak (varinfo5so.c:29)
Mark Wielaard c288cf
@@ -101,7 +101,7 @@ Uninitialised byte(s) found during client check request
Mark Wielaard c288cf
    by 0x........: varinfo5_main (varinfo5so.c:156)
Mark Wielaard c288cf
    by 0x........: main (varinfo5.c:5)
Mark Wielaard c288cf
  Location 0x........ is 0 bytes inside static_global_undef[3],
Mark Wielaard c288cf
- declared at varinfo5so.c:89, in frame #0 of thread 1
Mark Wielaard c288cf
+ a global variable declared at varinfo5so.c:89
Mark Wielaard c288cf
 
Mark Wielaard c288cf
 Uninitialised byte(s) found during client check request
Mark Wielaard c288cf
    at 0x........: croak (varinfo5so.c:29)
Mark Wielaard c288cf
diff --git a/memcheck/tests/varinfo5.stderr.exp-ppc64 b/memcheck/tests/varinfo5.stderr.exp-ppc64
Mark Wielaard c288cf
index db0c4fd..f5ebf0b 100644
Mark Wielaard c288cf
--- a/memcheck/tests/varinfo5.stderr.exp-ppc64
Mark Wielaard c288cf
+++ b/memcheck/tests/varinfo5.stderr.exp-ppc64
Mark Wielaard c288cf
@@ -83,7 +83,7 @@ Uninitialised byte(s) found during client check request
Mark Wielaard c288cf
    by 0x........: varinfo5_main (varinfo5so.c:156)
Mark Wielaard c288cf
    by 0x........: main (varinfo5.c:5)
Mark Wielaard c288cf
  Location 0x........ is 0 bytes inside static_global_def[1],
Mark Wielaard c288cf
- declared at varinfo5so.c:87, in frame #0 of thread 1
Mark Wielaard c288cf
+ a global variable declared at varinfo5so.c:87
Mark Wielaard c288cf
 
Mark Wielaard c288cf
 Uninitialised byte(s) found during client check request
Mark Wielaard c288cf
    at 0x........: croak (varinfo5so.c:30)
Mark Wielaard c288cf
@@ -101,7 +101,7 @@ Uninitialised byte(s) found during client check request
Mark Wielaard c288cf
    by 0x........: varinfo5_main (varinfo5so.c:156)
Mark Wielaard c288cf
    by 0x........: main (varinfo5.c:5)
Mark Wielaard c288cf
  Location 0x........ is 0 bytes inside static_global_undef[3],
Mark Wielaard c288cf
- declared at varinfo5so.c:89, in frame #0 of thread 1
Mark Wielaard c288cf
+ a global variable declared at varinfo5so.c:89
Mark Wielaard c288cf
 
Mark Wielaard c288cf
 Uninitialised byte(s) found during client check request
Mark Wielaard c288cf
    at 0x........: croak (varinfo5so.c:30)
Mark Wielaard c288cf
--- valgrind-3.8.1/coregrind/m_debuginfo/readdwarf3.c.orig	2012-08-17 08:59:56.000000000 +0200
Mark Wielaard c288cf
+++ valgrind-3.8.1/coregrind/m_debuginfo/readdwarf3.c	2013-02-19 15:39:55.965382081 +0100
Mark Wielaard c288cf
@@ -1853,7 +1853,7 @@
Mark Wielaard c288cf
    if (dtag == DW_TAG_variable || dtag == DW_TAG_formal_parameter) {
Mark Wielaard c288cf
       UChar* name        = NULL;
Mark Wielaard c288cf
       UWord  typeR       = D3_INVALID_CUOFF;
Mark Wielaard c288cf
-      Bool   external    = False;
Mark Wielaard c288cf
+      Bool   global      = False;
Mark Wielaard c288cf
       GExpr* gexpr       = NULL;
Mark Wielaard c288cf
       Int    n_attrs     = 0;
Mark Wielaard c288cf
       UWord  abs_ori     = (UWord)D3_INVALID_CUOFF;
Mark Wielaard c288cf
@@ -1880,7 +1880,7 @@
Mark Wielaard c288cf
             typeR = cook_die_using_form( cc, (UWord)cts, form );
Mark Wielaard c288cf
          }
Mark Wielaard c288cf
          if (attr == DW_AT_external && ctsSzB > 0 && cts > 0) {
Mark Wielaard c288cf
-            external = True;
Mark Wielaard c288cf
+            global = True;
Mark Wielaard c288cf
          }
Mark Wielaard c288cf
          if (attr == DW_AT_abstract_origin && ctsSzB > 0) {
Mark Wielaard c288cf
             abs_ori = (UWord)cts;
Mark Wielaard c288cf
@@ -1902,6 +1902,14 @@
Mark Wielaard c288cf
             if (0) VG_(printf)("XXX filename = %s\n", fileName);
Mark Wielaard c288cf
          }
Mark Wielaard c288cf
       }
Mark Wielaard c288cf
+      if (!global && dtag == DW_TAG_variable && level == 1) {
Mark Wielaard c288cf
+         /* Case of a static variable. It is better to declare
Mark Wielaard c288cf
+            it global as the variable is not really related to
Mark Wielaard c288cf
+            a PC range, as its address can be used by program
Mark Wielaard c288cf
+            counters outside of the ranges where it is visible . */
Mark Wielaard c288cf
+         global = True;
Mark Wielaard c288cf
+      }
Mark Wielaard c288cf
+
Mark Wielaard c288cf
       /* We'll collect it under if one of the following three
Mark Wielaard c288cf
          conditions holds:
Mark Wielaard c288cf
          (1) has location and type    -> completed
Mark Wielaard c288cf
@@ -1927,7 +1935,7 @@
Mark Wielaard c288cf
             this CU. */
Mark Wielaard c288cf
          vg_assert(parser->sp >= 0);
Mark Wielaard c288cf
 
Mark Wielaard c288cf
-         /* If this is a local variable (non-external), try to find
Mark Wielaard c288cf
+         /* If this is a local variable (non-global), try to find
Mark Wielaard c288cf
             the GExpr for the DW_AT_frame_base of the containing
Mark Wielaard c288cf
             function.  It should have been pushed on the stack at the
Mark Wielaard c288cf
             time we encountered its DW_TAG_subprogram DIE, so the way
Mark Wielaard c288cf
@@ -1939,7 +1947,7 @@
Mark Wielaard c288cf
             if the containing DT_TAG_subprogram didn't supply a
Mark Wielaard c288cf
             DW_AT_frame_base -- that's OK, but there must actually be
Mark Wielaard c288cf
             a containing DW_TAG_subprogram. */
Mark Wielaard c288cf
-         if (!external) {
Mark Wielaard c288cf
+         if (!global) {
Mark Wielaard c288cf
             Bool found = False;
Mark Wielaard c288cf
             for (i = parser->sp; i >= 0; i--) {
Mark Wielaard c288cf
                if (parser->isFunc[i]) {
Mark Wielaard c288cf
@@ -1951,7 +1959,7 @@
Mark Wielaard c288cf
             if (!found) {
Mark Wielaard c288cf
                if (0 && VG_(clo_verbosity) >= 0) {
Mark Wielaard c288cf
                   VG_(message)(Vg_DebugMsg, 
Mark Wielaard c288cf
-                     "warning: parse_var_DIE: non-external variable "
Mark Wielaard c288cf
+                     "warning: parse_var_DIE: non-global variable "
Mark Wielaard c288cf
                      "outside DW_TAG_subprogram\n");
Mark Wielaard c288cf
                }
Mark Wielaard c288cf
                /* goto bad_DIE; */
Mark Wielaard c288cf
@@ -1964,18 +1972,18 @@
Mark Wielaard c288cf
             }
Mark Wielaard c288cf
          }
Mark Wielaard c288cf
 
Mark Wielaard c288cf
-         /* re "external ? 0 : parser->sp" (twice), if the var is
Mark Wielaard c288cf
-            marked 'external' then we must put it at the global scope,
Mark Wielaard c288cf
+         /* re "global ? 0 : parser->sp" (twice), if the var is
Mark Wielaard c288cf
+            marked 'global' then we must put it at the global scope,
Mark Wielaard c288cf
             as only the global scope (level 0) covers the entire PC
Mark Wielaard c288cf
             address space.  It is asserted elsewhere that level 0 
Mark Wielaard c288cf
             always covers the entire address space. */
Mark Wielaard c288cf
-         xa = parser->ranges[external ? 0 : parser->sp];
Mark Wielaard c288cf
+         xa = parser->ranges[global ? 0 : parser->sp];
Mark Wielaard c288cf
          nRanges = VG_(sizeXA)(xa);
Mark Wielaard c288cf
          vg_assert(nRanges >= 0);
Mark Wielaard c288cf
 
Mark Wielaard c288cf
          tv = ML_(dinfo_zalloc)( "di.readdwarf3.pvD.1", sizeof(TempVar) );
Mark Wielaard c288cf
          tv->name   = name;
Mark Wielaard c288cf
-         tv->level  = external ? 0 : parser->sp;
Mark Wielaard c288cf
+         tv->level  = global ? 0 : parser->sp;
Mark Wielaard c288cf
          tv->typeR  = typeR;
Mark Wielaard c288cf
          tv->gexpr  = gexpr;
Mark Wielaard c288cf
          tv->fbGX   = fbGX;