]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Bug 497723 - Enabling Ada demangling breaks callgrind differentiation between overloa...
authorPaul Floyd <pjfloyd@wanadoo.fr>
Sat, 21 Dec 2024 19:46:40 +0000 (20:46 +0100)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Sat, 21 Dec 2024 19:46:40 +0000 (20:46 +0100)
NEWS
callgrind/tests/Makefile.am
callgrind/tests/bug497723.post.exp [new file with mode: 0644]
callgrind/tests/bug497723.stderr.exp [new file with mode: 0644]
callgrind/tests/bug497723.vgtest [new file with mode: 0644]
coregrind/m_redir.c

diff --git a/NEWS b/NEWS
index b668ad2e4becb8ab54903a0c3d06bdcd2ca6bf64..0be2ff033959536d291e9c0ae5fcd30e22571d55 100644 (file)
--- 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
index 9b686799080b366c5e37dff33fa9686cf2a2b426..4a49ea7de4f6d2f7af7a3e1c2c5107ce32eb2346 100644 (file)
@@ -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 (file)
index 0000000..7be1e7e
--- /dev/null
@@ -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 (file)
index 0000000..d0b7820
--- /dev/null
@@ -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 (file)
index 0000000..722ee33
--- /dev/null
@@ -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
index f9e8d8801a192e894ae901a30ba525ab490f5ee6..6c360d59ce698465d031716033852c24d0fcee7e 100644 (file)
@@ -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;