diff --git a/tooling/dynamic/agent/debugger_impl.cpp b/tooling/dynamic/agent/debugger_impl.cpp index 8e7df7a7c89f97dc0e65a2c209b16de6d437e45e..b6f10efeb65137e2d48dca6efd1ec0e1e52f3850 100755 --- a/tooling/dynamic/agent/debugger_impl.cpp +++ b/tooling/dynamic/agent/debugger_impl.cpp @@ -1392,10 +1392,6 @@ DispatchResponse DebuggerImpl::RemoveBreakpointsByUrl(const RemoveBreakpointsByU return true; }; if (!MatchScripts(scriptMatchCallback, url, ScriptMatchType::URL)) { - if (IsLaunchAccelerateMode() && breakpointPendingMap_.erase(url)) { - LOG_DEBUGGER(INFO) << "All breakpoints on " << url << " are removed"; - return DispatchResponse::Ok(); - } LOG_DEBUGGER(ERROR) << "RemoveBreakpointByUrl: Unknown url: " << url; return DispatchResponse::Fail("Unknown url"); } diff --git a/tooling/dynamic/client/domain/debugger_client.cpp b/tooling/dynamic/client/domain/debugger_client.cpp index d8355aa74be5f4b4a53eaf17ba40d537ff60eb33..91fce473f26211efb4ed38a3e9c7109b1aedd0be 100644 --- a/tooling/dynamic/client/domain/debugger_client.cpp +++ b/tooling/dynamic/client/domain/debugger_client.cpp @@ -49,7 +49,6 @@ bool DebuggerClient::DispatcherCmd(const std::string &cmd) { "step-out", std::bind(&DebuggerClient::StepOutCommand, this)}, { "step-over", std::bind(&DebuggerClient::StepOverCommand, this)}, { "enable-launch-accelerate", std::bind(&DebuggerClient::EnableLaunchAccelerateCommand, this)}, - { "removeBreakpointsByUrl", std::bind(&DebuggerClient::RemoveBreakpointsByUrlCommand, this)}, { "saveAllPossibleBreakpoints", std::bind(&DebuggerClient::SaveAllPossibleBreakpointsCommand, this)}, { "setSymbolicBreakpoints", std::bind(&DebuggerClient::SetSymbolicBreakpointsCommand, this)}, { "removeSymbolicBreakpoints", std::bind(&DebuggerClient::RemoveSymbolicBreakpointsCommand, this)}, @@ -340,11 +339,6 @@ void DebuggerClient::AddSymbolicBreakpointInfo(const std::string& functionName) symbolicBreakpointInfoList_.emplace_back(symbolicBreakpointInfo); } -void DebuggerClient::AddUrl(const std::string& url) -{ - urlList_.push_back(url); -} - void DebuggerClient::RecvReply(std::unique_ptr json) { if (json == nullptr) { @@ -551,27 +545,6 @@ int DebuggerClient::RemoveSymbolicBreakpointsCommand() return 0; } -int DebuggerClient::RemoveBreakpointsByUrlCommand() -{ - Session *session = SessionManager::getInstance().GetSessionById(sessionId_); - uint32_t id = session->GetMessageId(); - - std::unique_ptr request = PtJson::CreateObject(); - request->Add("id", id); - request->Add("method", "Debugger.removeBreakpointsByUrl"); - - std::unique_ptr params = PtJson::CreateObject(); - params->Add("url", urlList_.back().c_str()); - request->Add("params", params); - - std::string message = request->Stringify(); - if (session->ClientSendReq(message)) { - session->GetDomainManager().SetDomainById(id, "Debugger"); - } - - return 0; -} - int DebuggerClient::EnableLaunchAccelerateCommand() { Session *session = SessionManager::getInstance().GetSessionById(sessionId_); diff --git a/tooling/dynamic/client/domain/debugger_client.h b/tooling/dynamic/client/domain/debugger_client.h index bd6eb0b866e4d8099cc669714914ccc16a657f3e..1ebe7bdc2c2311de8bd81cb6bad302ad324e4df3 100644 --- a/tooling/dynamic/client/domain/debugger_client.h +++ b/tooling/dynamic/client/domain/debugger_client.h @@ -69,16 +69,14 @@ public: int AsyncStackDepthCommand(); int SetSymbolicBreakpointsCommand(); int RemoveSymbolicBreakpointsCommand(); - int RemoveBreakpointsByUrlCommand(); + void AddBreakPointInfo(const std::string& url, const int& lineNumber, const int& columnNumber = 0); void AddSymbolicBreakpointInfo(const std::string& functionName); - void AddUrl(const std::string& url); void RecvReply(std::unique_ptr json); void PausedReply(const std::unique_ptr json); void handleResponse(std::unique_ptr json); private: - std::vector urlList_ {}; std::vector breakPointInfoList_ {}; std::vector symbolicBreakpointInfoList_ {}; int32_t sessionId_; diff --git a/tooling/dynamic/client/utils/cli_command.cpp b/tooling/dynamic/client/utils/cli_command.cpp index 42367a63435d8e3e35fb246bbbe4ef73915793fb..e6b88abd962ea353605df26d87bcd7b0008491fc 100644 --- a/tooling/dynamic/client/utils/cli_command.cpp +++ b/tooling/dynamic/client/utils/cli_command.cpp @@ -37,7 +37,6 @@ const std::string HELP_MSG = "usage: \n" " break(b) break with options\n" " setSymbolicBreakpoints setSymbolicBreakpoints\n" " removeSymbolicBreakpoints removeSymbolicBreakpoints\n" - " removeBreakpointsByUrl removeBreakpointsByUrl\n" " backtrack(bt) backtrace\n" " continue(c) continue\n" " delete(d) delete with options\n" @@ -96,7 +95,6 @@ const std::vector cmdList = { "break", "setSymbolicBreakpoints", "removeSymbolicBreakpoints", - "removeBreakpointsByUrl", "backtrack", "continue", "delete", @@ -186,8 +184,6 @@ void CliCommand::CreateCommandMap() std::bind(&CliCommand::SetSymbolicBreakpointsCommand, this, "setSymbolicBreakpoints")}, {std::make_pair("removeSymbolicBreakpoints", "removeSymbolicBreakpoints"), std::bind(&CliCommand::RemoveSymbolicBreakpointsCommand, this, "removeSymbolicBreakpoints")}, - {std::make_pair("removeBreakpointsByUrl", "removeBreakpointsByUrl"), - std::bind(&CliCommand::RemoveBreakpointsByUrlCommand, this, "removeBreakpointsByUrl")}, }; CreateOtherCommandMap(); } @@ -425,27 +421,6 @@ ErrCode CliCommand::RemoveSymbolicBreakpointsCommand(const std::string &cmd) return result ? ErrCode::ERR_OK : ErrCode::ERR_FAIL; } -ErrCode CliCommand::RemoveBreakpointsByUrlCommand(const std::string &cmd) -{ - bool result = false; - Session *session = SessionManager::getInstance().GetSessionById(sessionId_); - DebuggerClient &debuggerCli = session->GetDomainManager().GetDebuggerClient(); - if (GetArgList().size() == 1) { //1: one arguments - if (Utils::IsNumber(GetArgList()[0])) { - OutputCommand(cmd, false); - return ErrCode::ERR_FAIL; - } - debuggerCli.AddUrl(GetArgList()[0]); - } else { - OutputCommand(cmd, false); - return ErrCode::ERR_FAIL; - } - - result = debuggerCli.DispatcherCmd(cmd); - OutputCommand(cmd, true); - return result ? ErrCode::ERR_OK : ErrCode::ERR_FAIL; -} - ErrCode CliCommand::DeleteCommand(const std::string &cmd) { bool result = false; diff --git a/tooling/dynamic/client/utils/cli_command.h b/tooling/dynamic/client/utils/cli_command.h index 84758ce9b3077ae112e795572129779974bbaa73..0b0e7f460b5904bfdd1694ef1e4296762857e67c 100644 --- a/tooling/dynamic/client/utils/cli_command.h +++ b/tooling/dynamic/client/utils/cli_command.h @@ -75,7 +75,6 @@ public: ErrCode SaveAllPossibleBreakpointsCommand(const std::string &cmd); ErrCode SetSymbolicBreakpointsCommand(const std::string &cmd); ErrCode RemoveSymbolicBreakpointsCommand(const std::string &cmd); - ErrCode RemoveBreakpointsByUrlCommand(const std::string &cmd); void OutputCommand(const std::string &cmd, bool flag); VecStr GetArgList() diff --git a/tooling/dynamic/test/testcases/js_accelerate_launch_test.h b/tooling/dynamic/test/testcases/js_accelerate_launch_test.h index a7e467f0d8293cbc2a10d0ac2f3fca24a644b547..2bb890c70665777e1b905d4719c62493298a3908 100644 --- a/tooling/dynamic/test/testcases/js_accelerate_launch_test.h +++ b/tooling/dynamic/test/testcases/js_accelerate_launch_test.h @@ -32,12 +32,6 @@ public: // Debugger.saveAllPossibleBreakpoints {SocketAction::SEND, "b-new " DEBUGGER_JS_DIR "sample.js 22"}, {SocketAction::RECV, "", ActionRule::CUSTOM_RULE, MatchRule::replySuccess}, - {SocketAction::SEND, "b-new " "test.js 22"}, - {SocketAction::RECV, "", ActionRule::CUSTOM_RULE, MatchRule::replySuccess}, - {SocketAction::SEND, "removeBreakpointsByUrl " "test.js"}, - {SocketAction::RECV, "", ActionRule::CUSTOM_RULE, MatchRule::replySuccess}, - {SocketAction::SEND, "removeBreakpointsByUrl " "test1.js"}, - {SocketAction::RECV, "Unknown url", ActionRule::STRING_CONTAIN}, {SocketAction::SEND, "run"}, {SocketAction::RECV, "", ActionRule::CUSTOM_RULE, MatchRule::replySuccess}, // load sample.js