/* * Copyright (c) 2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef ECMASCRIPT_TOOLING_CLIENT_DOMAIN_DEBUGGER_CLIENT_H #define ECMASCRIPT_TOOLING_CLIENT_DOMAIN_DEBUGGER_CLIENT_H #include #include #include "tooling/base/pt_json.h" using PtJson = panda::ecmascript::tooling::PtJson; using Result = panda::ecmascript::tooling::Result; namespace OHOS::ArkCompiler::Toolchain { struct BreakPointInfo { int lineNumber; int columnNumber; std::string url; }; class DebuggerClient final { public: DebuggerClient(int32_t sessionId) : sessionId_(sessionId) {} ~DebuggerClient() = default; bool DispatcherCmd(const std::string &cmd); int BreakCommand(); int BacktrackCommand(); int DeleteCommand(); int DisableCommand(); int DisplayCommand(); int EnableCommand(); int FinishCommand(); int FrameCommand(); int IgnoreCommand(); int InfobreakpointsCommand(); int InfosourceCommand(); int JumpCommand(); int NextCommand(); int ListCommand(); int PtypeCommand(); int RunCommand(); int SetvarCommand(); int StepCommand(); int UndisplayCommand(); int WatchCommand(); int ResumeCommand(); int StepIntoCommand(); int StepOutCommand(); int StepOverCommand(); void AddBreakPointInfo(const std::string& url, const int& lineNumber, const int& columnNumber = 0); void RecvReply(std::unique_ptr json); void PausedReply(const std::unique_ptr json); void handleResponse(std::unique_ptr json); private: std::vector breakPointInfoList_ {}; int32_t sessionId_; }; } // OHOS::ArkCompiler::Toolchain #endif