Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(139)

Side by Side Diff: pkg/dartino_compiler/lib/debug_state.dart

Issue 1987673002: Initial Implementation of the vm-service protocol (Closed) Base URL: git@github.com:dartino/sdk.git@master
Patch Set: cleanup Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 } 45 }
46 46
47 class Breakpoint { 47 class Breakpoint {
48 final DartinoFunction function; 48 final DartinoFunction function;
49 final int bytecodeIndex; 49 final int bytecodeIndex;
50 final int id; 50 final int id;
51 String get methodName => function.name; 51 String get methodName => function.name;
52 52
53 Breakpoint(this.function, this.bytecodeIndex, this.id); 53 Breakpoint(this.function, this.bytecodeIndex, this.id);
54 54
55 String location(DebugState state) { 55 String locationString(DebugState state) {
56 return state.getDebugInfo(function).fileAndLineStringFor(bytecodeIndex); 56 return state.getDebugInfo(function).fileAndLineStringFor(bytecodeIndex);
57 } 57 }
58 58
59 SourceLocation location(DebugState state) {
60 return state.getDebugInfo(function).locationFor(bytecodeIndex);
61 }
62
59 String toString() => "id: '$id' method: '$methodName' " 63 String toString() => "id: '$id' method: '$methodName' "
60 "bytecode index: '$bytecodeIndex'"; 64 "bytecode index: '$bytecodeIndex'";
61 } 65 }
62 66
63 class BackTraceFrame { 67 class BackTraceFrame {
64 final DartinoFunction function; 68 final DartinoFunction function;
65 final int bytecodePointer; 69 final int bytecodePointer;
66 final IncrementalCompiler compiler; 70 final IncrementalCompiler compiler;
67 final DebugState debugState; 71 final DebugState debugState;
68 72
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 return (!topFrame.isVisible || 351 return (!topFrame.isVisible ||
348 currentLocation == null || 352 currentLocation == null ||
349 currentLocation.isSameSourceLevelLocationAs(previous) || 353 currentLocation.isSameSourceLevelLocationAs(previous) ||
350 currentLocation.node == null); 354 currentLocation.node == null);
351 } 355 }
352 356
353 SourceLocation sourceLocationForFrame(int frame) { 357 SourceLocation sourceLocationForFrame(int frame) {
354 return currentBackTrace.frames[frame].sourceLocation(); 358 return currentBackTrace.frames[frame].sourceLocation();
355 } 359 }
356 } 360 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698