Files
ark_js_runtime/ecmascript/tooling/interface/js_debugger_manager.h
T
Gymee 902e99d08c fix code review problems
Signed-off-by: Gymee <yumeijie@huawei.com>
Change-Id: If382b34005b2e76861106e40beff8d430c8d3a7f
2022-04-19 09:36:45 +08:00

68 lines
1.8 KiB
C++

/*
* Copyright (c) 2022 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_INTERFACE_JS_DEBUGGER_MANAGER_H
#define ECMASCRIPT_TOOLING_INTERFACE_JS_DEBUGGER_MANAGER_H
#include "libpandabase/os/library_loader.h"
namespace panda::ecmascript::tooling {
class JsDebuggerManager {
public:
using LibraryHandle = os::library_loader::LibraryHandle;
JsDebuggerManager() = default;
~JsDebuggerManager() = default;
NO_COPY_SEMANTIC(JsDebuggerManager);
NO_MOVE_SEMANTIC(JsDebuggerManager);
void SetDebugMode(bool isDebugMode)
{
isDebugMode_ = isDebugMode;
}
bool IsDebugMode() const
{
return isDebugMode_;
}
void SetDebugLibraryHandle(LibraryHandle handle)
{
debuggerLibraryHandle_ = std::move(handle);
}
const LibraryHandle &GetDebugLibraryHandle() const
{
return debuggerLibraryHandle_;
}
const JSTaggedType *GetEvaluateCtxFrameSp() const
{
return evaluateCtxFrameSp_;
}
void SetEvaluateCtxFrameSp(JSTaggedType *sp)
{
evaluateCtxFrameSp_ = sp;
}
private:
bool isDebugMode_ {false};
LibraryHandle debuggerLibraryHandle_ {nullptr};
JSTaggedType *evaluateCtxFrameSp_ {nullptr};
};
} // panda::ecmascript::tooling
#endif // ECMASCRIPT_TOOLING_INTERFACE_JS_DEBUGGER_MANAGER_H