Re: [PATCH 0/7] Support reading/writing memory on architectures with non 8-bits bytes

Eli Zaretskii
2015-04-09T08:20:30Z

> From: Simon Marchi <simon.marchi@ericsson.com>
> CC: Simon Marchi <simon.marchi@ericsson.com>
> Date: Wed, 8 Apr 2015 15:56:12 -0400
>
> On such a system, memory is addressable in atomic chunks of 16-bits. On
> a "normal" system, you have 8 bits of data associated with each memory
> address:
>
> Address Data
> ---------------
> 0x1000 0xaa
> 0x1001 0xbb
> 0x1002 0xcc
> 0x1003 0xdd
>
> whereas on a system with 16-bits bytes, you have 16-bits of data per
> address:
>
> Address Data
> ---------------
> 0x1000 0xaaaa
> 0x1001 0xbbbb
> 0x1002 0xcccc
> 0x1003 0xdddd
>
> To support these systems, GDB must be modified to consider the byte size
> when reading/writing memory. This is what this first patch series is
> about.
>
> Also, on these systems, sizeof(char) == 1 == 16 bits. There is therefore
> many places related to types and values handling that need to be
> modified. This will be the subject of subsequent patch series.

I wonder: wouldn't it be possible to keep the current "byte == 8 bits"
notion, and instead to change the way addresses are interpreted by the
target back-end?

IOW, do we really need to expose this issue all the way to the higher
levels of GDB application code?