[PATCH v2 4/7] gdbarch: add addressable_memory_unit_size method

Pedro Alves palves@redhat.com
Thu May 21 17:46:00 GMT 2015


On 04/15/2015 08:47 PM, Simon Marchi wrote:
> Add a new gdbarch method to get the length of an addressable memory unit
> for a given architecture. The default implementation returns 1.
> 

> --- a/gdb/gdbarch.sh
> +++ b/gdb/gdbarch.sh
> @@ -1109,6 +1109,11 @@ m:char *:gcc_target_options:void:::default_gcc_target_options::0
>  # returns the BFD architecture name, which is correct in nearly every
>  # case.
>  m:const char *:gnu_triplet_regexp:void:::default_gnu_triplet_regexp::0
> +
> +# Return the size in bytes of an addressable memory unit on this architecture.
> +# This corresponds to the number of bytes associated to each address in memory.
> +m:int:addressable_memory_unit_size:void:::default_addressable_memory_unit_size::0

This is the central place everyone should look at first to understand
non 8-bit bytes targets.  For extra clarity, could you please
add "8-bit"s in there, say:

 "the size in 8-bit bytes" (...) to the number of 8-bit bytes associated to
 each address in memory."

Looks good to me with that change.

Thanks,
Pedro Alves



More information about the Gdb-patches mailing list