solenv/gdb/libreoffice/sw.py |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 2c524ab87e336418c3ee7370f76284a53dff1c82
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Mon Jul 17 14:16:24 2023 +0200
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Mon Jul 17 16:39:16 2023 +0200

    solenv: gdb: BigPtrArrayPrinter, try both 0 and 0ul
    
    Apparently commit ea858ca92488309789e83666681a358af1d9f6f6 broke it on
    Fedora 38, where i now get:
      gdb.error: No type named std::_Head_base<0ul, BlockInfo**, false>.
    
    So try both variants.
    
    Change-Id: If344077df7a6b329286bc1296446562301305946
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154525
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/solenv/gdb/libreoffice/sw.py b/solenv/gdb/libreoffice/sw.py
index 2b5cc7c7278b..50d0f2221f2e 100644
--- a/solenv/gdb/libreoffice/sw.py
+++ b/solenv/gdb/libreoffice/sw.py
@@ -194,7 +194,12 @@ class BigPtrArrayPrinter(object):
             # libstdc++ unique_ptr is a std::tuple which contains multiple
             # _M_head_impl members and gdb may pick the wrong one by default
             # so have to manually cast it to the one that contains the array
-            self.blocks = 
array['m_ppInf']['_M_t']['_M_t'].cast(gdb.lookup_type("std::_Head_base<0ul, 
BlockInfo**, false>"))['_M_head_impl']
+            try:
+                # supposedly works on Debian gdb 13.2
+                self.blocks = 
array['m_ppInf']['_M_t']['_M_t'].cast(gdb.lookup_type("std::_Head_base<0ul, 
BlockInfo**, false>"))['_M_head_impl']
+            except gdb.error:
+                # works on Fedora gdb 13.2
+                self.blocks = 
array['m_ppInf']['_M_t']['_M_t'].cast(gdb.lookup_type("std::_Head_base<0, 
BlockInfo**, false>"))['_M_head_impl']
             self.count = array['m_nSize']
             self.pos = 0
             self.block_count = array['m_nBlock']

Reply via email to