]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Follow-up tweaks to System.Dwarf_Line
authorEric Botcazou <ebotcazou@adacore.com>
Tue, 6 Jul 2021 10:18:57 +0000 (12:18 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Tue, 21 Sep 2021 15:24:59 +0000 (15:24 +0000)
gcc/ada/

* libgnat/s-dwalin.adb (Skip_Form): Fix cases of DW_FORM_addrx
and DW_FORM_implicit_const.  Replace Constraint_Error with
Dwarf_Error.

gcc/ada/libgnat/s-dwalin.adb

index 530b80294273c6104475f1d1cc95c5ccc49b1800..74700e68bfc8ca7b3ca20c8ca7b6f78df42af491 100644 (file)
@@ -1114,8 +1114,6 @@ package body System.Dwarf_Lines is
       case Form is
          when DW_FORM_addr =>
             Skip := Offset (Ptr_Sz);
-         when DW_FORM_addrx =>
-            Skip := Offset (uint32'(Read_LEB128 (S)));
          when DW_FORM_block1 =>
             Skip := Offset (uint8'(Read (S)));
          when DW_FORM_block2 =>
@@ -1161,11 +1159,12 @@ package body System.Dwarf_Lines is
             begin
                return;
             end;
-         when DW_FORM_udata
-            | DW_FORM_ref_udata
+         when DW_FORM_addrx
             | DW_FORM_loclistx
+            | DW_FORM_ref_udata
             | DW_FORM_rnglistx
             | DW_FORM_strx
+            | DW_FORM_udata
            =>
             declare
                Val : constant uint32 := Read_LEB128 (S);
@@ -1173,7 +1172,7 @@ package body System.Dwarf_Lines is
             begin
                return;
             end;
-         when DW_FORM_flag_present =>
+         when DW_FORM_flag_present | DW_FORM_implicit_const =>
             return;
          when DW_FORM_ref_addr
             | DW_FORM_sec_offset
@@ -1187,10 +1186,10 @@ package body System.Dwarf_Lines is
                null;
             end loop;
             return;
-         when DW_FORM_implicit_const | DW_FORM_indirect =>
-            raise Constraint_Error;
+         when DW_FORM_indirect =>
+            raise Dwarf_Error with "DW_FORM_indirect not implemented";
          when others =>
-            raise Constraint_Error;
+            raise Dwarf_Error with "DWARF form not implemented";
       end case;
 
       Seek (S, Tell (S) + Skip);