Loading...
--- dyld/dyld-1340/dyld/DebuggerSupport.cpp
+++ dyld/dyld-941.4/dyld/DebuggerSupport.cpp
@@ -28,23 +28,16 @@
#include <string.h>
#include <mach-o/loader.h>
#include <mach-o/dyld_images.h>
-#include <TargetConditionals.h>
-#if !TARGET_OS_EXCLAVEKIT
- #include <mach-o/dyld_process_info.h>
- #include <mach/mach_time.h>
-#endif
+#include <mach-o/dyld_process_info.h>
+#include <mach/mach_time.h>
#include "Vector.h"
#include "Tracing.h"
#include "Array.h"
#include "DebuggerSupport.h"
#include "MachOFile.h"
-#include "dyld_process_info.h"
-
-using lsl::Vector;
-using lsl::Allocator;
-
-extern struct mach_header __dso_handle;
+
+extern void* __dso_handle;
// lldb sets a break point on this function
extern "C" void _dyld_debugger_notification(enum dyld_notify_mode mode, unsigned long count, uint64_t machHeaders[]);
@@ -73,22 +66,20 @@
gProcessInfo->uuidArray = sImageUUIDs->begin();
}
-void addImagesToAllImages(Allocator& persistentAllocator, uint32_t infoCount, const dyld_image_info info[], uint32_t initialImageCount)
+void addImagesToAllImages(Allocator& allocator, uint32_t infoCount, const dyld_image_info info[])
{
// set infoArray to NULL to denote it is in-use
gProcessInfo->infoArray = NULL;
// append all new images
if ( sImageInfos == nullptr ) {
- sImageInfos = Vector<dyld_image_info>::make(persistentAllocator);
- sImageInfos->reserve(initialImageCount);
+ sImageInfos = Vector<dyld_image_info>::make(allocator);
+ sImageInfos->reserve(256);
}
for (uint32_t i=0; i < infoCount; ++i)
sImageInfos->push_back(info[i]);
gProcessInfo->infoArrayCount = (uint32_t)sImageInfos->size();
-#if !TARGET_OS_EXCLAVEKIT
gProcessInfo->infoArrayChangeTimestamp = mach_absolute_time();
-#endif
// set infoArray back to base address of vector (other process can now read)
gProcessInfo->infoArray = sImageInfos->begin();
@@ -112,9 +103,8 @@
sAotImageInfos->push_back(aotInfo[i]);
}
gProcessInfo->aotInfoCount = (uint32_t)sAotImageInfos->size();
-#if !TARGET_OS_EXCLAVEKIT
gProcessInfo->aotInfoArrayChangeTimestamp = mach_absolute_time();
-#endif
+
// set aotInfoArray back to base address of vector (other process can now read)
gProcessInfo->aotInfoArray = sAotImageInfos->begin();
}
@@ -142,31 +132,6 @@
}
#endif
-#if SUPPORT_ROSETTA
-void removeAotImageFromAllAotImages(const mach_header* loadAddress)
-{
- if ( sAotImageInfos == nullptr ) {
- return;
- }
-
- // set aotInfoArray to NULL to denote it is in-use
- gProcessInfo->aotInfoArray = NULL;
-
- // remove image from aotInfoArray
- for (auto it=sAotImageInfos->begin(); it != sAotImageInfos->end(); ++it) {
- if ( it->aotLoadAddress == loadAddress ) {
- sAotImageInfos->erase(it);
- break;
- }
- }
- gProcessInfo->aotInfoCount = (uint32_t)sAotImageInfos->size();
-#if !TARGET_OS_EXCLAVEKIT
- gProcessInfo->aotInfoArrayChangeTimestamp = mach_absolute_time();
-#endif
- // set aotInfoArray back to base address of vector
- gProcessInfo->aotInfoArray = sAotImageInfos->begin();
-}
-#endif
void removeImageFromAllImages(const mach_header* loadAddress)
{
@@ -188,10 +153,10 @@
// set infoArray back to base address of vector
gProcessInfo->infoArray = sImageInfos->begin();
- // set uuidArray to NULL to denote it is in-use
+ // set uuidArrayCount to NULL to denote it is in-use
gProcessInfo->uuidArray = NULL;
- // remove image from uuidArray
+ // remove image from infoArray
for (auto it=sImageUUIDs->begin(); it != sImageUUIDs->end(); ++it) {
if ( it->imageLoadAddress == loadAddress ) {
sImageUUIDs->erase(it);
@@ -199,9 +164,8 @@
}
}
gProcessInfo->uuidArrayCount = sImageUUIDs->size();
-#if !TARGET_OS_EXCLAVEKIT
gProcessInfo->infoArrayChangeTimestamp = mach_absolute_time();
-#endif
+
// set infoArray back to base address of vector
gProcessInfo->uuidArray = sImageUUIDs->begin();
@@ -215,13 +179,11 @@
struct dyld_all_image_infos* gProcessInfo = nullptr;
#else
- void lldb_image_notifier(enum dyld_image_mode mode, uint32_t infoCount, const dyld_image_info info[])
+ static void lldb_image_notifier(enum dyld_image_mode mode, uint32_t infoCount, const dyld_image_info info[])
{
#if BUILDING_DYLD
- #if !TARGET_OS_EXCLAVEKIT
- dyld3::ScopedTimer timer(DBG_DYLD_GDB_IMAGE_NOTIFIER, 0, 0, 0);
- #endif
- uint64_t machHeaders[infoCount];
+ dyld3::ScopedTimer(DBG_DYLD_GDB_IMAGE_NOTIFIER, 0, 0, 0);
+ uint64_t machHeaders[infoCount];
for (uint32_t i=0; i < infoCount; ++i) {
machHeaders[i] = (uintptr_t)(info[i].imageLoadAddress);
}
@@ -233,9 +195,6 @@
case dyld_image_removing:
_dyld_debugger_notification(dyld_notify_removing, infoCount, machHeaders);
break;
- case dyld_image_dyld_moved:
- _dyld_debugger_notification(dyld_notify_dyld_moved, infoCount, machHeaders);
- break;
default:
break;
}
@@ -259,7 +218,6 @@
#define MAYBE_ATOMIC(x) x
#endif
-
struct dyld_all_image_infos dyld_all_image_infos __attribute__ ((section ("__DATA,__all_image_info")))
= {
17, 0, MAYBE_ATOMIC(NULL), &lldb_image_notifier, false, false, (const mach_header*)&__dso_handle, NULL,