public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] default_type_align: Use type_length_units
@ 2018-06-13 22:24 Simon Marchi
  2018-06-14 16:59 ` Tom Tromey
  0 siblings, 1 reply; 6+ messages in thread
From: Simon Marchi @ 2018-06-13 22:24 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey, Simon Marchi

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-06-15 16:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-13 22:24 [PATCH] default_type_align: Use type_length_units Simon Marchi
2018-06-14 16:59 ` Tom Tromey
2018-06-14 18:26   ` Simon Marchi
2018-06-14 19:50     ` Tom Tromey
2018-06-14 22:28       ` Simon Marchi
2018-06-15 16:43         ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).