aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/internal/obj
diff options
context:
space:
mode:
authorJosh Bleecher Snyder <josharian@gmail.com>2017-04-07 19:50:31 +0000
committerJosh Bleecher Snyder <josharian@gmail.com>2017-04-07 19:52:26 +0000
commit3cf1ce40bde952c0ca0ac2af7737bfae5841f0c4 (patch)
treeeb4a5983beb577cf49316e84ab9245c7aa8fc7e3 /src/cmd/internal/obj
parentc8b889cc4824f4dbd64a51a3f7b5b6dce4b87ed2 (diff)
downloadgo-3cf1ce40bde952c0ca0ac2af7737bfae5841f0c4.tar.xz
Revert "cmd/compile: output DWARF lexical blocks for local variables"
This reverts commit c8b889cc4824f4dbd64a51a3f7b5b6dce4b87ed2. Reason for revert: broke noopt build, compiler performance regression, new Curfn uses Let's fix those and then try this again. Change-Id: Icc3cad1365d04cac8fd09da9dbb0bbf55c13ef44 Reviewed-on: https://go-review.googlesource.com/39991 Reviewed-by: Robert Griesemer <gri@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src/cmd/internal/obj')
-rw-r--r--src/cmd/internal/obj/data.go2
-rw-r--r--src/cmd/internal/obj/link.go3
-rw-r--r--src/cmd/internal/obj/objfile.go31
3 files changed, 8 insertions, 28 deletions
diff --git a/src/cmd/internal/obj/data.go b/src/cmd/internal/obj/data.go
index 7a19e3a38c..114841dedb 100644
--- a/src/cmd/internal/obj/data.go
+++ b/src/cmd/internal/obj/data.go
@@ -114,7 +114,7 @@ func (s *LSym) WriteInt(ctxt *Link, off int64, siz int, i int64) {
// WriteAddr writes an address of size siz into s at offset off.
// rsym and roff specify the relocation for the address.
func (s *LSym) WriteAddr(ctxt *Link, off int64, siz int, rsym *LSym, roff int64) {
- if siz != ctxt.Arch.PtrSize && siz != 4 {
+ if siz != ctxt.Arch.PtrSize {
ctxt.Diag("WriteAddr: bad address size %d in %s", siz, s.Name)
}
s.prepwrite(ctxt, off, siz)
diff --git a/src/cmd/internal/obj/link.go b/src/cmd/internal/obj/link.go
index e08d7a0340..fd07851f3b 100644
--- a/src/cmd/internal/obj/link.go
+++ b/src/cmd/internal/obj/link.go
@@ -483,7 +483,6 @@ const (
SHOSTOBJ
SDWARFSECT
SDWARFINFO
- SDWARFRANGE
SSUB = SymKind(1 << 8)
SMASK = SymKind(SSUB - 1)
SHIDDEN = SymKind(1 << 9)
@@ -740,7 +739,7 @@ type Link struct {
Armsize int32
Pc int64
DiagFunc func(string, ...interface{})
- DebugInfo func(fn *LSym, curfn interface{}) []dwarf.Scope // if non-nil, curfn is a *gc.Node
+ DebugInfo func(fn *LSym, curfn interface{}) []*dwarf.Var // if non-nil, curfn is a *gc.Node
Cursym *LSym
Version int
Errors int
diff --git a/src/cmd/internal/obj/objfile.go b/src/cmd/internal/obj/objfile.go
index 314c7a9de6..6858143674 100644
--- a/src/cmd/internal/obj/objfile.go
+++ b/src/cmd/internal/obj/objfile.go
@@ -542,14 +542,10 @@ func (c dwCtxt) SymValue(s dwarf.Sym) int64 {
return 0
}
func (c dwCtxt) AddAddress(s dwarf.Sym, data interface{}, value int64) {
+ rsym := data.(*LSym)
ls := s.(*LSym)
size := c.PtrSize()
- if data != nil {
- rsym := data.(*LSym)
- ls.WriteAddr(c.Link, ls.Size, size, rsym, value)
- } else {
- ls.WriteInt(c.Link, ls.Size, size, value)
- }
+ ls.WriteAddr(c.Link, ls.Size, size, rsym, value)
}
func (c dwCtxt) AddSectionOffset(s dwarf.Sym, size int, t interface{}, ofs int64) {
ls := s.(*LSym)
@@ -559,10 +555,6 @@ func (c dwCtxt) AddSectionOffset(s dwarf.Sym, size int, t interface{}, ofs int64
r.Type = R_DWARFREF
}
-func (s *LSym) Len() int64 {
- return s.Size
-}
-
// makeFuncDebugEntry makes a DWARF Debugging Information Entry
// for TEXT symbol s.
func makeFuncDebugEntry(ctxt *Link, curfn interface{}, s *LSym) {
@@ -572,21 +564,10 @@ func makeFuncDebugEntry(ctxt *Link, curfn interface{}, s *LSym) {
}
dsym.Type = SDWARFINFO
dsym.Set(AttrDuplicateOK, s.DuplicateOK())
-
- drsym := ctxt.Lookup(dwarf.RangePrefix+s.Name, int(s.Version))
- if drsym.Size != 0 {
- return
- }
- drsym.Type = SDWARFRANGE
- drsym.Set(AttrDuplicateOK, s.DuplicateOK())
-
- var scopes []dwarf.Scope
+ var vars []*dwarf.Var
if ctxt.DebugInfo != nil {
- scopes = ctxt.DebugInfo(s, curfn)
- }
- err := dwarf.PutFunc(dwCtxt{ctxt}, dsym, drsym, s.Name, s.Version == 0, s, s.Size, scopes)
- if err != nil {
- ctxt.Diag("emitting DWARF for %s failed: %v", s.Name, err)
+ vars = ctxt.DebugInfo(s, curfn)
}
- ctxt.Data = append(ctxt.Data, dsym, drsym)
+ dwarf.PutFunc(dwCtxt{ctxt}, dsym, s.Name, s.Version == 0, s, s.Size, vars)
+ ctxt.Data = append(ctxt.Data, dsym)
}