diff options
author | Tom Tromey <tom@tromey.com> | 2020-10-17 11:41:59 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2020-10-17 11:41:59 -0600 |
commit | cfabbd351a174406fd5aa063303f5c8bf9266bbc (patch) | |
tree | 7ced6e989556f3816728d610997f94bb76f9db72 /gdb/valprint.c | |
parent | 9717970a4e374218fe74c99cf5bc7f1d45adbf0e (diff) | |
download | gdb-cfabbd351a174406fd5aa063303f5c8bf9266bbc.zip gdb-cfabbd351a174406fd5aa063303f5c8bf9266bbc.tar.gz gdb-cfabbd351a174406fd5aa063303f5c8bf9266bbc.tar.bz2 |
Make range types inherit signed-ness from base type
I ran across this comment in valprint.c:
/* FIXME: create_static_range_type does not set the unsigned bit in a
range type (I think it probably should copy it from the target
type), so we won't print values which are too large to
fit in a signed integer correctly. */
It seems to me that a range type ought to inherit its signed-ness from
the underlying type, so this patch implements this change, and removes
the comment. (It was also copied into m2-valprint.c.)
I also remove the comment about handling ranges of enums, because I
think that comment is incorrect.
gdb/ChangeLog
2020-10-17 Tom Tromey <tom@tromey.com>
* valprint.c (generic_value_print): Remove comment.
* m2-valprint.c (m2_value_print_inner): Remove comment.
* gdbtypes.c (create_range_type): Set TYPE_UNSIGNED from base
type.
Diffstat (limited to 'gdb/valprint.c')
-rw-r--r-- | gdb/valprint.c | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/gdb/valprint.c b/gdb/valprint.c index 0749f38..dd70a1a 100644 --- a/gdb/valprint.c +++ b/gdb/valprint.c @@ -893,16 +893,6 @@ generic_value_print (struct value *val, struct ui_file *stream, int recurse, break; case TYPE_CODE_RANGE: - /* FIXME: create_static_range_type does not set the unsigned bit in a - range type (I think it probably should copy it from the - target type), so we won't print values which are too large to - fit in a signed integer correctly. */ - /* FIXME: Doesn't handle ranges of enums correctly. (Can't just - print with the target type, though, because the size of our - type and the target type might differ). */ - - /* FALLTHROUGH */ - case TYPE_CODE_INT: generic_value_print_int (val, stream, options); break; |