mirror of
https://github.com/chromium/crashpad.git
synced 2025-03-09 22:26:06 +00:00
linux: update test expectations
Android 9+ sets the executable's dynamic array address in the link map. Improve tests to verify that the dynamic array address in the link map matches the address in the executable. Bug: chromium:1050178 Change-Id: I4c938f804092c8f35578389a7e7d7267144ad80c Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/1967972 Reviewed-by: Mark Mentovai <mark@chromium.org> Commit-Queue: Joshua Peraza <jperaza@chromium.org>
This commit is contained in:
parent
4b5a5bac26
commit
686852d9d8
@ -74,6 +74,13 @@ void TestAgainstTarget(PtraceConnection* connection) {
|
||||
LinuxVMAddress debug_address;
|
||||
ASSERT_TRUE(exe_reader.GetDebugAddress(&debug_address));
|
||||
|
||||
VMAddress exe_dynamic_address = 0;
|
||||
if (exe_reader.GetDynamicArrayAddress(&exe_dynamic_address)) {
|
||||
CheckedLinuxAddressRange exe_range(
|
||||
connection->Is64Bit(), exe_reader.Address(), exe_reader.Size());
|
||||
EXPECT_TRUE(exe_range.ContainsValue(exe_dynamic_address));
|
||||
}
|
||||
|
||||
// start the actual tests
|
||||
DebugRendezvous debug;
|
||||
ASSERT_TRUE(debug.Initialize(range, debug_address));
|
||||
@ -85,8 +92,13 @@ void TestAgainstTarget(PtraceConnection* connection) {
|
||||
EXPECT_NE(debug.Executable()->name.find("crashpad_snapshot_test"),
|
||||
std::string::npos);
|
||||
|
||||
// Android's loader never sets the dynamic array for the executable.
|
||||
EXPECT_EQ(debug.Executable()->dynamic_array, 0u);
|
||||
// Android's loader doesn't set the dynamic array for the executable in the
|
||||
// link map until Android 9.0 (API 28).
|
||||
if (android_runtime_api >= 28) {
|
||||
EXPECT_EQ(debug.Executable()->dynamic_array, exe_dynamic_address);
|
||||
} else {
|
||||
EXPECT_EQ(debug.Executable()->dynamic_array, 0u);
|
||||
}
|
||||
#else
|
||||
// glibc's loader implements most of the tested features that Android's was
|
||||
// missing but has since gained.
|
||||
@ -94,9 +106,7 @@ void TestAgainstTarget(PtraceConnection* connection) {
|
||||
|
||||
// glibc's loader does not set the name for the executable.
|
||||
EXPECT_TRUE(debug.Executable()->name.empty());
|
||||
CheckedLinuxAddressRange exe_range(
|
||||
connection->Is64Bit(), exe_reader.Address(), exe_reader.Size());
|
||||
EXPECT_TRUE(exe_range.ContainsValue(debug.Executable()->dynamic_array));
|
||||
EXPECT_EQ(debug.Executable()->dynamic_array, exe_dynamic_address);
|
||||
#endif // OS_ANDROID
|
||||
|
||||
// Android's loader doesn't set the load bias until Android 4.3 (API 18).
|
||||
|
Loading…
x
Reference in New Issue
Block a user