summaryrefslogtreecommitdiff
path: root/gdb_plugins
diff options
context:
space:
mode:
authorVegard Storheil Eriksen <zyp@jvnv.net>2022-04-16 20:52:41 +0200
committerVegard Storheil Eriksen <zyp@jvnv.net>2022-04-16 21:02:39 +0200
commitc6b1f1112a3f4a5139700ef33da62c1ebdc3a7ba (patch)
tree4b25e62e180676abb528bb8da98d86e7405a2a1b /gdb_plugins
parent2edb8ae305449c9fbf3d934198164fec1320d324 (diff)
gdb_plugins/mmio: Add mmio_ref helper.
Diffstat (limited to 'gdb_plugins')
-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()