From f099d97aa36cc1b63a8c46ef061ffc25f9a39905 Mon Sep 17 00:00:00 2001 From: Luis Machado Date: Fri, 18 Dec 2020 13:55:55 -0300 Subject: [PATCH] Fix incorrect length for capabilities The length used to include the tag, but now it doesn't. This fixes it. gdb/ChangeLog: 2020-12-30 Luis Machado * valprint.c (generic_value_print_capability): Don't add 1 to the capability length. --- gdb/valprint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/valprint.c b/gdb/valprint.c index a3a2ba0c58e..fc54a9f2fba 100644 --- a/gdb/valprint.c +++ b/gdb/valprint.c @@ -514,7 +514,7 @@ generic_value_print_capability (struct value *val, struct ui_file *stream, { struct type *type = check_typedef (value_type (val)); /* Account for the tag bit in the length. */ - int length = TYPE_LENGTH (type) + 1; + int length = TYPE_LENGTH (type); const gdb_byte *contents = value_contents_for_printing (val).data (); enum bfd_endian byte_order = type_byte_order (type); bool tag = false; -- 2.47.2