From 4210112bfd33f500291d6d4791663e1a3fac236f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Crelier?= Date: Mon, 26 Aug 2019 17:27:04 +0000 Subject: [PATCH] [vm/debugger] Increase verbosity of --verbose-debug when setting breakpoints. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This helped investigate an async* issue. Also rename 'BP' to 'breakpoint'. Change-Id: Ie4f59c47b4282a4e19713e41afe996cfca55a16c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114462 Reviewed-by: Alexander Markov Commit-Queue: Régis Crelier --- runtime/vm/debugger.cc | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/runtime/vm/debugger.cc b/runtime/vm/debugger.cc index c1c62fb67ec..e8cba7e8970 100644 --- a/runtime/vm/debugger.cc +++ b/runtime/vm/debugger.cc @@ -3177,6 +3177,12 @@ void Debugger::MakeCodeBreakpointAt(const Function& func, if (code_bpt == NULL) { // No code breakpoint for this code exists; create one. code_bpt = new CodeBreakpoint(bytecode, loc->token_pos_, pc); + if (FLAG_verbose_debug) { + OS::PrintErr("Setting bytecode breakpoint at pos %s pc %#" Px + " offset %#" Px "\n", + loc->token_pos_.ToCString(), pc, + pc - bytecode.PayloadStart()); + } RegisterCodeBreakpoint(code_bpt); } code_bpt->set_bpt_location(loc); @@ -3210,6 +3216,12 @@ void Debugger::MakeCodeBreakpointAt(const Function& func, // No code breakpoint for this code exists; create one. code_bpt = new CodeBreakpoint(code, loc->token_pos_, lowest_pc, lowest_kind); + if (FLAG_verbose_debug) { + OS::PrintErr("Setting code breakpoint at pos %s pc %#" Px + " offset %#" Px "\n", + loc->token_pos_.ToCString(), lowest_pc, + lowest_pc - code.PayloadStart()); + } RegisterCodeBreakpoint(code_bpt); } code_bpt->set_bpt_location(loc); @@ -3493,10 +3505,9 @@ BreakpointLocation* Debugger::SetCodeBreakpoints( intptr_t line_number; intptr_t column_number; script.GetTokenLocation(breakpoint_pos, &line_number, &column_number); - OS::PrintErr( - "Resolved BP for " - "function '%s' at line %" Pd " col %" Pd "\n", - func.ToFullyQualifiedCString(), line_number, column_number); + OS::PrintErr("Resolved breakpoint for function '%s' at line %" Pd + " col %" Pd "\n", + func.ToFullyQualifiedCString(), line_number, column_number); } return loc; } @@ -4703,8 +4714,8 @@ void Debugger::HandleCodeChange(bool bytecode_loaded, const Function& func) { } else { if (FLAG_verbose_debug) { OS::PrintErr( - "Pending BP remains unresolved in inner bytecode function " - "'%s'\n", + "Pending breakpoint remains unresolved in " + "inner bytecode function '%s'\n", inner_function.ToFullyQualifiedCString()); } } @@ -4716,7 +4727,8 @@ void Debugger::HandleCodeChange(bool bytecode_loaded, const Function& func) { ASSERT(!inner_function.HasCode()); if (FLAG_verbose_debug) { OS::PrintErr( - "Pending BP remains unresolved in inner function '%s'\n", + "Pending breakpoint remains unresolved in " + "inner function '%s'\n", inner_function.ToFullyQualifiedCString()); } continue; @@ -4749,9 +4761,8 @@ void Debugger::HandleCodeChange(bool bytecode_loaded, const Function& func) { while (bpt != NULL) { if (FLAG_verbose_debug) { OS::PrintErr( - "Resolved BP %" Pd - " to pos %s, " - "function '%s' (requested range %s-%s, " + "Resolved breakpoint %" Pd + " to pos %s, function '%s' (requested range %s-%s, " "requested col %" Pd ")\n", bpt->id(), loc->token_pos().ToCString(), func.ToFullyQualifiedCString(), requested_pos.ToCString(),