From eab09c65a9eacb3f6001488f6980e5ac8f0c0aeb Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Fri, 10 Feb 2023 13:56:58 +0100 Subject: libdw: Handle DW_OP_GNU_uninit in dwarf_getlocation dwarf_getlocation would return an error when it saw a DW_OP_GNU_uninit. Handle it by simply recognizing as a no argument operation. DW_OP_GNU_uninit is emitted by GCC as a marker to flag the location expression as referring to an uninitialized value. Signed-off-by: Mark Wielaard --- tests/varlocs.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests/varlocs.c') diff --git a/tests/varlocs.c b/tests/varlocs.c index d2c13767..8e563fd3 100644 --- a/tests/varlocs.c +++ b/tests/varlocs.c @@ -251,6 +251,12 @@ print_expr (Dwarf_Attribute *attr, Dwarf_Op *expr, Dwarf_Addr addr, int depth) printf ("%s", opname); break; + case DW_OP_GNU_uninit: + /* No arguments. Special. It means the expression describes + an value which hasn't been initialized (yet). */ + printf ("%s", opname); + break; + case DW_OP_call_frame_cfa: /* No arguments. Special. Pushes Call Frame Address as computed by CFI data (dwarf_cfi_addrframe will fetch that info (either from -- cgit v1.2.3