mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Fix integer type mismatches in swift-inspect when building 32-bit.
This commit is contained in:
@@ -241,7 +241,7 @@ internal final class DarwinRemoteProcess: RemoteProcess {
|
||||
internal func iteratePotentialMetadataPages(_ body: (swift_addr_t, UInt64) -> Void) {
|
||||
if let initialPoolPointer: UInt = readGlobalVariable(named: "_swift_debug_allocationPoolPointer"),
|
||||
let initialPoolSize: UInt = readGlobalVariable(named: "_swift_debug_allocationPoolSize") {
|
||||
body(swift_reflection_ptr_t(initialPoolPointer), UInt64(initialPoolSize));
|
||||
body(swift_addr_t(initialPoolPointer), UInt64(initialPoolSize));
|
||||
}
|
||||
|
||||
if let pageSize: UInt = readGlobalVariable(named: "_swift_debug_metadataAllocatorPageSize") {
|
||||
|
||||
@@ -194,8 +194,11 @@ internal struct DumpGenericMetadata: ParsableCommand {
|
||||
private func metadataFromScanning(process: any RemoteProcess) throws -> [Metadata] {
|
||||
var metadata: [Metadata] = []
|
||||
|
||||
func scanMemory(address: swift_reflection_ptr_t, size: UInt64) {
|
||||
for candidate in stride(from: address, to: address + swift_reflection_ptr_t(size), by: MemoryLayout<UInt>.size) {
|
||||
func scanMemory(address: swift_addr_t, size: UInt64) {
|
||||
let convertedAddress = swift_reflection_ptr_t(address)
|
||||
for candidate in stride(from: convertedAddress,
|
||||
to: convertedAddress + swift_reflection_ptr_t(size),
|
||||
by: MemoryLayout<UInt>.size) {
|
||||
guard let name = process.context.name(type: candidate, mangled: mangled) else {
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user