Skip to content

Commit 9bafce8

Browse files
committed
8369563: Gtest dll_address_to_function_and_library_name has issues with stripped pdb files
Backport-of: 98e1d2fab123befa78342ba53b76a560dddd6385
1 parent e3167a4 commit 9bafce8

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

test/hotspot/gtest/runtime/test_os.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -935,16 +935,24 @@ TEST_VM(os, dll_address_to_function_and_library_name) {
935935
LOG("shorten_paths=%d, demangle=%d, strip_arguments=%d, provide_scratch_buffer=%d",
936936
shorten_paths, demangle, strip_arguments, provide_scratch_buffer);
937937

938-
// Should show os::min_page_size in libjvm
938+
// Should show Threads::create_vm in libjvm
939939
addr = CAST_FROM_FN_PTR(address, Threads::create_vm);
940940
st.reset();
941941
EXPECT_TRUE(os::print_function_and_library_name(&st, addr,
942942
provide_scratch_buffer ? tmp : nullptr,
943943
sizeof(tmp),
944944
shorten_paths, demangle,
945945
strip_arguments));
946+
947+
#ifdef _WINDOWS
948+
// On Windows, if no full .pdb file is available, the output can be something like "0x... in ..."
949+
if (strncmp(output, "0x", 2) != 0) {
950+
#endif
946951
EXPECT_CONTAINS(output, "Threads");
947952
EXPECT_CONTAINS(output, "create_vm");
953+
#ifdef _WINDOWS
954+
}
955+
#endif
948956
EXPECT_CONTAINS(output, "jvm"); // "jvm.dll" or "libjvm.so" or similar
949957
LOG("%s", output);
950958

0 commit comments

Comments
 (0)