[Libreoffice-commits] .: solenv/gdb

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Jan 7 08:05:53 PST 2013


 solenv/gdb/libreoffice/cppu.py |   11 +++++++++++
 1 file changed, 11 insertions(+)

New commits:
commit c2fe5679e9eb8c3a18b286bbd8b85a6a17fe6858
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Jan 7 16:59:26 2013 +0100

    Avoid infinite recursion in -gdb.py printers
    
    ...when printing the pThread argument in a
    cppu_threadpool::ThreadPool::waitInPool call frame.
    
    Change-Id: I5c94485a0218be449c9dab67701a634eef3e08a1

diff --git a/solenv/gdb/libreoffice/cppu.py b/solenv/gdb/libreoffice/cppu.py
index 1e3b25e..8db684a 100644
--- a/solenv/gdb/libreoffice/cppu.py
+++ b/solenv/gdb/libreoffice/cppu.py
@@ -143,6 +143,16 @@ class UnoTypePrinter(object):
         else:
             return "invalid %s" % self.typename
 
+class CppuThreadpoolThreadPoolPrinter(object):
+    '''Prints cppu_threadpool::ThreadPool objects (a hack to avoid infinite recursion through sal.RtlReferencePrinter when printing an rtl::Reference<cppu_threadpool::ThreadPool> whose std::list<cppu_threadpool::WaitingThread*> m_lstThreads member, via rtl::Reference<cppu_threadpool::ORequestThread> thread member, via rtl::Reference<cppu_threadpool::ThreadPool> m_aThreadPool member, has a circular reference back)'''
+
+    def __init__(self, typename, value):
+        self.typename = typename
+        self.value = value
+
+    def to_string(self):
+        return '%s@%s' % (self.typename, self.value.address)
+
 printer = None
 
 def build_pretty_printers():
@@ -156,6 +166,7 @@ def build_pretty_printers():
     printer.add('com::sun::star::uno::Reference', UnoReferencePrinter)
     printer.add('com::sun::star::uno::Sequence', UnoSequencePrinter)
     printer.add('com::sun::star::uno::Type', UnoTypePrinter)
+    printer.add('cppu_threadpool::ThreadPool', CppuThreadpoolThreadPoolPrinter)
 
 def register_pretty_printers(obj):
     printing.register_pretty_printer(printer, obj)


More information about the Libreoffice-commits mailing list