| Index: src/inspector/v8-debugger-agent-impl.cc
|
| diff --git a/src/inspector/v8-debugger-agent-impl.cc b/src/inspector/v8-debugger-agent-impl.cc
|
| index 8b7521d974b0da1de2a6a62cf4054014f4471e04..00fcd87203fa12ab4f3b8a6f350761dac5b3b3e9 100644
|
| --- a/src/inspector/v8-debugger-agent-impl.cc
|
| +++ b/src/inspector/v8-debugger-agent-impl.cc
|
| @@ -420,7 +420,8 @@ void V8DebuggerAgentImpl::removeBreakpointImpl(const String16& breakpointId) {
|
| Response V8DebuggerAgentImpl::getPossibleBreakpoints(
|
| std::unique_ptr<protocol::Debugger::Location> start,
|
| Maybe<protocol::Debugger::Location> end, Maybe<bool> restrictToFunction,
|
| - std::unique_ptr<protocol::Array<protocol::Debugger::Location>>* locations) {
|
| + std::unique_ptr<protocol::Array<protocol::Debugger::BreakLocation>>*
|
| + locations) {
|
| String16 scriptId = start->getScriptId();
|
|
|
| if (start->getLineNumber() < 0 || start->getColumnNumber(0) < 0)
|
| @@ -443,19 +444,33 @@ Response V8DebuggerAgentImpl::getPossibleBreakpoints(
|
| auto it = m_scripts.find(scriptId);
|
| if (it == m_scripts.end()) return Response::Error("Script not found");
|
|
|
| - std::vector<v8::debug::Location> v8Locations;
|
| + std::vector<v8::debug::BreakLocation> v8Locations;
|
| if (!it->second->getPossibleBreakpoints(
|
| v8Start, v8End, restrictToFunction.fromMaybe(false), &v8Locations))
|
| return Response::InternalError();
|
|
|
| - *locations = protocol::Array<protocol::Debugger::Location>::create();
|
| + *locations = protocol::Array<protocol::Debugger::BreakLocation>::create();
|
| for (size_t i = 0; i < v8Locations.size(); ++i) {
|
| - (*locations)
|
| - ->addItem(protocol::Debugger::Location::create()
|
| - .setScriptId(scriptId)
|
| - .setLineNumber(v8Locations[i].GetLineNumber())
|
| - .setColumnNumber(v8Locations[i].GetColumnNumber())
|
| - .build());
|
| + std::unique_ptr<protocol::Debugger::Location> location =
|
| + protocol::Debugger::Location::create()
|
| + .setScriptId(scriptId)
|
| + .setLineNumber(v8Locations[i].GetLocation().GetLineNumber())
|
| + .setColumnNumber(v8Locations[i].GetLocation().GetColumnNumber())
|
| + .build();
|
| + std::unique_ptr<protocol::Debugger::BreakLocation> breakLocation =
|
| + protocol::Debugger::BreakLocation::create()
|
| + .setLocation(std::move(location))
|
| + .build();
|
| + if (v8Locations[i].IsCall()) {
|
| + breakLocation->setType(protocol::Debugger::BreakLocation::TypeEnum::Call);
|
| + } else if (v8Locations[i].IsReturn()) {
|
| + breakLocation->setType(
|
| + protocol::Debugger::BreakLocation::TypeEnum::Return);
|
| + } else if (v8Locations[i].IsDebuggerStatement()) {
|
| + breakLocation->setType(
|
| + protocol::Debugger::BreakLocation::TypeEnum::DebuggerStatement);
|
| + }
|
| + (*locations)->addItem(std::move(breakLocation));
|
| }
|
| return Response::OK();
|
| }
|
|
|