Skip to content

Commit

Permalink
Finish support for Go1.5beta2
Browse files Browse the repository at this point in the history
  • Loading branch information
derekparker committed Jul 28, 2015
1 parent bcbda1d commit a506bb7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dwarf/frame/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
7 changes: 3 additions & 4 deletions proc/arch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}

Expand Down
9 changes: 6 additions & 3 deletions proc/stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
}
Expand All @@ -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
}
}
Expand Down

0 comments on commit a506bb7

Please sign in to comment.