From 02ba354f49b033aa1a5719c78176dc1a5df3e626 Mon Sep 17 00:00:00 2001 From: George Luiz Bittencourt Date: Fri, 8 Nov 2024 09:42:52 -0300 Subject: [PATCH 1/2] improved dwarf error message when debugging info is not present. --- src/debug/dwarf/open.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/debug/dwarf/open.go b/src/debug/dwarf/open.go index 0901341cc4f5b..3c7e40ead0429 100644 --- a/src/debug/dwarf/open.go +++ b/src/debug/dwarf/open.go @@ -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. // 64-bit DWARf: 4 bytes of 0xff, 8 byte length, 2 byte version. if len(d.info) < 6 { - return nil, DecodeError{"info", Offset(len(d.info)), "too short"} + return nil, DecodeError{"info", Offset(len(d.info)), "too short. make sure you compiled with debugging information."} } offset := 4 if d.info[0] == 0xff && d.info[1] == 0xff && d.info[2] == 0xff && d.info[3] == 0xff { From 384e5481c72f349ff3680b8d75eb586912fc39cd Mon Sep 17 00:00:00 2001 From: George Luiz Bittencourt Date: Sat, 9 Nov 2024 06:08:37 -0300 Subject: [PATCH 2/2] improved dwarf error message when debugging info is not present. --- src/debug/dwarf/open.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/debug/dwarf/open.go b/src/debug/dwarf/open.go index 3c7e40ead0429..d0e332e610b51 100644 --- a/src/debug/dwarf/open.go +++ b/src/debug/dwarf/open.go @@ -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. // 64-bit DWARf: 4 bytes of 0xff, 8 byte length, 2 byte version. 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 if d.info[0] == 0xff && d.info[1] == 0xff && d.info[2] == 0xff && d.info[3] == 0xff {