Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8259569: gtest os.dll_address_to_function_and_library_name_vm fails
Reviewed-by: dcubed
  • Loading branch information
tstuefe committed Jan 16, 2021
1 parent 536082d commit 90c73d057d6bd26031727b73886d6eaa6b153ca0
Showing with 1 addition and 36 deletions.
  1. +1 −36 test/hotspot/gtest/runtime/test_os.cpp
@@ -698,7 +698,7 @@ TEST_VM(os, pagesizes_test_print) {
ASSERT_EQ(strcmp(expected, buffer), 0);
}

TEST_VM(os, DISABLED_dll_address_to_function_and_library_name) {
TEST_VM(os, dll_address_to_function_and_library_name) {
char tmp[1024];
char output[1024];
stringStream st(output, sizeof(output));
@@ -737,15 +737,6 @@ TEST_VM(os, DISABLED_dll_address_to_function_and_library_name) {
EXPECT_CONTAINS(output, "Threads");
EXPECT_CONTAINS(output, "create_vm");
EXPECT_CONTAINS(output, "jvm"); // "jvm.dll" or "libjvm.so" or similar
#ifndef _WIN32 // Demangler gives us no arguments on Windows
if (demangle) {
if (strip_arguments) {
EXPECT_DOES_NOT_CONTAIN(output, "(");
} else {
EXPECT_CONTAINS(output, "(");
}
}
#endif // _WIN32
LOG("%s", output);

// Test truncation on scratch buffer
@@ -767,31 +758,5 @@ TEST_VM(os, DISABLED_dll_address_to_function_and_library_name) {
shorten_paths, demangle));
EXPECT_CONTAINS(output, "jvm"); // "jvm.dll" or "libjvm.so" or similar
LOG("%s", output);

// Pointer into system library
#ifndef _WIN32
addr = CAST_FROM_FN_PTR(address, ::malloc);
st.reset();
EXPECT_TRUE(os::print_function_and_library_name(&st, addr,
provide_scratch_buffer ? tmp : NULL,
sizeof(tmp),
shorten_paths, demangle));
EXPECT_CONTAINS(output, "malloc");
LINUX_ONLY(EXPECT_CONTAINS(output, "libc"));
MACOS_ONLY(EXPECT_CONTAINS(output, "libsystem"));
LOG("%s", output);
#else
addr = CAST_FROM_FN_PTR(address, CreateFileA);
st.reset(); // this also zero-terminates start of output
EXPECT_TRUE(os::print_function_and_library_name(&st, addr,
provide_scratch_buffer ? tmp : NULL,
sizeof(tmp),
shorten_paths, demangle));
for (char* p = output; *p; p++) {
*p = ::toupper(*p);
}
EXPECT_CONTAINS(output, "KERNEL32.DLL");
LOG("%s", output);
#endif
}
}

0 comments on commit 90c73d0

Please sign in to comment.