]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix lazy debuginfo loading on ppc64le
authorAaron Merey <amerey@redhat.com>
Wed, 30 Aug 2023 18:49:09 +0000 (14:49 -0400)
committerMark Wielaard <mark@klomp.org>
Fri, 1 Sep 2023 23:00:04 +0000 (01:00 +0200)
Lazy debuginfo loading introduced in commit 60f7e89ba32 assumed that
either describe_IP or find_DiCfSI will be called before stacktrace
printing.  describe_IP and find_DiCfSI cause debuginfo to be lazily
loaded before symtab lookup occurs during stacktraces.

However this assumption does not hold true on ppc64le, resulting
in debuginfo failing to load in time for stacktraces.  Fix this
by loading debuginfo during get_StackTrace_wrk on ppc arches.

coregrind/m_stacktrace.c

index 308bebdd867b4846d9116ca76b306999315bd85f..0ec6f5993a10a1abbc45881be9eafcb5aa4635cd 100644 (file)
@@ -772,6 +772,8 @@ UInt VG_(get_StackTrace_wrk) ( ThreadId tid_if_known,
 #  endif
    Addr fp_min = sp - VG_STACK_REDZONE_SZB;
 
+   VG_(addr_load_di)(ip);
+
    /* Snaffle IPs from the client's stack into ips[0 .. max_n_ips-1],
       stopping when the trail goes cold, which we guess to be
       when FP is not a reasonable stack location. */
@@ -913,6 +915,7 @@ UInt VG_(get_StackTrace_wrk) ( ThreadId tid_if_known,
                             play safe, a la x86/amd64 above.  See
                             extensive comments above. */
             RECURSIVE_MERGE(cmrf,ips,i);
+            VG_(addr_load_di)(ip);
             continue;
          }