OLD | NEW |
1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
4 | 4 |
5 library dartino.debug_state; | 5 library dartino.debug_state; |
6 | 6 |
7 import 'bytecodes.dart'; | 7 import 'bytecodes.dart'; |
8 import 'dartino_system.dart'; | 8 import 'dartino_system.dart'; |
9 import 'incremental/dartino_compiler_incremental.dart'; | 9 import 'incremental/dartino_compiler_incremental.dart'; |
10 import 'vm_context.dart'; | 10 import 'vm_context.dart'; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 } | 53 } |
54 | 54 |
55 class Breakpoint { | 55 class Breakpoint { |
56 final DartinoFunction function; | 56 final DartinoFunction function; |
57 final int bytecodeIndex; | 57 final int bytecodeIndex; |
58 final int id; | 58 final int id; |
59 String get methodName => function.name; | 59 String get methodName => function.name; |
60 | 60 |
61 Breakpoint(this.function, this.bytecodeIndex, this.id); | 61 Breakpoint(this.function, this.bytecodeIndex, this.id); |
62 | 62 |
63 String location(DebugState state) { | 63 String locationString(DebugState state) { |
64 return state.getDebugInfo(function).fileAndLineStringFor(bytecodeIndex); | 64 return state.getDebugInfo(function).fileAndLineStringFor(bytecodeIndex); |
65 } | 65 } |
66 | 66 |
| 67 SourceLocation location(DebugState state) { |
| 68 return state.getDebugInfo(function).locationFor(bytecodeIndex); |
| 69 } |
| 70 |
67 String toString() => "id: '$id' method: '$methodName' " | 71 String toString() => "id: '$id' method: '$methodName' " |
68 "bytecode index: '$bytecodeIndex'"; | 72 "bytecode index: '$bytecodeIndex'"; |
69 } | 73 } |
70 | 74 |
71 class BackTraceFrame { | 75 class BackTraceFrame { |
72 final DartinoFunction function; | 76 final DartinoFunction function; |
73 final int bytecodePointer; | 77 final int bytecodePointer; |
74 final IncrementalCompiler compiler; | 78 final IncrementalCompiler compiler; |
75 final DebugState debugState; | 79 final DebugState debugState; |
76 | 80 |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 return (!topFrame.isVisible || | 359 return (!topFrame.isVisible || |
356 currentLocation == null || | 360 currentLocation == null || |
357 currentLocation.isSameSourceLevelLocationAs(previous) || | 361 currentLocation.isSameSourceLevelLocationAs(previous) || |
358 currentLocation.node == null); | 362 currentLocation.node == null); |
359 } | 363 } |
360 | 364 |
361 SourceLocation sourceLocationForFrame(int frame) { | 365 SourceLocation sourceLocationForFrame(int frame) { |
362 return currentBackTrace.frames[frame].sourceLocation(); | 366 return currentBackTrace.frames[frame].sourceLocation(); |
363 } | 367 } |
364 } | 368 } |
OLD | NEW |