summaryrefslogtreecommitdiff
path: root/libunwindstack/tests/DexFileTest.cpp
diff options
context:
space:
mode:
authorDavid Srbecky <dsrbecky@google.com>2018-02-23 18:06:13 +0000
committerDavid Srbecky <dsrbecky@google.com>2019-03-29 14:01:32 +0000
commit85b5fecec920208ec43b42488f08d4c2e5aaeda2 (patch)
treef247629aaf617cc5fc287cf3eb2e6f076f6a635d /libunwindstack/tests/DexFileTest.cpp
parente346d03c2bf198ab25e926bc2c26dd9db53b87ba (diff)
Check for data races when reading JIT/DEX entries.
Update the entries only when the list is modified by the runtime. Check that the list wasn't concurrently modified when being read. Bug: 124287208 Test: libunwindstack_test Test: art/test.py -b --host -r -t 137-cfi Change-Id: I87ba70322053a01b3d5be1fdf6310e1dc21bb084
Diffstat (limited to 'libunwindstack/tests/DexFileTest.cpp')
-rw-r--r--libunwindstack/tests/DexFileTest.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/libunwindstack/tests/DexFileTest.cpp b/libunwindstack/tests/DexFileTest.cpp
index 0149a42c7..df7b31dfd 100644
--- a/libunwindstack/tests/DexFileTest.cpp
+++ b/libunwindstack/tests/DexFileTest.cpp
@@ -177,11 +177,11 @@ TEST(DexFileTest, get_method) {
std::string method;
uint64_t method_offset;
- ASSERT_TRUE(dex_file->GetMethodInformation(0x102, &method, &method_offset));
+ ASSERT_TRUE(dex_file->GetFunctionName(0x4102, &method, &method_offset));
EXPECT_EQ("Main.<init>", method);
EXPECT_EQ(2U, method_offset);
- ASSERT_TRUE(dex_file->GetMethodInformation(0x118, &method, &method_offset));
+ ASSERT_TRUE(dex_file->GetFunctionName(0x4118, &method, &method_offset));
EXPECT_EQ("Main.main", method);
EXPECT_EQ(0U, method_offset);
}
@@ -195,9 +195,9 @@ TEST(DexFileTest, get_method_empty) {
std::string method;
uint64_t method_offset;
- EXPECT_FALSE(dex_file->GetMethodInformation(0x100000, &method, &method_offset));
+ EXPECT_FALSE(dex_file->GetFunctionName(0x100000, &method, &method_offset));
- EXPECT_FALSE(dex_file->GetMethodInformation(0x98, &method, &method_offset));
+ EXPECT_FALSE(dex_file->GetFunctionName(0x98, &method, &method_offset));
}
} // namespace unwindstack