Skip to content

Commit bb3c7f5

Browse files
committed
[RemoteMirror] Allow clients to specify whether Obj-C interop is enabled.
rdar://119570103
1 parent 6c27021 commit bb3c7f5

File tree

7 files changed

+459
-369
lines changed

7 files changed

+459
-369
lines changed

include/swift/Remote/InProcessMemoryReader.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ class InProcessMemoryReader final : public MemoryReader {
8888
}
8989
return true;
9090
}
91+
case DLQ_GetObjCInteropIsEnabled:
92+
break;
9193
}
9294
return false;
9395
}

include/swift/Remote/MemoryReader.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ class MemoryReader {
195195
return resolvePointer(address, pointerData);
196196
}
197197

198-
// Parse extra inhabitants stored in a pointer.
198+
// Parse extra inhabitants stored in a pointer.
199199
// Sets *extraInhabitant to -1 if the pointer at this address
200200
// is actually a valid pointer.
201201
// Otherwise, it sets *extraInhabitant to the inhabitant

include/swift/Remote/MetadataReader.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -647,8 +647,11 @@ class MetadataReader {
647647

648648
auto classMeta = cast<TargetClassMetadata>(meta);
649649
while (stripSignedPointer(classMeta->Superclass)) {
650-
classMeta = cast<TargetClassMetadata>(
651-
readMetadata(stripSignedPointer(classMeta->Superclass)));
650+
meta = readMetadata(stripSignedPointer(classMeta->Superclass));
651+
if (!meta || meta->getKind() != MetadataKind::Class)
652+
return llvm::None;
653+
654+
classMeta = cast<TargetClassMetadata>(meta);
652655

653656
// Subtract the size contribution of the isa and retain counts from
654657
// the super class.

include/swift/SwiftRemoteMirror/MemoryReaderInterface.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ typedef enum {
103103
/// process. This is currently 0x1000 (4096) except on 64-bit Apple platforms
104104
/// where it is 0x100000000.
105105
DLQ_GetLeastValidPointerValue,
106+
107+
/// The query should ignore inBuffer, and treat outBuffer as bool* which
108+
/// should be populated with whether the target runtime uses Obj-C interop.
109+
DLQ_GetObjCInteropIsEnabled,
106110
} DataLayoutQueryType;
107111

108112
/// Data layout query function, which returns answers based on query types (from

lib/StaticMirror/ObjectFileContext.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,8 @@ bool ObjectMemoryReader::queryDataLayout(DataLayoutQueryType type,
431431
}
432432
return true;
433433
}
434+
case DLQ_GetObjCInteropIsEnabled:
435+
break;
434436
}
435437

436438
return false;

0 commit comments

Comments
 (0)