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

Unified Diff: runtime/vm/object.cc

Issue 1312763010: Support column-based breakpoints in the VM and Observatory. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 1fcbdb078b7d49285b5c5bea5664e2b39b3a753b..032733222dddb4b474a3e2fce2f5f0d06566c3cb 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -8592,7 +8592,8 @@ void Script::SetLocationOffset(intptr_t line_offset,
void Script::GetTokenLocation(intptr_t token_pos,
intptr_t* line,
- intptr_t* column) const {
+ intptr_t* column,
+ intptr_t* token_len) const {
ASSERT(line != NULL);
const TokenStream& tkns = TokenStream::Handle(tokens());
if (column == NULL) {
@@ -8614,6 +8615,13 @@ void Script::GetTokenLocation(intptr_t token_pos,
intptr_t relative_line = scanner.CurrentPosition().line;
*line = relative_line + line_offset();
*column = scanner.CurrentPosition().column;
+ if (token_len != NULL) {
+ if (scanner.current_token().literal != NULL) {
+ *token_len = scanner.current_token().literal->Length();
+ } else {
+ *token_len = 1;
rmacnak 2015/09/03 00:55:19 Maybe otherwise keyword length?
turnidge 2015/09/04 18:05:29 My hope was that the literal pointed to the keywor
+ }
+ }
// On the first line of the script we must add the column offset.
if (relative_line == 1) {
*column += col_offset();

Powered by Google App Engine
This is Rietveld 408576698