diff options
author | Vegard Storheil Eriksen <zyp@jvnv.net> | 2022-04-16 20:52:41 +0200 |
---|---|---|
committer | Vegard Storheil Eriksen <zyp@jvnv.net> | 2022-04-16 21:02:39 +0200 |
commit | c6b1f1112a3f4a5139700ef33da62c1ebdc3a7ba (patch) | |
tree | 4b25e62e180676abb528bb8da98d86e7405a2a1b | |
parent | 2edb8ae305449c9fbf3d934198164fec1320d324 (diff) |
gdb_plugins/mmio: Add mmio_ref helper.
-rw-r--r-- | gdb_plugins/mmio.py | 13 |
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() |