mirror of
https://github.com/go-delve/delve.git
synced 2025-10-28 04:35:19 +08:00
proc/*,service: replace uses of uintptr with uint64 (#2163)
Since proc is supposed to work independently from the target architecture it shouldn't use architecture-dependent types, like uintptr. For example when reading a 64bit core file on a 32bit architecture, uintptr will be 32bit but the addresses proc needs to represent will be 64bit.
This commit is contained in:
committed by
GitHub
parent
e07bfd3180
commit
12009e9833
@ -326,9 +326,9 @@ func buildMemory(core, exeELF *elf.File, exe io.ReaderAt, notes []*note) proc.Me
|
||||
for _, entry := range fileNote.entries {
|
||||
r := &offsetReaderAt{
|
||||
reader: exe,
|
||||
offset: uintptr(entry.Start - (entry.FileOfs * fileNote.PageSize)),
|
||||
offset: entry.Start - (entry.FileOfs * fileNote.PageSize),
|
||||
}
|
||||
memory.Add(r, uintptr(entry.Start), uintptr(entry.End-entry.Start))
|
||||
memory.Add(r, entry.Start, entry.End-entry.Start)
|
||||
}
|
||||
|
||||
}
|
||||
@ -344,9 +344,9 @@ func buildMemory(core, exeELF *elf.File, exe io.ReaderAt, notes []*note) proc.Me
|
||||
}
|
||||
r := &offsetReaderAt{
|
||||
reader: prog.ReaderAt,
|
||||
offset: uintptr(prog.Vaddr),
|
||||
offset: prog.Vaddr,
|
||||
}
|
||||
memory.Add(r, uintptr(prog.Vaddr), uintptr(prog.Filesz))
|
||||
memory.Add(r, prog.Vaddr, prog.Filesz)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user