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

Unified Diff: runtime/vm/debugger.cc

Issue 2979163002: Allow setting breakpoints in function literal field initializers under --dfe. (Closed)
Patch Set: Address comments on patch set 2 Created 3 years, 5 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/kernel_binary_flowgraph.h » ('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 ac05de0b61080fde02d7aebad73df7c4c1eaafbb..396a86974a67a5e334543a3a445ae54da0175e85 100644
--- a/runtime/vm/debugger.cc
+++ b/runtime/vm/debugger.cc
@@ -16,6 +16,7 @@
#include "vm/flags.h"
#include "vm/globals.h"
#include "vm/json_stream.h"
+#include "vm/kernel_reader.h"
#include "vm/longjump.h"
#include "vm/message_handler.h"
#include "vm/object.h"
@@ -57,6 +58,7 @@ DEFINE_FLAG(bool,
"the VM service.");
DECLARE_FLAG(bool, warn_on_pause_with_no_debugger);
+DECLARE_FLAG(bool, use_dart_frontend);
#ifndef PRODUCT
@@ -2662,7 +2664,25 @@ bool Debugger::FindBestFit(const Script& script,
// the breakpoint in.
continue;
}
- if (Parser::FieldHasFunctionLiteralInitializer(field, &start, &end)) {
+ if (!field.has_initializer()) {
+ continue;
+ }
+
+ bool has_func_literal_initializer = false;
+#ifndef DART_PRECOMPILED_RUNTIME
+ if (FLAG_use_dart_frontend) {
+ has_func_literal_initializer =
+ kernel::KernelReader::FieldHasFunctionLiteralInitializer(
+ field, &start, &end);
+ } else {
+#endif // !DART_PRECOMPILED_RUNTIME
+ has_func_literal_initializer =
+ Parser::FieldHasFunctionLiteralInitializer(field, &start, &end);
+#ifndef DART_PRECOMPILED_RUNTIME
+ }
+#endif // !DART_PRECOMPILED_RUNTIME
+
+ if (has_func_literal_initializer) {
if ((start <= token_pos && token_pos <= end) ||
(token_pos <= start && start <= last_token_pos)) {
return true;
« no previous file with comments | « runtime/tests/vm/vm.status ('k') | runtime/vm/kernel_binary_flowgraph.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698