From c6b1f1112a3f4a5139700ef33da62c1ebdc3a7ba Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Sat, 16 Apr 2022 20:52:41 +0200 Subject: gdb_plugins/mmio: Add mmio_ref helper. --- gdb_plugins/mmio.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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() -- cgit v1.2.3