提交 89aaec9c 编写于 作者: D duke

Merge

......@@ -200,3 +200,4 @@ b43aa5bd8ca5c8121336495382d35ecfa7a71536 jdk8-b74
278af9fc67e7eba2884936b49ec07345f423aabb jdk8-b76
3933eebc659d58c597aa8cb4b3e58f2250ce3e1a jdk8-b77
fd1a5574cf68af24bfd52decc37ac6361afb278a jdk8-b78
91d35211e74464dca5edf9b66ab01d0d0d8cded7 jdk8-b79
README:
This file should be located at the top of the OpenJDK Mercurial root
repository. This root repository will include a "make" directory,
and a Makefile for building the entire OpenJDK.
A full OpenJDK repository set (forest) should also include the following
6 nested repositories:
repository. A full OpenJDK repository set (forest) should also include
the following 6 nested repositories:
"jdk", "hotspot", "langtools", "corba", "jaxws" and "jaxp".
There are also several source downloads for the jax* repositories that
will be needed.
This one root repository can be obtained with something like:
The root repository can be obtained with something like:
hg clone http://hg.openjdk.java.net/jdk8/jdk8 openjdk8
To make sure you have all the nested repositories, you can run the
get_source.sh script located in the same respository as this file:
You can run the get_source.sh script located in the root repository to get
the other needed repositories:
cd openjdk8 && sh ./get_source.sh
People unfamiliar with Mercurial should read the first few chapters of
the Mercurial book: http://hgbook.red-bean.com/read/
See http://openjdk.java.net/ for more information about the OpenJDK.
See http://openjdk.java.net/ for more information about OpenJDK.
Simple Build Instructions:
0. Get the necessary system software/packages installed on your system, see
http://hg.openjdk.java.net/jdk8/build/raw-file/tip/README-builds.html
http://hg.openjdk.java.net/jdk8/jdk8/raw-file/tip/README-builds.html
1. If you don't have a jdk6 installed, download and install a JDK 6 from
1. If you don't have a jdk7u7 or newer jdk, download and install it from
http://java.sun.com/javase/downloads/index.jsp
Set the environment variable ALT_BOOTDIR to the location of JDK 6.
Add the /bin directory of this installation to your PATH environment
variable.
2. Check the sanity of doing a build with your current system:
make sanity
See README-builds.html if you run into problems.
2. Configure the build:
bash ./configure
3. Do a complete build of the OpenJDK:
3. Build the OpenJDK:
make all
The resulting JDK image should be found in build/*/j2sdk-image
The resulting JDK image should be found in build/*/images/j2sdk-image
where make is GNU make 3.81 or newer, /usr/bin/make on Linux usually
is 3.81 or newer.
is 3.81 or newer. Note that on Solaris, GNU make is called "gmake".
Complete details are available in README-builds.html.
Complete details are available in the file:
http://hg.openjdk.java.net/jdk8/jdk8/raw-file/tip/README-builds.html
因为 它太大了无法显示 source diff 。你可以改为 查看blob
......@@ -47,10 +47,6 @@ AC_DEFUN([BPERF_CHECK_CORES],
FOUND_CORES=yes
fi
# For c/c++ code we run twice as many concurrent build
# jobs than we have cores, otherwise we will stall on io.
CONCURRENT_BUILD_JOBS=`expr $NUM_CORES \* 2`
if test "x$FOUND_CORES" = xyes; then
AC_MSG_RESULT([$NUM_CORES])
else
......@@ -98,32 +94,62 @@ AC_DEFUN([BPERF_CHECK_MEMORY_SIZE],
AC_DEFUN_ONCE([BPERF_SETUP_BUILD_CORES],
[
# How many cores do we have on this build system?
AC_ARG_WITH(num-cores, [AS_HELP_STRING([--with-num-cores],
# How many cores do we have on this build system?
AC_ARG_WITH(num-cores, [AS_HELP_STRING([--with-num-cores],
[number of cores in the build system, e.g. --with-num-cores=8 @<:@probed@:>@])])
if test "x$with_num_cores" = x; then
if test "x$with_num_cores" = x; then
# The number of cores were not specified, try to probe them.
BPERF_CHECK_CORES
else
else
NUM_CORES=$with_num_cores
CONCURRENT_BUILD_JOBS=`expr $NUM_CORES \* 2`
fi
AC_SUBST(NUM_CORES)
AC_SUBST(CONCURRENT_BUILD_JOBS)
fi
AC_SUBST(NUM_CORES)
])
AC_DEFUN_ONCE([BPERF_SETUP_BUILD_MEMORY],
[
# How much memory do we have on this build system?
AC_ARG_WITH(memory-size, [AS_HELP_STRING([--with-memory-size],
# How much memory do we have on this build system?
AC_ARG_WITH(memory-size, [AS_HELP_STRING([--with-memory-size],
[memory (in MB) available in the build system, e.g. --with-memory-size=1024 @<:@probed@:>@])])
if test "x$with_memory_size" = x; then
if test "x$with_memory_size" = x; then
# The memory size was not specified, try to probe it.
BPERF_CHECK_MEMORY_SIZE
else
else
MEMORY_SIZE=$with_memory_size
fi
AC_SUBST(MEMORY_SIZE)
fi
AC_SUBST(MEMORY_SIZE)
])
AC_DEFUN_ONCE([BPERF_SETUP_BUILD_JOBS],
[
# Provide a decent default number of parallel jobs for make depending on
# number of cores, amount of memory and machine architecture.
AC_ARG_WITH(jobs, [AS_HELP_STRING([--with-jobs],
[number of parallel jobs to let make run @<:@calculated based on cores and memory@:>@])])
if test "x$with_jobs" = x; then
# Number of jobs was not specified, calculate.
AC_MSG_CHECKING([for appropriate number of jobs to run in parallel])
# Approximate memory in GB, rounding up a bit.
memory_gb=`expr $MEMORY_SIZE / 1100`
# Pick the lowest of memory in gb and number of cores.
if test "$memory_gb" -lt "$NUM_CORES"; then
JOBS="$memory_gb"
else
JOBS="$NUM_CORES"
# On bigger machines, leave some room for other processes to run
if test "$JOBS" -gt "4"; then
JOBS=`expr $JOBS '*' 90 / 100`
fi
fi
# Cap number of jobs to 16
if test "$JOBS" -gt "16"; then
JOBS=16
fi
AC_MSG_RESULT([$JOBS])
else
JOBS=$with_jobs
fi
AC_SUBST(JOBS)
])
AC_DEFUN([BPERF_SETUP_CCACHE],
......
......@@ -204,6 +204,7 @@ JDKOPT_SETUP_BUILD_TWEAKS
BPERF_SETUP_BUILD_CORES
BPERF_SETUP_BUILD_MEMORY
BPERF_SETUP_BUILD_JOBS
# Setup smart javac (after cores and memory have been setup)
BPERF_SETUP_SMART_JAVAC
......
......@@ -174,7 +174,7 @@ printf "* C++ Compiler: $CXX_VENDOR version $CXX_VERSION (at $CXX)\n"
printf "\n"
printf "Build performance summary:\n"
printf "* Cores to use: $NUM_CORES\n"
printf "* Cores to use: $JOBS\n"
printf "* Memory limit: $MEMORY_SIZE MB\n"
printf "* ccache status: $CCACHE_STATUS\n"
printf "\n"
......
......@@ -80,7 +80,7 @@ ALT_EXPORT_PATH=$(HOTSPOT_DIST)
HOTSPOT_MAKE_ARGS:=@HOTSPOT_MAKE_ARGS@ @STATIC_CXX_SETTING@
# This is used from the libjvm build for C/C++ code.
HOTSPOT_BUILD_JOBS:=@CONCURRENT_BUILD_JOBS@
HOTSPOT_BUILD_JOBS:=$(JOBS)
# Control wether Hotspot runs Queens test after building
TEST_IN_BUILD=@TEST_IN_BUILD@
......
......@@ -260,6 +260,9 @@ ENABLE_SJAVAC:=@ENABLE_SJAVAC@
# the sjavac server log files.
SJAVAC_SERVER_DIR:=@SJAVAC_SERVER_DIR@
# Number of parallel jobs to use for compilation
JOBS?=@JOBS@
# The OpenJDK makefiles should be changed to using the standard
# configure output ..._CFLAGS and ..._LIBS. In the meantime we
# extract the information here.
......@@ -283,7 +286,7 @@ X_LIBS:=@X_LIBS@
OPENWIN_HOME:=@OPENWIN_HOME@
# The lowest required version of macosx to enforce compatiblity for
MACOSX_REQUIRED_VERSION=@MACOSX_REQUIRED_VERSION@
MACOSX_VERSION_MIN=@MACOSX_VERSION_MIN@
# There are two types: CC or CL
# CC is gcc and others behaving reasonably similar.
......
......@@ -876,10 +876,17 @@ if test "x$OPENJDK_TARGET_OS" = xsolaris; then
fi
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DMACOSX -D_ALLBSD_SOURCE"
# Adding these macros will make it an error to link to mac APIs newer than OS version 10.7
MACOSX_REQUIRED_VERSION=1070
AC_SUBST(MACOSX_REQUIRED_VERSION)
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DMAC_OS_X_VERSION_MAX_ALLOWED=\$(MACOSX_REQUIRED_VERSION) -DMAC_OS_X_VERSION_MIN_REQUIRED=\$(MACOSX_REQUIRED_VERSION)"
# Setting these parameters makes it an error to link to macosx APIs that are
# newer than the given OS version and makes the linked binaries compatible even
# if built on a newer version of the OS.
# The expected format is X.Y.Z
MACOSX_VERSION_MIN=10.7.0
AC_SUBST(MACOSX_VERSION_MIN)
# The macro takes the version with no dots, ex: 1070
# Let the flags variables get resolved in make for easier override on make
# command line.
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DMAC_OS_X_VERSION_MAX_ALLOWED=\$(subst .,,\$(MACOSX_VERSION_MIN)) -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
LDFLAGS_JDK="$LDFLAGS_JDK -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
fi
if test "x$OPENJDK_TARGET_OS" = xbsd; then
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DBSD -D_ALLBSD_SOURCE"
......
......@@ -501,7 +501,7 @@ define SetupJavaCompilation
$(ECHO) Compiling $1
($$($1_JVM) $$($1_SJAVAC) \
$$($1_REMOTE) \
-j $(NUM_CORES) \
-j $(JOBS) \
--permit-unidentified-artifacts \
--permit-sources-without-package \
--compare-found-sources $$($1_BIN)/_the.batch.tmp \
......
......@@ -58,9 +58,6 @@ $(eval $(call ResetAllTimers))
# Setup number of jobs to use. -jN is unfortunately not available for us to parse from the command line,
# hence this workaround.
ifeq ($(JOBS),)
JOBS=$(NUM_CORES)
endif
MAKE_ARGS:=$(MAKE_ARGS) -j$(JOBS)
### Main targets
......
......@@ -200,3 +200,4 @@ d4e68ce17795601017ac2f952baad7272942c36e jdk8-b75
58be6ca3c0603882a1ec478724e337aac85e0da0 jdk8-b76
35684a40c5845782324dbcc9ac8969528020ff61 jdk8-b77
27d6368ae8ba570c31c2f0e696d39c99fa2f4538 jdk8-b78
e41fb1aa0329767b2737303c994e38bede1baa07 jdk8-b79
......@@ -318,3 +318,5 @@ cdb46031e7184d37301288f5719121a63c7054b5 jdk8-b77
9f19f4a7d48a4ebe7f616b6068971ea5f8b075fa hs25-b19
d5e12e7d2f719144d84903d9151455661c47b476 jdk8-b78
555ec35a250783110aa070dbc8a8603f6cabe41f hs25-b20
6691814929b606fe0e7954fd6e485dd876505c83 jdk8-b79
df5396524152118535c36da5801d828b560d19a2 hs25-b21
......@@ -19,7 +19,7 @@
# 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.
#
#
#
# This guards against adding broken .java files to the directory
......@@ -42,8 +42,6 @@ PKGLIST = \
sun.jvm.hotspot \
sun.jvm.hotspot.asm \
sun.jvm.hotspot.asm.sparc \
sun.jvm.hotspot.bugspot \
sun.jvm.hotspot.bugspot.tree \
sun.jvm.hotspot.c1 \
sun.jvm.hotspot.ci \
sun.jvm.hotspot.code \
......@@ -84,7 +82,6 @@ sun.jvm.hotspot.gc_implementation.shared \
sun.jvm.hotspot.gc_interface \
sun.jvm.hotspot.interpreter \
sun.jvm.hotspot.jdi \
sun.jvm.hotspot.livejvm \
sun.jvm.hotspot.memory \
sun.jvm.hotspot.opto \
sun.jvm.hotspot.oops \
......@@ -130,8 +127,6 @@ FILELIST = \
sun/jvm/hotspot/*.java \
sun/jvm/hotspot/asm/*.java \
sun/jvm/hotspot/asm/sparc/*.java \
sun/jvm/hotspot/bugspot/*.java \
sun/jvm/hotspot/bugspot/tree/*.java \
sun/jvm/hotspot/c1/*.java \
sun/jvm/hotspot/ci/*.java \
sun/jvm/hotspot/code/*.java \
......@@ -168,7 +163,6 @@ sun/jvm/hotspot/gc_implementation/parallelScavenge/*.java \
sun/jvm/hotspot/gc_implementation/shared/*.java \
sun/jvm/hotspot/interpreter/*.java \
sun/jvm/hotspot/jdi/*.java \
sun/jvm/hotspot/livejvm/*.java \
sun/jvm/hotspot/memory/*.java \
sun/jvm/hotspot/oops/*.java \
sun/jvm/hotspot/opto/*.java \
......@@ -205,7 +199,7 @@ sun/jvm/hotspot/utilities/*.java \
sun/jvm/hotspot/utilities/memo/*.java \
sun/jvm/hotspot/utilities/soql/*.java \
com/sun/java/swing/action/*.java \
com/sun/java/swing/ui/*.java
com/sun/java/swing/ui/*.java
#END FILELIST
ifneq "x$(ALT_BOOTDIR)" "x"
......@@ -231,7 +225,7 @@ BUILD_DIR = ../build
OUTPUT_DIR = $(BUILD_DIR)/classes
DOC_DIR = $(BUILD_DIR)/doc
# gnumake 3.78.1 does not accept the *s,
# gnumake 3.78.1 does not accept the *s,
# so use the shell to expand them
ALLFILES := $(patsubst %,$(SRC_DIR)/%,$(FILELIST))
ALLFILES := $(shell /bin/ls $(ALLFILES))
......@@ -303,7 +297,7 @@ sizes: $(ALLFILES)
cscope: $(ALLFILES)
rm -f java.files
echo $(ALLFILES) > java.files
cscope -b -i java.files -f java.out
cscope -b -i java.files -f java.out
rm -f java.files
.PHONY: sa.jar
......
REM
REM Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved.
REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
REM
REM This code is free software; you can redistribute it and/or modify it
REM under the terms of the GNU General Public License version 2 only, as
REM published by the Free Software Foundation.
REM
REM This code is distributed in the hope that it will be useful, but WITHOUT
REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
REM version 2 for more details (a copy is included in the LICENSE file that
REM accompanied this code).
REM
REM You should have received a copy of the GNU General Public License version
REM 2 along with this work; if not, write to the Free Software Foundation,
REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
REM
REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
REM or visit www.oracle.com if you need additional information or have any
REM questions.
REM
REM
java -showversion -cp ..\build\classes;..\src\share\lib\js.jar;.\sa.jar;lib\js.jar sun.jvm.hotspot.bugspot.Main
......@@ -26,14 +26,12 @@
<ul>
<li><code>java -cp classes sun.jvm.hotspot.HSDB</code>
<li><code>java -cp classes sun.jvm.hotspot.bugspot.Main</code>
</ul>
<h2>Feedback</h2>
<p>
Refactoring of package hierarchy. All user interface components should be in
the ui package. Perhaps: sun.jvm.hotspot.ui.hsdb.Main for the HSDB and
sun.jvm.hotspot.ui.bugspot.Main for BugSpot.
the ui package. Perhaps: sun.jvm.hotspot.ui.hsdb.Main for the HSDB.
<p>
The src\share\vm\agent area seems like a workspace so it should be organized like
one. In particular, I'd like to suggest the following directory layout:<br>
......@@ -47,7 +45,7 @@
</ul>
<p>
Seems like there is a lot of redundant functionality. Between the HSDB and BugSpot. Perhaps
Seems like there is a lot of redundant functionality. Perhaps
this can be consolidated with a <code>javax.swing.Actions</code> architecture.
<h2>Tasklist</h2>
......@@ -55,11 +53,7 @@
<p>
<b>Stack memory pane</b>:
It's one of the more useful JVM debugging tools in the SA. However, it
doesn't support any interaction with the text; the Memory Panel in BugSpot
was written afterward (with help from Shannon) and implements proper
selection, scrolling, and drag-and-drop, but no annotations. I'm not sure how
to integrate the annotations with the JTable that's being used for the memory
view; if you have suggestions here please let me know.
doesn't support any interaction with the text.
<p>
<b>Integrations with the NetBeans architecture (plug in).</b> See the
<a href="http://openide.netbeans.org">Netbeans Open APIs homepage</a>
......
......@@ -372,8 +372,7 @@ static bool attachToProcess(JNIEnv* env, jobject obj, jint pid) {
We are attaching to a process in 'read-only' mode. i.e., we do not want to
put breakpoints, suspend/resume threads etc. For read-only JDI and HSDB kind of
usage this should suffice. We are not intending to use this for full-fledged
ProcessControl implementation to be used with BugSpotAgent.
usage this should suffice.
Please refer to DEBUG_ATTACH_NONINVASIVE mode source comments from dbgeng.h.
In this mode, debug engine does not call DebugActiveProrcess. i.e., we are not
......
/*
* Copyright (c) 2003, 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.
*
*/
package sun.jvm.hotspot.asm.amd64;
import sun.jvm.hotspot.asm.Register;
import sun.jvm.hotspot.utilities.Assert;
public class AMD64FloatRegister extends Register {
public AMD64FloatRegister(int number) {
super(number);
}
public int getNumber() {
return number;
}
public int getNumberOfRegisters() {
return AMD64FloatRegisters.getNumRegisters();
}
public boolean isFloat() {
return true;
}
public boolean isFramePointer() {
return false;
}
public boolean isStackPointer() {
return false;
}
public boolean isValid() {
return number >= 0 && number < AMD64FloatRegisters.getNumRegisters();
}
public String toString() {
return AMD64FloatRegisters.getRegisterName(number);
}
}
/*
* Copyright (c) 2002, 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.
*
*/
package sun.jvm.hotspot.bugspot;
import sun.jvm.hotspot.oops.*;
/** Wrapper class which describes line number information for Java
class files. The line number table is converted into this
representation on demand. These objects are then sorted by line
number for fast lookup when setting breakpoints in a particular
source file. */
public class JavaLineNumberInfo {
private InstanceKlass klass;
private Method method;
private int startBCI;
private int lineNumber;
public JavaLineNumberInfo(InstanceKlass klass,
Method method,
int startBCI,
int lineNumber) {
this.klass = klass;
this.method = method;
this.startBCI = startBCI;
this.lineNumber = lineNumber;
}
public InstanceKlass getKlass() { return klass; }
public Method getMethod() { return method; }
public int getStartBCI() { return startBCI; }
public int getLineNumber() { return lineNumber; }
}
/*
* Copyright (c) 2001, 2008, 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.
*
*/
package sun.jvm.hotspot.bugspot;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import sun.jvm.hotspot.ui.*;
/** The main class for the BugSpot debugger. */
public class Main {
public static void main(String[] args) {
JFrame frame = new JFrame("BugSpot");
frame.setSize(800, 600);
BugSpot db = new BugSpot();
db.setMDIMode(true);
db.build();
frame.setJMenuBar(db.getMenuBar());
frame.getContentPane().add(db);
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
GraphicsUtilities.reshapeToAspectRatio(frame,
4.0f/3.0f, 0.85f, Toolkit.getDefaultToolkit().getScreenSize());
GraphicsUtilities.centerInContainer(frame,
Toolkit.getDefaultToolkit().getScreenSize());
frame.setVisible(true);
}
}
/*
* Copyright (c) 2001, 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.
*
*/
package sun.jvm.hotspot.bugspot;
import sun.jvm.hotspot.debugger.*;
import sun.jvm.hotspot.debugger.cdbg.*;
/** Helper class for locating a program counter. Indicates the
confidence of the find. */
public class PCFinder {
public static final int LOW_CONFIDENCE = 1;
public static final int HIGH_CONFIDENCE = 2;
public static class Info {
private String name;
private long offset;
private int confidence;
public Info(String name, long offset, int confidence) {
this.name = name;
this.offset = offset;
this.confidence = confidence;
}
/** May be null */
public String getName() { return name; }
/** If this is -1, a symbol could not be found, and the offset
should not be shown */
public long getOffset() { return offset; }
/** PCFinder.LOW_CONFIDENCE or PCFinder.HIGH_CONFIDENCE */
public int getConfidence() { return confidence; }
}
/** Passed loadobject may be null in which case the returned Info
object has low confidence */
public static Info findPC(Address pc, LoadObject lo, CDebugger dbg) {
if (lo == null) {
return new Info(null, -1, LOW_CONFIDENCE);
}
// First try debug info
BlockSym sym = lo.debugInfoForPC(pc);
while (sym != null) {
if (sym.isFunction()) {
// Highest confidence
return new Info(sym.toString(), pc.minus(sym.getAddress()), HIGH_CONFIDENCE);
}
}
// Now try looking up symbol in loadobject
// FIXME: must add support for mapfiles on Win32 and try looking
// up there first if possible. Should we hide that behind
// LoadObject.closestSymbolToPC and have the ClosestSymbol return
// confidence? I think so. On Solaris there is no notion of a
// mapfile, and the confidence for closestSymbolToPC will be high
// instead of low.
int confidence = HIGH_CONFIDENCE;
ClosestSymbol cs = lo.closestSymbolToPC(pc);
if (cs != null) {
// FIXME: currently low confidence (only on Win32)
return new Info(cs.getName() + "()", cs.getOffset(), LOW_CONFIDENCE);
}
// Unknown location
return new Info(dbg.getNameOfFile(lo.getName()).toUpperCase() +
"! " + pc + "()", -1, HIGH_CONFIDENCE);
}
}
/*
* Copyright (c) 2001, 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.
*
*/
package sun.jvm.hotspot.bugspot.tree;
import sun.jvm.hotspot.debugger.cdbg.*;
import sun.jvm.hotspot.ui.tree.SimpleTreeNode;
/** Encapsulates a double value in a tree handled by SimpleTreeModel */
public class DoubleTreeNodeAdapter extends FieldTreeNodeAdapter {
private double val;
public DoubleTreeNodeAdapter(double val, FieldIdentifier id) {
this(val, id, false);
}
public DoubleTreeNodeAdapter(double val, FieldIdentifier id, boolean treeTableMode) {
super(id, treeTableMode);
this.val = val;
}
public int getChildCount() {
return 0;
}
public SimpleTreeNode getChild(int index) {
return null;
}
public boolean isLeaf() {
return true;
}
public int getIndexOfChild(SimpleTreeNode child) {
return 0;
}
public String getValue() {
return Double.toString(val);
}
}
......@@ -58,10 +58,6 @@ public class PMap extends Tool {
}
}
protected boolean requiresVM() {
return false;
}
public static void main(String[] args) throws Exception {
PMap t = new PMap();
t.start(args);
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册