diff options
author | Alan Hayward <alan.hayward@arm.com> | 2018-06-20 09:31:37 +0100 |
---|---|---|
committer | Alan Hayward <alan.hayward@arm.com> | 2018-06-21 16:27:15 +0100 |
commit | 33bab475a6984afedac8a036b3bb40b5555b4127 (patch) | |
tree | 90001a8f3d2240a6bb406e5d9916e4475c70d35a /gdb/regcache.h | |
parent | d388f64333fb977c1b975cb9d26c762b143f4cb9 (diff) | |
download | gdb-33bab475a6984afedac8a036b3bb40b5555b4127.zip gdb-33bab475a6984afedac8a036b3bb40b5555b4127.tar.gz gdb-33bab475a6984afedac8a036b3bb40b5555b4127.tar.bz2 |
Avoid memcpys in regcache read_part/write_part for full registers.
Additionally, tidy up the functions: Remove asserts, use gdb_byte,
update comments.
gdb/
* regcache.c (readable_regcache::read_part): Avoid memcpy when
possible.
(regcache::write_part): Likewise.
(readable_regcache::cooked_read_part): Update comment.
(readable_regcache::cooked_write_part): Likewise.
* regcache.h: (readable_regcache::read_part): Likewise.
(regcache::write_part): Likewise.
Diffstat (limited to 'gdb/regcache.h')
-rw-r--r-- | gdb/regcache.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/gdb/regcache.h b/gdb/regcache.h index 74ac858..5e96a7a 100644 --- a/gdb/regcache.h +++ b/gdb/regcache.h @@ -253,8 +253,11 @@ public: struct value *cooked_read_value (int regnum); protected: - enum register_status read_part (int regnum, int offset, int len, void *in, - bool is_raw); + + /* Perform a partial register transfer using a read, modify, write + operation. Will fail if register is currently invalid. */ + enum register_status read_part (int regnum, int offset, int len, + gdb_byte *out, bool is_raw); }; /* Buffer of registers, can be read and written. */ @@ -355,9 +358,10 @@ private: int regnum, const void *in_buf, void *out_buf, size_t size) const; + /* Perform a partial register transfer using a read, modify, write + operation. */ enum register_status write_part (int regnum, int offset, int len, - const void *out, bool is_raw); - + const gdb_byte *in, bool is_raw); /* The address space of this register cache (for registers where it makes sense, like PC or SP). */ |