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 PANDA_RUNTIME_TOOLING_PT_LANG_EXT_PRIVATE_H_ 17 #define PANDA_RUNTIME_TOOLING_PT_LANG_EXT_PRIVATE_H_ 18 19 #include <string_view> 20 21 #include "runtime/interpreter/frame.h" 22 #include "runtime/include/mem/panda_smart_pointers.h" 23 #include "runtime/include/tooling/debug_interface.h" 24 #include "runtime/include/tooling/pt_lang_extension.h" 25 26 namespace panda::tooling { 27 class PtLangExtPrivate : public PtLangExt { 28 public: 29 virtual std::optional<Error> GetPtValueFromManaged(const Frame::VRegister &vreg, PtValue *outValue) const = 0; 30 virtual void ReleasePtValueFromManaged(const PtValue *value) const = 0; 31 virtual std::optional<Error> StorePtValueFromManaged(const PtValue &value, Frame::VRegister *inOutVreg) const = 0; 32 33 virtual Class *PtClassToClass(const PtClass &klass) const = 0; 34 virtual PtClass ClassToPtClass(BaseClass *klass) const = 0; 35 36 virtual Field *PtPropertyToField(const PtProperty &property) const = 0; 37 virtual PtProperty FieldToPtProperty(Field *field) const = 0; 38 }; 39 40 PandaUniquePtr<PtLangExt> CreatePtLangExt(std::string_view language); 41 42 } // namespace panda::tooling 43 44 #endif // PANDA_RUNTIME_TOOLING_PT_LANG_EXT_PRIVATE_H_ 45