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

Issue 2431223006: Add stacktrace_test (Closed)

Created:
4 years, 2 months ago by Johnni Winther
Modified:
4 years, 1 month ago
CC:
reviews_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Add stacktrace_test - also add helper program for working with sourcemaps. R=sigmund@google.com Committed: https://github.com/dart-lang/sdk/commit/d153808ca647c0c4e9484b903848851b4d314b50

Patch Set 1 #

Patch Set 2 : Support d8 access on linux/macos #

Total comments: 15

Patch Set 3 : Updated cf. comments. #

Patch Set 4 : Updated cf. comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1026 lines, -5 lines) Patch
M pkg/compiler/lib/src/dart2js.dart View 1 chunk +1 line, -0 lines 0 comments Download
M pkg/compiler/lib/src/io/position_information.dart View 2 chunks +3 lines, -1 line 0 comments Download
M tests/compiler/dart2js/sourcemaps/diff_view.dart View 2 chunks +2 lines, -3 lines 0 comments Download
A tests/compiler/dart2js/sourcemaps/lax_json.dart View 1 2 3 1 chunk +296 lines, -0 lines 0 comments Download
A tests/compiler/dart2js/sourcemaps/lax_json_test.dart View 1 2 3 1 chunk +65 lines, -0 lines 0 comments Download
A tests/compiler/dart2js/sourcemaps/load.dart View 1 chunk +97 lines, -0 lines 0 comments Download
A tests/compiler/dart2js/sourcemaps/load_save_test.dart View 1 chunk +76 lines, -0 lines 0 comments Download
A tests/compiler/dart2js/sourcemaps/save.dart View 1 2 3 1 chunk +141 lines, -0 lines 0 comments Download
A tests/compiler/dart2js/sourcemaps/stacktrace_test.dart View 1 2 1 chunk +344 lines, -0 lines 0 comments Download
M tests/compiler/dart2js/sourcemaps/trace_graph.dart View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 11 (3 generated)
Johnni Winther
Please test stacktrace_test this for a spin on Linux/MacOS
4 years, 2 months ago (2016-10-20 13:49:55 UTC) #3
Johnni Winther
ping
4 years, 1 month ago (2016-10-24 08:22:06 UTC) #4
Siggi Cherem (dart-lang)
sorry - I thought I had sent these comments earlier, seems I forgot to publish. ...
4 years, 1 month ago (2016-10-27 13:25:19 UTC) #5
Johnni Winther
https://codereview.chromium.org/2431223006/diff/20001/tests/compiler/dart2js/sourcemaps/lazon.dart File tests/compiler/dart2js/sourcemaps/lazon.dart (right): https://codereview.chromium.org/2431223006/diff/20001/tests/compiler/dart2js/sourcemaps/lazon.dart#newcode11 tests/compiler/dart2js/sourcemaps/lazon.dart:11: library lazon; On 2016/10/27 13:25:19, Siggi Cherem (dart-lang) wrote: ...
4 years, 1 month ago (2016-11-02 14:34:31 UTC) #6
Siggi Cherem (dart-lang)
lgtm https://codereview.chromium.org/2431223006/diff/20001/tests/compiler/dart2js/sourcemaps/stacktrace_test.dart File tests/compiler/dart2js/sourcemaps/stacktrace_test.dart (right): https://codereview.chromium.org/2431223006/diff/20001/tests/compiler/dart2js/sourcemaps/stacktrace_test.dart#newcode240 tests/compiler/dart2js/sourcemaps/stacktrace_test.dart:240: int lastColon = text.lastIndexOf(':'); On 2016/11/02 14:34:30, Johnni ...
4 years, 1 month ago (2016-11-02 15:25:24 UTC) #7
Johnni Winther
https://codereview.chromium.org/2431223006/diff/20001/tests/compiler/dart2js/sourcemaps/stacktrace_test.dart File tests/compiler/dart2js/sourcemaps/stacktrace_test.dart (right): https://codereview.chromium.org/2431223006/diff/20001/tests/compiler/dart2js/sourcemaps/stacktrace_test.dart#newcode240 tests/compiler/dart2js/sourcemaps/stacktrace_test.dart:240: int lastColon = text.lastIndexOf(':'); On 2016/11/02 15:25:24, Siggi Cherem ...
4 years, 1 month ago (2016-11-03 09:20:18 UTC) #8
Johnni Winther
Committed patchset #4 (id:60001) manually as d153808ca647c0c4e9484b903848851b4d314b50 (presubmit successful).
4 years, 1 month ago (2016-11-03 10:00:57 UTC) #10
Johnni Winther
4 years, 1 month ago (2016-11-03 11:21:10 UTC) #11
Message was sent while issue was closed.
https://codereview.chromium.org/2431223006/diff/20001/tests/compiler/dart2js/...
File tests/compiler/dart2js/sourcemaps/stacktrace_test.dart (right):

https://codereview.chromium.org/2431223006/diff/20001/tests/compiler/dart2js/...
tests/compiler/dart2js/sourcemaps/stacktrace_test.dart:240: int lastColon =
text.lastIndexOf(':');
On 2016/11/03 09:20:18, Johnni Winther wrote:
> On 2016/11/02 15:25:24, Siggi Cherem (dart-lang) wrote:
> > On 2016/11/02 14:34:30, Johnni Winther wrote:
> > > On 2016/10/27 13:25:19, Siggi Cherem (dart-lang) wrote:
> > > > idea: consider splitting text by ':' first, then the case analysis below
> > might
> > > > get collapsed/simplified?
> > > > 
> > > > var segments = text.split(':');
> > > > var fileName = segments[0];
> > > > var lineNo = (segments.length > 1) ? int.parse(segments[1], onError: (_)
> =>
> > > > null) : null;
> > > > var columnNo = (segments.length > 2) ? int.parse(segments[2], onError:
(_)
> > =>
> > > > null): null;
> > > 
> > > Doesn't work on Windows - file names may contain :
> > 
> > I see, for this specific case, is it because the drive name will show up in
> the
> > stack trace?
> > 
> > It might still be worth to keep the "split" logic separate from how you
> convert
> > those values to line/file/column numbers. For example, with some ad-hoc
split
> > function:
> > 
> > _split(t) {
> >   var i1 = t.lastIndexOf(':');
> >   var i2 = t.lastIndexOf(':', i1 - 1);
> >   var result = [];
> >   int start = 0;
> >   if (i2 > 0) {
> >     result.add(t.substring(start, i2));
> >     start = i2 + 1;
> >   }
> >   if (i1 > 0) {
> >     result.add(t.substring(start, i1));
> >     start = i1 + 1;
> >   }
> >   result.add(t.substring(start));
> >   return result;
> > }
> > 
> 
> Alas `t.lastIndexOf(':', i1 - 1);` throws if `i1 - 1` is negative. That's way
> need to got backwards.

Should have been: That's why we need to go backwards.

Powered by Google App Engine
This is Rietveld 408576698