Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

catch_debugger.h - implement break into debugger assembler instructions for iOS

Commit
fa6211bfc2cc55ee3d88724c1238c22de9b2a276
Author
ptc-tgamper ·
Committer
Martin Hořeňovský
Parents
4e90f910dc83

Files · Download .tar.gz

Changes

 include/internal/catch_debugger.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/include/internal/catch_debugger.h b/include/internal/catch_debugger.h
index db3ff681..fb1850a2 100644
--- a/include/internal/catch_debugger.h
+++ b/include/internal/catch_debugger.h
@@ -19,6 +19,17 @@ namespace Catch {
 
     #define CATCH_TRAP() __asm__("int $3\n" : : ) /* NOLINT */
 
+#elif defined(CATCH_PLATFORM_IPHONE)
+
+    // use inline assembler
+    #if defined(__i386__) || defined(__x86_64__)
+        #define CATCH_TRAP()  __asm__("int $3")
+    #elif defined(__aarch64__)
+        #define CATCH_TRAP()  __asm__(".inst 0xd4200000")
+    #elif defined(__arm__)
+        #define CATCH_TRAP()  __asm__(".inst 0xe7f001f0")
+    #endif
+
 #elif defined(CATCH_PLATFORM_LINUX)
     // If we can use inline assembler, do it because this allows us to break
     // directly at the location of the failing check instead of breaking inside