10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 package sun.jvm.hotspot;
26
27 import java.io.*;
28 import java.awt.*;
29 import java.awt.event.*;
30 import java.math.*;
31 import javax.swing.*;
32 import javax.swing.tree.*;
33 import java.util.*;
34
35 import sun.jvm.hotspot.code.*;
36 import sun.jvm.hotspot.compiler.*;
37 import sun.jvm.hotspot.debugger.*;
38 import sun.jvm.hotspot.gc_implementation.parallelScavenge.*;
39 import sun.jvm.hotspot.gc_interface.*;
40 import sun.jvm.hotspot.interpreter.*;
41 import sun.jvm.hotspot.memory.*;
42 import sun.jvm.hotspot.oops.*;
43 import sun.jvm.hotspot.runtime.*;
44 import sun.jvm.hotspot.ui.*;
45 import sun.jvm.hotspot.ui.tree.*;
46 import sun.jvm.hotspot.ui.classbrowser.*;
47 import sun.jvm.hotspot.utilities.*;
48
49 /** The top-level HotSpot Debugger. FIXME: make this an embeddable
50 component! (Among other things, figure out what to do with the
51 menu bar...) */
52
911 anno += "\nExecuting in codelet \"" + description + "\" at PC = " + curFrame.getPC();
912 }
913 } else if (curVFrame.isCompiledFrame()) {
914 anno += "\nExecuting at PC = " + curFrame.getPC();
915 }
916
917 if (startAddr == null) {
918 startAddr = curFrame.getSP();
919 }
920
921 // FIXME: some compiled frames with empty oop map sets have been
922 // found (for example, Vector's inner Enumeration class, method
923 // "hasMoreElements"). Not sure yet why these cases are showing
924 // up -- should be possible (though unlikely) for safepoint code
925 // to patch the return instruction of these methods and then
926 // later attempt to get an oop map for that instruction. For
927 // now, we warn if we find such a method.
928 boolean shouldSkipOopMaps = false;
929 if (curVFrame.isCompiledFrame()) {
930 CodeBlob cb = VM.getVM().getCodeCache().findBlob(curFrame.getPC());
931 OopMapSet maps = cb.getOopMaps();
932 if ((maps == null) || (maps.getSize() == 0)) {
933 shouldSkipOopMaps = true;
934 }
935 }
936
937 // Add signal information to annotation if necessary
938 SignalInfo sigInfo = (SignalInfo) interruptedFrameMap.get(curFrame);
939 if (sigInfo != null) {
940 // This frame took a signal and we need to report it.
941 anno = (anno + "\n*** INTERRUPTED BY SIGNAL " + Integer.toString(sigInfo.sigNum) +
942 " (" + sigInfo.sigName + ")");
943 }
944
945 JavaVFrame nextVFrame = curVFrame;
946 sun.jvm.hotspot.runtime.Frame nextFrame = curFrame;
947 do {
948 curVFrame = nextVFrame;
949 curFrame = nextFrame;
950
951 try {
960 (bci >= 0 && bci < method.getCodeSize())) {
961 lineNumberAnno = ", line " + method.getLineNumberFromBCI(bci);
962 } else {
963 lineNumberAnno = " (INVALID BCI)";
964 }
965 }
966 anno += "\n" + method.getMethodHolder().getName().asString() + "." +
967 method.getName().asString() + method.getSignature().asString() +
968 "\n@bci " + bci + lineNumberAnno;
969 } catch (Exception e) {
970 anno += "\n(ERROR while iterating vframes for frame " + curFrame + ")";
971 }
972
973 nextVFrame = curVFrame.javaSender();
974 if (nextVFrame != null) {
975 nextFrame = nextVFrame.getFrame();
976 }
977 } while (nextVFrame != null && nextFrame.equals(curFrame));
978
979 if (shouldSkipOopMaps) {
980 anno = anno + "\nNOTE: null or empty OopMapSet found for this CodeBlob";
981 }
982
983 if (curFrame.getFP() != null) {
984 annoPanel.addAnnotation(new Annotation(curFrame.getSP(),
985 curFrame.getFP(),
986 anno));
987 } else {
988 if (VM.getVM().getCPU().equals("x86") || VM.getVM().getCPU().equals("amd64")) {
989 // For C2, which has null frame pointers on x86/amd64
990 CodeBlob cb = VM.getVM().getCodeCache().findBlob(curFrame.getPC());
991 Address sp = curFrame.getSP();
992 if (Assert.ASSERTS_ENABLED) {
993 Assert.that(cb.getFrameSize() > 0, "CodeBlob must have non-zero frame size");
994 }
995 annoPanel.addAnnotation(new Annotation(sp,
996 sp.addOffsetTo(cb.getFrameSize()),
997 anno));
998 } else {
999 Assert.that(VM.getVM().getCPU().equals("ia64"), "only ia64 should reach here");
1000 }
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 package sun.jvm.hotspot;
26
27 import java.io.*;
28 import java.awt.*;
29 import java.awt.event.*;
30 import javax.swing.*;
31 import java.util.*;
32
33 import sun.jvm.hotspot.code.*;
34 import sun.jvm.hotspot.compiler.*;
35 import sun.jvm.hotspot.debugger.*;
36 import sun.jvm.hotspot.gc_implementation.parallelScavenge.*;
37 import sun.jvm.hotspot.gc_interface.*;
38 import sun.jvm.hotspot.interpreter.*;
39 import sun.jvm.hotspot.memory.*;
40 import sun.jvm.hotspot.oops.*;
41 import sun.jvm.hotspot.runtime.*;
42 import sun.jvm.hotspot.ui.*;
43 import sun.jvm.hotspot.ui.tree.*;
44 import sun.jvm.hotspot.ui.classbrowser.*;
45 import sun.jvm.hotspot.utilities.*;
46
47 /** The top-level HotSpot Debugger. FIXME: make this an embeddable
48 component! (Among other things, figure out what to do with the
49 menu bar...) */
50
909 anno += "\nExecuting in codelet \"" + description + "\" at PC = " + curFrame.getPC();
910 }
911 } else if (curVFrame.isCompiledFrame()) {
912 anno += "\nExecuting at PC = " + curFrame.getPC();
913 }
914
915 if (startAddr == null) {
916 startAddr = curFrame.getSP();
917 }
918
919 // FIXME: some compiled frames with empty oop map sets have been
920 // found (for example, Vector's inner Enumeration class, method
921 // "hasMoreElements"). Not sure yet why these cases are showing
922 // up -- should be possible (though unlikely) for safepoint code
923 // to patch the return instruction of these methods and then
924 // later attempt to get an oop map for that instruction. For
925 // now, we warn if we find such a method.
926 boolean shouldSkipOopMaps = false;
927 if (curVFrame.isCompiledFrame()) {
928 CodeBlob cb = VM.getVM().getCodeCache().findBlob(curFrame.getPC());
929 ImmutableOopMapSet maps = cb.getOopMaps();
930 if ((maps == null) || (maps.getSize() == 0)) {
931 shouldSkipOopMaps = true;
932 }
933 }
934
935 // Add signal information to annotation if necessary
936 SignalInfo sigInfo = (SignalInfo) interruptedFrameMap.get(curFrame);
937 if (sigInfo != null) {
938 // This frame took a signal and we need to report it.
939 anno = (anno + "\n*** INTERRUPTED BY SIGNAL " + Integer.toString(sigInfo.sigNum) +
940 " (" + sigInfo.sigName + ")");
941 }
942
943 JavaVFrame nextVFrame = curVFrame;
944 sun.jvm.hotspot.runtime.Frame nextFrame = curFrame;
945 do {
946 curVFrame = nextVFrame;
947 curFrame = nextFrame;
948
949 try {
958 (bci >= 0 && bci < method.getCodeSize())) {
959 lineNumberAnno = ", line " + method.getLineNumberFromBCI(bci);
960 } else {
961 lineNumberAnno = " (INVALID BCI)";
962 }
963 }
964 anno += "\n" + method.getMethodHolder().getName().asString() + "." +
965 method.getName().asString() + method.getSignature().asString() +
966 "\n@bci " + bci + lineNumberAnno;
967 } catch (Exception e) {
968 anno += "\n(ERROR while iterating vframes for frame " + curFrame + ")";
969 }
970
971 nextVFrame = curVFrame.javaSender();
972 if (nextVFrame != null) {
973 nextFrame = nextVFrame.getFrame();
974 }
975 } while (nextVFrame != null && nextFrame.equals(curFrame));
976
977 if (shouldSkipOopMaps) {
978 anno = anno + "\nNOTE: null or empty ImmutableOopMapSet found for this CodeBlob";
979 }
980
981 if (curFrame.getFP() != null) {
982 annoPanel.addAnnotation(new Annotation(curFrame.getSP(),
983 curFrame.getFP(),
984 anno));
985 } else {
986 if (VM.getVM().getCPU().equals("x86") || VM.getVM().getCPU().equals("amd64")) {
987 // For C2, which has null frame pointers on x86/amd64
988 CodeBlob cb = VM.getVM().getCodeCache().findBlob(curFrame.getPC());
989 Address sp = curFrame.getSP();
990 if (Assert.ASSERTS_ENABLED) {
991 Assert.that(cb.getFrameSize() > 0, "CodeBlob must have non-zero frame size");
992 }
993 annoPanel.addAnnotation(new Annotation(sp,
994 sp.addOffsetTo(cb.getFrameSize()),
995 anno));
996 } else {
997 Assert.that(VM.getVM().getCPU().equals("ia64"), "only ia64 should reach here");
998 }
|