File indexing completed on 2026-05-10 08:42:53
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef LLDB_TARGET_INSTRUMENTATIONRUNTIME_H
0010 #define LLDB_TARGET_INSTRUMENTATIONRUNTIME_H
0011
0012 #include <map>
0013 #include <vector>
0014
0015 #include "lldb/Core/PluginInterface.h"
0016 #include "lldb/Utility/StructuredData.h"
0017 #include "lldb/lldb-forward.h"
0018 #include "lldb/lldb-private.h"
0019 #include "lldb/lldb-types.h"
0020
0021 namespace lldb_private {
0022
0023 typedef std::map<lldb::InstrumentationRuntimeType,
0024 lldb::InstrumentationRuntimeSP>
0025 InstrumentationRuntimeCollection;
0026
0027 class InstrumentationRuntime
0028 : public std::enable_shared_from_this<InstrumentationRuntime>,
0029 public PluginInterface {
0030
0031 lldb::ProcessWP m_process_wp;
0032
0033
0034 lldb::ModuleSP m_runtime_module;
0035
0036
0037 lldb::user_id_t m_breakpoint_id;
0038
0039
0040
0041 bool m_is_active;
0042
0043 protected:
0044 InstrumentationRuntime(const lldb::ProcessSP &process_sp)
0045 : m_breakpoint_id(0), m_is_active(false) {
0046 if (process_sp)
0047 m_process_wp = process_sp;
0048 }
0049
0050 lldb::ProcessSP GetProcessSP() { return m_process_wp.lock(); }
0051
0052 lldb::ModuleSP GetRuntimeModuleSP() { return m_runtime_module; }
0053
0054 void SetRuntimeModuleSP(lldb::ModuleSP module_sp) {
0055 m_runtime_module = std::move(module_sp);
0056 }
0057
0058 lldb::user_id_t GetBreakpointID() const { return m_breakpoint_id; }
0059
0060 void SetBreakpointID(lldb::user_id_t ID) { m_breakpoint_id = ID; }
0061
0062 void SetActive(bool IsActive) { m_is_active = IsActive; }
0063
0064
0065
0066 virtual const RegularExpression &GetPatternForRuntimeLibrary() = 0;
0067
0068
0069 virtual bool CheckIfRuntimeIsValid(const lldb::ModuleSP module_sp) = 0;
0070
0071
0072
0073
0074 virtual void Activate() = 0;
0075
0076 public:
0077 static void ModulesDidLoad(lldb_private::ModuleList &module_list,
0078 Process *process,
0079 InstrumentationRuntimeCollection &runtimes);
0080
0081
0082
0083
0084 void ModulesDidLoad(lldb_private::ModuleList &module_list);
0085
0086 bool IsActive() const { return m_is_active; }
0087
0088 virtual lldb::ThreadCollectionSP
0089 GetBacktracesFromExtendedStopInfo(StructuredData::ObjectSP info);
0090 };
0091
0092 }
0093
0094 #endif