From 70d3c937c31bfa28fbba940d505b6de006ea8529 Mon Sep 17 00:00:00 2001 From: Josef Kemetmueller Date: Mon, 23 Jan 2017 21:19:10 +0100 Subject: [PATCH] Enable breaking into debugger on Mac The integrated assembler segment was missing an underscore: "_asm__". Also we remove the "DEBUG" macro check, so we are consistent with the linux and windows variant. Now breaking into gdb on failure should work via: gdb --args test_executable --break --- include/internal/catch_debugger.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/include/internal/catch_debugger.h b/include/internal/catch_debugger.h index 060cbc90..15a4c64b 100644 --- a/include/internal/catch_debugger.h +++ b/include/internal/catch_debugger.h @@ -23,14 +23,12 @@ namespace Catch{ // The following code snippet based on: // http://cocoawithlove.com/2008/03/break-into-debugger.html - #ifdef DEBUG - #if defined(__ppc64__) || defined(__ppc__) - #define CATCH_TRAP() \ - __asm__("li r0, 20\nsc\nnop\nli r0, 37\nli r4, 2\nsc\nnop\n" \ - : : : "memory","r0","r3","r4" ) - #else - #define CATCH_TRAP() _asm__("int $3\n" : : ) - #endif + #if defined(__ppc64__) || defined(__ppc__) + #define CATCH_TRAP() \ + __asm__("li r0, 20\nsc\nnop\nli r0, 37\nli r4, 2\nsc\nnop\n" \ + : : : "memory","r0","r3","r4" ) + #else + #define CATCH_TRAP() __asm__("int $3\n" : : ) #endif #elif defined(CATCH_PLATFORM_LINUX)