Skip to content
Permalink
Browse files
8237250: pmap and pstack should do a better of making it clear that t…
…hey are not supported on Mac OS X

Reviewed-by: amenkov, sspitsyn
  • Loading branch information
plummercj committed Apr 13, 2020
1 parent a46f4bf commit 4a09f31eff40884b5e8aa5fabf9ad4f55cd8ed6f
Showing 4 changed files with 26 additions and 9 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2020, 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
@@ -28,6 +28,7 @@
import java.util.*;
import sun.jvm.hotspot.debugger.*;
import sun.jvm.hotspot.debugger.cdbg.*;
import sun.jvm.hotspot.utilities.PlatformInfo;

public class PMap extends Tool {

@@ -53,6 +54,11 @@ public void run(PrintStream out) {
}

public void run(PrintStream out, Debugger dbg) {
if (PlatformInfo.getOS().equals("darwin")) {
out.println("Not available on Mac OS X");
return;
}

CDebugger cdbg = dbg.getCDebugger();
if (cdbg != null) {
List l = cdbg.getLoadObjectList();
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2020, 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
@@ -60,7 +60,7 @@ public void run(PrintStream out) {

public void run(PrintStream out, Debugger dbg) {
if (PlatformInfo.getOS().equals("darwin")) {
out.println("Not available on Darwin");
out.println("Not available on Mac OS X");
return;
}

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2020, 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
@@ -26,6 +26,7 @@
import java.util.Map;

import jdk.test.lib.apps.LingeredApp;
import jdk.test.lib.Platform;
import jtreg.SkippedException;

/**
@@ -34,7 +35,6 @@
* @summary Test clhsdb pmap command
* @requires vm.hasSA
* @library /test/lib
* @requires os.family != "mac"
* @run main/othervm ClhsdbPmap
*/

@@ -52,8 +52,13 @@ public static void main(String[] args) throws Exception {
List<String> cmds = List.of("pmap");

Map<String, List<String>> expStrMap = new HashMap<>();
expStrMap.put("pmap",
if (Platform.isOSX()) {
expStrMap.put("pmap",
List.of("Not available on Mac OS X"));
} else {
expStrMap.put("pmap",
List.of("jvm", "java", "net", "nio", "jimage", "zip"));
}

test.run(theApp.getPid(), cmds, expStrMap, null);
} catch (SkippedException se) {
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2020, 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
@@ -26,13 +26,14 @@
import java.util.Map;

import jdk.test.lib.apps.LingeredApp;
import jdk.test.lib.Platform;
import jtreg.SkippedException;

/**
* @test
* @bug 8190198
* @summary Test clhsdb pstack command
* @requires vm.hasSA & os.family != "mac"
* @requires vm.hasSA
* @library /test/lib
* @run main/othervm ClhsdbPstack
*/
@@ -51,11 +52,16 @@ public static void main(String[] args) throws Exception {
List<String> cmds = List.of("pstack -v");

Map<String, List<String>> expStrMap = new HashMap<>();
expStrMap.put("pstack -v", List.of(
if (Platform.isOSX()) {
expStrMap.put("pstack -v", List.of(
"Not available on Mac OS X"));
} else {
expStrMap.put("pstack -v", List.of(
"No deadlocks found", "Common-Cleaner",
"Signal Dispatcher", "CompilerThread",
"Sweeper thread", "Service Thread",
"Reference Handler", "Finalizer", "main"));
}

test.run(theApp.getPid(), cmds, expStrMap, null);
} catch (SkippedException se) {

0 comments on commit 4a09f31

Please sign in to comment.