1e509ee18Sopenharmony_ci/* 2e509ee18Sopenharmony_ci * Copyright (c) 2021 Huawei Device Co., Ltd. 3e509ee18Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4e509ee18Sopenharmony_ci * you may not use this file except in compliance with the License. 5e509ee18Sopenharmony_ci * You may obtain a copy of the License at 6e509ee18Sopenharmony_ci * 7e509ee18Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8e509ee18Sopenharmony_ci * 9e509ee18Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10e509ee18Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11e509ee18Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12e509ee18Sopenharmony_ci * See the License for the specific language governing permissions and 13e509ee18Sopenharmony_ci * limitations under the License. 14e509ee18Sopenharmony_ci */ 15e509ee18Sopenharmony_ci 16e509ee18Sopenharmony_ci#ifndef ECMASCRIPT_TOOLING_DEBUGGER_SERVICE_H 17e509ee18Sopenharmony_ci#define ECMASCRIPT_TOOLING_DEBUGGER_SERVICE_H 18e509ee18Sopenharmony_ci 19e509ee18Sopenharmony_ci#include <functional> 20e509ee18Sopenharmony_ci#include <string> 21e509ee18Sopenharmony_ci 22e509ee18Sopenharmony_ci#include "common/macros.h" 23e509ee18Sopenharmony_ci 24e509ee18Sopenharmony_cinamespace panda::ecmascript { 25e509ee18Sopenharmony_ciclass EcmaVM; 26e509ee18Sopenharmony_ci} // namespace panda::ecmascript 27e509ee18Sopenharmony_ci 28e509ee18Sopenharmony_cinamespace panda::ecmascript::tooling { 29e509ee18Sopenharmony_ci#ifdef __cplusplus 30e509ee18Sopenharmony_ci#if __cplusplus 31e509ee18Sopenharmony_ciextern "C" { 32e509ee18Sopenharmony_ci#endif 33e509ee18Sopenharmony_ci#endif /* End of #ifdef __cplusplus */ 34e509ee18Sopenharmony_ci 35e509ee18Sopenharmony_ciTOOLCHAIN_EXPORT void InitializeDebugger(::panda::ecmascript::EcmaVM *vm, 36e509ee18Sopenharmony_ci const std::function<void(const void *, const std::string &)> &onResponse); 37e509ee18Sopenharmony_ci 38e509ee18Sopenharmony_ciTOOLCHAIN_EXPORT void UninitializeDebugger(::panda::ecmascript::EcmaVM *vm); 39e509ee18Sopenharmony_ci 40e509ee18Sopenharmony_ciTOOLCHAIN_EXPORT void OnMessage(const ::panda::ecmascript::EcmaVM *vm, std::string &&message); 41e509ee18Sopenharmony_ci 42e509ee18Sopenharmony_ciTOOLCHAIN_EXPORT void WaitForDebugger(const ::panda::ecmascript::EcmaVM *vm); 43e509ee18Sopenharmony_ci 44e509ee18Sopenharmony_ciTOOLCHAIN_EXPORT void ProcessMessage(const ::panda::ecmascript::EcmaVM *vm); 45e509ee18Sopenharmony_ci 46e509ee18Sopenharmony_ciTOOLCHAIN_EXPORT int32_t GetDispatchStatus(const ::panda::ecmascript::EcmaVM *vm); 47e509ee18Sopenharmony_ci 48e509ee18Sopenharmony_ci#ifdef __cplusplus 49e509ee18Sopenharmony_ci#if __cplusplus 50e509ee18Sopenharmony_ci} 51e509ee18Sopenharmony_ci#endif 52e509ee18Sopenharmony_ci#endif /* End of #ifdef __cplusplus */ 53e509ee18Sopenharmony_ci} // panda::ecmascript::tooling 54e509ee18Sopenharmony_ci 55e509ee18Sopenharmony_ci#endif