]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
libdw: Handle DW_OP_GNU_uninit in dwarf_getlocation
authorMark Wielaard <mark@klomp.org>
Fri, 10 Feb 2023 12:56:58 +0000 (13:56 +0100)
committerMark Wielaard <mark@klomp.org>
Tue, 14 Feb 2023 16:28:40 +0000 (17:28 +0100)
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 <mark@klomp.org>
libdw/ChangeLog
libdw/dwarf_getlocation.c
tests/ChangeLog
tests/varlocs.c

index 2c1f61e899b556e5b136ad7c8f055d0dfdd39b13..ddf14e550e64c23119e3a7708162939d3a803dab 100644 (file)
@@ -1,3 +1,8 @@
+2023-02-10  Mark Wielaard  <mark@klomp.org>
+
+       * dwarf_getlocation.c (__libdw_intern_expression): Handle
+       DW_OP_GNU_uninit.
+
 2023-02-12  Mark Wielaard  <mark@klomp.org>
 
        * cfi.c (execute_cfi): Add cfi_asser before reading second lib128.
index 4e8c047b5dd45496c66eb29a29ef6d1afd81ebeb..66eab3e99db2533617717ace523c23d716d56249 100644 (file)
@@ -396,6 +396,7 @@ __libdw_intern_expression (Dwarf *dbg, bool other_byte_order,
        case DW_OP_form_tls_address:
        case DW_OP_GNU_push_tls_address:
        case DW_OP_stack_value:
+       case DW_OP_GNU_uninit:
          /* No operand.  */
          break;
 
index 89f1a9918e820e5c1136f2a89102bddfb4692ec5..eb3e1118fa00767da12a94747c5de92c791546cc 100644 (file)
@@ -1,3 +1,7 @@
+2023-02-10  Mark Wielaard  <mark@klomp.org>
+
+       * varlocs.c (print_expr): Handle DW_OP_GNU_uninit.
+
 2023-02-07  Mark Wielaard  <mark@klomp.org>
 
        * tests/funcretval.c (handle_function): Check for
index d2c13767cd03ae40598d167a626e745dc4f15f2a..8e563fd32152f92ccdca3fd648d231e821c4d2e9 100644 (file)
@@ -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