LLDB mainline
ScriptInterpreterBridge.h
Go to the documentation of this file.
1//===-- ScriptInterpreterBridge.h ------------------------------*- C++ -*-===//
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-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLDB_SOURCE_API_SCRIPTINTERPRETERBRIDGE_H
10#define LLDB_SOURCE_API_SCRIPTINTERPRETERBRIDGE_H
11
12#include "lldb/API/SBDefines.h"
15#include "lldb/Utility/Status.h"
16#include "lldb/lldb-forward.h"
17#include <optional>
18
19namespace lldb_private {
20
22class Event;
23
24/// Unwraps the opaque internal object held by an SB (public API) instance,
25/// for scripting-language plugins that need to convert values passed across
26/// the script callback boundary back to their lldb_private form. Every SB
27/// class this needs to reach into grants friendship to this class alone, so
28/// that access to API internals stays confined to this single bridge rather
29/// than spreading across the Interpreter layer.
31public:
33
34 static Status GetStatus(const lldb::SBError &error);
35
36 static Event *GetEvent(const lldb::SBEvent &event);
37
38 static lldb::StreamSP GetStream(const lldb::SBStream &stream);
39
40 static lldb::ThreadSP GetThread(const lldb::SBThread &thread);
41
43
45
46 static lldb::BreakpointSP GetBreakpoint(const lldb::SBBreakpoint &breakpoint);
47
50
51 static CommandReturnObject *
53
54 static lldb::DebuggerSP GetDebugger(const lldb::SBDebugger &debugger);
55
57 GetProcessAttachInfo(const lldb::SBAttachInfo &attach_info);
58
60 GetProcessLaunchInfo(const lldb::SBLaunchInfo &launch_info);
61
62 static std::optional<MemoryRegionInfo>
64
67
69 GetStackFrameList(const lldb::SBFrameList &frame_list);
70
72
73 static lldb::TargetSP GetTarget(const lldb::SBTarget &target);
74};
75
76} // namespace lldb_private
77
78#endif // LLDB_SOURCE_API_SCRIPTINTERPRETERBRIDGE_H
static llvm::raw_ostream & error(Stream &strm)
Represents a list of SBFrame objects.
Definition SBFrameList.h:31
Unwraps the opaque internal object held by an SB (public API) instance, for scripting-language plugin...
static SymbolContext GetSymbolContext(const lldb::SBSymbolContext &sym_ctx)
static lldb::DataExtractorSP GetDataExtractor(const lldb::SBData &data)
static lldb::BreakpointLocationSP GetBreakpointLocation(const lldb::SBBreakpointLocation &break_loc)
static lldb::ProcessLaunchInfoSP GetProcessLaunchInfo(const lldb::SBLaunchInfo &launch_info)
static CommandReturnObject * GetCommandReturnObject(const lldb::SBCommandReturnObject &cmd_retobj)
static lldb::BreakpointSP GetBreakpoint(const lldb::SBBreakpoint &breakpoint)
static lldb::ThreadSP GetThread(const lldb::SBThread &thread)
static lldb::ExecutionContextRefSP GetExecutionContextRef(const lldb::SBExecutionContext &exe_ctx)
static lldb::TargetSP GetTarget(const lldb::SBTarget &target)
static lldb::DebuggerSP GetDebugger(const lldb::SBDebugger &debugger)
static lldb::ProcessAttachInfoSP GetProcessAttachInfo(const lldb::SBAttachInfo &attach_info)
static lldb::StackFrameSP GetStackFrame(const lldb::SBFrame &frame)
static lldb::StackFrameListSP GetStackFrameList(const lldb::SBFrameList &frame_list)
static lldb::StreamSP GetStream(const lldb::SBStream &stream)
static Event * GetEvent(const lldb::SBEvent &event)
static std::optional< MemoryRegionInfo > GetMemoryRegionInfo(const lldb::SBMemoryRegionInfo &mem_region)
static lldb::ValueObjectSP GetValueObject(const lldb::SBValue &value)
static Status GetStatus(const lldb::SBError &error)
An error handling class.
Definition Status.h:118
Defines a symbol context baton that can be handed other debug core functions.
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::StackFrame > StackFrameSP
std::shared_ptr< lldb_private::BreakpointLocation > BreakpointLocationSP
std::shared_ptr< lldb_private::Thread > ThreadSP
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
std::shared_ptr< lldb_private::ProcessAttachInfo > ProcessAttachInfoSP
std::shared_ptr< lldb_private::Stream > StreamSP
std::shared_ptr< lldb_private::Breakpoint > BreakpointSP
std::shared_ptr< lldb_private::Debugger > DebuggerSP
std::shared_ptr< lldb_private::Target > TargetSP
std::shared_ptr< lldb_private::DataExtractor > DataExtractorSP
std::shared_ptr< lldb_private::ProcessLaunchInfo > ProcessLaunchInfoSP
std::shared_ptr< lldb_private::StackFrameList > StackFrameListSP
std::shared_ptr< lldb_private::ExecutionContextRef > ExecutionContextRefSP