Mercurial > hg > truffle
comparison agent/src/share/classes/sun/jvm/hotspot/tools/PStack.java @ 8750:39432a1cefdd
8003348: SA can not read core file on OS
Summary: Macosx uses Mach-O file format for binary files, not ELF format. Currently SA works on core files on other platforms, t his change enables SA work on core file generated on Darwin.
Reviewed-by: sla, sspitsyn
Contributed-by: yumin.qi@oracle.com
author | minqi |
---|---|
date | Thu, 14 Mar 2013 00:33:08 -0700 |
parents | 5ed317b25e23 |
children | 38ea2efa32a7 |
comparison
equal
deleted
inserted
replaced
8719:c8b31b461e1a | 8750:39432a1cefdd |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 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 | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
30 import sun.jvm.hotspot.interpreter.*; | 30 import sun.jvm.hotspot.interpreter.*; |
31 import sun.jvm.hotspot.debugger.*; | 31 import sun.jvm.hotspot.debugger.*; |
32 import sun.jvm.hotspot.debugger.cdbg.*; | 32 import sun.jvm.hotspot.debugger.cdbg.*; |
33 import sun.jvm.hotspot.oops.*; | 33 import sun.jvm.hotspot.oops.*; |
34 import sun.jvm.hotspot.runtime.*; | 34 import sun.jvm.hotspot.runtime.*; |
35 import sun.jvm.hotspot.utilities.PlatformInfo; | |
35 | 36 |
36 public class PStack extends Tool { | 37 public class PStack extends Tool { |
37 // in non-verbose mode, Method*s are not printed in java frames | 38 // in non-verbose mode, Method*s are not printed in java frames |
38 public PStack(boolean v, boolean concurrentLocks) { | 39 public PStack(boolean v, boolean concurrentLocks) { |
39 this.verbose = v; | 40 this.verbose = v; |
52 Debugger dbg = getAgent().getDebugger(); | 53 Debugger dbg = getAgent().getDebugger(); |
53 run(out, dbg); | 54 run(out, dbg); |
54 } | 55 } |
55 | 56 |
56 public void run(PrintStream out, Debugger dbg) { | 57 public void run(PrintStream out, Debugger dbg) { |
58 if (PlatformInfo.getOS().equals("darwin")) { | |
59 out.println("Not available on Darwin"); | |
60 return; | |
61 } | |
62 | |
57 CDebugger cdbg = dbg.getCDebugger(); | 63 CDebugger cdbg = dbg.getCDebugger(); |
58 if (cdbg != null) { | 64 if (cdbg != null) { |
59 ConcurrentLocksPrinter concLocksPrinter = null; | 65 ConcurrentLocksPrinter concLocksPrinter = null; |
60 // compute and cache java Vframes. | 66 // compute and cache java Vframes. |
61 initJFrameCache(); | 67 initJFrameCache(); |