]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Use partial register read/writes in transfer_regset
authorAlan Hayward <alan.hayward@arm.com>
Wed, 20 Jun 2018 17:19:05 +0000 (18:19 +0100)
committerAlan Hayward <alan.hayward@arm.com>
Fri, 22 Jun 2018 15:26:02 +0000 (16:26 +0100)
commit8e7767e3f782c46451a548d708f5582669d7a6d7
treea406ee831dad6254abe28f61caeba1d63be514ab
parent514cd3a0f589fa48ca7bc9504c36436c0cbefcb2
Use partial register read/writes in transfer_regset

This avoids assert failures when the register is bigger than the
slot size. This happens on Aarch64 when truncating Z registers
into an fpsimd structure. This can be triggered by running
gdb command "generate-core-file".

Also, when the register is smaller then the slot size, then
zero pad when writing to the slot, and truncate when writing
to the regcache. This happens on Aarch64 with the CPSR register.

Continue to ensure registers are invalidated when both buffers
are null.

gdb/
* regcache.c (readable_regcache::read_part): Fix asserts.
(reg_buffer::raw_collect_part): New function.
(regcache::write_part): Fix asserts.
(reg_buffer::raw_supply_part): New function.
(regcache::transfer_regset_register): New helper function.
(regcache::transfer_regset): Call new functions.
(regcache_supply_regset): Use gdb_byte*.
(regcache::supply_regset): Likewise.
(regcache_collect_regset): Likewise.
(regcache::collect_regset): Likewise.
* regcache.h (reg_buffer::raw_collect_part): New declaration.
(reg_buffer::raw_supply_part): Likewise.
(regcache::transfer_regset_register): Likewise.
(regcache::transfer_regset): Use gdb_byte*.
gdb/ChangeLog
gdb/regcache.c
gdb/regcache.h