[Lldb-commits] [lldb] 3449207 - [lldb][NFC] Fix the SPI prototypes in HostInfoMacOSX.mm
Jason Molenda via lldb-commits
lldb-commits at lists.llvm.org
Fri Feb 6 18:00:23 PST 2026
Author: Jason Molenda
Date: 2026-02-06T17:59:14-08:00
New Revision: 3449207b7b22f5c28d73046d076d8048aac43353
URL: https://github.com/llvm/llvm-project/commit/3449207b7b22f5c28d73046d076d8048aac43353
DIFF: https://github.com/llvm/llvm-project/commit/3449207b7b22f5c28d73046d076d8048aac43353.diff
LOG: [lldb][NFC] Fix the SPI prototypes in HostInfoMacOSX.mm
to unblock a CI bot building with a different set of headers.
rdar://148939795
Added:
Modified:
lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm
Removed:
################################################################################
diff --git a/lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm b/lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm
index 114b91fc0b4d3..e8f416270cdb8 100644
--- a/lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm
+++ b/lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm
@@ -655,24 +655,30 @@ static bool ResolveAndVerifyCandidateSupportDir(FileSpec &path) {
// All available on at least macOS 12
extern "C" {
+typedef struct dyld_process_s *dyld_process_t;
+typedef struct dyld_process_snapshot_s *dyld_process_snapshot_t;
+typedef struct dyld_shared_cache_s *dyld_shared_cache_t;
+typedef struct dyld_image_s *dyld_image_t;
+
int dyld_shared_cache_iterate_text(
const uuid_t cacheUuid,
void (^callback)(const dyld_shared_cache_dylib_text_info *info));
uint8_t *_dyld_get_shared_cache_range(size_t *length);
bool _dyld_get_shared_cache_uuid(uuid_t uuid);
-bool dyld_image_for_each_segment_info(void *image,
+bool dyld_image_for_each_segment_info(dyld_image_t image,
void (^)(const char *segmentName,
uint64_t vmAddr, uint64_t vmSize,
int perm));
const char *dyld_shared_cache_file_path(void);
bool dyld_shared_cache_for_file(const char *filePath,
- void (^block)(void *cache));
-void dyld_shared_cache_copy_uuid(void *cache, uuid_t *uuid);
-uint64_t dyld_shared_cache_get_base_address(void *cache);
-void dyld_shared_cache_for_each_image(void *cache, void (^block)(void *image));
-bool dyld_image_copy_uuid(void *cache, uuid_t *uuid);
-const char *dyld_image_get_installname(void *image);
-const char *dyld_image_get_file_path(void *image);
+ void (^block)(dyld_shared_cache_t cache));
+void dyld_shared_cache_copy_uuid(dyld_shared_cache_t cache, uuid_t *uuid);
+uint64_t dyld_shared_cache_get_base_address(dyld_shared_cache_t cache);
+void dyld_shared_cache_for_each_image(dyld_shared_cache_t cache,
+ void (^block)(dyld_image_t image));
+bool dyld_image_copy_uuid(dyld_image_t cache, uuid_t *uuid);
+const char *dyld_image_get_installname(dyld_image_t image);
+const char *dyld_image_get_file_path(dyld_image_t image);
}
namespace {
@@ -758,9 +764,9 @@ static dispatch_data_t (*g_dyld_image_segment_data_4HWTrace)(
return {};
__block std::vector<segment> segments;
- __block void *image_copy = image;
+ __block dyld_image_t image_copy = (dyld_image_t)image;
dyld_image_for_each_segment_info(
- image,
+ (dyld_image_t)image,
^(const char *segmentName, uint64_t vmAddr, uint64_t vmSize, int perm) {
segment seg;
seg.name = segmentName;
@@ -824,7 +830,7 @@ static dispatch_data_t (*g_dyld_image_segment_data_4HWTrace)(
return false;
__block bool return_failed = false;
- dyld_shared_cache_for_file(filepath.c_str(), ^(void *cache) {
+ dyld_shared_cache_for_file(filepath.c_str(), ^(dyld_shared_cache_t cache) {
uuid_t sc_uuid;
dyld_shared_cache_copy_uuid(cache, &sc_uuid);
UUID this_cache(sc_uuid, sizeof(uuid_t));
@@ -833,7 +839,7 @@ static dispatch_data_t (*g_dyld_image_segment_data_4HWTrace)(
return;
}
- dyld_shared_cache_for_each_image(cache, ^(void *image) {
+ dyld_shared_cache_for_each_image(cache, ^(dyld_image_t image) {
uuid_t uuid_tmp;
if (!dyld_image_copy_uuid(image, &uuid_tmp))
return;
@@ -842,7 +848,7 @@ static dispatch_data_t (*g_dyld_image_segment_data_4HWTrace)(
Log *log = GetLog(LLDBLog::Modules);
if (log && log->GetVerbose())
LLDB_LOGF(log, "sc file %s image %p", dyld_image_get_installname(image),
- image);
+ (void *)image);
m_dyld_image_retain_4HWTrace(image);
m_caches[m_host_uuid][dyld_image_get_installname(image)] =
@@ -861,11 +867,12 @@ static dispatch_data_t (*g_dyld_image_segment_data_4HWTrace)(
bool SharedCacheInfo::CreateHostSharedCacheImageList() {
std::string host_shared_cache_file = dyld_shared_cache_file_path();
__block UUID host_sc_uuid;
- dyld_shared_cache_for_file(host_shared_cache_file.c_str(), ^(void *cache) {
- uuid_t sc_uuid;
- dyld_shared_cache_copy_uuid(cache, &sc_uuid);
- host_sc_uuid = UUID(sc_uuid, sizeof(uuid_t));
- });
+ dyld_shared_cache_for_file(host_shared_cache_file.c_str(),
+ ^(dyld_shared_cache_t cache) {
+ uuid_t sc_uuid;
+ dyld_shared_cache_copy_uuid(cache, &sc_uuid);
+ host_sc_uuid = UUID(sc_uuid, sizeof(uuid_t));
+ });
if (host_sc_uuid.IsValid())
return CreateSharedCacheImageList(host_sc_uuid, host_shared_cache_file);
More information about the lldb-commits
mailing list