arch-arm: gdb support Thumb-2 ISA
From the document*1, we should allow 2,3,4 in kind check function for
supporting all kinds of ARM breakpoint.
1. https://sourceware.org/gdb/current/onlinedocs/gdb/ARM-Breakpoint-Kinds.html
Change-Id: I82bcb88cfe6e80e7f17cd6bb68a26a45ace7b174
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/54124
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
diff --git a/src/arch/arm/remote_gdb.cc b/src/arch/arm/remote_gdb.cc
index 215c532..6e8923e 100644
--- a/src/arch/arm/remote_gdb.cc
+++ b/src/arch/arm/remote_gdb.cc
@@ -168,6 +168,20 @@
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 @@
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