summaryrefslogtreecommitdiff
path: root/gdb-helpers
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2025-03-02 23:56:15 -0700
committerLuke T. Shumaker <lukeshu@lukeshu.com>2025-03-03 23:33:45 -0700
commit55df5f277fe53b964361fb5e305ca574082afd91 (patch)
tree0c8acdb7e872e5310e7244a1893386c934260cef /gdb-helpers
parent6354a440b24d9a0b157c8c5571403f09dd04c245 (diff)
gdb-helpers: rp2040-show-interrupts: Split into several methods
Diffstat (limited to 'gdb-helpers')
-rw-r--r--gdb-helpers/rp2040.py20
1 files changed, 12 insertions, 8 deletions
diff --git a/gdb-helpers/rp2040.py b/gdb-helpers/rp2040.py
index 30a936a..ec719e8 100644
--- a/gdb-helpers/rp2040.py
+++ b/gdb-helpers/rp2040.py
@@ -1,6 +1,6 @@
# gdb-helpers/rp2040.py - GDB helpers for the RP2040 CPU.
#
-# Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com>
+# Copyright (C) 2024-2025 Luke T. Shumaker <lukeshu@lukeshu.com>
# SPDX-License-Identifier: AGPL-3.0-or-later
import gdb
@@ -96,15 +96,13 @@ class RP2040ShowInterrupts(gdb.Command):
)
def invoke(self, arg: str, from_tty: bool) -> None:
+ self.arm_cortex_m0plus_mmregisters()
+ self.arm_cortex_m0plus_registers()
+ print()
+
+ def arm_cortex_m0plus_mmregisters(self) -> None:
base: int = 0xE0000000
icsr = read_mmreg(base + 0xED04)
- psr = read_reg("xPSR")
- # ║├┤║├┤├┤║├┤║║├┤├──┤║║║├──┤
- # 10987654321098765432109876543210 (dec bitnum)
- # 3 2 1 0
- # ║├┤║├┤├┤║├┤║║├┤├──┤║║║├──┤
- # fedcba9876543210fedcba9876543210 (hex bitnum)
- # 1 0
print(
f"""
ARM Cortex-M0+ memory-mapped registers:
@@ -142,7 +140,13 @@ AIRCR : {fmt32(read_mmreg(base+0xed0c)) } Application Interrupt and Reset Co
╓sleep_deep
s_ev_on_pend╖ ║╓sleep_on_exit
SCR : {fmt32(read_mmreg(base+0xed10)) } System Control
+"""
+ )
+ def arm_cortex_m0plus_registers(self) -> None:
+ psr = read_reg("xPSR")
+ print(
+ f"""
ARM Cortex-M0+ processor core registers:
╓pm (0=normal, 1=top priority)