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 size_t (*ObjectFileGetModuleSpecifications)(
44     const FileSpec &file, lldb::DataBufferSP &data_sp,
45     lldb::offset_t data_offset, lldb::offset_t file_offset,
46     lldb::offset_t length, ModuleSpecList &module_specs);
47 typedef ObjectFile *(*ObjectFileCreateInstance)(const lldb::ModuleSP &module_sp,
48                                                 lldb::DataBufferSP &data_sp,
49                                                 lldb::offset_t data_offset,
50                                                 const FileSpec *file,
51                                                 lldb::offset_t file_offset,
52                                                 lldb::offset_t length);
53 typedef ObjectFile *(*ObjectFileCreateMemoryInstance)(
54     const lldb::ModuleSP &module_sp, lldb::DataBufferSP &data_sp,
55     const lldb::ProcessSP &process_sp, lldb::addr_t offset);
56 typedef bool (*ObjectFileSaveCore)(const lldb::ProcessSP &process_sp,
57                                    const FileSpec &outfile,
58                                    lldb::SaveCoreStyle &core_style,
59                                    Status &error);
60 typedef EmulateInstruction *(*EmulateInstructionCreateInstance)(
61     const ArchSpec &arch, InstructionType inst_type);
62 typedef OperatingSystem *(*OperatingSystemCreateInstance)(Process *process,
63                                                           bool force);
64 typedef Language *(*LanguageCreateInstance)(lldb::LanguageType language);
65 typedef LanguageRuntime *(*LanguageRuntimeCreateInstance)(
66     Process *process, lldb::LanguageType language);
67 typedef lldb::CommandObjectSP (*LanguageRuntimeGetCommandObject)(
68     CommandInterpreter &interpreter);
69 typedef lldb::BreakpointPreconditionSP (
70     *LanguageRuntimeGetExceptionPrecondition)(lldb::LanguageType language,
71                                               bool throw_bp);
72 typedef lldb::StructuredDataPluginSP (*StructuredDataPluginCreateInstance)(
73     Process &process);
74 typedef Status (*StructuredDataFilterLaunchInfo)(ProcessLaunchInfo &launch_info,
75                                                  Target *target);
76 typedef SystemRuntime *(*SystemRuntimeCreateInstance)(Process *process);
77 typedef lldb::PlatformSP (*PlatformCreateInstance)(bool force,
78                                                    const ArchSpec *arch);
79 typedef lldb::ProcessSP (*ProcessCreateInstance)(
80     lldb::TargetSP target_sp, lldb::ListenerSP listener_sp,
81     const FileSpec *crash_file_path, bool can_connect);
82 typedef lldb::ScriptInterpreterSP (*ScriptInterpreterCreateInstance)(
83     Debugger &debugger);
84 typedef SymbolFile *(*SymbolFileCreateInstance)(lldb::ObjectFileSP objfile_sp);
85 typedef SymbolVendor *(*SymbolVendorCreateInstance)(
86     const lldb::ModuleSP &module_sp,
87     lldb_private::Stream
88         *feedback_strm); // Module can be NULL for default system symbol vendor
89 typedef bool (*BreakpointHitCallback)(void *baton,
90                                       StoppointCallbackContext *context,
91                                       lldb::user_id_t break_id,
92                                       lldb::user_id_t break_loc_id);
93 typedef bool (*WatchpointHitCallback)(void *baton,
94                                       StoppointCallbackContext *context,
95                                       lldb::user_id_t watch_id);
96 typedef bool (*ThreadPlanShouldStopHereCallback)(
97     ThreadPlan *current_plan, Flags &flags, lldb::FrameComparison operation,
98     Status &status, void *baton);
99 typedef lldb::ThreadPlanSP (*ThreadPlanStepFromHereCallback)(
100     ThreadPlan *current_plan, Flags &flags, lldb::FrameComparison operation,
101     Status &status, void *baton);
102 typedef UnwindAssembly *(*UnwindAssemblyCreateInstance)(const ArchSpec &arch);
103 typedef lldb::MemoryHistorySP (*MemoryHistoryCreateInstance)(
104     const lldb::ProcessSP &process_sp);
105 typedef lldb::InstrumentationRuntimeType (*InstrumentationRuntimeGetType)();
106 typedef lldb::InstrumentationRuntimeSP (*InstrumentationRuntimeCreateInstance)(
107     const lldb::ProcessSP &process_sp);
108 typedef lldb::TypeSystemSP (*TypeSystemCreateInstance)(
109     lldb::LanguageType language, Module *module, Target *target);
110 typedef lldb::REPLSP (*REPLCreateInstance)(Status &error,
111                                            lldb::LanguageType language,
112                                            Debugger *debugger, Target *target,
113                                            const char *repl_options);
114 typedef int (*ComparisonFunction)(const void *, const void *);
115 typedef void (*DebuggerInitializeCallback)(Debugger &debugger);
116 /// Trace
117 /// \{
118 typedef llvm::Expected<lldb::TraceSP> (*TraceCreateInstanceForSessionFile)(
119     const llvm::json::Value &trace_session_file,
120     llvm::StringRef session_file_dir, lldb_private::Debugger &debugger);
121 typedef llvm::Expected<lldb::TraceSP> (*TraceCreateInstanceForLiveProcess)(
122     Process &process);
123 typedef llvm::Expected<lldb::TraceExporterUP> (*TraceExporterCreateInstance)();
124 typedef lldb::CommandObjectSP (*ThreadTraceExportCommandCreator)(
125     CommandInterpreter &interpreter);
126 /// \}
127 } // namespace lldb_private
128 
129 #endif // #if defined(__cplusplus)
130 
131 #endif // LLDB_LLDB_PRIVATE_INTERFACES_H
132