Finish support for Go1.5beta2

This commit is contained in:
Derek Parker 2015-07-28 18:56:55 -05:00
parent bcbda1dba3
commit a506bb7d8e
3 changed files with 10 additions and 8 deletions

@ -291,7 +291,7 @@ func offsetextended(frame *FrameContext) {
offset, _ = util.DecodeULEB128(frame.buf)
)
frame.regs[reg] = DWRule{offset: int64(offset), rule: rule_offset}
frame.regs[reg] = DWRule{offset: int64(offset) * frame.dataAlignment, rule: rule_offset}
}
func undefined(frame *FrameContext) {

@ -37,10 +37,9 @@ func (a *AMD64) SetGStructOffset(ver GoVersion, isextld bool) {
a.gStructOffset = 0x8a0
case "linux":
a.gStructOffset = 0xfffffffffffffff0
}
if isextld || ver.AfterOrEqual(GoVersion{1, 5, -1, 2}) || ver.IsDevel() {
a.gStructOffset += 8
if isextld || ver.AfterOrEqual(GoVersion{1, 5, -1, 2}) || ver.IsDevel() {
a.gStructOffset += 8
}
}
}

@ -53,13 +53,13 @@ func (dbp *Process) stacktrace(pc, sp uint64, depth int) ([]Location, error) {
)
f, l, fn := dbp.PCToLine(pc)
locations = append(locations, Location{PC: pc, File: f, Line: l, Fn: fn})
for i := int64(0); i < int64(depth); i++ {
for i := 0; i < depth; i++ {
fde, err := dbp.frameEntries.FDEForPC(ret)
if err != nil {
return nil, err
}
btoffset += fde.ReturnAddressOffset(ret)
retaddr = uintptr(int64(sp) + btoffset + (i * int64(dbp.arch.PtrSize())))
retaddr = uintptr(int64(sp) + btoffset + int64(i*dbp.arch.PtrSize()))
if retaddr == 0 {
return nil, NullAddrError{}
}
@ -72,8 +72,11 @@ func (dbp *Process) stacktrace(pc, sp uint64, depth int) ([]Location, error) {
break
}
f, l, fn = dbp.goSymTable.PCToLine(ret)
if fn == nil {
break
}
locations = append(locations, Location{PC: ret, File: f, Line: l, Fn: fn})
if fn != nil && fn.Name == "runtime.goexit" {
if fn.Name == "runtime.goexit" {
break
}
}