aboutsummaryrefslogtreecommitdiff
path: root/gdb/value.h
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@ericsson.com>2015-07-28 11:01:50 -0400
committerSimon Marchi <simon.marchi@ericsson.com>2015-07-28 11:01:50 -0400
commit3ae385afe150f2e001a1cc8fb14f4ba0ab94cdf2 (patch)
tree0984430c0197e8fb667866605cac82e050fd8ce5 /gdb/value.h
parente512cdbdffafefa63baeb835ba6636fcef56e17d (diff)
Consider addressable memory unit size in various value functions
This patch updates various value handling functions to make them consider the addressable memory unit size of the current architecture. This allows to correctly extract and print values on architectures whose addressable memory unit is not 8 bits. The patch doesn't cover all the code that would ideally need to be adjusted, only the code paths that we happen to use, plus a few obvious ones. Specifically, those areas are not covered by this patch: - Management of unavailable bits - Bitfields - C++ stuff Regression-tested on x86-64 Ubuntu 14.04. I saw no related test result change. gdb/ChangeLog: * c-valprint.c (c_val_print_array): Consider addressable memory unit size. (c_val_print_ptr): Likewise. (c_val_print_int): Likewise. * findvar.c (read_frame_register_value): Likewise. * valarith.c (find_size_for_pointer_math): Likewise. (value_ptrdiff): Likewise. (value_subscripted_rvalue): Likewise. * valops.c (read_value_memory): Likewise (and rename variables). (value_assign): Likewise. (value_repeat): Likewise. (value_array): Likewise. (value_slice): Likewise. * valprint.c (generic_val_print_ptr): Likewise. (generic_val_print_enum): Likewise. (generic_val_print_bool): Likewise. (generic_val_print_int): Likewise. (generic_val_print_char): Likewise. (generic_val_print_float): Likewise. (generic_val_print_decfloat): Likewise. (generic_val_print_complex): Likewise. (val_print_scalar_formatted): Likewise. (val_print_array_elements): Likewise. * value.c (set_value_parent): Likewise. (value_contents_copy_raw): Likewise. (set_internalvar_component): Likewise. (value_primitive_field): Likewise. (value_fetch_lazy): Likewise. * value.h (read_value_memory): Update comment.
Diffstat (limited to 'gdb/value.h')
-rw-r--r--gdb/value.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/value.h b/gdb/value.h
index e25f52bffc..82deaf2168 100644
--- a/gdb/value.h
+++ b/gdb/value.h
@@ -571,8 +571,8 @@ extern int value_contents_eq (const struct value *val1, int offset1,
const struct value *val2, int offset2,
int length);
-/* Read LENGTH bytes of memory starting at MEMADDR into BUFFER, which
- is (or will be copied to) VAL's contents buffer offset by
+/* Read LENGTH addressable memory units starting at MEMADDR into BUFFER,
+ which is (or will be copied to) VAL's contents buffer offset by
EMBEDDED_OFFSET (that is, to &VAL->contents[EMBEDDED_OFFSET]).
Marks value contents ranges as unavailable if the corresponding
memory is likewise unavailable. STACK indicates whether the memory