Chromium Code Reviews| Index: plugins/org.chromium.debug.core/src/org/chromium/debug/core/model/BreakpointSynchronizer.java |
| diff --git a/plugins/org.chromium.debug.core/src/org/chromium/debug/core/model/BreakpointSynchronizer.java b/plugins/org.chromium.debug.core/src/org/chromium/debug/core/model/BreakpointSynchronizer.java |
| index a709b9cb9963f8a5dca1f6c75512319f64887c69..fcfc884cc3b2423dba9898af58d33c64168c40e0 100644 |
| --- a/plugins/org.chromium.debug.core/src/org/chromium/debug/core/model/BreakpointSynchronizer.java |
| +++ b/plugins/org.chromium.debug.core/src/org/chromium/debug/core/model/BreakpointSynchronizer.java |
| @@ -4,6 +4,8 @@ |
| package org.chromium.debug.core.model; |
| +import static org.chromium.debug.core.util.ChromiumDebugPluginUtil.getSafe; |
| + |
| import java.util.ArrayList; |
| import java.util.Collection; |
| import java.util.Collections; |
| @@ -217,6 +219,9 @@ public class BreakpointSynchronizer { |
| for (Breakpoint sdkBreakpoint : sdkBreakpointsToCreate) { |
| Object sourceElement = sourceDirector.getSourceElement(sdkBreakpoint); |
| if (sourceElement instanceof IFile == false) { |
| + statusBuilder.getReportBuilder().addProblem( |
| + ReportBuilder.Problem.UNRESOLVED_REMOTE_BREAKPOINT, |
| + sdkBreakpoint.getScriptName()); |
| continue; |
| } |
| // We do not actually support working files for scripts with offset. |
| @@ -394,9 +399,16 @@ public class BreakpointSynchronizer { |
| return toString(); |
| } |
| } |
| + enum Problem { |
|
apavlov
2011/06/14 14:54:36
blank above
Peter Rybin
2011/06/16 08:50:24
Done.
|
| + UNRESOLVED_REMOTE_BREAKPOINT; |
| + String getVisibleName() { |
| + return toString(); |
| + } |
| + } |
| private final Direction direction; |
| private final Map<Property, AtomicInteger> counters; |
| + private final Map<Problem, List<String>> problems; |
| ReportBuilder(Direction direction) { |
| this.direction = direction; |
| @@ -404,12 +416,22 @@ public class BreakpointSynchronizer { |
| for (Property property : Property.class.getEnumConstants()) { |
| counters.put(property, new AtomicInteger(0)); |
| } |
| + problems = new HashMap<Problem, List<String>>(1); |
| } |
| public void increment(Property property) { |
| counters.get(property).addAndGet(1); |
| } |
| + public synchronized void addProblem(Problem problem, String message) { |
| + List<String> list = getSafe(problems, problem); |
| + if (list == null) { |
| + list = new ArrayList<String>(); |
| + problems.put(problem, list); |
| + } |
| + list.add(message); |
| + } |
| + |
| public String build() { |
| StringBuilder builder = new StringBuilder(); |
| builder.append("direction=").append(direction); //$NON-NLS-1$ |
| @@ -421,6 +443,9 @@ public class BreakpointSynchronizer { |
| builder.append(" ").append(en.getKey().getVisibleName()); //$NON-NLS-1$ |
| builder.append("=").append(number); //$NON-NLS-1$ |
| } |
| + if (!problems.isEmpty()) { |
| + builder.append('\n').append(problems.toString()); |
| + } |
| return builder.toString(); |
| } |
| } |
| @@ -477,13 +502,13 @@ public class BreakpointSynchronizer { |
| @Override |
| VmResourceId getVmResourceId(Breakpoint breakpoint) { |
| if (breakpoint.getType() == Breakpoint.Type.SCRIPT_NAME) { |
| - return VmResourceId.forName(breakpoint.getScriptName()); |
| + return new VmResourceId(breakpoint.getScriptName(), null); |
| } else { |
| Long scriptId = breakpoint.getScriptId(); |
| if (scriptId == null) { |
| return null; |
| } |
| - return VmResourceId.forId(scriptId); |
| + return new VmResourceId(null, scriptId); |
| } |
| } |
| }; |
| @@ -610,7 +635,7 @@ public class BreakpointSynchronizer { |
| Set<WrappedBreakpoint> result = new HashSet<WrappedBreakpoint>(); |
| BreakpointWrapManager wrapManager = ChromiumDebugPlugin.getDefault().getBreakpointWrapManager(); |
| - |
| + |
| for (JavaScriptBreakpointAdapter adapter : wrapManager.getAdapters()) { |
| for (IBreakpoint breakpoint : breakpointManager.getBreakpoints(adapter.getModelId())) { |
| WrappedBreakpoint breakpointWrapper = adapter.tryWrapBreakpoint(breakpoint); |