63 lines · c
1//===----------------------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9#ifndef LLDB_SOURCE_PLUGINS_SCRIPTED_FRAME_H10#define LLDB_SOURCE_PLUGINS_SCRIPTED_FRAME_H11 12#include "ScriptedThread.h"13#include "lldb/Interpreter/ScriptInterpreter.h"14#include "lldb/Target/DynamicRegisterInfo.h"15#include "lldb/Target/StackFrame.h"16#include <string>17 18namespace lldb_private {19class ScriptedThread;20}21 22namespace lldb_private {23 24class ScriptedFrame : public lldb_private::StackFrame {25 26public:27 ScriptedFrame(ScriptedThread &thread,28 lldb::ScriptedFrameInterfaceSP interface_sp,29 lldb::user_id_t frame_idx, lldb::addr_t pc,30 SymbolContext &sym_ctx, lldb::RegisterContextSP reg_ctx_sp,31 std::shared_ptr<DynamicRegisterInfo> reg_info_sp,32 StructuredData::GenericSP script_object_sp = nullptr);33 34 ~ScriptedFrame() override;35 36 static llvm::Expected<std::shared_ptr<ScriptedFrame>>37 Create(ScriptedThread &thread, StructuredData::DictionarySP args_sp,38 StructuredData::Generic *script_object = nullptr);39 40 bool IsInlined() override;41 bool IsArtificial() const override;42 bool IsHidden() override;43 const char *GetFunctionName() override;44 const char *GetDisplayFunctionName() override;45 46private:47 void CheckInterpreterAndScriptObject() const;48 lldb::ScriptedFrameInterfaceSP GetInterface() const;49 50 ScriptedFrame(const ScriptedFrame &) = delete;51 const ScriptedFrame &operator=(const ScriptedFrame &) = delete;52 53 std::shared_ptr<DynamicRegisterInfo> GetDynamicRegisterInfo();54 55 lldb::ScriptedFrameInterfaceSP m_scripted_frame_interface_sp;56 lldb_private::StructuredData::GenericSP m_script_object_sp;57 std::shared_ptr<DynamicRegisterInfo> m_register_info_sp;58};59 60} // namespace lldb_private61 62#endif // LLDB_SOURCE_PLUGINS_SCRIPTED_FRAME_H63