Author: bart Date: 2008-03-07 18:52:38 +0000 (Fri, 07 Mar 2008) New Revision: 7585
Log: Switched to VG_(get_data_description)() for descriptions of addresses in error reports. Modified: trunk/exp-drd/drd_error.c trunk/exp-drd/drd_error.h trunk/exp-drd/tests/filter_stderr trunk/exp-drd/tests/fp_race.stderr.exp trunk/exp-drd/tests/hg03_inherit.stderr.exp trunk/exp-drd/tests/hg04_race.stderr.exp trunk/exp-drd/tests/hg05_race2.stderr.exp trunk/exp-drd/tests/rwlock_race.stderr.exp trunk/exp-drd/tests/sem_as_mutex.stderr.exp trunk/exp-drd/tests/tc01_simple_race.stderr.exp trunk/exp-drd/tests/tc16_byterace.stderr.exp trunk/exp-drd/tests/tc20_verifywrap.stderr.exp trunk/exp-drd/tests/tc20_verifywrap2.stderr.exp Modified: trunk/exp-drd/drd_error.c =================================================================== --- trunk/exp-drd/drd_error.c 2008-03-07 18:50:06 UTC (rev 7584) +++ trunk/exp-drd/drd_error.c 2008-03-07 18:52:38 UTC (rev 7585) @@ -220,13 +220,20 @@ void drd_report_data_race2(Error* const err, const DataRaceErrInfo* const dri) { AddrInfo ai; - Char descr[256]; + Char descr1[256]; + Char descr2[256]; tl_assert(dri); tl_assert(dri->addr); tl_assert(dri->size > 0); - describe_addr_text(dri->addr, dri->size, - &ai, descr, sizeof(descr)); + + descr1[0] = 0; + descr2[0] = 0; + VG_(get_data_description)(descr1, descr2, sizeof(descr1), dri->addr); + if (descr1[0] == 0) + { + describe_addr(dri->addr, dri->size, &ai); + } VG_(message)(Vg_UserMsg, "Conflicting %s by %s at 0x%08lx size %ld", dri->access_type == eStore ? "store" : "load", @@ -234,11 +241,19 @@ dri->addr, dri->size); VG_(pp_ExeContext)(VG_(get_error_where)(err)); - VG_(message)(Vg_UserMsg, "Allocation context: %s", descr); - if (ai.akind == eMallocd && ai.lastchange) + if (descr1[0]) { + VG_(message)(Vg_UserMsg, "%s", descr1); + VG_(message)(Vg_UserMsg, "%s", descr2); + } + else if (ai.akind == eMallocd && ai.lastchange) + { VG_(pp_ExeContext)(ai.lastchange); } + else + { + VG_(message)(Vg_UserMsg, "Allocation context: unknown.\n"); + } thread_report_conflicting_segments(VgThreadIdToDrdThreadId(dri->tid), dri->addr, dri->size, dri->access_type); } Modified: trunk/exp-drd/drd_error.h =================================================================== --- trunk/exp-drd/drd_error.h 2008-03-07 18:50:06 UTC (rev 7584) +++ trunk/exp-drd/drd_error.h 2008-03-07 18:52:38 UTC (rev 7585) @@ -27,7 +27,7 @@ #define __DRD_ERROR_H -#include "pub_drd_bitmap.h" // BmAccessTypeT +#include "pub_drd_bitmap.h" // BmAccessTypeT #include "drd_thread.h" // DrdThreadId #include "pub_tool_basics.h" // SizeT #include "pub_tool_debuginfo.h" // SegInfo Modified: trunk/exp-drd/tests/filter_stderr =================================================================== --- trunk/exp-drd/tests/filter_stderr 2008-03-07 18:50:06 UTC (rev 7584) +++ trunk/exp-drd/tests/filter_stderr 2008-03-07 18:52:38 UTC (rev 7585) @@ -11,7 +11,6 @@ sed \ -e "/^exp-drd, a data race detector\.$/d" \ -e "s/^Allocation context: stack of thread \([0-9]*\), offset -[0-9]*$/Allocation context: stack of thread \1, offset .../" \ --e "s/^Allocation context: .*$/Allocation context: unknown/" \ -e "s/(tc20_verifywrap.c:261)/(tc20_verifywrap.c:262)/" \ -e "/^NOTE: This is an Experimental-Class Valgrind Tool.$/d" \ -e "/^Copyright (C) 2006-200., and GNU GPL'd, by Bart Van Assche.$/d" \ Modified: trunk/exp-drd/tests/fp_race.stderr.exp =================================================================== --- trunk/exp-drd/tests/fp_race.stderr.exp 2008-03-07 18:50:06 UTC (rev 7584) +++ trunk/exp-drd/tests/fp_race.stderr.exp 2008-03-07 18:52:38 UTC (rev 7585) @@ -1,7 +1,8 @@ Conflicting load by main at 0x........ size 8 at 0x........: main (fp_race.c:?) -Allocation context: unknown +Location 0x........ is 0 bytes inside local var "s_d3" +declared at fp_race.c:47, in frame #0 of thread 1 Other segment start (thread_func) (thread finished, call stack no longer available) Other segment end (thread_func) @@ -9,7 +10,8 @@ Conflicting store by main at 0x........ size 8 at 0x........: main (fp_race.c:?) -Allocation context: unknown +Location 0x........ is 0 bytes inside local var "s_d3" +declared at fp_race.c:47, in frame #0 of thread 1 Other segment start (thread_func) (thread finished, call stack no longer available) Other segment end (thread_func) Modified: trunk/exp-drd/tests/hg03_inherit.stderr.exp =================================================================== --- trunk/exp-drd/tests/hg03_inherit.stderr.exp 2008-03-07 18:50:06 UTC (rev 7584) +++ trunk/exp-drd/tests/hg03_inherit.stderr.exp 2008-03-07 18:52:38 UTC (rev 7585) @@ -5,7 +5,8 @@ by 0x........: vg_thread_wrapper (drd_intercepts.c:?) by 0x........: start_thread (in libpthread-?.?.so) by 0x........: clone (in /...libc...) -Allocation context: unknown +Location 0x........ is 0 bytes inside shared[1], +declared at hg03_inherit.c:11, in frame #0 of thread 3 Other segment start (thread 1) at 0x........: pthread_join (drd_intercepts.c:?) by 0x........: main (hg03_inherit.c:49) @@ -19,7 +20,8 @@ by 0x........: vg_thread_wrapper (drd_intercepts.c:?) by 0x........: start_thread (in libpthread-?.?.so) by 0x........: clone (in /...libc...) -Allocation context: unknown +Location 0x........ is 0 bytes inside shared[1], +declared at hg03_inherit.c:11, in frame #0 of thread 3 Other segment start (thread 1) at 0x........: pthread_join (drd_intercepts.c:?) by 0x........: main (hg03_inherit.c:49) Modified: trunk/exp-drd/tests/hg04_race.stderr.exp =================================================================== --- trunk/exp-drd/tests/hg04_race.stderr.exp 2008-03-07 18:50:06 UTC (rev 7584) +++ trunk/exp-drd/tests/hg04_race.stderr.exp 2008-03-07 18:52:38 UTC (rev 7585) @@ -5,7 +5,8 @@ by 0x........: vg_thread_wrapper (drd_intercepts.c:?) by 0x........: start_thread (in libpthread-?.?.so) by 0x........: clone (in /...libc...) -Allocation context: unknown +Location 0x........ is 0 bytes inside local var "shared" +declared at hg04_race.c:6, in frame #0 of thread 2 Other segment start (thread 2) (thread finished, call stack no longer available) Other segment end (thread 2) @@ -16,7 +17,8 @@ by 0x........: vg_thread_wrapper (drd_intercepts.c:?) by 0x........: start_thread (in libpthread-?.?.so) by 0x........: clone (in /...libc...) -Allocation context: unknown +Location 0x........ is 0 bytes inside local var "shared" +declared at hg04_race.c:6, in frame #0 of thread 2 Other segment start (thread 2) (thread finished, call stack no longer available) Other segment end (thread 2) Modified: trunk/exp-drd/tests/hg05_race2.stderr.exp =================================================================== --- trunk/exp-drd/tests/hg05_race2.stderr.exp 2008-03-07 18:50:06 UTC (rev 7584) +++ trunk/exp-drd/tests/hg05_race2.stderr.exp 2008-03-07 18:52:38 UTC (rev 7585) @@ -5,7 +5,8 @@ by 0x........: vg_thread_wrapper (drd_intercepts.c:?) by 0x........: start_thread (in libpthread-?.?.so) by 0x........: clone (in /...libc...) -Allocation context: unknown +Location 0x........ is 0 bytes inside foo.poot[5].plop[11], +declared at hg05_race2.c:24, in frame #4 of thread 1 Other segment start (thread 2) (thread finished, call stack no longer available) Other segment end (thread 2) @@ -16,7 +17,8 @@ by 0x........: vg_thread_wrapper (drd_intercepts.c:?) by 0x........: start_thread (in libpthread-?.?.so) by 0x........: clone (in /...libc...) -Allocation context: unknown +Location 0x........ is 0 bytes inside foo.poot[5].plop[11], +declared at hg05_race2.c:24, in frame #4 of thread 1 Other segment start (thread 2) (thread finished, call stack no longer available) Other segment end (thread 2) Modified: trunk/exp-drd/tests/rwlock_race.stderr.exp =================================================================== --- trunk/exp-drd/tests/rwlock_race.stderr.exp 2008-03-07 18:50:06 UTC (rev 7584) +++ trunk/exp-drd/tests/rwlock_race.stderr.exp 2008-03-07 18:52:38 UTC (rev 7585) @@ -5,7 +5,8 @@ by 0x........: vg_thread_wrapper (drd_intercepts.c:?) by 0x........: start_thread (in libpthread-?.?.so) by 0x........: clone (in /...libc...) -Allocation context: unknown +Location 0x........ is 0 bytes inside local var "s_racy" +declared at rwlock_race.c:17, in frame #0 of thread 2 Other segment start (thread 2) (thread finished, call stack no longer available) Other segment end (thread 2) @@ -16,7 +17,8 @@ by 0x........: vg_thread_wrapper (drd_intercepts.c:?) by 0x........: start_thread (in libpthread-?.?.so) by 0x........: clone (in /...libc...) -Allocation context: unknown +Location 0x........ is 0 bytes inside local var "s_racy" +declared at rwlock_race.c:17, in frame #0 of thread 2 Other segment start (thread 2) (thread finished, call stack no longer available) Other segment end (thread 2) Modified: trunk/exp-drd/tests/sem_as_mutex.stderr.exp =================================================================== --- trunk/exp-drd/tests/sem_as_mutex.stderr.exp 2008-03-07 18:50:06 UTC (rev 7584) +++ trunk/exp-drd/tests/sem_as_mutex.stderr.exp 2008-03-07 18:52:38 UTC (rev 7585) @@ -1,7 +1,8 @@ Conflicting load by main at 0x........ size 8 at 0x........: main (sem_as_mutex.c:?) -Allocation context: unknown +Location 0x........ is 0 bytes inside local var "s_d3" +declared at sem_as_mutex.c:48, in frame #0 of thread 1 Other segment start (thread_func) (thread finished, call stack no longer available) Other segment end (thread_func) @@ -9,7 +10,8 @@ Conflicting store by main at 0x........ size 8 at 0x........: main (sem_as_mutex.c:?) -Allocation context: unknown +Location 0x........ is 0 bytes inside local var "s_d3" +declared at sem_as_mutex.c:48, in frame #0 of thread 1 Other segment start (thread_func) (thread finished, call stack no longer available) Other segment end (thread_func) Modified: trunk/exp-drd/tests/tc01_simple_race.stderr.exp =================================================================== --- trunk/exp-drd/tests/tc01_simple_race.stderr.exp 2008-03-07 18:50:06 UTC (rev 7584) +++ trunk/exp-drd/tests/tc01_simple_race.stderr.exp 2008-03-07 18:52:38 UTC (rev 7585) @@ -1,7 +1,8 @@ Conflicting load by thread 1 at 0x........ size 4 at 0x........: main (tc01_simple_race.c:28) -Allocation context: unknown +Location 0x........ is 0 bytes inside global var "x" +declared at tc01_simple_race.c:9 Other segment start (thread 2) (thread finished, call stack no longer available) Other segment end (thread 2) @@ -9,7 +10,8 @@ Conflicting store by thread 1 at 0x........ size 4 at 0x........: main (tc01_simple_race.c:28) -Allocation context: unknown +Location 0x........ is 0 bytes inside global var "x" +declared at tc01_simple_race.c:9 Other segment start (thread 2) (thread finished, call stack no longer available) Other segment end (thread 2) Modified: trunk/exp-drd/tests/tc16_byterace.stderr.exp =================================================================== --- trunk/exp-drd/tests/tc16_byterace.stderr.exp 2008-03-07 18:50:06 UTC (rev 7584) +++ trunk/exp-drd/tests/tc16_byterace.stderr.exp 2008-03-07 18:52:38 UTC (rev 7585) @@ -1,7 +1,8 @@ Conflicting load by thread 1 at 0x........ size 1 at 0x........: main (tc16_byterace.c:34) -Allocation context: unknown +Location 0x........ is 0 bytes inside bytes[4], +a global variable declared at tc16_byterace.c:7 Other segment start (thread 2) (thread finished, call stack no longer available) Other segment end (thread 2) @@ -9,7 +10,8 @@ Conflicting store by thread 1 at 0x........ size 1 at 0x........: main (tc16_byterace.c:34) -Allocation context: unknown +Location 0x........ is 0 bytes inside bytes[4], +a global variable declared at tc16_byterace.c:7 Other segment start (thread 2) (thread finished, call stack no longer available) Other segment end (thread 2) Modified: trunk/exp-drd/tests/tc20_verifywrap.stderr.exp =================================================================== --- trunk/exp-drd/tests/tc20_verifywrap.stderr.exp 2008-03-07 18:50:06 UTC (rev 7584) +++ trunk/exp-drd/tests/tc20_verifywrap.stderr.exp 2008-03-07 18:52:38 UTC (rev 7585) @@ -7,7 +7,8 @@ Conflicting store by thread 1 at 0x........ size 2 at 0x........: main (tc20_verifywrap.c:78) -Allocation context: unknown +Location 0x........ is 0 bytes inside global var "unprotected" +declared at tc20_verifywrap.c:27 Other segment start (thread 2) (thread finished, call stack no longer available) Other segment end (thread 2) Modified: trunk/exp-drd/tests/tc20_verifywrap2.stderr.exp =================================================================== --- trunk/exp-drd/tests/tc20_verifywrap2.stderr.exp 2008-03-07 18:50:06 UTC (rev 7584) +++ trunk/exp-drd/tests/tc20_verifywrap2.stderr.exp 2008-03-07 18:52:38 UTC (rev 7585) @@ -7,7 +7,8 @@ Conflicting store by thread 1 at 0x........ size 2 at 0x........: main (tc20_verifywrap.c:78) -Allocation context: unknown +Location 0x........ is 0 bytes inside global var "unprotected" +declared at tc20_verifywrap.c:27 Other segment start (thread 2) (thread finished, call stack no longer available) Other segment end (thread 2) ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Valgrind-developers mailing list Valgrind-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/valgrind-developers