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:
Alessandro Arzilli
2020-09-09 19:36:15 +02:00
committed by GitHub
parent e07bfd3180
commit 12009e9833
39 changed files with 178 additions and 180 deletions

View File

@ -516,7 +516,7 @@ func (it *stackIterator) executeFrameRegRule(regnum uint64, rule frame.DWRule, c
func (it *stackIterator) readRegisterAt(regnum uint64, addr uint64) (*op.DwarfRegister, error) {
buf := make([]byte, it.bi.Arch.regSize(regnum))
_, err := it.mem.ReadMemory(buf, uintptr(addr))
_, err := it.mem.ReadMemory(buf, addr)
if err != nil {
return nil, err
}
@ -675,7 +675,7 @@ func (d *Defer) EvalScope(thread Thread) (*EvalScope, error) {
return nil, fmt.Errorf("could not read DWARF function entry: %v", err)
}
scope.Regs.FrameBase, _, _, _ = bi.Location(e, dwarf.AttrFrameBase, scope.PC, scope.Regs)
scope.Mem = cacheMemory(scope.Mem, uintptr(scope.Regs.CFA), int(d.argSz))
scope.Mem = cacheMemory(scope.Mem, uint64(scope.Regs.CFA), int(d.argSz))
return scope, nil
}