1
0
mirror of https://github.com/golang/go synced 2024-11-21 22:34:48 -07:00

improved dwarf error message when debugging info is not present.

This commit is contained in:
George Luiz Bittencourt 2024-11-09 06:08:37 -03:00
parent 02ba354f49
commit 384e5481c7

View File

@ -79,7 +79,7 @@ func New(abbrev, aranges, frame, info, line, pubnames, ranges, str []byte) (*Dat
// 32-bit DWARF: 4 byte length, 2 byte version. // 32-bit DWARF: 4 byte length, 2 byte version.
// 64-bit DWARf: 4 bytes of 0xff, 8 byte length, 2 byte version. // 64-bit DWARf: 4 bytes of 0xff, 8 byte length, 2 byte version.
if len(d.info) < 6 { if len(d.info) < 6 {
return nil, DecodeError{"info", Offset(len(d.info)), "too short. make sure you compiled with debugging information."} return nil, DecodeError{"info", Offset(len(d.info)), "no debugging information found."}
} }
offset := 4 offset := 4
if d.info[0] == 0xff && d.info[1] == 0xff && d.info[2] == 0xff && d.info[3] == 0xff { if d.info[0] == 0xff && d.info[1] == 0xff && d.info[2] == 0xff && d.info[3] == 0xff {