From 0c408e2785a74e0dfaa0efb87d3abde274701730 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 9 Feb 2015 12:10:30 +0000 Subject: [PATCH] Really break into the debugger at the assertion line under wxGTK. This completes the changes of r78408: in addition to making wxTrap() a macro, we also need to call it directly from the assert macro expansion instead of doing it from deep inside wx assert dialog code. See #11184. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78463 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/utilsgtk.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gtk/utilsgtk.cpp b/src/gtk/utilsgtk.cpp index e299cdc58a..d1603d7f1a 100644 --- a/src/gtk/utilsgtk.cpp +++ b/src/gtk/utilsgtk.cpp @@ -323,7 +323,13 @@ bool wxGUIAppTraits::ShowAssertDialog(const wxString& msg) switch (result) { case GTK_ASSERT_DIALOG_STOP: - wxTrap(); + // Don't call wxTrap() directly from here to avoid having the + // functions between the occurrence of the assert in the code + // and this function in the call stack. Instead, just set a + // flag so that inline expansion of the assert macro we are + // called from calls wxTrap() itself, like this the debugger + // would break exactly at the assert position. + wxTrapInAssert = true; break; case GTK_ASSERT_DIALOG_CONTINUE: // nothing to do