1 //===-- lldb-private-interfaces.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_LLDB_PRIVATE_INTERFACES_H
10 #define LLDB_LLDB_PRIVATE_INTERFACES_H
11 
12 #if defined(__cplusplus)
13 
14 #include "lldb/lldb-enumerations.h"
15 #include "lldb/lldb-forward.h"
16 #include "lldb/lldb-private-enumerations.h"
17 #include "lldb/lldb-types.h"
18 #include <memory>
19 #include <set>
20 
21 namespace llvm {
22 namespace json {
23 class Object;
24 class Value;
25 }
26 } // namespace llvm
27 
28 namespace lldb_private {
29 typedef lldb::ABISP (*ABICreateInstance)(lldb::ProcessSP process_sp,
30                                          const ArchSpec &arch);
31 typedef std::unique_ptr<Architecture> (*ArchitectureCreateInstance)(
32     const ArchSpec &arch);
33 typedef lldb::DisassemblerSP (*DisassemblerCreateInstance)(const ArchSpec &arch,
34                                                            const char *flavor);
35 typedef DynamicLoader *(*DynamicLoaderCreateInstance)(Process *process,
36                                                       bool force);
37 typedef lldb::JITLoaderSP (*JITLoaderCreateInstance)(Process *process,
38                                                      bool force);
39 typedef ObjectContainer *(*ObjectContainerCreateInstance)(
40     const lldb::ModuleSP &module_sp, lldb::DataBufferSP &data_sp,
41     lldb::offset_t data_offset, const FileSpec *file, lldb::offset_t offset,
42     lldb::offset_t length);
43 typedef ObjectContainer *(*ObjectContainerCreateMemoryInstance)(
44     const lldb::ModuleSP &module_sp, lldb::WritableDataBufferSP data_sp,
45     const lldb::ProcessSP &process_sp, lldb::addr_t offset);
46 typedef size_t (*ObjectFileGetModuleSpecifications)(
47     const FileSpec &file, lldb::DataBufferSP &data_sp,
48     lldb::offset_t data_offset, lldb::offset_t file_offset,
49     lldb::offset_t length, ModuleSpecList &module_specs);
50 typedef ObjectFile *(*ObjectFileCreateInstance)(const lldb::ModuleSP &module_sp,
51                                                 lldb::DataBufferSP data_sp,
52                                                 lldb::offset_t data_offset,
53                                                 const FileSpec *file,
54                                                 lldb::offset_t file_offset,
55                                                 lldb::offset_t length);
56 typedef ObjectFile *(*ObjectFileCreateMemoryInstance)(
57     const lldb::ModuleSP &module_sp, lldb::WritableDataBufferSP data_sp,
58     const lldb::ProcessSP &process_sp, lldb::addr_t offset);
59 typedef bool (*ObjectFileSaveCore)(const lldb::ProcessSP &process_sp,
60                                    const FileSpec &outfile,
61                                    lldb::SaveCoreStyle &core_style,
62                                    Status &error);
63 typedef EmulateInstruction *(*EmulateInstructionCreateInstance)(
64     const ArchSpec &arch, InstructionType inst_type);
65 typedef OperatingSystem *(*OperatingSystemCreateInstance)(Process *process,
66                                                           bool force);
67 typedef Language *(*LanguageCreateInstance)(lldb::LanguageType language);
68 typedef LanguageRuntime *(*LanguageRuntimeCreateInstance)(
69     Process *process, lldb::LanguageType language);
70 typedef lldb::CommandObjectSP (*LanguageRuntimeGetCommandObject)(
71     CommandInterpreter &interpreter);
72 typedef lldb::BreakpointPreconditionSP (
73     *LanguageRuntimeGetExceptionPrecondition)(lldb::LanguageType language,
74                                               bool throw_bp);
75 typedef lldb::StructuredDataPluginSP (*StructuredDataPluginCreateInstance)(
76     Process &process);
77 typedef Status (*StructuredDataFilterLaunchInfo)(ProcessLaunchInfo &launch_info,
78                                                  Target *target);
79 typedef SystemRuntime *(*SystemRuntimeCreateInstance)(Process *process);
80 typedef lldb::PlatformSP (*PlatformCreateInstance)(bool force,
81                                                    const ArchSpec *arch);
82 typedef lldb::ProcessSP (*ProcessCreateInstance)(
83     lldb::TargetSP target_sp, lldb::ListenerSP listener_sp,
84     const FileSpec *crash_file_path, bool can_connect);
85 typedef lldb::RegisterTypeBuilderSP (*RegisterTypeBuilderCreateInstance)(
86     Target &target);
87 typedef lldb::ScriptInterpreterSP (*ScriptInterpreterCreateInstance)(
88     Debugger &debugger);
89 typedef SymbolFile *(*SymbolFileCreateInstance)(lldb::ObjectFileSP objfile_sp);
90 typedef SymbolVendor *(*SymbolVendorCreateInstance)(
91     const lldb::ModuleSP &module_sp,
92     lldb_private::Stream
93         *feedback_strm); // Module can be NULL for default system symbol vendor
94 typedef bool (*BreakpointHitCallback)(void *baton,
95                                       StoppointCallbackContext *context,
96                                       lldb::user_id_t break_id,
97                                       lldb::user_id_t break_loc_id);
98 typedef bool (*WatchpointHitCallback)(void *baton,
99                                       StoppointCallbackContext *context,
100                                       lldb::user_id_t watch_id);
101 typedef bool (*ThreadPlanShouldStopHereCallback)(
102     ThreadPlan *current_plan, Flags &flags, lldb::FrameComparison operation,
103     Status &status, void *baton);
104 typedef lldb::ThreadPlanSP (*ThreadPlanStepFromHereCallback)(
105     ThreadPlan *current_plan, Flags &flags, lldb::FrameComparison operation,
106     Status &status, void *baton);
107 typedef UnwindAssembly *(*UnwindAssemblyCreateInstance)(const ArchSpec &arch);
108 typedef lldb::MemoryHistorySP (*MemoryHistoryCreateInstance)(
109     const lldb::ProcessSP &process_sp);
110 typedef lldb::InstrumentationRuntimeType (*InstrumentationRuntimeGetType)();
111 typedef lldb::InstrumentationRuntimeSP (*InstrumentationRuntimeCreateInstance)(
112     const lldb::ProcessSP &process_sp);
113 typedef lldb::TypeSystemSP (*TypeSystemCreateInstance)(
114     lldb::LanguageType language, Module *module, Target *target);
115 typedef lldb::REPLSP (*REPLCreateInstance)(Status &error,
116                                            lldb::LanguageType language,
117                                            Debugger *debugger, Target *target,
118                                            const char *repl_options);
119 typedef int (*ComparisonFunction)(const void *, const void *);
120 typedef void (*DebuggerInitializeCallback)(Debugger &debugger);
121 /// Trace
122 /// \{
123 typedef llvm::Expected<lldb::TraceSP> (*TraceCreateInstanceFromBundle)(
124     const llvm::json::Value &trace_bundle_description,
125     llvm::StringRef session_file_dir, lldb_private::Debugger &debugger);
126 typedef llvm::Expected<lldb::TraceSP> (*TraceCreateInstanceForLiveProcess)(
127     Process &process);
128 typedef llvm::Expected<lldb::TraceExporterUP> (*TraceExporterCreateInstance)();
129 typedef lldb::CommandObjectSP (*ThreadTraceExportCommandCreator)(
130     CommandInterpreter &interpreter);
131 /// \}
132 } // namespace lldb_private
133 
134 #endif // #if defined(__cplusplus)
135 
136 #endif // LLDB_LLDB_PRIVATE_INTERFACES_H
137