Adds attribute, indicating that breakpoint was installed in TeaVM

This commit is contained in:
konsoletyper 2014-08-13 21:34:46 +04:00
parent c0dc459f22
commit 14fdf9b797
3 changed files with 8 additions and 11 deletions

View File

@ -99,7 +99,7 @@ class LocationGraphBuilder {
for (Map.Entry<InstructionLocation, Set<InstructionLocation>> entry : graphBuilder.entrySet()) { for (Map.Entry<InstructionLocation, Set<InstructionLocation>> entry : graphBuilder.entrySet()) {
InstructionLocation[] successors = entry.getValue().toArray(new InstructionLocation[0]); InstructionLocation[] successors = entry.getValue().toArray(new InstructionLocation[0]);
for (int i = 0; i < successors.length; ++i) { for (int i = 0; i < successors.length; ++i) {
if (successors[i].getLine() < 0) { if (successors[i] != null && successors[i].getLine() < 0) {
successors[i] = null; successors[i] = null;
} }
} }

View File

@ -27,8 +27,8 @@
<classpathentry exported="true" kind="lib" path="lib/logback-classic-1.1.2.jar"/> <classpathentry exported="true" kind="lib" path="lib/logback-classic-1.1.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/logback-core-1.1.2.jar"/> <classpathentry exported="true" kind="lib" path="lib/logback-core-1.1.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/slf4j-api-1.7.7.jar"/> <classpathentry exported="true" kind="lib" path="lib/slf4j-api-1.7.7.jar"/>
<classpathentry exported="true" kind="lib" path="lib/teavm-chrome-rdp-0.2-SNAPSHOT.jar"/> <classpathentry exported="true" kind="lib" path="lib/teavm-chrome-rdp-0.2-SNAPSHOT.jar" sourcepath="/teavm-chrome-rdp"/>
<classpathentry exported="true" kind="lib" path="lib/teavm-core-0.2-SNAPSHOT.jar"/> <classpathentry exported="true" kind="lib" path="lib/teavm-core-0.2-SNAPSHOT.jar" sourcepath="/teavm-core"/>
<classpathentry exported="true" kind="lib" path="lib/websocket-api-9.2.1.v20140609.jar"/> <classpathentry exported="true" kind="lib" path="lib/websocket-api-9.2.1.v20140609.jar"/>
<classpathentry exported="true" kind="lib" path="lib/websocket-client-9.2.1.v20140609.jar"/> <classpathentry exported="true" kind="lib" path="lib/websocket-client-9.2.1.v20140609.jar"/>
<classpathentry exported="true" kind="lib" path="lib/websocket-common-9.2.1.v20140609.jar"/> <classpathentry exported="true" kind="lib" path="lib/websocket-common-9.2.1.v20140609.jar"/>

View File

@ -2,7 +2,6 @@ package org.teavm.eclipse.debugger;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap; import java.util.concurrent.ConcurrentMap;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IMarkerDelta; import org.eclipse.core.resources.IMarkerDelta;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.DebugEvent; import org.eclipse.debug.core.DebugEvent;
@ -31,7 +30,7 @@ public class TeaVMDebugTarget implements IDebugTarget, IStep {
private TeaVMDebugProcess process; private TeaVMDebugProcess process;
private TeaVMThread thread; private TeaVMThread thread;
ConcurrentMap<IBreakpoint, Breakpoint> breakpointMap = new ConcurrentHashMap<>(); ConcurrentMap<IBreakpoint, Breakpoint> breakpointMap = new ConcurrentHashMap<>();
ConcurrentMap<Breakpoint, IBreakpoint> breakpointBackMap = new ConcurrentHashMap<>(); ConcurrentMap<Breakpoint, IJavaLineBreakpoint> breakpointBackMap = new ConcurrentHashMap<>();
public TeaVMDebugTarget(ILaunch launch, final Debugger teavmDebugger, ChromeRDPServer server) { public TeaVMDebugTarget(ILaunch launch, final Debugger teavmDebugger, ChromeRDPServer server) {
this.launch = launch; this.launch = launch;
@ -78,17 +77,15 @@ public class TeaVMDebugTarget implements IDebugTarget, IStep {
} }
private void updateBreakpoint(Breakpoint teavmBreakpoint) { private void updateBreakpoint(Breakpoint teavmBreakpoint) {
IBreakpoint breakpoint = breakpointBackMap.get(teavmBreakpoint); IJavaLineBreakpoint breakpoint = breakpointBackMap.get(teavmBreakpoint);
if (breakpoint != null) { if (breakpoint != null) {
try { try {
if (!teavmBreakpoint.isValid() && teavmDebugger.isAttached()) { if (!teavmBreakpoint.isValid() && teavmDebugger.isAttached()) {
breakpoint.getMarker().setAttribute(IMarker.PROBLEM, breakpoint.getMarker().setAttribute("org.eclipse.jdt.debug.core.installCount", 0);
"Can't transfer this breakpoint to browser");
breakpoint.getMarker().setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_WARNING);
} else { } else {
breakpoint.getMarker().setAttribute(IMarker.PROBLEM, null); breakpoint.getMarker().setAttribute("org.eclipse.jdt.debug.core.installCount", 1);
breakpoint.getMarker().setAttribute(IMarker.SEVERITY, null);
} }
DebugPlugin.getDefault().getBreakpointManager().fireBreakpointChanged(breakpoint);
} catch (CoreException e) { } catch (CoreException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }