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