Mercurial > hg > truffle
comparison agent/src/share/classes/sun/jvm/hotspot/runtime/win32_amd64/Win32AMD64JavaThreadPDAccess.java @ 3908:7588156f5cf9
7051798: SA-JDI: NPE in Frame.addressOfStackSlot(Frame.java:244)
Reviewed-by: kvn
author | never |
---|---|
date | Mon, 05 Sep 2011 17:09:05 -0700 |
parents | c18cbe5936b8 |
children | f6f3bb0ee072 |
comparison
equal
deleted
inserted
replaced
3907:7b5c767f229c | 3908:7588156f5cf9 |
---|---|
29 import sun.jvm.hotspot.debugger.*; | 29 import sun.jvm.hotspot.debugger.*; |
30 import sun.jvm.hotspot.debugger.win32.*; | 30 import sun.jvm.hotspot.debugger.win32.*; |
31 import sun.jvm.hotspot.debugger.amd64.*; | 31 import sun.jvm.hotspot.debugger.amd64.*; |
32 import sun.jvm.hotspot.runtime.*; | 32 import sun.jvm.hotspot.runtime.*; |
33 import sun.jvm.hotspot.runtime.amd64.*; | 33 import sun.jvm.hotspot.runtime.amd64.*; |
34 import sun.jvm.hotspot.runtime.x86.*; | |
34 import sun.jvm.hotspot.types.*; | 35 import sun.jvm.hotspot.types.*; |
35 import sun.jvm.hotspot.utilities.*; | 36 import sun.jvm.hotspot.utilities.*; |
36 | 37 |
37 /** This class is only public to allow using the VMObjectFactory to | 38 /** This class is only public to allow using the VMObjectFactory to |
38 instantiate these. | 39 instantiate these. |
84 if (fp == null) { | 85 if (fp == null) { |
85 return null; // no information | 86 return null; // no information |
86 } | 87 } |
87 Address pc = thread.getLastJavaPC(); | 88 Address pc = thread.getLastJavaPC(); |
88 if ( pc != null ) { | 89 if ( pc != null ) { |
89 return new AMD64Frame(thread.getLastJavaSP(), fp, pc); | 90 return new X86Frame(thread.getLastJavaSP(), fp, pc); |
90 } else { | 91 } else { |
91 return new AMD64Frame(thread.getLastJavaSP(), fp); | 92 return new X86Frame(thread.getLastJavaSP(), fp); |
92 } | 93 } |
93 } | 94 } |
94 | 95 |
95 public RegisterMap newRegisterMap(JavaThread thread, boolean updateMap) { | 96 public RegisterMap newRegisterMap(JavaThread thread, boolean updateMap) { |
96 return new AMD64RegisterMap(thread, updateMap); | 97 return new X86RegisterMap(thread, updateMap); |
97 } | 98 } |
98 | 99 |
99 public Frame getCurrentFrameGuess(JavaThread thread, Address addr) { | 100 public Frame getCurrentFrameGuess(JavaThread thread, Address addr) { |
100 ThreadProxy t = getThreadProxy(addr); | 101 ThreadProxy t = getThreadProxy(addr); |
101 AMD64ThreadContext context = (AMD64ThreadContext) t.getContext(); | 102 AMD64ThreadContext context = (AMD64ThreadContext) t.getContext(); |
102 AMD64CurrentFrameGuess guesser = new AMD64CurrentFrameGuess(context, thread); | 103 AMD64CurrentFrameGuess guesser = new AMD64CurrentFrameGuess(context, thread); |
103 if (!guesser.run(GUESS_SCAN_RANGE)) { | 104 if (!guesser.run(GUESS_SCAN_RANGE)) { |
104 return null; | 105 return null; |
105 } | 106 } |
106 if (guesser.getPC() == null) { | 107 if (guesser.getPC() == null) { |
107 return new AMD64Frame(guesser.getSP(), guesser.getFP()); | 108 return new X86Frame(guesser.getSP(), guesser.getFP()); |
108 } else { | 109 } else { |
109 return new AMD64Frame(guesser.getSP(), guesser.getFP(), guesser.getPC()); | 110 return new X86Frame(guesser.getSP(), guesser.getFP(), guesser.getPC()); |
110 } | 111 } |
111 } | 112 } |
112 | 113 |
113 public void printThreadIDOn(Address addr, PrintStream tty) { | 114 public void printThreadIDOn(Address addr, PrintStream tty) { |
114 tty.print(getThreadProxy(addr)); | 115 tty.print(getThreadProxy(addr)); |