Hello, > > > I was going to suggest that this would benefit from unit tests in > > > the style of dwarf2read.c:copy_bitwise's, but, actually, isn't this > > > exactly the same as copy_bitwise? Can we get rid of ada-lang.c:move_bits? > > > (And maybe move copy_bitwise elsewhere?) > > > > I meant to say dwarf2loc.c instead of dwarf2read.c. > > It does look exactly the same, doesn't it? I'll see if we can just > re-use dwarf2loc's copy_bitwise. Thanks for the suggestion! How about the attached? I ran it through AdaCore's testsuite on all the platforms we support as well as the official testsuite on x86_64-linux. No regression. 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. Thank you! -- Joel