Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 #include "vm/debugger.h" | 5 #include "vm/debugger.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 | 8 |
| 9 #include "vm/code_generator.h" | 9 #include "vm/code_generator.h" |
| 10 #include "vm/code_patcher.h" | 10 #include "vm/code_patcher.h" |
| (...skipping 1224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1235 } | 1235 } |
| 1236 intptr_t first_token_idx, last_token_idx; | 1236 intptr_t first_token_idx, last_token_idx; |
| 1237 script.TokenRangeAtLine(line_number, &first_token_idx, &last_token_idx); | 1237 script.TokenRangeAtLine(line_number, &first_token_idx, &last_token_idx); |
| 1238 if (first_token_idx < 0) { | 1238 if (first_token_idx < 0) { |
| 1239 // Script does not contain the given line number. | 1239 // Script does not contain the given line number. |
| 1240 if (FLAG_verbose_debug) { | 1240 if (FLAG_verbose_debug) { |
| 1241 OS::Print("Script '%s' does not contain line number %"Pd"\n", | 1241 OS::Print("Script '%s' does not contain line number %"Pd"\n", |
| 1242 script_url.ToCString(), line_number); | 1242 script_url.ToCString(), line_number); |
| 1243 } | 1243 } |
| 1244 return NULL; | 1244 return NULL; |
| 1245 } else if (last_token_idx < 0) { | |
| 1246 // Line does not contain any tokens. first_toekn_index is the first | |
|
regis
2013/05/24 16:07:32
first_token_index
hausner
2013/05/24 16:23:43
Done.
| |
| 1247 // token after the given line. We check whether that token is | |
| 1248 // part of a function. | |
| 1249 last_token_idx = first_token_idx; | |
| 1245 } | 1250 } |
| 1246 | 1251 |
| 1247 Function& func = Function::Handle(isolate_); | 1252 Function& func = Function::Handle(isolate_); |
| 1248 while (first_token_idx <= last_token_idx) { | 1253 while (first_token_idx <= last_token_idx) { |
| 1249 func = lib.LookupFunctionInScript(script, first_token_idx); | 1254 func = lib.LookupFunctionInScript(script, first_token_idx); |
| 1250 if (!func.IsNull()) { | 1255 if (!func.IsNull()) { |
| 1251 break; | 1256 break; |
| 1252 } | 1257 } |
| 1253 first_token_idx++; | 1258 first_token_idx++; |
| 1254 } | 1259 } |
| (...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1830 } | 1835 } |
| 1831 | 1836 |
| 1832 | 1837 |
| 1833 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { | 1838 void Debugger::RegisterCodeBreakpoint(CodeBreakpoint* bpt) { |
| 1834 ASSERT(bpt->next() == NULL); | 1839 ASSERT(bpt->next() == NULL); |
| 1835 bpt->set_next(code_breakpoints_); | 1840 bpt->set_next(code_breakpoints_); |
| 1836 code_breakpoints_ = bpt; | 1841 code_breakpoints_ = bpt; |
| 1837 } | 1842 } |
| 1838 | 1843 |
| 1839 } // namespace dart | 1844 } // namespace dart |
| OLD | NEW |