diff options
author | Andrew Burgess <andrew.burgess@embecosm.com> | 2021-04-21 10:59:38 +0100 |
---|---|---|
committer | Andrew Burgess <andrew.burgess@embecosm.com> | 2021-04-22 09:16:54 +0100 |
commit | 05f3c0f09ec7181e00b4095804acad78040284c8 (patch) | |
tree | f05d37d9a386a4e6c67698ab5cc803bcb7edd914 /ChangeLog | |
parent | 2662c237a9219b0863535b8b99be383add2cf0b9 (diff) | |
download | gdb-05f3c0f09ec7181e00b4095804acad78040284c8.zip gdb-05f3c0f09ec7181e00b4095804acad78040284c8.tar.gz gdb-05f3c0f09ec7181e00b4095804acad78040284c8.tar.bz2 |
gdb: allow default_addressable_memory_unit_size to handle more cases
Currently default_addressable_memory_unit_size always returns 1,
indicating 1 byte is 1 octet. If a target has something other than
this (common) setup then the target should override the
default_addressable_memory_unit_size.
However, the bfd library already knows about each targets octets per
byte, so it seems redundant making targets override this method to
tell GDB something it already knows (through bfd).
In this commit I propose to make default_addressable_memory_unit_size
return a value based on bfd's bits per byte. I checked, and for every
target that GDB currently supports the bits per byte in bfd is 8, so
the current behaviour will not change.
In fact, the only targets in bfd that have bits per byte set to
something other than 8 can be found in cpu-tic4x.c and cpu-tic54x.c, I
don't believe these are supported by GDB right now.
I don't propose to remove the ability to override
default_addressable_memory_unit_size, this allows targets additional
flexibility for how to handle weird combinations of byte sizes.
This change was motivated by an out of tree target I was working on,
but it seemed like it was a good change that others might benefit
from.
There should be no user visible changes after this commit.
gdb/ChangeLog:
* arch-utils.c (default_addressable_memory_unit_size): Return a
value based on bfd's bits per byte.
Diffstat (limited to 'ChangeLog')
0 files changed, 0 insertions, 0 deletions