summaryrefslogtreecommitdiff
path: root/solenv
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2013-02-07 14:23:57 +0100
committerMichael Stahl <mstahl@redhat.com>2013-02-07 14:36:26 +0100
commitdb9823414d91386b01187d5945f08ac8385bd575 (patch)
tree096cc4dc97d32aa9219daf423dfb4a662808a8f4 /solenv
parentb058abc39aaa34d81ebb36cc2405b221fb055418 (diff)
gdb: UnoReferencePrinter: prevent ambiguity problems differently
With gdb 7.5.1 the dynamic_cast may cause "Couldn't determine value's most derived type for dynamic_cast", which isn't helpful either. So just print the current XInterface value in case the cast fails. Change-Id: I453b1a8eecbb056853293280195f6475f8852f2b
Diffstat (limited to 'solenv')
-rw-r--r--solenv/gdb/libreoffice/cppu.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/solenv/gdb/libreoffice/cppu.py b/solenv/gdb/libreoffice/cppu.py
index 31f1da60f568..dd5ff2df13a1 100644
--- a/solenv/gdb/libreoffice/cppu.py
+++ b/solenv/gdb/libreoffice/cppu.py
@@ -63,10 +63,14 @@ class UnoReferencePrinter(object):
def to_string(self):
iface = self.value['_pInterface']
if iface:
- # dynamic_cast hopefully avoids this problem:
- # base class 'com::sun::star::uno::XInterface' is ambiguous
- impl = iface.dynamic_cast(self._itype()).dereference()
- return '%s to %s' % (self.typename, str(impl))
+ try:
+ impl = iface.cast(_itype).dereference()
+ return '%s to %s' % (self.typename, str(impl))
+ except:
+ # fallback for potential problem:
+ # base class 'com::sun::star::uno::XInterface' is ambiguous
+ return '%s to (XInterface) %s' % (self.typename, str(iface))
+
else:
return "empty %s" % self.typename