sal/osl/unx/backtraceapi.cxx |   16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

New commits:
commit 29e200aa0af78a4589bf7e52dddfb62f3bdf4e01
Author:     Luboš Luňák <l.lu...@collabora.com>
AuthorDate: Fri Oct 22 10:30:25 2021 +0200
Commit:     Luboš Luňák <l.lu...@collabora.com>
CommitDate: Fri Oct 22 16:32:43 2021 +0200

    revert part of "Simplify vector initialization in sal"
    
    This first allocates space based on the two items, and only
    afterwards it reserves space for all items, possibly allocating
    again.
    
    This partially reverts commit 8546cdb2ad25b03ac152615357cab00 .
    
    Change-Id: I8668cb03881766fc5078ab5e411efe56e6f3009e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124054
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lu...@collabora.com>

diff --git a/sal/osl/unx/backtraceapi.cxx b/sal/osl/unx/backtraceapi.cxx
index 3022be8dd829..23d3bec498b9 100644
--- a/sal/osl/unx/backtraceapi.cxx
+++ b/sal/osl/unx/backtraceapi.cxx
@@ -79,12 +79,10 @@ void process_file_addr2line( const char* file, 
std::vector<FrameData>& frameData
     OUString arg1("-Cfe");
     OUString arg2 = OUString::fromUtf8(file);
     std::vector<OUString> addrs;
-    std::vector<rtl_uString*> args
-    {
-        arg1.pData,
-        arg2.pData
-    };
+    std::vector<rtl_uString*> args;
     args.reserve(frameData.size() + 2);
+    args.push_back( arg1.pData );
+    args.push_back( arg2.pData );
     for( FrameData& frame : frameData )
     {
         if( frame.file != nullptr && strcmp( file, frame.file ) == 0 )
commit d6a26e26505ec1f6810c6b749129a79ba0931742
Author:     Luboš Luňák <l.lu...@collabora.com>
AuthorDate: Fri Oct 22 10:22:56 2021 +0200
Commit:     Luboš Luňák <l.lu...@collabora.com>
CommitDate: Fri Oct 22 16:32:30 2021 +0200

    cache negative addr2line hits
    
    Otherwise we'd be trying to resolve unknown symbols repeatedly.
    
    Change-Id: I1c1eb9f97a1f64436ad0858ceff75fa29343979a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124053
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lu...@collabora.com>

diff --git a/sal/osl/unx/backtraceapi.cxx b/sal/osl/unx/backtraceapi.cxx
index b372a500f7f0..3022be8dd829 100644
--- a/sal/osl/unx/backtraceapi.cxx
+++ b/sal/osl/unx/backtraceapi.cxx
@@ -161,7 +161,13 @@ void process_file_addr2line( const char* file, 
std::vector<FrameData>& frameData
             OString function = lines[linesPos];
             OString source = lines[linesPos+1];
             linesPos += 2;
-            if(!function.isEmpty() && !function.startsWith("??"))
+            if(function.isEmpty() || function.startsWith("??"))
+            {
+                // Cache that the address cannot be resolved.
+                std::lock_guard guard(frameCacheMutex);
+                frameCache.insert( { frame.addr, "" } );
+            }
+            else
             {
                 if( source.startsWith("??"))
                     frame.info = function + " in " + file;

Reply via email to