Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Unified Diff: util/mach/exception_ports_test.cc

Issue 566693003: ExcCrashRecoverOriginalException() (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « util/mach/exc_server_variants_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/mach/exception_ports_test.cc
diff --git a/util/mach/exception_ports_test.cc b/util/mach/exception_ports_test.cc
index d549651c53d4474bc40adabb7059c4148a59f5dd..7da1d56de23f36c7e0abc3cc4a807cc752dcfa1e 100644
--- a/util/mach/exception_ports_test.cc
+++ b/util/mach/exception_ports_test.cc
@@ -183,21 +183,19 @@ class TestExceptionPorts : public UniversalMachExcServer,
EXPECT_EQ(EXC_CRASH, exception);
EXPECT_EQ(2u, code_count);
- // The code_count check above would ideally use ASSERT_EQ so that the next
- // conditional would not be necessary, but ASSERT_* requires a function
- // returning type void, and the interface dictates otherwise here.
- if (code_count >= 1) {
- // The signal that terminated the process is stored in code[0] along with
- // some other data. See 10.9.4 xnu-2422.110.17/bsd/kern/kern_exit.c
- // proc_prepareexit().
- int sig = (code[0] >> 24) & 0xff;
+ // The exception and code_count checks above would ideally use ASSERT_EQ so
+ // that the next conditional would not be necessary, but ASSERT_* requires a
+ // function returning type void, and the interface dictates otherwise here.
+ if (exception == EXC_CRASH && code_count >= 1) {
+ int signal;
+ ExcCrashRecoverOriginalException(code[0], NULL, &signal);
// The child crashed with a division by zero, which shows up as SIGFPE.
// This was chosen because it’s unlikely to be generated by testing or
// assertion failures.
- EXPECT_EQ(SIGFPE, sig);
+ EXPECT_EQ(SIGFPE, signal);
- SetExpectedChildTermination(kTerminationSignal, sig);
+ SetExpectedChildTermination(kTerminationSignal, signal);
}
// Even for an EXC_CRASH handler, returning KERN_SUCCESS with a
« no previous file with comments | « util/mach/exc_server_variants_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698