diff --git a/tooling/agent/debugger_impl.cpp b/tooling/agent/debugger_impl.cpp index 5aaaeeba91e628fbe94a7c81cb04d13f864c676a..6b030f4515bb5c3f0b1e2bc52ac182f7a740ee47 100644 --- a/tooling/agent/debugger_impl.cpp +++ b/tooling/agent/debugger_impl.cpp @@ -619,7 +619,8 @@ DispatchResponse DebuggerImpl::GetPossibleBreakpoints(const GetPossibleBreakpoin if (iter == scripts_.end()) { return DispatchResponse::Fail("Unknown file name."); } - DebugInfoExtractor *extractor = GetExtractor(iter->second->GetUrl()); + const std::string &url = iter->second->GetUrl(); + DebugInfoExtractor *extractor = GetExtractor(url); if (extractor == nullptr) { LOG_DEBUGGER(ERROR) << "GetPossibleBreakpoints: extractor is null"; return DispatchResponse::Fail("Unknown file name."); @@ -630,7 +631,7 @@ DispatchResponse DebuggerImpl::GetPossibleBreakpoints(const GetPossibleBreakpoin auto callbackFunc = []([[maybe_unused]] File::EntityId id, [[maybe_unused]] uint32_t offset) -> bool { return true; }; - if (extractor->MatchWithLocation(callbackFunc, line, column)) { + if (extractor->MatchWithLocation(callbackFunc, line, column, url)) { std::unique_ptr location = std::make_unique(); location->SetScriptId(start->GetScriptId()).SetLine(line).SetColumn(column); locations->emplace_back(std::move(location)); @@ -685,7 +686,7 @@ DispatchResponse DebuggerImpl::RemoveBreakpoint(const RemoveBreakpointParams &pa JSPtLocation location {fileName.c_str(), id, offset}; return DebuggerApi::RemoveBreakpoint(jsDebugger_, location); }; - if (!extractor->MatchWithLocation(callbackFunc, metaData.line_, metaData.column_)) { + if (!extractor->MatchWithLocation(callbackFunc, metaData.line_, metaData.column_, metaData.url_)) { LOG_DEBUGGER(ERROR) << "failed to set breakpoint location number: " << metaData.line_ << ":" << metaData.column_; return DispatchResponse::Fail("Breakpoint not found."); @@ -752,7 +753,7 @@ DispatchResponse DebuggerImpl::SetBreakpointByUrl(const SetBreakpointByUrlParams } return DebuggerApi::SetBreakpoint(jsDebugger_, location, condFuncRef); }; - if (!extractor->MatchWithLocation(callbackFunc, lineNumber, columnNumber)) { + if (!extractor->MatchWithLocation(callbackFunc, lineNumber, columnNumber, url)) { LOG_DEBUGGER(ERROR) << "failed to set breakpoint location number: " << lineNumber << ":" << columnNumber; return DispatchResponse::Fail("Breakpoint not found."); } diff --git a/tooling/test/utils/test_extractor.cpp b/tooling/test/utils/test_extractor.cpp index af68370912de1764609892bb6a89ef51d2198c39..21295c8ef5b19cb15fba30f8211cc94ff8e260d7 100644 --- a/tooling/test/utils/test_extractor.cpp +++ b/tooling/test/utils/test_extractor.cpp @@ -35,7 +35,7 @@ std::pair TestExtractor::GetBreakpointAddress(const SourceLo retOffset = offset; return true; }; - MatchWithLocation(callbackFunc, sourceLocation.line, sourceLocation.column); + MatchWithLocation(callbackFunc, sourceLocation.line, sourceLocation.column, sourceLocation.path); return {retId, retOffset}; }