From: Paul Floyd Date: Sat, 21 Dec 2024 19:46:40 +0000 (+0100) Subject: Bug 497723 - Enabling Ada demangling breaks callgrind differentiation between overloa... X-Git-Tag: VALGRIND_3_25_0~195 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2e029beff537aab841ea7a3b4207b8b5ff33c86f;p=thirdparty%2Fvalgrind.git Bug 497723 - Enabling Ada demangling breaks callgrind differentiation between overloaded functions and procedures --- diff --git a/NEWS b/NEWS index b668ad2e4b..0be2ff0339 100644 --- a/NEWS +++ b/NEWS @@ -36,6 +36,8 @@ are not entered into bugzilla tend to get forgotten about or ignored. 469782 Valgrind does not support zstd-compressed debug sections 497130 Recognize new DWARF5 DW_LANG constants 497455 Update drd/scripts/download-and-build-gcc +497723 Enabling Ada demangling breaks callgrind differentiation between + overloaded functions and procedures To see details of a given bug, visit https://bugs.kde.org/show_bug.cgi?id=XXXXXX diff --git a/callgrind/tests/Makefile.am b/callgrind/tests/Makefile.am index 9b68679908..4a49ea7de4 100644 --- a/callgrind/tests/Makefile.am +++ b/callgrind/tests/Makefile.am @@ -10,6 +10,7 @@ EXTRA_DIST = \ ann1.post.exp ann1.stderr.exp ann1.vgtest \ ann2.post.exp ann2.stderr.exp ann2.vgtest \ clreq.vgtest clreq.stderr.exp \ + bug497723.stderr.exp bug497723.post.exp bug497723.vgtest \ simwork1.vgtest simwork1.stdout.exp simwork1.stderr.exp \ simwork2.vgtest simwork2.stdout.exp simwork2.stderr.exp \ simwork3.vgtest simwork3.stdout.exp simwork3.stderr.exp \ diff --git a/callgrind/tests/bug497723.post.exp b/callgrind/tests/bug497723.post.exp new file mode 100644 index 0000000000..7be1e7e38c --- /dev/null +++ b/callgrind/tests/bug497723.post.exp @@ -0,0 +1,2 @@ +cfn=(5164) ada__text_io__put_line +cfn=(5160) _ada_main diff --git a/callgrind/tests/bug497723.stderr.exp b/callgrind/tests/bug497723.stderr.exp new file mode 100644 index 0000000000..d0b7820ae3 --- /dev/null +++ b/callgrind/tests/bug497723.stderr.exp @@ -0,0 +1,6 @@ + + +Events : Ir +Collected : + +I refs: diff --git a/callgrind/tests/bug497723.vgtest b/callgrind/tests/bug497723.vgtest new file mode 100644 index 0000000000..722ee33d05 --- /dev/null +++ b/callgrind/tests/bug497723.vgtest @@ -0,0 +1,4 @@ +prog: ../../memcheck/tests/bug445235_ada_demangle +vgopts: --callgrind-out-file=callgrind.out +post: grep "cfn.*ada_" callgrind.out +cleanup: rm callgrind.out diff --git a/coregrind/m_redir.c b/coregrind/m_redir.c index f9e8d8801a..6c360d59ce 100644 --- a/coregrind/m_redir.c +++ b/coregrind/m_redir.c @@ -537,8 +537,13 @@ void VG_(redir_notify_new_DebugInfo)( DebugInfo* newdi ) * For Ada demangling, the language doesn't use a regular * prefix like _Z or _R, so look for a common symbol and * set a global flag. + * + * https://bugs.kde.org/show_bug.cgi?id=497723 but not for + * callgrind because demangled overloaded manes get + * incorrectly counted together. */ - if (!isText && VG_(strcmp)(*names, "__gnat_ada_main_program_name") == 0) { + if (!isText && VG_(strcmp)(*names, "__gnat_ada_main_program_name") == 0 && + VG_(strcmp)(VG_(clo_toolname), "callgrind") != 0) { VG_(lang_is_ada) = True; } isGlobal = False;