Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down