+2018-06-27 Simon Marchi <simon.marchi@ericsson.com>
+
+ * gdb-gdb.py.in (CoreAddrPrettyPrinter): New class.
+ (type_lookup_function): Recognize CORE_ADDR values.
+
2018-06-27 Simon Marchi <simon.marchi@ericsson.com>
* gdb-gdb.py.in (StructMainTypePrettyPrinter) <to_string>: Don't
return "\n{" + ",\n ".join(fields) + "}"
+
+class CoreAddrPrettyPrinter:
+ """Print CORE_ADDR values as hex."""
+
+ def __init__(self, val):
+ self._val = val
+
+ def to_string(self):
+ return hex(int(self._val))
+
+
def type_lookup_function(val):
"""A routine that returns the correct pretty printer for VAL
if appropriate. Returns None otherwise.
return StructTypePrettyPrinter(val)
elif val.type.tag == "main_type":
return StructMainTypePrettyPrinter(val)
+ elif val.type.name == 'CORE_ADDR':
+ return CoreAddrPrettyPrinter(val)
return None
def register_pretty_printer(objfile):