]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link/internal/ld: fix DWARF offsets with GOEXPERIMENT=framepointer
authorAustin Clements <austin@google.com>
Thu, 26 May 2016 02:59:19 +0000 (22:59 -0400)
committerAustin Clements <austin@google.com>
Thu, 26 May 2016 13:54:02 +0000 (13:54 +0000)
The offsets computed by the DWARF expressions for local variables
currently don't account for the extra stack slot used by the frame
pointer when GOEXPERIMENT=framepointer is enabled.

Fix this by adding the extra stack slot to the offset.

This fixes TestGdbPython with GOEXPERIMENT=framepointer.

Updates #15840.

Change-Id: I1b2ebb2750cd22266f4a89ec8d9e8bfa05fabd19
Reviewed-on: https://go-review.googlesource.com/23458
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/link/internal/ld/dwarf.go

index bf1a7e74c1403f24c0c3443c150df09cf59c1d5a..ca86e72d8329ccfcab45fe255f4901eec949b899 100644 (file)
@@ -1558,6 +1558,12 @@ func writelines(prev *LSym) *LSym {
                                if !haslinkregister() {
                                        offs -= int64(SysArch.PtrSize)
                                }
+                               if obj.Framepointer_enabled != 0 {
+                                       // The frame pointer is saved
+                                       // between the CFA and the
+                                       // autos.
+                                       offs -= int64(SysArch.PtrSize)
+                               }
 
                        case obj.A_PARAM:
                                dt = DW_ABRV_PARAM