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

Side by Side Diff: tools/coverage.dart

Issue 23526056: Make Dart_ScriptGetTokenInfo account for line_offset() and col_offset() (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: address comment Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/debugger_api_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart 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 file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // This test forks a second vm process that runs a dart script as 5 // This test forks a second vm process that runs a dart script as
6 // a debug target, single stepping through the entire program, and 6 // a debug target, single stepping through the entire program, and
7 // recording each breakpoint. At the end, a coverage map of the source 7 // recording each breakpoint. At the end, a coverage map of the source
8 // is printed. 8 // is printed.
9 // 9 //
10 // Usage: dart coverage.dart [--wire] [--verbose] target_script.dart 10 // Usage: dart coverage.dart [--wire] [--verbose] target_script.dart
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 71
72 Source(this.url); 72 Source(this.url);
73 73
74 void recordBp(int tokenPos) { 74 void recordBp(int tokenPos) {
75 var count = tokenCounts[tokenPos]; 75 var count = tokenCounts[tokenPos];
76 tokenCounts[tokenPos] = count == null ? 1 : count + 1; 76 tokenCounts[tokenPos] = count == null ? 1 : count + 1;
77 } 77 }
78 78
79 void SetLineInfo(List lineInfoTable) { 79 void SetLineInfo(List lineInfoTable) {
80 // Each line is encoded as an array with first element being the line 80 // Each line is encoded as an array with first element being the line
81 // number, followed by pairs of (tokenPosition, textOffset). 81 // number, followed by pairs of (tokenPosition, columnNumber).
82 lineInfoTable.forEach((List<int> line) { 82 lineInfoTable.forEach((List<int> line) {
83 int lineNumber = line[0]; 83 int lineNumber = line[0];
84 for (int t = 1; t < line.length; t += 2) { 84 for (int t = 1; t < line.length; t += 2) {
85 assert(tokenPosToLine[line[t]] == null); 85 assert(tokenPosToLine[line[t]] == null);
86 tokenPosToLine[line[t]] = lineNumber; 86 tokenPosToLine[line[t]] = lineNumber;
87 } 87 }
88 }); 88 });
89 } 89 }
90 90
91 // Print out the annotated source code. For each line that has seen 91 // Print out the annotated source code. For each line that has seen
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 targetOpts.add(str); 538 targetOpts.add(str);
539 break; 539 break;
540 } 540 }
541 } 541 }
542 542
543 Process.start(options.executable, targetOpts).then((Process process) { 543 Process.start(options.executable, targetOpts).then((Process process) {
544 process.stdin.close(); 544 process.stdin.close();
545 debugger = new Debugger(process); 545 debugger = new Debugger(process);
546 }); 546 });
547 } 547 }
OLDNEW
« no previous file with comments | « runtime/vm/debugger_api_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698