Fix some bugs in CheckMicrodumpContents The crash address from the microdump was never checked against anything. Instead, the test was checking the value of a constant. On 32-bit systems, an intptr_t cannot represent kCrashAddress (0xDEADDEAD), causing a failure when the crash address is parsed from the microdump. Instead, use uintptr_t, which matches the type of kCrashAddress. Change-Id: Ib5612743803609f7801dcfb98deaa8779e362025 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2100816 Reviewed-by: Mike Frysinger <vapier@chromium.org>
diff --git a/src/client/linux/microdump_writer/microdump_writer_unittest.cc b/src/client/linux/microdump_writer/microdump_writer_unittest.cc index c2fea02..ca26fbf 100644 --- a/src/client/linux/microdump_writer/microdump_writer_unittest.cc +++ b/src/client/linux/microdump_writer/microdump_writer_unittest.cc
@@ -209,14 +209,14 @@ string token; unsigned crash_reason; string crash_reason_str; - intptr_t crash_address; + uintptr_t crash_address; crash_reason_tokens.ignore(2); // Ignore the "R " preamble. crash_reason_tokens >> std::hex >> crash_reason >> crash_reason_str >> crash_address; ASSERT_FALSE(crash_reason_tokens.fail()); ASSERT_EQ(MD_EXCEPTION_CODE_LIN_DUMP_REQUESTED, crash_reason); ASSERT_EQ("DUMP_REQUESTED", crash_reason_str); - ASSERT_EQ(0xDEADDEADu, kCrashAddress); + ASSERT_EQ(kCrashAddress, crash_address); did_find_crash_reason = true; } else if (line.find("V ") == 0) { if (expected_info.product_info)