@@ -198,9 +198,11 @@ type Func struct {
198
198
PCSP Data // PC → SP offset map
199
199
PCFile Data // PC → file number map (index into File)
200
200
PCLine Data // PC → line number map
201
+ PCInline Data // PC → inline tree index map
201
202
PCData []Data // PC → runtime support data map
202
203
FuncData []FuncData // non-PC-specific runtime support data
203
204
File []string // paths indexed by PCFile
205
+ InlTree []InlinedCall
204
206
}
205
207
206
208
// TODO: Add PCData []byte and PCDataIter (similar to liblink).
@@ -211,6 +213,15 @@ type FuncData struct {
211
213
Offset int64 // offset into symbol for funcdata pointer
212
214
}
213
215
216
+ // An InlinedCall is a node in an InlTree.
217
+ // See cmd/internal/obj.InlTree for details.
218
+ type InlinedCall struct {
219
+ Parent int
220
+ File string
221
+ Line int
222
+ Func SymID
223
+ }
224
+
214
225
// A Package is a parsed Go object file or archive defining a Go package.
215
226
type Package struct {
216
227
ImportPath string // import path denoting this package
@@ -583,7 +594,7 @@ func (r *objReader) parseObject(prefix []byte) error {
583
594
// TODO: extract OS + build ID if/when we need it
584
595
585
596
r .readFull (r .tmp [:8 ])
586
- if ! bytes .Equal (r .tmp [:8 ], []byte ("\x00 \x00 go17ld " )) {
597
+ if ! bytes .Equal (r .tmp [:8 ], []byte ("\x00 \x00 go19ld " )) {
587
598
return r .error (errCorruptObject )
588
599
}
589
600
@@ -671,6 +682,7 @@ func (r *objReader) parseObject(prefix []byte) error {
671
682
f .PCSP = r .readData ()
672
683
f .PCFile = r .readData ()
673
684
f .PCLine = r .readData ()
685
+ f .PCInline = r .readData ()
674
686
f .PCData = make ([]Data , r .readInt ())
675
687
for i := range f .PCData {
676
688
f .PCData [i ] = r .readData ()
@@ -686,11 +698,18 @@ func (r *objReader) parseObject(prefix []byte) error {
686
698
for i := range f .File {
687
699
f .File [i ] = r .readSymID ().Name
688
700
}
701
+ f .InlTree = make ([]InlinedCall , r .readInt ())
702
+ for i := range f .InlTree {
703
+ f .InlTree [i ].Parent = r .readInt ()
704
+ f .InlTree [i ].File = r .readSymID ().Name
705
+ f .InlTree [i ].Line = r .readInt ()
706
+ f .InlTree [i ].Func = r .readSymID ()
707
+ }
689
708
}
690
709
}
691
710
692
711
r .readFull (r .tmp [:7 ])
693
- if ! bytes .Equal (r .tmp [:7 ], []byte ("\xff go17ld " )) {
712
+ if ! bytes .Equal (r .tmp [:7 ], []byte ("\xff go19ld " )) {
694
713
return r .error (errCorruptObject )
695
714
}
696
715
0 commit comments