File tree Expand file tree Collapse file tree 3 files changed +17
-1
lines changed
source/Plugins/DynamicLoader/MacOSX-DYLD Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -251,6 +251,14 @@ class DynamicLoader : public PluginInterface {
251
251
return false ;
252
252
}
253
253
254
+ // / Return whether the dynamic loader is fully initialized and it's safe to
255
+ // / call its APIs.
256
+ // /
257
+ // / On some systems (e.g. Darwin based systems), lldb will get notified by
258
+ // / the dynamic loader before it itself finished initializing and it's not
259
+ // / safe to call certain APIs or SPIs.
260
+ virtual bool IsFullyInitialized () { return true ; }
261
+
254
262
protected:
255
263
// Utility methods for derived classes
256
264
@@ -294,7 +302,7 @@ class DynamicLoader : public PluginInterface {
294
302
// Read a pointer from memory at the given addr. Return LLDB_INVALID_ADDRESS
295
303
// if the read fails.
296
304
lldb::addr_t ReadPointer (lldb::addr_t addr);
297
-
305
+
298
306
// Calls into the Process protected method LoadOperatingSystemPlugin:
299
307
void LoadOperatingSystemPlugin (bool flush);
300
308
Original file line number Diff line number Diff line change @@ -1114,6 +1114,12 @@ bool DynamicLoaderMacOSXDYLD::GetSharedCacheInformation(
1114
1114
return false ;
1115
1115
}
1116
1116
1117
+ bool DynamicLoaderMacOSXDYLD::IsFullyInitialized () {
1118
+ if (ReadAllImageInfosStructure ())
1119
+ return m_dyld_all_image_infos.libSystemInitialized ;
1120
+ return false ;
1121
+ }
1122
+
1117
1123
void DynamicLoaderMacOSXDYLD::Initialize () {
1118
1124
PluginManager::RegisterPlugin (GetPluginNameStatic (),
1119
1125
GetPluginDescriptionStatic (), CreateInstance);
Original file line number Diff line number Diff line change @@ -68,6 +68,8 @@ class DynamicLoaderMacOSXDYLD : public lldb_private::DynamicLoaderDarwin {
68
68
69
69
uint32_t GetPluginVersion () override ;
70
70
71
+ bool IsFullyInitialized () override ;
72
+
71
73
protected:
72
74
void PutToLog (lldb_private::Log *log) const ;
73
75
You can’t perform that action at this time.
0 commit comments