OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2013, the Dart project authors. | 2 * Copyright (c) 2013, the Dart project authors. |
3 * | 3 * |
4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u se this file except | 4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u se this file except |
5 * in compliance with the License. You may obtain a copy of the License at | 5 * in compliance with the License. You may obtain a copy of the License at |
6 * | 6 * |
7 * http://www.eclipse.org/legal/epl-v10.html | 7 * http://www.eclipse.org/legal/epl-v10.html |
8 * | 8 * |
9 * Unless required by applicable law or agreed to in writing, software distribut ed under the License | 9 * Unless required by applicable law or agreed to in writing, software distribut ed under the License |
10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K IND, either express | 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K IND, either express |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
291 } | 291 } |
292 | 292 |
293 try { | 293 try { |
294 VmInterruptResult interruptResult = pause ? connection.interruptConditiona lly(isolate) | 294 VmInterruptResult interruptResult = pause ? connection.interruptConditiona lly(isolate) |
295 : VmInterruptResult.createNoopResult(connection); | 295 : VmInterruptResult.createNoopResult(connection); |
296 | 296 |
297 for (DartBreakpoint breakpoint : breakpoints) { | 297 for (DartBreakpoint breakpoint : breakpoints) { |
298 if (breakpoint.isBreakpointEnabled()) { | 298 if (breakpoint.isBreakpointEnabled()) { |
299 int line = breakpoint.getLine(); | 299 int line = breakpoint.getLine(); |
300 SetBreakpointHelper helper = new SetBreakpointHelper(isolate, breakpoi nt, line); | 300 SetBreakpointHelper helper = new SetBreakpointHelper(isolate, breakpoi nt, line); |
301 | |
301 // file path | 302 // file path |
302 String filePath = breakpoint.getActualFilePath(); | 303 String filePath = breakpoint.getActualFilePath(); |
303 if (filePath == null) { | 304 if (filePath == null) { |
304 continue; | 305 continue; |
305 } | 306 } |
307 | |
306 // try package: URL | 308 // try package: URL |
307 { | 309 { |
308 String url = getPackagesUrlForFilePath(filePath); | 310 String url = getPackagesUrlForFilePath(filePath); |
309 helper.setBreakpoint(url); | 311 helper.setBreakpoint(url); |
310 } | 312 } |
313 | |
311 // try file:// URL | 314 // try file:// URL |
312 { | 315 { |
313 String url = getAbsoluteUrlForFilePath(filePath); | 316 //String url = getAbsoluteUrlForFilePath(filePath); |
317 String url = getProjectRelativePath(breakpoint.getFile()); | |
314 helper.setBreakpoint(url); | 318 helper.setBreakpoint(url); |
315 } | 319 } |
316 } | 320 } |
317 } | 321 } |
318 | 322 |
319 interruptResult.resume(); | 323 interruptResult.resume(); |
320 } catch (IOException exception) { | 324 } catch (IOException exception) { |
321 DartDebugCorePlugin.logError(exception); | 325 DartDebugCorePlugin.logError(exception); |
322 } | 326 } |
323 } | 327 } |
(...skipping 18 matching lines...) Expand all Loading... | |
342 List<VmBreakpoint> breakpoints = entry.getValue(); | 346 List<VmBreakpoint> breakpoints = entry.getValue(); |
343 for (Iterator<VmBreakpoint> bpIter = breakpoints.iterator(); bpIter.hasNex t();) { | 347 for (Iterator<VmBreakpoint> bpIter = breakpoints.iterator(); bpIter.hasNex t();) { |
344 VmBreakpoint breakpoint = bpIter.next(); | 348 VmBreakpoint breakpoint = bpIter.next(); |
345 if (breakpoint.getIsolate() == isolate) { | 349 if (breakpoint.getIsolate() == isolate) { |
346 bpIter.remove(); | 350 bpIter.remove(); |
347 } | 351 } |
348 } | 352 } |
349 } | 353 } |
350 } | 354 } |
351 | 355 |
356 @SuppressWarnings("unused") | |
352 private String getAbsoluteUrlForFilePath(String filePath) { | 357 private String getAbsoluteUrlForFilePath(String filePath) { |
353 return new File(filePath).toURI().toString(); | 358 return new File(filePath).toURI().toString(); |
354 } | 359 } |
355 | 360 |
356 private String getPackagesUrlForFilePath(String filePath) { | 361 private String getPackagesUrlForFilePath(String filePath) { |
357 File javaFile = new File(filePath); | 362 File javaFile = new File(filePath); |
358 IFile resourceFile = ResourceUtil.getFile(javaFile); | 363 IFile resourceFile = ResourceUtil.getFile(javaFile); |
359 if (resourceFile == null) { | 364 if (resourceFile == null) { |
360 return null; | 365 return null; |
361 } | 366 } |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
398 | 403 |
399 if (boe == BreakOnExceptions.uncaught) { | 404 if (boe == BreakOnExceptions.uncaught) { |
400 pauseType = BreakOnExceptionsType.unhandled; | 405 pauseType = BreakOnExceptionsType.unhandled; |
401 } else if (boe == BreakOnExceptions.all) { | 406 } else if (boe == BreakOnExceptions.all) { |
402 pauseType = BreakOnExceptionsType.all; | 407 pauseType = BreakOnExceptionsType.all; |
403 } | 408 } |
404 | 409 |
405 return pauseType; | 410 return pauseType; |
406 } | 411 } |
407 | 412 |
413 private String getProjectRelativePath(IFile file) { | |
414 return file.getProjectRelativePath().toPortableString(); | |
scheglov
2014/10/20 21:07:13
What if we have 2 projects with lib/test.dart and
devoncarew
2014/10/20 21:37:35
Current behavior is that we set breakpoints for th
| |
415 } | |
416 | |
408 private boolean supportsBreakpoint(IBreakpoint breakpoint) { | 417 private boolean supportsBreakpoint(IBreakpoint breakpoint) { |
409 return target.supportsBreakpoint(breakpoint); | 418 return target.supportsBreakpoint(breakpoint); |
410 } | 419 } |
411 } | 420 } |
OLD | NEW |