agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File
hotspot-8003348 Cdiff agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java
agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java
Print this page
8003348: SA can not read core file on OS X
*** 1,7 ****
/*
! * Copyright (c) 2000, 2012, 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.
--- 1,7 ----
/*
! * Copyright (c) 2000, 2013, 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.
*** 40,49 ****
--- 40,50 ----
import sun.jvm.hotspot.utilities.*;
public class Threads {
private static JavaThreadFactory threadFactory;
private static AddressField threadListField;
+ private static CIntegerField numOfThreadsField;
private static VirtualConstructor virtualConstructor;
private static JavaThreadPDAccess access;
static {
VM.registerVMInitializedObserver(new Observer() {
*** 55,64 ****
--- 56,66 ----
private static synchronized void initialize(TypeDataBase db) {
Type type = db.lookupType("Threads");
threadListField = type.getAddressField("_thread_list");
+ numOfThreadsField = type.getCIntegerField("_number_of_threads");
// Instantiate appropriate platform-specific JavaThreadFactory
String os = VM.getVM().getOS();
String cpu = VM.getVM().getCPU();
*** 100,110 ****
--- 102,116 ----
if (cpu.equals("x86")) {
access = new BsdX86JavaThreadPDAccess();
} else if (cpu.equals("amd64") || cpu.equals("x86_64")) {
access = new BsdAMD64JavaThreadPDAccess();
}
+ } else if (os.equals("darwin")) {
+ if (cpu.equals("amd64") || cpu.equals("x86_64")) {
+ access = new BsdAMD64JavaThreadPDAccess();
}
+ }
if (access == null) {
throw new RuntimeException("OS/CPU combination " + os + "/" + cpu +
" not yet supported");
}
*** 142,151 ****
--- 148,161 ----
}
return createJavaThreadWrapper(threadAddr);
}
+ public int getNumberOfThreads() {
+ return (int) numOfThreadsField.getValue();
+ }
+
/** Routine for instantiating appropriately-typed wrapper for a
JavaThread. Currently needs to be public for OopUtilities to
access it. */
public JavaThread createJavaThreadWrapper(Address threadAddr) {
try {
agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File