diff options
author | Tom Tromey <tromey@adacore.com> | 2025-02-06 10:08:38 -0700 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2025-03-18 12:40:57 -0600 |
commit | e4d946a97a67fe692b13e64b541b0e8ddb39e2e9 (patch) | |
tree | 27abdc6f36659f2abd8085029505f397300f6bc1 /gdb | |
parent | 29b2c50ece6d39ca1ad535961da48eb1ec874c9e (diff) | |
download | binutils-e4d946a97a67fe692b13e64b541b0e8ddb39e2e9.zip binutils-e4d946a97a67fe692b13e64b541b0e8ddb39e2e9.tar.gz binutils-e4d946a97a67fe692b13e64b541b0e8ddb39e2e9.tar.bz2 |
Rename form_is_signed to form_is_strictly_signed
This renames attribute::form_is_signed to form_is_strictly_signed. I
think this more accurately captures what it does: it says whether a
form will always use signed data -- not whether a form might use
signed data, which DW_FORM_data* do depending on context.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32680
Approved-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/dwarf2/attribute.c | 2 | ||||
-rw-r--r-- | gdb/dwarf2/attribute.h | 13 |
2 files changed, 9 insertions, 6 deletions
diff --git a/gdb/dwarf2/attribute.c b/gdb/dwarf2/attribute.c index f777c14..3eb32b6 100644 --- a/gdb/dwarf2/attribute.c +++ b/gdb/dwarf2/attribute.c @@ -189,7 +189,7 @@ attribute::form_is_unsigned () const /* See attribute.h. */ bool -attribute::form_is_signed () const +attribute::form_is_strictly_signed () const { return form == DW_FORM_sdata || form == DW_FORM_implicit_const; } diff --git a/gdb/dwarf2/attribute.h b/gdb/dwarf2/attribute.h index 115d006..6332b39 100644 --- a/gdb/dwarf2/attribute.h +++ b/gdb/dwarf2/attribute.h @@ -69,7 +69,7 @@ struct attribute form. */ LONGEST as_signed () const { - gdb_assert (form_is_signed ()); + gdb_assert (form_is_strictly_signed ()); return u.snd; } @@ -97,7 +97,7 @@ struct attribute { if (form_is_unsigned ()) return true; - if (form_is_signed ()) + if (form_is_strictly_signed ()) return as_signed () >= 0; return false; } @@ -108,7 +108,7 @@ struct attribute { if (form_is_unsigned ()) return as_unsigned (); - if (form_is_signed ()) + if (form_is_strictly_signed ()) return (ULONGEST)as_signed (); gdb_assert (false); } @@ -168,8 +168,11 @@ struct attribute /* Check if the attribute's form is an unsigned integer form. */ bool form_is_unsigned () const; - /* Check if the attribute's form is a signed integer form. */ - bool form_is_signed () const; + /* Check if the attribute's form is a signed integer form. This + only returns true for forms that are strictly signed -- that is, + for a context-dependent form like DW_FORM_data1, this returns + false. */ + bool form_is_strictly_signed () const; /* Check if the attribute's form is a form that requires "reprocessing". */ |