summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb_plugins/mmio.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/gdb_plugins/mmio.py b/gdb_plugins/mmio.py
index 5f2a249..0cc3249 100644
--- a/gdb_plugins/mmio.py
+++ b/gdb_plugins/mmio.py
@@ -94,3 +94,16 @@ class MMIOPtr(gdb.Function):
return obj['p'].cast(t.pointer())
MMIOPtr()
+
+class MMIORef(gdb.Function):
+ """
+ Usage is, for instance, p /x $mmio_ref(RCC)
+ """
+ def __init__(self):
+ gdb.Function.__init__(self, 'mmio_ref')
+
+ def invoke(self, obj):
+ t = get_mmio_ptr_type(obj.type)
+ return obj['p'].cast(t.pointer()).dereference()
+
+MMIORef()