remote: Make readahead_cache a C++ class
authorPedro Alves <palves@redhat.com>
Tue, 22 May 2018 17:22:07 +0000 (18:22 +0100)
committerPedro Alves <palves@redhat.com>
Tue, 22 May 2018 17:31:47 +0000 (18:31 +0100)
commitdd194f6b36727987dc7f0d707512bd886982099c
tree971c4b8a00e248df41ca2d62f8c135d09bafafe2
parent440b7aece49b9a1e9ff4537214134c3cd06425d9
remote: Make readahead_cache a C++ class

The idea here is eliminate the get_remote_state calls from within
readahead_cache_invalidate, readahead_cache_invalidate_fd,
remote_hostio_pread_from_cache by making those functions be class
methods instead.  Later on we'll have one readahead_cache instance per
remote connection, and this change makes that easier.

gdb/ChangeLog:
2018-05-22  Pedro Alves  <palves@redhat.com>

* remote.c (struct readahead_cache) <invalidate, invalidate_fd,
pread>: New method declarations.
(remote_target::open_1): Adjust.
(readahead_cache_invalidate): Rename to ...
(readahead_cache::invalidate): ... this, and adjust to be a class
method.
(readahead_cache_invalidate_fd): Rename to ...
(readahead_cache::invalidate_fd): ... this, and adjust to be a
class method.
(remote_hostio_pwrite): Adjust.
(remote_hostio_pread_from_cache): Rename to ...
(readahead_cache::pread): ... this, and adjust to be a class
method.
(remote_hostio_close): Adjust.
gdb/ChangeLog
gdb/remote.c