Skip to content

Commit 6af89d6

Browse files
committed
8229118: [TESTBUG] serviceability/sa/ClhsdbFindPC fails on AArch64
Reviewed-by: cjplummer, adinn
1 parent eed736f commit 6af89d6

File tree

2 files changed

+44
-4
lines changed

2 files changed

+44
-4
lines changed

test/hotspot/jtreg/serviceability/sa/ClhsdbFindPC.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,13 @@ private static void testFindPC(boolean withXcomp) throws Exception {
4545
LingeredApp theApp = null;
4646
try {
4747
ClhsdbLauncher test = new ClhsdbLauncher();
48-
theApp = withXcomp ? LingeredApp.startApp(List.of("-Xcomp"))
49-
: LingeredApp.startApp(List.of("-Xint"));
48+
49+
theApp = new LingeredAppWithTrivialMain();
50+
if (withXcomp) {
51+
LingeredApp.startApp(List.of("-Xcomp"), theApp);
52+
} else {
53+
LingeredApp.startApp(List.of("-Xint"), theApp);
54+
}
5055
System.out.print("Started LingeredApp ");
5156
if (withXcomp) {
5257
System.out.print("(-Xcomp) ");
@@ -67,7 +72,7 @@ private static void testFindPC(boolean withXcomp) throws Exception {
6772
// attach permission issues.
6873
if (output != null) {
6974
String cmdStr = null;
70-
String[] parts = output.split("LingeredApp.main");
75+
String[] parts = output.split("LingeredAppWithTrivialMain.main");
7176
String[] tokens = parts[1].split(" ");
7277
for (String token : tokens) {
7378
if (token.contains("pc")) {
@@ -82,7 +87,7 @@ private static void testFindPC(boolean withXcomp) throws Exception {
8287
Map<String, List<String>> expStrMap = new HashMap<>();
8388
if (withXcomp) {
8489
expStrMap.put(cmdStr, List.of(
85-
"In code in NMethod for jdk/test/lib/apps/LingeredApp.main",
90+
"In code in NMethod for LingeredAppWithTrivialMain.main",
8691
"content:",
8792
"oops:",
8893
"frame size:"));
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* This code is free software; you can redistribute it and/or modify it
6+
* under the terms of the GNU General Public License version 2 only, as
7+
* published by the Free Software Foundation.
8+
*
9+
* This code is distributed in the hope that it will be useful, but WITHOUT
10+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12+
* version 2 for more details (a copy is included in the LICENSE file that
13+
* accompanied this code).
14+
*
15+
* You should have received a copy of the GNU General Public License version
16+
* 2 along with this work; if not, write to the Free Software Foundation,
17+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18+
*
19+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20+
* or visit www.oracle.com if you need additional information or have any
21+
* questions.
22+
*/
23+
24+
import jdk.test.lib.apps.LingeredApp;
25+
26+
/**
27+
* This is a wrapper around LingeredApp.main to ensure we reliably get a
28+
* compiled main nmethod in the stack trace on all platforms when using
29+
* -Xcomp.
30+
*/
31+
public class LingeredAppWithTrivialMain extends LingeredApp {
32+
public static void main(String args[]) {
33+
LingeredApp.main(args);
34+
}
35+
}

0 commit comments

Comments
 (0)