3772 {
3773 if (latent_locations_ == nullptr) {
3774
3775 return;
3776 }
3778 auto isolate_group = thread->isolate_group();
3779 auto zone = thread->zone();
3785 const GrowableObjectArray&
libs =
3787
3788 GrowableHandlePtrArray<const Script>
scripts(zone, 1);
3789 while (loc != nullptr) {
3790 url = loc->url();
3791 bool found_match = false;
3792 bool is_package = url.StartsWith(Symbols::PackageScheme());
3793 for (intptr_t
i = 0;
i <
libs.Length();
i++) {
3795 script = lib.LookupScript(url, !is_package);
3798 }
3799 }
3801
3802
3803 found_match = true;
3805 loc = loc->next();
3806 if (prev_loc == nullptr) {
3807 latent_locations_ = loc;
3808 } else {
3809 prev_loc->set_next(loc);
3810 }
3811
3812
3813 intptr_t line_number = matched_loc->requested_line_number();
3814 intptr_t column_number = matched_loc->requested_column_number();
3815 ASSERT(line_number >= 0);
3816 TokenPosition first_token_pos = TokenPosition::kNoSource;
3817 TokenPosition last_token_pos = TokenPosition::kNoSource;
3818 scripts.At(0).TokenRangeAtLine(line_number, &first_token_pos,
3819 &last_token_pos);
3820 if (!first_token_pos.IsDebugPause() || !last_token_pos.IsDebugPause()) {
3821
3822
3823 Breakpoint* bpt = matched_loc->breakpoints();
3824 while (bpt != nullptr) {
3825 if (FLAG_verbose_debug) {
3827 ": "
3828 "dropping latent breakpoint %" Pd " in '%s'\n",
3829 line_number, bpt->id(), url.ToCString());
3830 }
3831 Breakpoint*
prev = bpt;
3832 bpt = bpt->next();
3834 }
3835 delete matched_loc;
3836 } else {
3837
3838
3839
3841 GetBreakpointLocation(url, first_token_pos, -1, column_number);
3842 ASSERT(existing_loc ==
nullptr);
3843 if (existing_loc == nullptr) {
3844
3845
3847 this,
scripts, first_token_pos, last_token_pos, line_number,
3848 column_number);
3849 RegisterBreakpointLocation(unresolved_loc);
3850
3851
3852 Breakpoint* bpt = matched_loc->breakpoints();
3853 unresolved_loc->set_breakpoints(bpt);
3854 matched_loc->set_breakpoints(nullptr);
3855 while (bpt != nullptr) {
3856 bpt->set_bpt_location(unresolved_loc);
3857 if (FLAG_verbose_debug) {
3859 "Converted latent breakpoint "
3860 "%" Pd " in '%s' at line %" Pd " col %" Pd "\n",
3861 bpt->id(), url.ToCString(), line_number, column_number);
3862 }
3863 bpt = bpt->next();
3864 }
3866 }
3867 delete matched_loc;
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877 break;
3878 }
3879 }
3880 if (!found_match) {
3881
3882 if (FLAG_verbose_debug) {
3883 Breakpoint* bpt = loc->breakpoints();
3884 while (bpt != nullptr) {
3886 "No match found for latent breakpoint id "
3887 "%" Pd " with url '%s'\n",
3888 bpt->id(), url.ToCString());
3889 bpt = bpt->next();
3890 }
3891 }
3892 loc = loc->next();
3893 }
3894 }
3895}
static float prev(float f)
void SyncBreakpointLocation(BreakpointLocation *loc)