Commit 66a7cc28 authored by hjk's avatar hjk
Browse files

debugger: show contents of pointer instead of its address in the python dumpers

parent 9236dd81
...@@ -976,6 +976,10 @@ class Dumper: ...@@ -976,6 +976,10 @@ class Dumper:
self.putField("valueencoded", encoding) self.putField("valueencoded", encoding)
self.putField("value", value) self.putField("value", value)
def putPointerValue(self, value):
self.putValue("0x%x" % value.dereference().cast(
gdb.lookup_type("unsigned long")))
def putStringValue(self, value): def putStringValue(self, value):
if value is None: if value is None:
self.put('value="<not available>",') self.put('value="<not available>",')
...@@ -1190,6 +1194,7 @@ class Dumper: ...@@ -1190,6 +1194,7 @@ class Dumper:
format = self.itemFormat(item) format = self.itemFormat(item)
if not format is None: if not format is None:
#warn("FORMAT %s" % format)
self.putAddress(value.address) self.putAddress(value.address)
self.putType(item.value.type) self.putType(item.value.type)
self.putNumChild(0) self.putNumChild(0)
...@@ -1197,7 +1202,7 @@ class Dumper: ...@@ -1197,7 +1202,7 @@ class Dumper:
if format == 0: if format == 0:
# Bald pointer. # Bald pointer.
self.putValue(str(cleanAddress(value.address))) self.putPointerValue(value.address)
elif format == 1 or format == 2: elif format == 1 or format == 2:
# Latin1 or UTF-8 # Latin1 or UTF-8
f = select(format == 1, Hex2EncodedLatin1, Hex2EncodedUtf8) f = select(format == 1, Hex2EncodedLatin1, Hex2EncodedUtf8)
...@@ -1256,7 +1261,7 @@ class Dumper: ...@@ -1256,7 +1261,7 @@ class Dumper:
self.putItemHelper( self.putItemHelper(
Item(item.value.dereference(), item.iname, None, None)) Item(item.value.dereference(), item.iname, None, None))
self.childTypes.pop() self.childTypes.pop()
self.putValue("@%s" % cleanAddress(value.address)) self.putPointerValue(value.address)
isHandled = True isHandled = True
# Fall back to plain pointer printing. # Fall back to plain pointer printing.
...@@ -1270,7 +1275,7 @@ class Dumper: ...@@ -1270,7 +1275,7 @@ class Dumper:
self.putItem( self.putItem(
Item(item.value.dereference(), item.iname, "*", "*")) Item(item.value.dereference(), item.iname, "*", "*"))
self.endChildren() self.endChildren()
self.putValue(cleanAddress(value.address)) self.putPointerValue(value.address)
elif str(type).startswith("<anon"): elif str(type).startswith("<anon"):
# Anonymous union. We need a dummy name to distinguish # Anonymous union. We need a dummy name to distinguish
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment