From d67ab8ac85b1c128502618be0985bc75a5ae4a26 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 9 Jul 2008 12:43:35 +0000 Subject: [PATCH] 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 --- drd/drd_error.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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) { -- 2.47.3