Skip to content

Commit b498b44

Browse files
committed
8274039: codestrings gtest fails when hsdis is present
Backport-of: c9de80635e25badbb5410e22b6619379598a9a57
1 parent ba2bd83 commit b498b44

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/hotspot/gtest/code/test_codestrings.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,13 @@ static const char* replace_addr_expr(const char* str)
3737
{
3838
// Remove any address expression "0x0123456789abcdef" found in order to
3939
// aid string comparison. Also remove any trailing printout from a padded
40-
// buffer.
40+
// buffer (too brittle?).
4141

42-
std::basic_string<char> tmp = std::regex_replace(str, std::regex("0x[0-9a-fA-F]+"), "<addr>");
43-
std::basic_string<char> red = std::regex_replace(tmp, std::regex("\\s+<addr>:\\s+\\.inst\\t<addr> ; undefined"), "");
42+
std::basic_string<char> tmp1 = std::regex_replace(str, std::regex("0x[0-9a-fA-F]+"), "<addr>");
43+
// Padding: aarch64
44+
std::basic_string<char> tmp2 = std::regex_replace(tmp1, std::regex("\\s+<addr>:\\s+\\.inst\\t<addr> ; undefined"), "");
45+
// Padding: x64
46+
std::basic_string<char> red = std::regex_replace(tmp2, std::regex("\\s+<addr>:\\s+hlt[ \\t]+(?!\\n\\s+;;)"), "");
4447

4548
return os::strdup(red.c_str());
4649
}

0 commit comments

Comments
 (0)