]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: poison pcln.frame value
authorRuss Cox <rsc@golang.org>
Wed, 4 Mar 2015 21:50:59 +0000 (16:50 -0500)
committerRuss Cox <rsc@golang.org>
Thu, 5 Mar 2015 04:14:00 +0000 (04:14 +0000)
Nothing uses it, nothing should start using it.
Stop leaving plausible-looking values there.
It would be nice to remove entirely, but that would
require a new version number for the object file format,
in order not to break external readers like debug/gosym.
It's easier to leave and poison.

I came across an old mail thread suggesting we start using it
to speed up tracebacks. I want to make sure that doesn't happen.

(The values there were never quite right, and the number is
fundamentally PC-specific anyway.)

Change-Id: Iaf38e8a6b523cbae30b69c28497c4588ef397519
Reviewed-on: https://go-review.googlesource.com/6890
Reviewed-by: Minux Ma <minux@golang.org>
src/cmd/internal/ld/pcln.go

index a74143d9fd24f4a8b9236997ea656c60f02beb86..0250ca0eb829cac133d7f7f88a8ab76a514c402a 100644 (file)
@@ -231,7 +231,6 @@ func pclntab() {
        nfunc = 0
        var last *LSym
        var end int32
-       var frameptrsize int32
        var funcstart int32
        var i int32
        var it Pciter
@@ -273,17 +272,11 @@ func pclntab() {
                off = int32(setuint32(Ctxt, ftab, int64(off), uint32(Ctxt.Cursym.Args)))
 
                // frame int32
-               // TODO: Remove entirely. The pcsp table is more precise.
-               // This is only used by a fallback case during stack walking
-               // when a called function doesn't have argument information.
-               // We need to make sure everything has argument information
-               // and then remove this.
-               frameptrsize = int32(Thearch.Ptrsize)
-
-               if Ctxt.Cursym.Leaf != 0 {
-                       frameptrsize = 0
-               }
-               off = int32(setuint32(Ctxt, ftab, int64(off), uint32(Ctxt.Cursym.Locals)+uint32(frameptrsize)))
+               // This has been removed (it was never set quite correctly anyway).
+               // Nothing should use it.
+               // Leave an obviously incorrect value.
+               // TODO: Remove entirely.
+               off = int32(setuint32(Ctxt, ftab, int64(off), 0x1234567))
 
                if pcln != &pclntab_zpcln {
                        renumberfiles(Ctxt, pcln.File, &pcln.Pcfile)