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 Disassembler *(*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::ScriptInterpreterSP (*ScriptInterpreterCreateInstance)(
86     Debugger &debugger);
87 typedef SymbolFile *(*SymbolFileCreateInstance)(lldb::ObjectFileSP objfile_sp);
88 typedef SymbolVendor *(*SymbolVendorCreateInstance)(
89     const lldb::ModuleSP &module_sp,
90     lldb_private::Stream
91         *feedback_strm); // Module can be NULL for default system symbol vendor
92 typedef bool (*BreakpointHitCallback)(void *baton,
93                                       StoppointCallbackContext *context,
94                                       lldb::user_id_t break_id,
95                                       lldb::user_id_t break_loc_id);
96 typedef bool (*WatchpointHitCallback)(void *baton,
97                                       StoppointCallbackContext *context,
98                                       lldb::user_id_t watch_id);
99 typedef bool (*ThreadPlanShouldStopHereCallback)(
100     ThreadPlan *current_plan, Flags &flags, lldb::FrameComparison operation,
101     Status &status, void *baton);
102 typedef lldb::ThreadPlanSP (*ThreadPlanStepFromHereCallback)(
103     ThreadPlan *current_plan, Flags &flags, lldb::FrameComparison operation,
104     Status &status, void *baton);
105 typedef UnwindAssembly *(*UnwindAssemblyCreateInstance)(const ArchSpec &arch);
106 typedef lldb::MemoryHistorySP (*MemoryHistoryCreateInstance)(
107     const lldb::ProcessSP &process_sp);
108 typedef lldb::InstrumentationRuntimeType (*InstrumentationRuntimeGetType)();
109 typedef lldb::InstrumentationRuntimeSP (*InstrumentationRuntimeCreateInstance)(
110     const lldb::ProcessSP &process_sp);
111 typedef lldb::TypeSystemSP (*TypeSystemCreateInstance)(
112     lldb::LanguageType language, Module *module, Target *target);
113 typedef lldb::REPLSP (*REPLCreateInstance)(Status &error,
114                                            lldb::LanguageType language,
115                                            Debugger *debugger, Target *target,
116                                            const char *repl_options);
117 typedef int (*ComparisonFunction)(const void *, const void *);
118 typedef void (*DebuggerInitializeCallback)(Debugger &debugger);
119 /// Trace
120 /// \{
121 typedef llvm::Expected<lldb::TraceSP> (*TraceCreateInstanceFromBundle)(
122     const llvm::json::Value &trace_bundle_description,
123     llvm::StringRef session_file_dir, lldb_private::Debugger &debugger);
124 typedef llvm::Expected<lldb::TraceSP> (*TraceCreateInstanceForLiveProcess)(
125     Process &process);
126 typedef llvm::Expected<lldb::TraceExporterUP> (*TraceExporterCreateInstance)();
127 typedef lldb::CommandObjectSP (*ThreadTraceExportCommandCreator)(
128     CommandInterpreter &interpreter);
129 /// \}
130 } // namespace lldb_private
131 
132 #endif // #if defined(__cplusplus)
133 
134 #endif // LLDB_LLDB_PRIVATE_INTERFACES_H
135