Skip to content

Commit 827207b

Browse files
committed
8369563: Gtest dll_address_to_function_and_library_name has issues with stripped pdb files
Backport-of: 98e1d2f
1 parent 69e83b1 commit 827207b

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
@@ -804,16 +804,24 @@ TEST_VM(os, dll_address_to_function_and_library_name) {
804804
LOG("shorten_paths=%d, demangle=%d, strip_arguments=%d, provide_scratch_buffer=%d",
805805
shorten_paths, demangle, strip_arguments, provide_scratch_buffer);
806806

807-
// Should show os::min_page_size in libjvm
807+
// Should show Threads::create_vm in libjvm
808808
addr = CAST_FROM_FN_PTR(address, Threads::create_vm);
809809
st.reset();
810810
EXPECT_TRUE(os::print_function_and_library_name(&st, addr,
811811
provide_scratch_buffer ? tmp : NULL,
812812
sizeof(tmp),
813813
shorten_paths, demangle,
814814
strip_arguments));
815+
816+
#ifdef _WINDOWS
817+
// On Windows, if no full .pdb file is available, the output can be something like "0x... in ..."
818+
if (strncmp(output, "0x", 2) != 0) {
819+
#endif
815820
EXPECT_CONTAINS(output, "Threads");
816821
EXPECT_CONTAINS(output, "create_vm");
822+
#ifdef _WINDOWS
823+
}
824+
#endif
817825
EXPECT_CONTAINS(output, "jvm"); // "jvm.dll" or "libjvm.so" or similar
818826
LOG("%s", output);
819827

0 commit comments

Comments
 (0)