aboutsummaryrefslogtreecommitdiff
path: root/gdb/utils.h
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@adacore.com>2018-11-14 18:18:49 -0500
committerJoel Brobecker <brobecker@adacore.com>2018-11-14 18:18:49 -0500
commita99bc3d23c133fe80f7ccac44246a471fb075bc3 (patch)
tree8aabba85c80b30af36df1e73eeaeca83cbeb13fb /gdb/utils.h
parent8b2d40cbba8fbf98d6e031c7d8c7e2ac1baae2d9 (diff)
downloadbinutils-a99bc3d23c133fe80f7ccac44246a471fb075bc3.zip
binutils-a99bc3d23c133fe80f7ccac44246a471fb075bc3.tar.gz
binutils-a99bc3d23c133fe80f7ccac44246a471fb075bc3.tar.bz2
delete ada-lang.c::move_bits, sharing and re-using copy_bitwise instead
This patch deletes ada-lang.c's move_bits function entirely, and replaces all calls to it by calls to copy_bitwise instead. Because the latter function was declared locally inside dwarf2loc.c, this patch also move the function to a common area, and makes it non-static. gdb/ChangeLog: * ada-lang.c (move_bits): Delete. Update all callers to use copy_bitwise instead. * dwarf2loc.c (copy_bitwise, bits_to_str::bits_to_str) (selftests::check_copy_bitwise, selftests::copy_bitwise_tests): Move from here to utils.c. (_initialize_dwarf2loc): Remove call to register copy_bitwise selftests. * utils.h (copy_bitwise): Add declaration. * utils.c (copy_bitwise, bits_to_str::bits_to_str) (selftests::check_copy_bitwise, selftests::copy_bitwise_tests): Moved here from dwarf2loc.c. (_initialize_utils): Register copy_bitwise selftests. Tested on x86_64-linux, no regression. Also tested using AdaCore's testsuite on a collection of small endian and big endian platforms.
Diffstat (limited to 'gdb/utils.h')
-rw-r--r--gdb/utils.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/gdb/utils.h b/gdb/utils.h
index fa9a590..08a29af 100644
--- a/gdb/utils.h
+++ b/gdb/utils.h
@@ -519,4 +519,12 @@ extern void dump_core (void);
extern char *make_hex_string (const gdb_byte *data, size_t length);
+/* Copy NBITS bits from SOURCE to DEST starting at the given bit
+ offsets. Use the bit order as specified by BITS_BIG_ENDIAN.
+ Source and destination buffers must not overlap. */
+
+extern void copy_bitwise (gdb_byte *dest, ULONGEST dest_offset,
+ const gdb_byte *source, ULONGEST source_offset,
+ ULONGEST nbits, int bits_big_endian);
+
#endif /* UTILS_H */