Handle the new raise implementation in glibc since commit a770631302,
which uses a helper function __raise_direct instead of calling
pthread_kill.  This will be part of the 2.45 release.

https://sourceware.org/bugzilla/show_bug.cgi?id=34603
Signed-off-by: Andreas Schwab <[email protected]>
---
 tests/backtrace.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/tests/backtrace.c b/tests/backtrace.c
index 55555301..6afd88b2 100644
--- a/tests/backtrace.c
+++ b/tests/backtrace.c
@@ -105,8 +105,8 @@ callback_verify (pid_t tid, unsigned frameno, Dwarf_Addr pc,
   static bool reduce_frameno = false;
   if (reduce_frameno)
     frameno--;
-  static bool pthread_kill_seen = false;
-  if (pthread_kill_seen)
+  static bool raise_impl_seen = false;
+  if (raise_impl_seen)
     frameno--;
   if (! use_raise_jmp_patching && frameno >= 2)
     frameno += 2;
@@ -118,9 +118,10 @@ callback_verify (pid_t tid, unsigned frameno, Dwarf_Addr 
pc,
               && (strcmp (symname, "__kernel_vsyscall") == 0
                   || strcmp (symname, "__libc_do_syscall") == 0))
        reduce_frameno = true;
-      else if (! pthread_kill_seen && symname
-              && strstr (symname, "pthread_kill") != NULL)
-       pthread_kill_seen = true;
+      else if (! raise_impl_seen && symname
+              && (strstr (symname, "pthread_kill") != NULL
+                  || strcmp (symname, "__raise_direct") == 0))
+       raise_impl_seen = true;
       else
        {
          if (!symname || strcmp (symname, "raise") != 0)
-- 
2.55.0


-- 
Andreas Schwab, SUSE Labs, [email protected]
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

Reply via email to