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

Unified Diff: runtime/vm/object.cc

Issue 10839002: Better breakpoint management (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
« runtime/vm/debugger.cc ('K') | « runtime/vm/debugger.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 10018)
+++ runtime/vm/object.cc (working copy)
@@ -5101,15 +5101,17 @@
void Script::TokenRangeAtLine(intptr_t line_number,
intptr_t* first_token_index,
intptr_t* last_token_index) const {
siva 2012/07/30 22:17:15 Something to consider for later, not this CL: we
hausner 2012/07/30 22:36:57 I agree. I was confused too and didn't realize tha
- intptr_t first_src_pos;
- intptr_t last_src_pos;
const String& src = String::Handle(Source());
const String& dummy_key = String::Handle(Symbols::Empty());
const TokenStream& tkns = TokenStream::Handle(tokens());
Scanner scanner(src, dummy_key);
- scanner.TokenRangeAtLine(line_number, &first_src_pos, &last_src_pos);
- *first_token_index = tkns.ComputeTokenPosition(first_src_pos);
- *last_token_index = tkns.ComputeTokenPosition(last_src_pos);
+ scanner.TokenRangeAtLine(line_number, first_token_index, last_token_index);
+ if (*first_token_index >= 0) {
+ *first_token_index = tkns.ComputeTokenPosition(*first_token_index);
+ }
+ if (*last_token_index >= 0) {
+ *last_token_index = tkns.ComputeTokenPosition(*last_token_index);
+ }
}
« runtime/vm/debugger.cc ('K') | « runtime/vm/debugger.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698