3749 {
3750 if (latent_locations_ == nullptr) {
3751
3752 return;
3753 }
3755 auto isolate_group = thread->isolate_group();
3756 auto zone = thread->zone();
3762 const GrowableObjectArray&
libs =
3764
3765 GrowableHandlePtrArray<const Script>
scripts(zone, 1);
3766 while (loc != nullptr) {
3767 url = loc->url();
3768 bool found_match = false;
3769 bool is_package = url.StartsWith(Symbols::PackageScheme());
3770 for (intptr_t i = 0; i <
libs.Length(); i++) {
3772 script = lib.LookupScript(url, !is_package);
3775 }
3776 }
3778
3779
3780 found_match = true;
3782 loc = loc->next();
3783 if (prev_loc == nullptr) {
3784 latent_locations_ = loc;
3785 } else {
3786 prev_loc->set_next(loc);
3787 }
3788
3789
3790 intptr_t line_number = matched_loc->requested_line_number();
3791 intptr_t column_number = matched_loc->requested_column_number();
3792 ASSERT(line_number >= 0);
3793 TokenPosition first_token_pos = TokenPosition::kNoSource;
3794 TokenPosition last_token_pos = TokenPosition::kNoSource;
3795 scripts.At(0).TokenRangeAtLine(line_number, &first_token_pos,
3796 &last_token_pos);
3797 if (!first_token_pos.IsDebugPause() || !last_token_pos.IsDebugPause()) {
3798
3799
3800 Breakpoint* bpt = matched_loc->breakpoints();
3801 while (bpt != nullptr) {
3802 if (FLAG_verbose_debug) {
3804 ": "
3805 "dropping latent breakpoint %" Pd " in '%s'\n",
3806 line_number, bpt->id(), url.ToCString());
3807 }
3808 Breakpoint*
prev = bpt;
3809 bpt = bpt->next();
3811 }
3812 delete matched_loc;
3813 } else {
3814
3815
3816
3818 GetBreakpointLocation(url, first_token_pos, -1, column_number);
3819 ASSERT(existing_loc ==
nullptr);
3820 if (existing_loc == nullptr) {
3821
3822
3824 this,
scripts, first_token_pos, last_token_pos, line_number,
3825 column_number);
3826 RegisterBreakpointLocation(unresolved_loc);
3827
3828
3829 Breakpoint* bpt = matched_loc->breakpoints();
3830 unresolved_loc->set_breakpoints(bpt);
3831 matched_loc->set_breakpoints(nullptr);
3832 while (bpt != nullptr) {
3833 bpt->set_bpt_location(unresolved_loc);
3834 if (FLAG_verbose_debug) {
3836 "Converted latent breakpoint "
3837 "%" Pd " in '%s' at line %" Pd " col %" Pd "\n",
3838 bpt->id(), url.ToCString(), line_number, column_number);
3839 }
3840 bpt = bpt->next();
3841 }
3843 }
3844 delete matched_loc;
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854 break;
3855 }
3856 }
3857 if (!found_match) {
3858
3859 if (FLAG_verbose_debug) {
3860 Breakpoint* bpt = loc->breakpoints();
3861 while (bpt != nullptr) {
3863 "No match found for latent breakpoint id "
3864 "%" Pd " with url '%s'\n",
3865 bpt->id(), url.ToCString());
3866 bpt = bpt->next();
3867 }
3868 }
3869 loc = loc->next();
3870 }
3871 }
3872}
static float prev(float f)
void SyncBreakpointLocation(BreakpointLocation *loc)