Address post-submit review comments related to CL #430050

See: https://chromium-review.googlesource.com/c/430050/

BUG=664460

Change-Id: I3cbfbd5b00725bd501f06427eebd976267c4f617
Reviewed-on: https://chromium-review.googlesource.com/438444
Reviewed-by: Primiano Tucci <primiano@chromium.org>
This commit is contained in:
Tobias Sargeant 2017-02-07 14:33:48 +00:00 committed by Tobias Sargeant
parent 6c78460419
commit 7ba80c7284
2 changed files with 13 additions and 6 deletions

View file

@ -80,8 +80,8 @@ pid_t SetupChildProcess(int number_of_threads) {
string helper_path(GetHelperBinary()); string helper_path(GetHelperBinary());
if (helper_path.empty()) { if (helper_path.empty()) {
ADD_FAILURE() << "Couldn't find helper binary"; fprintf(stderr, "Couldn't find helper binary\n");
return -1; _exit(1);
} }
// Pass the pipe fd and the number of threads as arguments. // Pass the pipe fd and the number of threads as arguments.
@ -94,8 +94,9 @@ pid_t SetupChildProcess(int number_of_threads) {
NULL); NULL);
// Kill if we get here. // Kill if we get here.
printf("Errno from exec: %d", errno); printf("Errno from exec: %d", errno);
ADD_FAILURE() << "Exec of " << helper_path << " failed: " << strerror(errno); std::string err_str = "Exec of " + helper_path + " failed";
return -1; perror(err_str.c_str());
_exit(1);
} }
close(fds[1]); close(fds[1]);

View file

@ -241,7 +241,8 @@ TEST(MinidumpWriterTest, StacksSkippedIfRequested) {
// pass an invalid principal mapping address, which will force // pass an invalid principal mapping address, which will force
// WriteMinidump to not dump any thread stacks. // WriteMinidump to not dump any thread stacks.
ASSERT_TRUE(WriteMinidump(templ.c_str(), child, &context, sizeof(context), ASSERT_TRUE(WriteMinidump(templ.c_str(), child, &context, sizeof(context),
true, 0x0102030405060708, false)); true, static_cast<uintptr_t>(0x0102030405060708ull),
false));
// Read the minidump. And ensure that no thread memory was dumped. // Read the minidump. And ensure that no thread memory was dumped.
Minidump minidump(templ); Minidump minidump(templ);
@ -286,7 +287,12 @@ TEST(MinidumpWriterTest, StacksAreSanitizedIfRequested) {
Minidump minidump(templ); Minidump minidump(templ);
ASSERT_TRUE(minidump.Read()); ASSERT_TRUE(minidump.Read());
const uintptr_t defaced = 0X0DEFACED0DEFACEDull; const uintptr_t defaced =
#if defined(__LP64__)
0x0defaced0defaced;
#else
0x0defaced;
#endif
MinidumpThreadList *threads = minidump.GetThreadList(); MinidumpThreadList *threads = minidump.GetThreadList();
for (unsigned int i = 0; i < threads->thread_count(); ++i) { for (unsigned int i = 0; i < threads->thread_count(); ++i) {
MinidumpThread *thread = threads->GetThreadAtIndex(i); MinidumpThread *thread = threads->GetThreadAtIndex(i);