aboutsummaryrefslogtreecommitdiff
path: root/gdb/valprint.c
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@adacore.com>2020-11-23 21:46:38 -0500
committerJoel Brobecker <brobecker@adacore.com>2020-11-23 21:46:38 -0500
commitc9f0b43fe46f473e4de3494f95b11ffb3d5a42a8 (patch)
tree3413d683bf1843314a98ca795a8ee8ec849de3ee /gdb/valprint.c
parent987b670356322ba4d493f441855bf5dc8d946e9f (diff)
downloadgdb-c9f0b43fe46f473e4de3494f95b11ffb3d5a42a8.zip
gdb-c9f0b43fe46f473e4de3494f95b11ffb3d5a42a8.tar.gz
gdb-c9f0b43fe46f473e4de3494f95b11ffb3d5a42a8.tar.bz2
gmp-utils: Convert the read/write methods to using gdb::array_view
This commit changes the interfaces of some of the methods declared in gmp-utils to take a gdb::array_view of gdb_byte instead of a (gdb_byte *, size) couple. This makes these methods' API probably more C++-idiomatic. * gmp-utils.h (gdb_mpz::read): Change buf and len parameters into one single gdb::array_view parameter. (gdb_mpz::write): Likewise. (gdb_mpq::read_fixed_point, gdb_mpq::write_fixed_point): Likewise. * gmp-utils.c (gdb_mpz::read): Change buf and len parameters into one single gdb::array_view parameter. Adjust implementation accordingly. (gdb_mpz::write): Likewise. (gdb_mpq::read_fixed_point, gdb_mpq::write_fixed_point): Likewise. * unittests/gmp-utils-selftests.c: Adapt following changes above. * valarith.c, valops.c, valprint.c, value.c: Likewise.
Diffstat (limited to 'gdb/valprint.c')
-rw-r--r--gdb/valprint.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/valprint.c b/gdb/valprint.c
index b102ff4..f428eb5 100644
--- a/gdb/valprint.c
+++ b/gdb/valprint.c
@@ -809,7 +809,7 @@ generic_val_print_fixed_point (struct value *val, struct ui_file *stream,
const gdb_byte *valaddr = value_contents_for_printing (val);
gdb_mpf f;
- f.read_fixed_point (valaddr, TYPE_LENGTH (type),
+ f.read_fixed_point (gdb::make_array_view (valaddr, TYPE_LENGTH (type)),
type_byte_order (type), type->is_unsigned (),
fixed_point_scaling_factor (type));