Refactor read/write memory code

This commit is contained in:
Derek Parker
2015-08-01 21:43:03 -05:00
parent 5e5f5aff30
commit 93dcd40cee
7 changed files with 25 additions and 42 deletions

View File

@ -46,7 +46,6 @@ func (n NullAddrError) Error() string {
func (dbp *Process) stacktrace(pc, sp uint64, depth int) ([]Location, error) {
var (
ret = pc
data = make([]byte, dbp.arch.PtrSize())
btoffset int64
locations []Location
retaddr uintptr
@ -63,7 +62,7 @@ func (dbp *Process) stacktrace(pc, sp uint64, depth int) ([]Location, error) {
if retaddr == 0 {
return nil, NullAddrError{}
}
_, err = readMemory(dbp.CurrentThread, retaddr, data)
data, err := dbp.CurrentThread.readMemory(retaddr, dbp.arch.PtrSize())
if err != nil {
return nil, err
}