From: Simon Marchi <simon.marchi@ericsson.com>
To: <gdb-patches@sourceware.org>
Cc: Tom Tromey <tom@tromey.com>, Simon Marchi <simon.marchi@ericsson.com>
Subject: [PATCH] default_type_align: Use type_length_units
Date: Wed, 13 Jun 2018 22:24:00 -0000 [thread overview]
Message-ID: <1528928623-27479-1-git-send-email-simon.marchi@ericsson.com> (raw)
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
next reply other threads:[~2018-06-13 22:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-13 22:24 Simon Marchi [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1528928623-27479-1-git-send-email-simon.marchi@ericsson.com \
--to=simon.marchi@ericsson.com \
--cc=gdb-patches@sourceware.org \
--cc=tom@tromey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox