From: Bart Van Assche Date: Wed, 9 Jul 2008 12:43:35 +0000 (+0000) Subject: Print section type and name as a last resort in case the other allocation context... X-Git-Tag: svn/VALGRIND_3_4_0~338 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d67ab8ac85b1c128502618be0985bc75a5ae4a26;p=thirdparty%2Fvalgrind.git Print section type and name as a last resort in case the other allocation context detection attempts failed. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8409 --- diff --git a/drd/drd_error.c b/drd/drd_error.c index 4c60c069f0..a8c0052af4 100644 --- a/drd/drd_error.c +++ b/drd/drd_error.c @@ -134,7 +134,21 @@ void drd_report_data_race2(Error* const err, const DataRaceErrInfo* const dri) } else { - VG_(message)(Vg_UserMsg, "Allocation context: unknown."); + char sect_name[64]; + VgSectKind sect_kind; + + sect_kind = VG_(seginfo_sect_kind)(sect_name, sizeof(sect_name), dri->addr); + if (sect_kind != Vg_SectUnknown) + { + VG_(message)(Vg_UserMsg, + "Allocation context: %s section of %s", + VG_(pp_SectKind)(sect_kind), + sect_name); + } + else + { + VG_(message)(Vg_UserMsg, "Allocation context: unknown."); + } } if (s_drd_show_conflicting_segments) {