This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] default_type_align: Use type_length_units
- From: Simon Marchi <simon dot marchi at ericsson dot com>
- To: <gdb-patches at sourceware dot org>
- Cc: Tom Tromey <tom at tromey dot com>, Simon Marchi <simon dot marchi at ericsson dot com>
- Date: Wed, 13 Jun 2018 18:23:43 -0400
- Subject: [PATCH] default_type_align: Use type_length_units
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
The type alignment value is returned in 8-bit-bytes instead of target
memory addressable units. For example, on a target with 16-bit-bytes
where sizeof(int) == 1 (one addressable unit), alignof(int) currently
returns 2. After, this patch, it returns 1.
gdb/ChangeLog:
* arch-utils.c (default_type_align): Use type_length_units.
---
gdb/arch-utils.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c
index 76bc16f..a65f01f 100644
--- a/gdb/arch-utils.c
+++ b/gdb/arch-utils.c
@@ -994,7 +994,7 @@ default_in_indirect_branch_thunk (gdbarch *gdbarch, CORE_ADDR pc)
ULONGEST
default_type_align (struct gdbarch *gdbarch, struct type *type)
{
- return TYPE_LENGTH (check_typedef (type));
+ return type_length_units (check_typedef (type));
}
void
--
2.7.4