diff options
author | hjk <hjk121@nokiamail.com> | 2014-01-31 16:56:32 +0100 |
---|---|---|
committer | hjk <hjk121@nokiamail.com> | 2014-01-31 17:11:02 +0100 |
commit | b2874f3bb362c151945666e59aa7eaddca773181 (patch) | |
tree | 9ad2bd1573f6929c4014a3b8a23f38448a19eeeb /share | |
parent | 667390f8dace40e9e78df9ee444ff02745776c54 (diff) | |
download | qt-creator-b2874f3bb362c151945666e59aa7eaddca773181.tar.gz |
Debugger: Make some gdb dumper work for libc++
Better user experience on Mac.
Change-Id: Ice1455685e0e9bbe0d45cde20563929b7370695d
Reviewed-by: hjk <hjk121@nokiamail.com>
Diffstat (limited to 'share')
-rw-r--r-- | share/qtcreator/debugger/gdbbridge.py | 9 | ||||
-rw-r--r-- | share/qtcreator/debugger/lldbbridge.py | 3 | ||||
-rw-r--r-- | share/qtcreator/debugger/stdtypes.py | 11 |
3 files changed, 17 insertions, 6 deletions
diff --git a/share/qtcreator/debugger/gdbbridge.py b/share/qtcreator/debugger/gdbbridge.py index d663300408..5e3f157da2 100644 --- a/share/qtcreator/debugger/gdbbridge.py +++ b/share/qtcreator/debugger/gdbbridge.py @@ -755,7 +755,11 @@ class Dumper(DumperBase): def childAt(self, value, index): field = value.type.fields()[index] if len(field.name): - return value[field.name] + try: + return value[field.name] + except: + return value.cast(field.type) + # FIXME: Cheat. There seems to be no official way to access # the real item, so we pass back the value. That at least # enables later ...["name"] style accesses as gdb handles @@ -765,6 +769,9 @@ class Dumper(DumperBase): def fieldAt(self, type, index): return type.fields()[index] + def simpleValue(self, value): + return str(value) + def directBaseClass(self, typeobj, index = 0): # FIXME: Check it's really a base. return typeobj.fields()[index] diff --git a/share/qtcreator/debugger/lldbbridge.py b/share/qtcreator/debugger/lldbbridge.py index c33e3ef2f0..ebeddb65a2 100644 --- a/share/qtcreator/debugger/lldbbridge.py +++ b/share/qtcreator/debugger/lldbbridge.py @@ -381,6 +381,9 @@ class Dumper(DumperBase): child = value.GetChildMemberWithName(name) return child if child.IsValid() else None + def simpleValue(self, value): + return str(value.value) + def childAt(self, value, index): return value.GetChildAtIndex(index) diff --git a/share/qtcreator/debugger/stdtypes.py b/share/qtcreator/debugger/stdtypes.py index cb740943b3..099f4184e4 100644 --- a/share/qtcreator/debugger/stdtypes.py +++ b/share/qtcreator/debugger/stdtypes.py @@ -489,7 +489,7 @@ def qdump__std__shared_ptr(d, value): return if d.isSimpleType(d.templateArgument(value.type, 0)): - d.putValue("%s @0x%x" % (i.dereference(), d.pointerValue(i))) + d.putValue("%s @0x%x" % (d.simpleValue(i.dereference()), d.pointerValue(i))) else: i = d.expensiveDowncast(i) d.putValue("@0x%x" % d.pointerValue(i)) @@ -509,7 +509,7 @@ def qdump__std____1__shared_ptr(d, value): return if d.isSimpleType(d.templateArgument(value.type, 0)): - d.putValue("%s @0x%x" % (i.dereference().value, d.pointerValue(i))) + d.putValue("%s @0x%x" % (d.simpleValue(i.dereference()), d.pointerValue(i))) else: d.putValue("@0x%x" % d.pointerValue(i)) @@ -528,7 +528,7 @@ def qdump__std__unique_ptr(d, value): return if d.isSimpleType(d.templateArgument(value.type, 0)): - d.putValue("%s @0x%x" % (i.dereference(), d.pointerValue(i))) + d.putValue("%s @0x%x" % (d.simpleValue(i.dereference()), d.pointerValue(i))) else: i = d.expensiveDowncast(i) d.putValue("@0x%x" % d.pointerValue(i)) @@ -538,14 +538,15 @@ def qdump__std__unique_ptr(d, value): d.putSubItem("data", i) def qdump__std____1__unique_ptr(d, value): - i = d.childAt(d.childAt(value["__ptr_"], 0), 0) + #i = d.childAt(d.childAt(value["__ptr_"], 0), 0) + i = d.childAt(value["__ptr_"], 0)["__first_"] if d.isNull(i): d.putValue("(null)") d.putNumChild(0) return if d.isSimpleType(d.templateArgument(value.type, 0)): - d.putValue("%s @0x%x" % (i.dereference().value, d.pointerValue(i))) + d.putValue("%s @0x%x" % (d.simpleValue(i.dereference()), d.pointerValue(i))) else: d.putValue("@0x%x" % d.pointerValue(i)) |