Mark discriminants as artificial in gdb.dwarf2/variant.exp
authorTom Tromey <tromey@adacore.com>
Wed, 11 Mar 2020 13:59:14 +0000 (07:59 -0600)
committerTom Tromey <tromey@adacore.com>
Wed, 11 Mar 2020 13:59:37 +0000 (07:59 -0600)
While working on a variant part patch, I notcied that
gdb.dwarf2/variant.exp does not mark the discriminant members as
DW_AT_artificial.  However, it should, as this is what the real Rust
compiler does, and how the Rust language support is supposed to work.

gdb/testsuite/ChangeLog
2020-03-11  Tom Tromey  <tromey@adacore.com>

* gdb.dwarf2/variant.exp: Mark discriminants as artificial.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.dwarf2/variant.exp

index d7de4e7b78540462b3fa7f9a0a007072668387c8..78505f1169d036f5c456aa0550102ff5f2c2a83a 100644 (file)
@@ -1,3 +1,7 @@
+2020-03-11  Tom Tromey  <tromey@adacore.com>
+
+       * gdb.dwarf2/variant.exp: Mark discriminants as artificial.
+
 2020-03-11  Tom de Vries  <tdevries@suse.de>
 
        * gdb.base/foll-fork.exp: Allow "Reading in symbols" messages.
index c0ae2e48bc26a9f315643549070f855e1238d85e..0250fafc7f8eac61c2f53e5af34da060031b0ae6 100644 (file)
@@ -91,6 +91,7 @@ Dwarf::assemble $asm_file {
                    discr_1_label: member {
                        {type :$uinteger_label}
                        {data_member_location 0 data1}
+                       {artificial 1 DW_FORM_flag_present}
                    }
 
                    variant {
@@ -123,6 +124,7 @@ Dwarf::assemble $asm_file {
                    discr_2_label: member {
                        {type :$uinteger_label}
                        {data_member_location 0 data1}
+                       {artificial 1 DW_FORM_flag_present}
                    }
 
                    variant {
@@ -172,6 +174,7 @@ Dwarf::assemble $asm_file {
                    discr_3_label: member {
                        {type :$int8_label}
                        {data_member_location 0 data1}
+                       {artificial 1 DW_FORM_flag_present}
                    }
 
                    variant {