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

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: hausner review 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
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 107ad5dffecb28d3d5767a2e978853cf94a68107..ed08883e88b73967f8689540e48b266e3a2ef40e 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -8620,7 +8620,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) {
@@ -8642,6 +8643,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;
+ }
+ }
// On the first line of the script we must add the column offset.
if (relative_line == 1) {
*column += col_offset();
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698