diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-01-07 16:59:26 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-01-07 17:05:16 +0100 |
commit | c2fe5679e9eb8c3a18b286bbd8b85a6a17fe6858 (patch) | |
tree | 5836c44fc02c9ea24f5ff9e3dd29085f553c67be /solenv/gdb/libreoffice | |
parent | e855dfbc3eb5a97ab57743a28b14555fd4b3375f (diff) |
Avoid infinite recursion in -gdb.py printers
...when printing the pThread argument in a
cppu_threadpool::ThreadPool::waitInPool call frame.
Change-Id: I5c94485a0218be449c9dab67701a634eef3e08a1
Diffstat (limited to 'solenv/gdb/libreoffice')
-rw-r--r-- | solenv/gdb/libreoffice/cppu.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/solenv/gdb/libreoffice/cppu.py b/solenv/gdb/libreoffice/cppu.py index 1e3b25ec0dd3..8db684a74eca 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) |