8229118: [TESTBUG] serviceability/sa/ClhsdbFindPC fails on AArch64
authorngasson
Thu, 15 Aug 2019 14:00:36 +0800
changeset 57757 902cef494e66
parent 57756 76ff3491e3b8
child 57758 91a758925be7
8229118: [TESTBUG] serviceability/sa/ClhsdbFindPC fails on AArch64 Reviewed-by: cjplummer, adinn
test/hotspot/jtreg/serviceability/sa/ClhsdbFindPC.java
test/hotspot/jtreg/serviceability/sa/LingeredAppWithTrivialMain.java
--- a/test/hotspot/jtreg/serviceability/sa/ClhsdbFindPC.java	Thu Aug 15 03:57:17 2019 +0200
+++ b/test/hotspot/jtreg/serviceability/sa/ClhsdbFindPC.java	Thu Aug 15 14:00:36 2019 +0800
@@ -45,8 +45,13 @@
         LingeredApp theApp = null;
         try {
             ClhsdbLauncher test = new ClhsdbLauncher();
-            theApp = withXcomp ? LingeredApp.startApp(List.of("-Xcomp"))
-                               : LingeredApp.startApp(List.of("-Xint"));
+
+            theApp = new LingeredAppWithTrivialMain();
+            if (withXcomp) {
+                LingeredApp.startApp(List.of("-Xcomp"), theApp);
+            } else {
+                LingeredApp.startApp(List.of("-Xint"), theApp);
+            }
             System.out.print("Started LingeredApp ");
             if (withXcomp) {
                 System.out.print("(-Xcomp) ");
@@ -67,7 +72,7 @@
             // attach permission issues.
             if (output != null) {
                 String cmdStr = null;
-                String[] parts = output.split("LingeredApp.main");
+                String[] parts = output.split("LingeredAppWithTrivialMain.main");
                 String[] tokens = parts[1].split(" ");
                 for (String token : tokens) {
                     if (token.contains("pc")) {
@@ -82,7 +87,7 @@
                 Map<String, List<String>> expStrMap = new HashMap<>();
                 if (withXcomp) {
                     expStrMap.put(cmdStr, List.of(
-                            "In code in NMethod for jdk/test/lib/apps/LingeredApp.main",
+                            "In code in NMethod for LingeredAppWithTrivialMain.main",
                             "content:",
                             "oops:",
                             "frame size:"));
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/hotspot/jtreg/serviceability/sa/LingeredAppWithTrivialMain.java	Thu Aug 15 14:00:36 2019 +0800
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import jdk.test.lib.apps.LingeredApp;
+
+/**
+ * This is a wrapper around LingeredApp.main to ensure we reliably get a
+ * compiled main nmethod in the stack trace on all platforms when using
+ * -Xcomp.
+ */
+public class LingeredAppWithTrivialMain extends LingeredApp {
+    public static void main(String args[]) {
+        LingeredApp.main(args);
+    }
+ }