summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/arch-utils.c8
2 files changed, 10 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 20558b5a764..6187229a37d 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2021-04-22 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * arch-utils.c (default_addressable_memory_unit_size): Return a
+ value based on bfd's bits per byte.
+
2021-04-21 Tom Tromey <tom@tromey.com>
* dwarf2/read.h (struct dwarf2_per_cu_data) <dwarf_version>: Now
diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c
index e1d5afd6039..5bb9c758449 100644
--- a/gdb/arch-utils.c
+++ b/gdb/arch-utils.c
@@ -1005,13 +1005,15 @@ default_gnu_triplet_regexp (struct gdbarch *gdbarch)
return gdbarch_bfd_arch_info (gdbarch)->arch_name;
}
-/* Default method for gdbarch_addressable_memory_unit_size. By default, a memory byte has
- a size of 1 octet. */
+/* Default method for gdbarch_addressable_memory_unit_size. The default is
+ based on the bits_per_byte defined in the bfd library for the current
+ architecture, this is usually 8-bits, and so this function will usually
+ return 1 indicating 1 byte is 1 octet. */
int
default_addressable_memory_unit_size (struct gdbarch *gdbarch)
{
- return 1;
+ return gdbarch_bfd_arch_info (gdbarch)->bits_per_byte / 8;
}
void