mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/link: rename Pcln to FuncInfo
After non pcln fields were added to it in a previous commit. Change-Id: Icf92c0774d157c61399a6fc2a3c4d2cd47a634d2 Reviewed-on: https://go-review.googlesource.com/21921 Run-TryBot: Shahar Kohanim <skohanim@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Crawshaw <crawshaw@golang.org>
This commit is contained in:
parent
24967ec122
commit
61b7a9c57b
6 changed files with 30 additions and 30 deletions
|
|
@ -272,8 +272,8 @@ func (d *deadcodepass) flood() {
|
||||||
if Debug['v'] > 1 {
|
if Debug['v'] > 1 {
|
||||||
fmt.Fprintf(d.ctxt.Bso, "marktext %s\n", s.Name)
|
fmt.Fprintf(d.ctxt.Bso, "marktext %s\n", s.Name)
|
||||||
}
|
}
|
||||||
if s.Pcln != nil {
|
if s.FuncInfo != nil {
|
||||||
for _, a := range s.Pcln.Autom {
|
for _, a := range s.FuncInfo.Autom {
|
||||||
d.mark(a.Gotype, s)
|
d.mark(a.Gotype, s)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -335,9 +335,9 @@ func (d *deadcodepass) flood() {
|
||||||
d.markableMethods = append(d.markableMethods, methods...)
|
d.markableMethods = append(d.markableMethods, methods...)
|
||||||
}
|
}
|
||||||
|
|
||||||
if s.Pcln != nil {
|
if s.FuncInfo != nil {
|
||||||
for i := range s.Pcln.Funcdata {
|
for i := range s.FuncInfo.Funcdata {
|
||||||
d.mark(s.Pcln.Funcdata[i], s)
|
d.mark(s.FuncInfo.Funcdata[i], s)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
d.mark(s.Gotype, s)
|
d.mark(s.Gotype, s)
|
||||||
|
|
|
||||||
|
|
@ -1345,8 +1345,8 @@ func finddebugruntimepath(s *LSym) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
for i := range s.Pcln.File {
|
for i := range s.FuncInfo.File {
|
||||||
f := s.Pcln.File[i]
|
f := s.FuncInfo.File[i]
|
||||||
if i := strings.Index(f.Name, "runtime/runtime.go"); i >= 0 {
|
if i := strings.Index(f.Name, "runtime/runtime.go"); i >= 0 {
|
||||||
gdbscript = f.Name[:i] + "runtime/runtime-gdb.py"
|
gdbscript = f.Name[:i] + "runtime/runtime-gdb.py"
|
||||||
break
|
break
|
||||||
|
|
@ -1514,14 +1514,14 @@ func writelines(prev *LSym) *LSym {
|
||||||
newattr(dwfunc, DW_AT_external, DW_CLS_FLAG, 1, 0)
|
newattr(dwfunc, DW_AT_external, DW_CLS_FLAG, 1, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
if s.Pcln == nil {
|
if s.FuncInfo == nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
finddebugruntimepath(s)
|
finddebugruntimepath(s)
|
||||||
|
|
||||||
pciterinit(Ctxt, &pcfile, &s.Pcln.Pcfile)
|
pciterinit(Ctxt, &pcfile, &s.FuncInfo.Pcfile)
|
||||||
pciterinit(Ctxt, &pcline, &s.Pcln.Pcline)
|
pciterinit(Ctxt, &pcline, &s.FuncInfo.Pcline)
|
||||||
epc = pc
|
epc = pc
|
||||||
for pcfile.done == 0 && pcline.done == 0 {
|
for pcfile.done == 0 && pcline.done == 0 {
|
||||||
if epc-s.Value >= int64(pcfile.nextpc) {
|
if epc-s.Value >= int64(pcfile.nextpc) {
|
||||||
|
|
@ -1556,7 +1556,7 @@ func writelines(prev *LSym) *LSym {
|
||||||
dt, da int
|
dt, da int
|
||||||
offs int64
|
offs int64
|
||||||
)
|
)
|
||||||
for _, a := range s.Pcln.Autom {
|
for _, a := range s.FuncInfo.Autom {
|
||||||
switch a.Name {
|
switch a.Name {
|
||||||
case obj.A_AUTO:
|
case obj.A_AUTO:
|
||||||
dt = DW_ABRV_AUTO
|
dt = DW_ABRV_AUTO
|
||||||
|
|
@ -1698,14 +1698,14 @@ func writeframes(prev *LSym) *LSym {
|
||||||
var pcsp Pciter
|
var pcsp Pciter
|
||||||
for Ctxt.Cursym = Ctxt.Textp; Ctxt.Cursym != nil; Ctxt.Cursym = Ctxt.Cursym.Next {
|
for Ctxt.Cursym = Ctxt.Textp; Ctxt.Cursym != nil; Ctxt.Cursym = Ctxt.Cursym.Next {
|
||||||
s := Ctxt.Cursym
|
s := Ctxt.Cursym
|
||||||
if s.Pcln == nil {
|
if s.FuncInfo == nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
// Emit a FDE, Section 6.4.1.
|
// Emit a FDE, Section 6.4.1.
|
||||||
// First build the section contents into a byte buffer.
|
// First build the section contents into a byte buffer.
|
||||||
deltaBuf = deltaBuf[:0]
|
deltaBuf = deltaBuf[:0]
|
||||||
for pciterinit(Ctxt, &pcsp, &s.Pcln.Pcsp); pcsp.done == 0; pciternext(&pcsp) {
|
for pciterinit(Ctxt, &pcsp, &s.FuncInfo.Pcsp); pcsp.done == 0; pciternext(&pcsp) {
|
||||||
nextpc := pcsp.nextpc
|
nextpc := pcsp.nextpc
|
||||||
|
|
||||||
// pciterinit goes up to the end of the function,
|
// pciterinit goes up to the end of the function,
|
||||||
|
|
|
||||||
|
|
@ -1710,7 +1710,7 @@ func stkcheck(up *Chain, depth int) int {
|
||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
|
|
||||||
if s.Attr.External() || s.Pcln == nil {
|
if s.Attr.External() || s.FuncInfo == nil {
|
||||||
// external function.
|
// external function.
|
||||||
// should never be called directly.
|
// should never be called directly.
|
||||||
// only diagnose the direct caller.
|
// only diagnose the direct caller.
|
||||||
|
|
@ -1748,8 +1748,8 @@ func stkcheck(up *Chain, depth int) int {
|
||||||
}
|
}
|
||||||
// Raise limit to allow frame.
|
// Raise limit to allow frame.
|
||||||
locals := int32(0)
|
locals := int32(0)
|
||||||
if s.Pcln != nil {
|
if s.FuncInfo != nil {
|
||||||
locals = s.Pcln.Locals
|
locals = s.FuncInfo.Locals
|
||||||
}
|
}
|
||||||
limit = int(obj.StackLimit+locals) + int(Ctxt.FixedFrameSize())
|
limit = int(obj.StackLimit+locals) + int(Ctxt.FixedFrameSize())
|
||||||
}
|
}
|
||||||
|
|
@ -1761,7 +1761,7 @@ func stkcheck(up *Chain, depth int) int {
|
||||||
var ch1 Chain
|
var ch1 Chain
|
||||||
var pcsp Pciter
|
var pcsp Pciter
|
||||||
var r *Reloc
|
var r *Reloc
|
||||||
for pciterinit(Ctxt, &pcsp, &s.Pcln.Pcsp); pcsp.done == 0; pciternext(&pcsp) {
|
for pciterinit(Ctxt, &pcsp, &s.FuncInfo.Pcsp); pcsp.done == 0; pciternext(&pcsp) {
|
||||||
// pcsp.value is in effect for [pcsp.pc, pcsp.nextpc).
|
// pcsp.value is in effect for [pcsp.pc, pcsp.nextpc).
|
||||||
|
|
||||||
// Check stack size in effect for this span.
|
// Check stack size in effect for this span.
|
||||||
|
|
@ -1983,16 +1983,16 @@ func genasmsym(put func(*LSym, string, int, int64, int64, int, *LSym)) {
|
||||||
put(s, s.Name, 'T', s.Value, s.Size, int(s.Version), s.Gotype)
|
put(s, s.Name, 'T', s.Value, s.Size, int(s.Version), s.Gotype)
|
||||||
|
|
||||||
locals := int32(0)
|
locals := int32(0)
|
||||||
if s.Pcln != nil {
|
if s.FuncInfo != nil {
|
||||||
locals = s.Pcln.Locals
|
locals = s.FuncInfo.Locals
|
||||||
}
|
}
|
||||||
// NOTE(ality): acid can't produce a stack trace without .frame symbols
|
// NOTE(ality): acid can't produce a stack trace without .frame symbols
|
||||||
put(nil, ".frame", 'm', int64(locals)+int64(SysArch.PtrSize), 0, 0, nil)
|
put(nil, ".frame", 'm', int64(locals)+int64(SysArch.PtrSize), 0, 0, nil)
|
||||||
|
|
||||||
if s.Pcln == nil {
|
if s.FuncInfo == nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
for _, a := range s.Pcln.Autom {
|
for _, a := range s.FuncInfo.Autom {
|
||||||
// Emit a or p according to actual offset, even if label is wrong.
|
// Emit a or p according to actual offset, even if label is wrong.
|
||||||
// This avoids negative offsets, which cannot be encoded.
|
// This avoids negative offsets, which cannot be encoded.
|
||||||
if a.Name != obj.A_AUTO && a.Name != obj.A_PARAM {
|
if a.Name != obj.A_AUTO && a.Name != obj.A_PARAM {
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ type LSym struct {
|
||||||
Dynimplib string
|
Dynimplib string
|
||||||
Dynimpvers string
|
Dynimpvers string
|
||||||
Sect *Section
|
Sect *Section
|
||||||
Pcln *Pcln
|
FuncInfo *FuncInfo
|
||||||
P []byte
|
P []byte
|
||||||
R []Reloc
|
R []Reloc
|
||||||
}
|
}
|
||||||
|
|
@ -217,7 +217,7 @@ type Library struct {
|
||||||
hash []byte
|
hash []byte
|
||||||
}
|
}
|
||||||
|
|
||||||
type Pcln struct {
|
type FuncInfo struct {
|
||||||
Args int32
|
Args int32
|
||||||
Locals int32
|
Locals int32
|
||||||
Autom []Auto
|
Autom []Auto
|
||||||
|
|
|
||||||
|
|
@ -331,8 +331,8 @@ overwrite:
|
||||||
}
|
}
|
||||||
|
|
||||||
if s.Type == obj.STEXT {
|
if s.Type == obj.STEXT {
|
||||||
s.Pcln = new(Pcln)
|
s.FuncInfo = new(FuncInfo)
|
||||||
pc := s.Pcln
|
pc := s.FuncInfo
|
||||||
|
|
||||||
pc.Args = r.readInt32()
|
pc.Args = r.readInt32()
|
||||||
pc.Locals = r.readInt32()
|
pc.Locals = r.readInt32()
|
||||||
|
|
|
||||||
|
|
@ -204,7 +204,7 @@ func container(s *LSym) int {
|
||||||
// pclntab initializes the pclntab symbol with
|
// pclntab initializes the pclntab symbol with
|
||||||
// runtime function and file name information.
|
// runtime function and file name information.
|
||||||
|
|
||||||
var pclntab_zpcln Pcln
|
var pclntab_zpcln FuncInfo
|
||||||
|
|
||||||
// These variables are used to initialize runtime.firstmoduledata, see symtab.go:symtab.
|
// These variables are used to initialize runtime.firstmoduledata, see symtab.go:symtab.
|
||||||
var pclntabNfunc int32
|
var pclntabNfunc int32
|
||||||
|
|
@ -255,13 +255,13 @@ func pclntab() {
|
||||||
var i int32
|
var i int32
|
||||||
var it Pciter
|
var it Pciter
|
||||||
var off int32
|
var off int32
|
||||||
var pcln *Pcln
|
var pcln *FuncInfo
|
||||||
for Ctxt.Cursym = Ctxt.Textp; Ctxt.Cursym != nil; Ctxt.Cursym = Ctxt.Cursym.Next {
|
for Ctxt.Cursym = Ctxt.Textp; Ctxt.Cursym != nil; Ctxt.Cursym = Ctxt.Cursym.Next {
|
||||||
last = Ctxt.Cursym
|
last = Ctxt.Cursym
|
||||||
if container(Ctxt.Cursym) != 0 {
|
if container(Ctxt.Cursym) != 0 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
pcln = Ctxt.Cursym.Pcln
|
pcln = Ctxt.Cursym.FuncInfo
|
||||||
if pcln == nil {
|
if pcln == nil {
|
||||||
pcln = &pclntab_zpcln
|
pcln = &pclntab_zpcln
|
||||||
}
|
}
|
||||||
|
|
@ -294,8 +294,8 @@ func pclntab() {
|
||||||
// args int32
|
// args int32
|
||||||
// TODO: Move into funcinfo.
|
// TODO: Move into funcinfo.
|
||||||
args := uint32(0)
|
args := uint32(0)
|
||||||
if Ctxt.Cursym.Pcln != nil {
|
if Ctxt.Cursym.FuncInfo != nil {
|
||||||
args = uint32(Ctxt.Cursym.Pcln.Args)
|
args = uint32(Ctxt.Cursym.FuncInfo.Args)
|
||||||
}
|
}
|
||||||
off = int32(setuint32(Ctxt, ftab, int64(off), args))
|
off = int32(setuint32(Ctxt, ftab, int64(off), args))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue