aboutsummaryrefslogtreecommitdiff
path: root/compile
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2023-12-01 11:27:17 -0500
committerSimon Marchi <simon.marchi@efficios.com>2023-12-14 16:04:49 +0000
commit08d8e7ff9474a88b491d22139ace851daae1a1c6 (patch)
tree7a32a5dabdddcb7a16fb24c134b241b8539fbe5c /compile
parentf06b75776428f524d91d860aecbbe2734cf5580c (diff)
downloadgdb-08d8e7ff9474a88b491d22139ace851daae1a1c6.zip
gdb-08d8e7ff9474a88b491d22139ace851daae1a1c6.tar.gz
gdb-08d8e7ff9474a88b491d22139ace851daae1a1c6.tar.bz2
gdb: simplify conditions in regcache::{read,write,raw_collect,raw_supply}_part
Make a few simplifications in these functions. 1. When checking if we need to do nothing, if the length is 0, we don't need to do anything, regardless of the value of offset. Remove the offset check. 2. When check if transferring the whole register, if the length is equal to the register size, then we transfer the whole register, no need to check the offset. Remove the offset check. 3. In the gdb_asserts, it is unnecessary to check for: offset <= reg_size given that right after we check for: len >= 0 && offset + len <= reg_size If `offset + len` is <= reg_size and len is >= 0, then necessarily offset is <= reg_size. Remove the `offset <= reg_size` check. Change-Id: I30a73acdc7bf432c45a07f5f177224d1cdc298e8 Reviewed-By: John Baldwin <jhb@FreeBSD.org>
Diffstat (limited to 'compile')
0 files changed, 0 insertions, 0 deletions