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

Unified Diff: runtime/vm/debugger.cc

Issue 2965673004: Fix setting breakpoints in parts of a library. (Closed)
Patch Set: Created 3 years, 6 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/tests/vm/vm.status ('k') | runtime/vm/debugger_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/debugger.cc
diff --git a/runtime/vm/debugger.cc b/runtime/vm/debugger.cc
index 96eea3b9a8c72e516d3cd71e8225758be78a66e7..6bfbede60abb9d9e5554b8acfd88fed330125959 100644
--- a/runtime/vm/debugger.cc
+++ b/runtime/vm/debugger.cc
@@ -2710,6 +2710,8 @@ bool Debugger::FindBestFit(const Script& script,
Function* best_fit) {
Zone* zone = Thread::Current()->zone();
Class& cls = Class::Handle(zone);
+ Library& lib = Library::Handle(zone, script.FindLibrary());
+ ASSERT(!lib.IsNull());
const GrowableObjectArray& closures = GrowableObjectArray::Handle(
zone, isolate_->object_store()->closure_functions());
Array& functions = Array::Handle(zone);
@@ -2740,7 +2742,9 @@ bool Debugger::FindBestFit(const Script& script,
continue;
}
cls = class_table.At(i);
- if (cls.script() != script.raw()) {
+ // This class is relevant to us only if it belongs to the
+ // library to which |script| belongs.
+ if (cls.library() != lib.raw()) {
continue;
}
// Parse class definition if not done yet.
@@ -2786,6 +2790,11 @@ bool Debugger::FindBestFit(const Script& script,
TokenPosition end;
field ^= fields.At(pos);
ASSERT(!field.IsNull());
+ if (field.Script() != script.raw()) {
+ // The field should be defined in the script we want to set
+ // the breakpoint in.
+ continue;
+ }
if (Parser::FieldHasFunctionLiteralInitializer(field, &start, &end)) {
if ((start <= token_pos && token_pos <= end) ||
(token_pos <= start && start <= last_token_pos)) {
« no previous file with comments | « runtime/tests/vm/vm.status ('k') | runtime/vm/debugger_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698