Add an ARMUtils.h file to house utility functions for the ARM/Thumb Instruction Set Architecture.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@124131 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Plugins/Process/Utility/ARMUtils.h b/source/Plugins/Process/Utility/ARMUtils.h
new file mode 100644
index 0000000..5b10b31
--- /dev/null
+++ b/source/Plugins/Process/Utility/ARMUtils.h
@@ -0,0 +1,23 @@
+//===-- lldb_ARMUtils.h -----------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef lldb_ARMUtils_h_
+#define lldb_ARMUtils_h_
+
+// Utility functions for the ARM/Thumb Instruction Set Architecture.
+
+namespace lldb_private {
+
+// This function performs the check for the register numbers 13 and 15 that are
+// not permitted for many Thumb register specifiers.
+static inline bool BadReg(uint32_t n) { return n == 13 || n == 15; }
+
+} // namespace lldb_private
+
+#endif // lldb_ARMUtils_h_
diff --git a/source/Plugins/Process/Utility/EmulateInstructionARM.cpp b/source/Plugins/Process/Utility/EmulateInstructionARM.cpp
index 8ae3054..06a73b3 100644
--- a/source/Plugins/Process/Utility/EmulateInstructionARM.cpp
+++ b/source/Plugins/Process/Utility/EmulateInstructionARM.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
#include "EmulateInstructionARM.h"
+#include "ARMUtils.h"
using namespace lldb;
using namespace lldb_private;
@@ -80,6 +81,7 @@
eEncodingT5,
} ARMEncoding;
+// Typedef for the callback function used during the emulation.
// Pass along (ARMEncoding)encoding as the callback data.
typedef bool (*EmulateCallback) (EmulateInstructionARM *emulator, ARMEncoding encoding);