From: Tom Tromey <tromey@adacore.com>
To: Tom Tromey <tromey@adacore.com>
Cc: Andrew Burgess <aburgess@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Handle DW_AT_encoding on DW_TAG_enumeration_type
Date: Mon, 18 May 2026 09:29:46 -0600 [thread overview]
Message-ID: <87y0hgbus5.fsf@tromey.com> (raw)
In-Reply-To: <87v7cofm5g.fsf@tromey.com> (Tom Tromey's message of "Fri, 15 May 2026 14:33:31 -0600")
Tom> Now, we could change update_enumeration_type_from_children to also
Tom> examine the attribute forms, with the idea that if we see DW_FORM_sdata
Tom> then it is definitely signed. While that wouldn't help this particular
Tom> test, it's possible to construct one where it does. In fact I happened
Tom> recently to be investigating this for gnat-llvm, where there's a type:
Tom> [ 10cf] enumeration_type abbrev: 21
Tom> name (strp) "tag_t"
Tom> byte_size (data1) 1
Tom> decl_file (data1) p.adb (1)
Tom> decl_line (data1) 20
Tom> alignment (udata) 1
Tom> ...
Tom> [ 10de] enumerator abbrev: 22
Tom> name (strp) "object"
Tom> const_value (sdata) 18446744073709551615 (-1)
Tom> Here the enumeration type doesn't specify a sign, but there's a constant
Tom> that is clearly signed. FWIW this occurs in array_of_variant.exp.
Tom> I'll address this in a separate patch.
I still could do this, but I'm not sure how important it really is.
For gnat-llvm, after digging into this, I think this is a compiler bug
and I'm going to modify the compiler to ensure that enumeration types
always have an appropriately-signed base type.
Tom
prev parent reply other threads:[~2026-05-18 15:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-13 14:27 Tom Tromey
2026-05-15 19:06 ` Andrew Burgess
2026-05-15 20:33 ` Tom Tromey
2026-05-16 11:13 ` Andrew Burgess
2026-05-18 15:29 ` Tom Tromey [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y0hgbus5.fsf@tromey.com \
--to=tromey@adacore.com \
--cc=aburgess@redhat.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox