https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83935

--- Comment #4 from Pierre-Marie de Rodat <derodat at adacore dot com> ---
(In reply to Tom Tromey from comment #3)
> TBH this did not make sense to me, either, which is partly why I originally
> wrote my patch the "more natural" way -- then this got caught in review,
> see https://reviews.llvm.org/D42082
Thanks for the pointer. So first, thanks for your efforts in adding support for
these tags in GDB!

During the review, Paul said:
> Adding a TAG_variant_part that had no children could also work, although it
> seems a little odd and might trip up an unwary non-Rust-aware debugger.
Well, for now, we do generate child-less variant parts for Ada types such as:

    type Integer_Option (B : Boolean) is record
       case B is
          when False => null;
          when True  => Value : Integer;
    end record;

So I hope non-Rust-aware debuggers can cope with this. ;-)

> It's worth a shot, though I think it was tried before, see
> http://lists.dwarfstd.org/pipermail/dwarf-discuss-dwarfstd.org/2006-August/
> 001710.html
Ah, I see. Looks like I have the same reasoning that Ron and Todd with respect
to variant parts nesting had 12 years ago! :-D Everybody seems to agree that
having a top-level member to serve as a variant part’s discriminant is a good
thing to have, and it’s even suggested to post a proposal to reword the
troublesome paragraph.

So I suggest we indeed post a submission on dwarf-discuss@ and leave GCC’s
DWARF back-end as it is today. What do you think? It’s a bit late for me, so
I’ll give it a try tomorrow.

Reply via email to