File tree 2 files changed +22
-6
lines changed
2 files changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -650,10 +650,14 @@ func (f *File) DWARF() (*dwarf.Data, error) {
650
650
return nil , err
651
651
}
652
652
653
- // Look for DWARF4 .debug_types sections.
653
+ // Look for DWARF4 .debug_types sections and DWARF5 sections .
654
654
for i , s := range f .Sections {
655
655
suffix := dwarfSuffix (s )
656
- if suffix != "types" {
656
+ if suffix == "" {
657
+ continue
658
+ }
659
+ if _ , ok := dat [suffix ]; ok {
660
+ // Already handled.
657
661
continue
658
662
}
659
663
@@ -662,7 +666,11 @@ func (f *File) DWARF() (*dwarf.Data, error) {
662
666
return nil , err
663
667
}
664
668
665
- err = d .AddTypes (fmt .Sprintf ("types-%d" , i ), b )
669
+ if suffix == "types" {
670
+ err = d .AddTypes (fmt .Sprintf ("types-%d" , i ), b )
671
+ } else {
672
+ err = d .AddSection (".debug_" + suffix , b )
673
+ }
666
674
if err != nil {
667
675
return nil , err
668
676
}
Original file line number Diff line number Diff line change @@ -267,10 +267,14 @@ func (f *File) DWARF() (*dwarf.Data, error) {
267
267
return nil , err
268
268
}
269
269
270
- // Look for DWARF4 .debug_types sections.
270
+ // Look for DWARF4 .debug_types sections and DWARF5 sections .
271
271
for i , s := range f .Sections {
272
272
suffix := dwarfSuffix (s )
273
- if suffix != "types" {
273
+ if suffix == "" {
274
+ continue
275
+ }
276
+ if _ , ok := dat [suffix ]; ok {
277
+ // Already handled.
274
278
continue
275
279
}
276
280
@@ -279,7 +283,11 @@ func (f *File) DWARF() (*dwarf.Data, error) {
279
283
return nil , err
280
284
}
281
285
282
- err = d .AddTypes (fmt .Sprintf ("types-%d" , i ), b )
286
+ if suffix == "types" {
287
+ err = d .AddTypes (fmt .Sprintf ("types-%d" , i ), b )
288
+ } else {
289
+ err = d .AddSection (".debug_" + suffix , b )
290
+ }
283
291
if err != nil {
284
292
return nil , err
285
293
}
You can’t perform that action at this time.
0 commit comments