aboutsummaryrefslogtreecommitdiff
path: root/gdb/ada-valprint.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2023-04-18 10:59:53 -0600
committerTom Tromey <tromey@adacore.com>2023-04-19 07:43:20 -0600
commit146441c9521991f3e9a010e4e6544ca74619943f (patch)
treec323d1eb86d868f7808f056b37ac6c45b9368a9a /gdb/ada-valprint.c
parent28ab94f51dcdee056d96e57ad04c27c22cf854ea (diff)
downloadgdb-146441c9521991f3e9a010e4e6544ca74619943f.zip
gdb-146441c9521991f3e9a010e4e6544ca74619943f.tar.gz
gdb-146441c9521991f3e9a010e4e6544ca74619943f.tar.bz2
Remove adjust_type_signedness
I happened across adjust_type_signedness, which may be used to modify a type when printing an Ada value. Modifying a type like this is a bad idea -- they should normally be considered immutable. Removing this function still passes both the dejagnu and internal AdaCore tests, though, so this patch drops it. As this was reviewed internally, and only affect Ada, I am checking it in.
Diffstat (limited to 'gdb/ada-valprint.c')
-rw-r--r--gdb/ada-valprint.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c
index 02ae46b..24a7ea2 100644
--- a/gdb/ada-valprint.c
+++ b/gdb/ada-valprint.c
@@ -37,15 +37,6 @@ static int print_field_values (struct value *, struct value *,
-/* Make TYPE unsigned if its range of values includes no negatives. */
-static void
-adjust_type_signedness (struct type *type)
-{
- if (type != NULL && type->code () == TYPE_CODE_RANGE
- && type->bounds ()->low.const_val () >= 0)
- type->set_is_unsigned (true);
-}
-
/* Assuming TYPE is a simple array type, prints its lower bound on STREAM,
if non-standard (i.e., other than 1 for numbers, other than lower bound
of index type for enumerated type). Returns 1 if something printed,
@@ -652,7 +643,6 @@ print_field_values (struct value *value, struct value *outer_value,
int bit_size = TYPE_FIELD_BITSIZE (type, i);
struct value_print_options opts;
- adjust_type_signedness (type->field (i).type ());
v = ada_value_primitive_packed_val
(value, nullptr,
bit_pos / HOST_CHAR_BIT,