From 54d2b386430c4fa9ccdade24c7645f7c1a656897 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 24 Jan 2015 22:08:36 +0000 Subject: [PATCH] Define wxTrap() as a macro for gcc on Intel platforms too. It is more convenient to break into the debugger at the exact location of the assert instead of inside a nested wxTrap() function. This does the same thing for gcc/x86 as was done for MSVC in r73124. See #11184. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78408 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/debug.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/include/wx/debug.h b/include/wx/debug.h index 0ea07a42df..539a892575 100644 --- a/include/wx/debug.h +++ b/include/wx/debug.h @@ -258,9 +258,16 @@ extern WXDLLIMPEXP_BASE void wxOnAssert(const char *file, // trap function itself which is not very useful. #ifdef __VISUALC__ #define wxTrap() __debugbreak() - #else + #elif defined(__GNUC__) + #if defined(__i386) || defined(__x86_64) + #define wxTrap() asm volatile ("int $3") + #endif + #endif + + #ifndef wxTrap + // For all the other cases, use a generic function. extern WXDLLIMPEXP_BASE void wxTrap(); - #endif // Win VisualC + #endif // Global flag used to indicate that assert macros should call wxTrap(): it // is set by the default assert handler if the user answers yes to the