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

Unified Diff: runtime/vm/debugger.cc

Issue 116223006: Fix setting breakpoint in non-finalized class (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 12 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 | « no previous file | tests/standalone/debugger/local_function_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/debugger.cc
===================================================================
--- runtime/vm/debugger.cc (revision 31442)
+++ runtime/vm/debugger.cc (working copy)
@@ -1392,6 +1392,13 @@
for (intptr_t i = 1; i < num_classes; i++) {
if (class_table.HasValidClassAt(i)) {
cls = class_table.At(i);
+ // If the class is not finalized, e.g. if it hasn't been parsed
+ // yet entirely, we can ignore it. If it contains a function with
+ // a latent breakpoint, we will detect it if and when the function
+ // gets compiled.
+ if (!cls.is_finalized()) {
+ continue;
+ }
// Note: we need to check the functions of this class even if
// the class is defined in a differenct 'script'. There could
// be mixin functions from the given script in this class.
@@ -1475,9 +1482,17 @@
for (intptr_t i = 1; i < num_classes; i++) {
if (class_table.HasValidClassAt(i)) {
cls = class_table.At(i);
- // Note: we need to check the functions of this class even if
- // the class is defined in a differenct 'script'. There could
+ // Note: if this class has been parsed and finalized already,
+ // we need to check the functions of this class even if
+ // it is defined in a differenct 'script'. There could
// be mixin functions from the given script in this class.
+ // However, if this class is not parsed yet (not finalized),
+ // we can ignore it and avoid the side effect of parsing it.
+ if ((cls.script() != script.raw()) && !cls.is_finalized()) {
+ continue;
+ }
+ // Parse class definition if not done yet.
+ cls.EnsureIsFinalized(isolate_);
Ivan Posva 2014/01/03 20:21:13 What happens if there is a compilation failure dur
hausner 2014/01/03 20:52:52 The compilation error gets dropped and the class r
functions = cls.functions();
if (!functions.IsNull()) {
const intptr_t num_functions = functions.Length();
« no previous file with comments | « no previous file | tests/standalone/debugger/local_function_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698