diff --git a/src/arch/arm/remote_gdb.cc b/src/arch/arm/remote_gdb.cc index 215c532ea6..6e8923e8bf 100644 --- a/src/arch/arm/remote_gdb.cc +++ b/src/arch/arm/remote_gdb.cc @@ -168,6 +168,20 @@ namespace gem5 using namespace ArmISA; +namespace +{ + +// https://sourceware.org/gdb/current/onlinedocs/gdb/ARM-Breakpoint-Kinds.html +enum class ArmBpKind +{ + THUMB = 2, + THUMB_2 = 3, + ARM = 4, +}; + +} // namespace + + static bool tryTranslate(ThreadContext *tc, Addr addr) { @@ -364,8 +378,14 @@ RemoteGDB::gdbRegs() bool RemoteGDB::checkBpKind(size_t kind) { - // 2 for Thumb ISA, 4 for ARM ISA. - return kind == 2 || kind == 4; + switch (ArmBpKind(kind)) { + case ArmBpKind::THUMB: + case ArmBpKind::THUMB_2: + case ArmBpKind::ARM: + return true; + default: + return false; + } } } // namespace gem5