[00/13] More work on DW_FORM_* and sign handling

Message ID 20250320-attribute-madness-v1-0-79d42789f881@adacore.com
Headers
Series More work on DW_FORM_* and sign handling |

Message

Tom Tromey March 20, 2025, 7:26 p.m. UTC
  This is another series fixing the sign handling of constants, in
particular DW_FORM_data*.

The first series was here:

    https://sourceware.org/pipermail/gdb-patches/2025-March/216216.html

See that series or the GCC and GDB bugs for context:

    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118837
    https://sourceware.org/bugzilla/show_bug.cgi?id=32680

The end goal of this series is to remove the somewhat murky
attribute::constant_value and require all callers to decide whether
they want zero- or sign-extension.

After this particular series, two uses still remain -- i.e., the
project is not yet done.  However, the last two seem a little tricky,
and I thought it would be best to flush out what I've already written.

Regression tested on x86-64 Fedora 40.

Tom

Signed-off-by: Tom Tromey <tromey@adacore.com>
---
Tom Tromey (13):
      Use attribute::unsigned_constant for sizes
      Introduce attribute::signed_constant
      Use attribute::signed_constant for fixed-point scale
      Use attribute::unsigned_constant for DW_AT_bit_stride
      Use correct sign for DW_AT_GNU_bias
      Use attribute::unsigned_constant for DW_AT_data_bit_offset
      Use attribute::unsigned_constant for DW_AT_data_member_location
      Use correct sign in get_mpz
      Use correct sign for variant part discriminants
      Use attribute::signed_constant in attribute::as_boolean
      Remove dead code from dwarf2_const_value_data
      Use bool in update_enumeration_type_from_children
      Use correct sign extension for enumeration types

 gdb/dwarf2/attribute.c    |  35 ++++++-
 gdb/dwarf2/attribute.h    |  18 ++++
 gdb/dwarf2/read.c         | 232 +++++++++++++++++++++++++---------------------
 gdbsupport/common-utils.h |  10 ++
 4 files changed, 188 insertions(+), 107 deletions(-)
---
base-commit: 4226ebed4193f35c42ee53bb8936398f732ed7d6
change-id: 20250320-attribute-madness-f33a6fac3169

Best regards,
  

Comments

Tom Tromey April 24, 2025, 7:24 p.m. UTC | #1
>>>>> "Tom" == Tom Tromey <tromey@adacore.com> writes:

Tom> This is another series fixing the sign handling of constants, in
Tom> particular DW_FORM_data*.

...
Tom> After this particular series, two uses still remain -- i.e., the
Tom> project is not yet done.  However, the last two seem a little tricky,
Tom> and I thought it would be best to flush out what I've already written.

I'm checking this in now.

Tom