aboutsummaryrefslogtreecommitdiff
path: root/gdb/compile
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2024-02-21 08:22:01 -0700
committerTom Tromey <tom@tromey.com>2024-03-14 09:13:53 -0600
commit91e15dbaf9d05747fab0d33e5af7ae69c983398a (patch)
tree1d741a6d6a5c36029c536bb1131842c4acdb796a /gdb/compile
parentb0e7d28eae1fa1a91932e47d8cf5decf96c2bc59 (diff)
downloadgdb-91e15dbaf9d05747fab0d33e5af7ae69c983398a.zip
gdb-91e15dbaf9d05747fab0d33e5af7ae69c983398a.tar.gz
gdb-91e15dbaf9d05747fab0d33e5af7ae69c983398a.tar.bz2
Pass alignment when using GCC_C_FE_VERSION_2
When the GCC compiler plugin responds with GCC_C_FE_VERSION_2, gdb can use the new 'finish_record_with_alignment' method. This lets gdb pass alignment information to the compiler, which in turn fixes the test case included in this patch. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31397
Diffstat (limited to 'gdb/compile')
-rw-r--r--gdb/compile/compile-c-types.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gdb/compile/compile-c-types.c b/gdb/compile/compile-c-types.c
index 1bfaefc..1243be3 100644
--- a/gdb/compile/compile-c-types.c
+++ b/gdb/compile/compile-c-types.c
@@ -118,7 +118,11 @@ convert_struct_or_union (compile_c_instance *context, struct type *type)
type->field (i).loc_bitpos ());
}
- context->plugin ().finish_record_or_union (result, type->length ());
+ if (context->plugin ().version () >= GCC_C_FE_VERSION_2)
+ context->plugin ().finish_record_with_alignment (result, type->length (),
+ type_align (type));
+ else
+ context->plugin ().finish_record_or_union (result, type->length ());
return result;
}