[Libreoffice-commits] core.git: 2 commits - cui/source solenv/gdb

Noel Grandin noel.grandin at collabora.co.uk
Wed Mar 14 14:57:10 UTC 2018


 cui/source/customize/cfg.cxx |    7 +++++--
 solenv/gdb/libreoffice/tl.py |    9 ++++++++-
 2 files changed, 13 insertions(+), 3 deletions(-)

New commits:
commit 55ad4e3cb7a0d705ff1c0f26feb644d8b06b71d8
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Mar 14 16:55:35 2018 +0200

    fix pretty printing of Fraction better
    
    work-around gdb bug, and deal with different representations of
    std::unique_ptr in different versions of libc++.
    
    Change-Id: I02a1f49c07dbcd70e13ef6be48e20b510bf5e3fa

diff --git a/solenv/gdb/libreoffice/tl.py b/solenv/gdb/libreoffice/tl.py
index 670482027b7f..dec0ae2f0d53 100644
--- a/solenv/gdb/libreoffice/tl.py
+++ b/solenv/gdb/libreoffice/tl.py
@@ -62,7 +62,14 @@ class FractionPrinter(object):
         self.val = val
 
     def to_string(self):
-        impl = self.val['mpImpl']['_M_t']['_M_t']['_M_head_impl'].dereference().cast(gdb.lookup_type('Fraction::Impl'))
+        # Workaround gdb bug <https://sourceware.org/bugzilla/show_bug.cgi?id=22968> "ptype does not
+        #     find inner C++ class type without -readnow"
+        gdb.lookup_type('Fraction')
+        # This would be simpler and more reliable if we could call the operator* on mpImpl to get the internal Impl.
+        # Different libc have different structures. Some have one _M_t, some have two nested.
+        tmp = self.val['mpImpl']['_M_t']
+        if tmp.type.fields()[0].name == '_M_t': tmp = tmp['_M_t']
+        impl = tmp['_M_head_impl'].dereference().cast(gdb.lookup_type('Fraction::Impl'))
         numerator = impl['value']['num']
         denominator = impl['value']['den']
         if impl['valid']:
commit 3a0ae2aae3f226e5e2e3785e578dee3ab4d2fa35
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Mar 14 15:30:07 2018 +0200

    fix crash on close customize dialog
    
    after
        commit 00431a8afcad08da11835131c2cd423d7f8cd115
        Date:   Tue Mar 13 11:57:33 2018 +0200
        loplugin:useuniqueptr in SvxEntries
    
    Change-Id: Ia115454522b87db93cefcbd89ca5d965f9b431c7

diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index 5762979a7528..515088d11916 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -2085,9 +2085,12 @@ SvxConfigEntry::SvxConfigEntry( const OUString& rDisplayName,
 
 SvxConfigEntry::~SvxConfigEntry()
 {
-    for (auto const& entry : *mpEntries)
+    if (mpEntries)
     {
-        delete entry;
+        for (auto const& entry : *mpEntries)
+        {
+            delete entry;
+        }
     }
 }
 


More information about the Libreoffice-commits mailing list