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 @@ -272,10 +272,14 @@ func (f *File) DWARF() (*dwarf.Data, error) {
272
272
return nil , err
273
273
}
274
274
275
- // Look for DWARF4 .debug_types sections.
275
+ // Look for DWARF4 .debug_types sections and DWARF5 sections .
276
276
for i , s := range f .Sections {
277
277
suffix := dwarfSuffix (s )
278
- if suffix != "types" {
278
+ if suffix == "" {
279
+ continue
280
+ }
281
+ if _ , ok := dat [suffix ]; ok {
282
+ // Already handled.
279
283
continue
280
284
}
281
285
@@ -284,7 +288,11 @@ func (f *File) DWARF() (*dwarf.Data, error) {
284
288
return nil , err
285
289
}
286
290
287
- err = d .AddTypes (fmt .Sprintf ("types-%d" , i ), b )
291
+ if suffix == "types" {
292
+ err = d .AddTypes (fmt .Sprintf ("types-%d" , i ), b )
293
+ } else {
294
+ err = d .AddSection (".debug_" + suffix , b )
295
+ }
288
296
if err != nil {
289
297
return nil , err
290
298
}
You can’t perform that action at this time.
0 commit comments