Commit 74626ca3 authored by Bruce Dawson's avatar Bruce Dawson Committed by Commit Bot

Print large negative error codes in hex

Numbers like 0xC0000005 and 0x80000003 are easily recognizable in hex
(access violation and breakpoint respectively) but confusing and
unrecognizable in decimal. So, print these in hex.

This change is based on crrev.com/c/1962589

Bug: 803617, 1007013
Change-Id: I53db7e6cadaaa41315180021bcaff84f540de990
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2067652Reviewed-by: default avatarCaleb Rouleau <crouleau@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#744068}
parent ba833667
...@@ -88,9 +88,20 @@ void NoRendererCrashesAssertion::Observe( ...@@ -88,9 +88,20 @@ void NoRendererCrashesAssertion::Observe(
break; // Crash - need to trigger a test failure below. break; // Crash - need to trigger a test failure below.
} }
FAIL() << "Unexpected termination of a renderer process" const auto exit_code = process_info->exit_code;
<< "; status: " << process_info->status // Windows error codes such as 0xC0000005 and 0xC0000409 are much easier
<< ", exit_code: " << process_info->exit_code; // to recognize and differentiate in hex.
if (static_cast<int>(exit_code) < -100) {
FAIL() << "Unexpected termination of a renderer process"
<< "; status: " << process_info->status << ", exit_code: 0x"
<< std::hex << exit_code;
} else {
// Print other error codes as a signed integer so that small negative
// numbers are also recognizable.
FAIL() << "Unexpected termination of a renderer process"
<< "; status: " << process_info->status
<< ", exit_code: " << exit_code;
}
} }
ScopedAllowRendererCrashes::ScopedAllowRendererCrashes() ScopedAllowRendererCrashes::ScopedAllowRendererCrashes()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment