aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGennadiy Civil <gennadiycivil@users.noreply.github.com>2018-04-04 10:51:46 -0400
committerGitHub <noreply@github.com>2018-04-04 10:51:46 -0400
commit07af8af37321892b022da63c3cd97688accd7483 (patch)
tree30c44c145e799a6f440c55a2dae026a3a7af15fb
parent7d955430d1f5fa3652000e407f2a46a9bfccbca3 (diff)
parent98687b7847eb357b5bea1c7114bc35703b36f8e1 (diff)
downloadgoogletest-07af8af37321892b022da63c3cd97688accd7483.tar.gz
googletest-07af8af37321892b022da63c3cd97688accd7483.tar.bz2
googletest-07af8af37321892b022da63c3cd97688accd7483.zip
Merge pull request #1523 from leissa/int3
provide alternative for DebugBreak()
-rw-r--r--googletest/src/gtest.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc
index 9079af8d..725aa089 100644
--- a/googletest/src/gtest.cc
+++ b/googletest/src/gtest.cc
@@ -4549,6 +4549,9 @@ void UnitTest::AddTestPartResult(
// when a failure happens and both the --gtest_break_on_failure and
// the --gtest_catch_exceptions flags are specified.
DebugBreak();
+#elif (defined(__clang__) || defined(__GNUC__)) && (defined(__x86_64__) || defined(__i386__))
+ // with clang/gcc we can achieve the same effect on x86 by invoking int3
+ asm("int3");
#else
// Dereference NULL through a volatile pointer to prevent the compiler
// from removing. We use this rather than abort() or __builtin_trap() for