LLDB mainline
ScriptedFrameInterface.h
Go to the documentation of this file.
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-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLDB_INTERPRETER_INTERFACES_SCRIPTEDFRAMEINTERFACE_H
10#define LLDB_INTERPRETER_INTERFACES_SCRIPTEDFRAMEINTERFACE_H
11
12#include "ScriptedInterface.h"
15#include "lldb/lldb-private.h"
16#include <optional>
17#include <string>
18
19namespace lldb_private {
21public:
22 virtual llvm::Expected<StructuredData::GenericSP>
23 CreatePluginObject(llvm::StringRef class_name, ExecutionContext &exe_ctx,
25 StructuredData::Generic *script_obj = nullptr) = 0;
26
28
30
32
33 virtual std::optional<SymbolContext> GetSymbolContext() {
34 return std::nullopt;
35 }
36
37 virtual std::optional<std::string> GetFunctionName() { return std::nullopt; }
38
39 virtual std::optional<std::string> GetDisplayFunctionName() {
40 return std::nullopt;
41 }
42
43 virtual bool IsInlined() { return false; }
44
45 virtual bool IsArtificial() { return false; }
46
47 virtual bool IsHidden() { return false; }
48
50
51 virtual std::optional<std::string> GetRegisterContext() {
52 return std::nullopt;
53 }
54
55 virtual lldb::ValueObjectListSP GetVariables() { return nullptr; }
56
57 /// Report which kind of variable \a valobj is presented as, for instance
58 /// \a eValueTypeVariableLocal to have it listed among the frame's locals.
59 ///
60 /// A ValueObject the ScriptedFrame built itself should have
61 /// \a eValueTypeSyntheticFlag set in the ValueType it reports. LLDB uses that
62 /// flag to skip the scope rules it applies to a declared variable, which a
63 /// made-up ValueObject cannot satisfy: it has no storage to locate, so an
64 /// in-scope-only listing drops it. A variable the frame is only forwarding
65 /// should leave the flag clear, so those rules still apply to it.
66 ///
67 /// If this returns std::nullopt, LLDB keeps the ValueType the ValueObject
68 /// already reports and adds the synthetic flag to it.
69 virtual std::optional<lldb::ValueType>
71 return std::nullopt;
72 }
73
75 GetValueObjectForVariableExpression(llvm::StringRef expr, uint32_t options,
76 Status &error) {
77 return nullptr;
78 }
79
80 virtual llvm::Expected<ScriptedMetadata>
82 return llvm::createStringError(
83 "the current interpreter doesn't support scripted stepping");
84 }
85};
86} // namespace lldb_private
87
88#endif // LLDB_INTERPRETER_INTERFACES_SCRIPTEDFRAMEINTERFACE_H
static llvm::raw_ostream & error(Stream &strm)
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
virtual StructuredData::DictionarySP GetRegisterInfo()
virtual std::optional< lldb::ValueType > GetValueTypeForVariable(lldb::ValueObjectSP valobj)
Report which kind of variable valobj is presented as, for instance eValueTypeVariableLocal to have it...
virtual llvm::Expected< StructuredData::GenericSP > CreatePluginObject(llvm::StringRef class_name, ExecutionContext &exe_ctx, StructuredData::DictionarySP args_sp, StructuredData::Generic *script_obj=nullptr)=0
virtual lldb::ValueObjectListSP GetVariables()
virtual llvm::Expected< ScriptedMetadata > GetThreadPlanMetadataForStepType(lldb::StepType step_type)
virtual std::optional< std::string > GetRegisterContext()
virtual std::optional< std::string > GetDisplayFunctionName()
virtual std::optional< std::string > GetFunctionName()
virtual std::optional< SymbolContext > GetSymbolContext()
virtual lldb::ValueObjectSP GetValueObjectForVariableExpression(llvm::StringRef expr, uint32_t options, Status &error)
An error handling class.
Definition Status.h:118
std::shared_ptr< Dictionary > DictionarySP
#define LLDB_INVALID_ADDRESS
#define LLDB_INVALID_FRAME_ID
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
std::shared_ptr< lldb_private::ValueObjectList > ValueObjectListSP
uint64_t user_id_t
Definition lldb-types.h:83
uint64_t addr_t
Definition lldb-types.h:80