binutils-gdb/gdbsupport
Simon Marchi e4e20d4511 gdb: use reg_buffer_common throughout gdbsupport/common-regcache.h
Right now, gdbsupport/common-regcache.h contains two abstractons for a
regcache.  An opaque type `regcache` (gdb and gdbserver both have their
own regcache that is the concrete version of this) and an abstract base
class `reg_buffer_common`, that is the base of regcaches on both sides.
These abstractions allow code to be written for both gdb and gdbserver,
for instance in the gdb/arch sub-directory.

However, having two
different abstractions is impractical.  If some common code has a regcache,
and wants to use an operation defined on reg_buffer_common, it can't.
It would be better to have just one.  Change all instances of `regcache
*` in gdbsupport/common-regcache.h to be `reg_buffer_common *`, then fix
fallouts.

Implementations in gdb and gdbserver now need to down-cast (using
gdb::checked_static_cast) from reg_buffer_common to their concrete
regcache type.  Some of them could be avoided by changing free functions
(like regcache_register_size) to be virtual methods on
reg_buffer_common.  I tried it, it seems to work, but I did not include
it in this series to avoid adding unnecessary changes.

Change-Id: Ia5503adb6b5509a0f4604bd2a68b4642cc5283fd
Reviewed-by: John Baldwin <jhb@FreeBSD.org>
2023-12-14 16:04:49 +00:00
..
.dir-locals.el Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
.gitattributes
acinclude.m4
aclocal.m4 Finalized intl-update patches 2023-11-15 12:53:04 +00:00
agent.cc Do not cast away const in agent_run_command 2023-02-14 09:01:18 -07:00
agent.h Do not cast away const in agent_run_command 2023-02-14 09:01:18 -07:00
alt-stack.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
array-view.h Enable some C++14 code in array-view.h 2023-11-29 14:29:44 -07:00
ax.def Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
block-signals.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
break-common.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
btrace-common.cc Use C++17 [[fallthrough]] attribute 2023-11-29 14:29:43 -07:00
btrace-common.h gdb: c++ify btrace_target_info 2023-09-11 06:15:52 +00:00
buildargv.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
byte-vector.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
ChangeLog-2020-2021
check-defines.el Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
cleanups.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
cleanups.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
common-debug.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
common-debug.h gdb: Replace gdb::optional with std::optional 2023-11-21 11:52:35 +00:00
common-defs.h Remove EXTERN_C and related defines 2023-11-06 20:31:12 -07:00
common-exceptions.cc [gdb] Fix typos 2023-06-03 22:43:57 +02:00
common-exceptions.h [gdb/build, c++20] Fix Wdeprecated-enum-enum-conversion 2023-08-17 10:41:34 +02:00
common-gdbthread.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
common-inferior.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
common-inferior.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
common-regcache.cc gdb: use reg_buffer_common throughout gdbsupport/common-regcache.h 2023-12-14 16:04:49 +00:00
common-regcache.h gdb: use reg_buffer_common throughout gdbsupport/common-regcache.h 2023-12-14 16:04:49 +00:00
common-types.h Move unrelocated_addr to common-types.h 2023-06-05 09:59:18 -06:00
common-utils.cc gdb: Fix building with latest libc++ 2023-04-29 00:35:11 -07:00
common-utils.h gdb: Use std::string_view instead of gdb::string_view 2023-11-21 11:52:36 +00:00
common.m4 Move -lsocket check to common.m4 2023-10-12 18:23:13 -06:00
compiler-type.m4 Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
config.in Finalized intl-update patches 2023-11-15 12:53:04 +00:00
configure Switch to -Wimplicit-fallthrough=5 2023-11-29 14:29:43 -07:00
configure.ac gdb/gdbsupport/gdbserver: Require c++17 2023-10-28 19:25:34 +00:00
create-version.sh Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
def-vector.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
default-init-alloc.h [gdb/build, c++20] Handle deprecated std::allocator::construct 2023-08-17 10:41:34 +02:00
eintr.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
enum-flags.h [gdb] Fix typos 2023-06-03 22:43:57 +02:00
environ.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
environ.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
errors.cc Introduce throw_winerror_with_name 2023-11-27 12:55:14 -07:00
errors.h Introduce throw_winerror_with_name 2023-11-27 12:55:14 -07:00
event-loop.cc gdb: Replace gdb::optional with std::optional 2023-11-21 11:52:35 +00:00
event-loop.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
event-pipe.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
event-pipe.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
fileio.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
fileio.h gdb, gdbserver, gdbsupport: fix whitespace issues 2023-03-09 16:32:00 -05:00
filestuff.cc gdb: Replace gdb::optional with std::optional 2023-11-21 11:52:35 +00:00
filestuff.h gdb: Replace gdb::optional with std::optional 2023-11-21 11:52:35 +00:00
filtered-iterator.h gdbsupport: Replace gdb::invoke_result with std::invoke_result 2023-11-21 11:52:36 +00:00
format.cc Use C++17 [[fallthrough]] attribute 2023-11-29 14:29:43 -07:00
format.h gdb: Use std::string_view instead of gdb::string_view 2023-11-21 11:52:36 +00:00
forward-scope-exit.h gdb: Replace gdb::optional with std::optional 2023-11-21 11:52:35 +00:00
function-view.h gdbsupport: Replace gdb::invoke_result with std::invoke_result 2023-11-21 11:52:36 +00:00
gdb_assert.h Remove gdb_static_assert 2023-11-29 14:29:44 -07:00
gdb_binary_search.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb_file.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb_locale.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb_obstack.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb_obstack.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb_proc_service.h Remove EXTERN_C and related defines 2023-11-06 20:31:12 -07:00
gdb_ref_ptr.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb_regex.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb_regex.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb_select.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb_setjmp.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb_signals.h [gdb] Fix typos 2023-06-03 22:43:57 +02:00
gdb_splay_tree.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb_sys_time.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb_tilde_expand.cc gdb, gdbserver, gdbsupport: fix whitespace issues 2023-03-09 16:32:00 -05:00
gdb_tilde_expand.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb_unique_ptr.h gdb: Use C++17's std::make_unique instead of gdb::make_unique 2023-11-21 11:52:35 +00:00
gdb_unlinker.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb_vecs.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb_vecs.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb_wait.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb_wait.h Remove explanatory comments from includes 2023-09-20 11:45:16 -06:00
gdb-checked-static-cast.h gdbsupport: add support for references to checked_static_cast 2023-05-24 14:53:53 -04:00
gdb-dlfcn.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb-dlfcn.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb-hashtab.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb-hashtab.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb-safe-ctype.h gdb: Fix building with latest libc++ 2023-04-29 00:35:11 -07:00
gdb-sigmask.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
gdb-xfree.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
hash_enum.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
host-defs.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
intrusive_list.h gdbsupport: use "reference" and "pointer" type aliases in intrusive_list 2023-10-19 10:57:51 -04:00
iterator-range.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
job-control.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
job-control.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
Makefile.am Finalized intl-update patches 2023-11-15 12:53:04 +00:00
Makefile.in Finalized intl-update patches 2023-11-15 12:53:04 +00:00
netstuff.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
netstuff.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
new-op.cc Rely on C++17 <new> in new-op.cc 2023-11-29 14:29:44 -07:00
next-iterator.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
observable.h gdb, gdbserver, gdbsupport: fix whitespace issues 2023-03-09 16:32:00 -05:00
offset-type.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
packed.h Remove gdb_static_assert 2023-11-29 14:29:44 -07:00
parallel-for.h gdbsupport: Replace gdb::invoke_result with std::invoke_result 2023-11-21 11:52:36 +00:00
pathstuff.cc [gdb] Fix typos 2023-06-03 22:43:57 +02:00
pathstuff.h Remove gdb_static_assert 2023-11-29 14:29:44 -07:00
poison.h [gdb/build, c++20] Stop using deprecated is_pod 2023-08-17 10:41:34 +02:00
preprocessor.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
print-utils.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
print-utils.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
ptid.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
ptid.h Fix build failure with GCC 4.8 2023-09-15 10:36:15 -06:00
ptrace.m4 Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
range-chain.h gdb: Replace gdb::optional with std::optional 2023-11-21 11:52:35 +00:00
README
refcounted-object.h [gdb] Fix segfault in for_each_block, part 1 2023-11-28 10:31:25 +01:00
reference-to-pointer-iterator.h [gdb] Fix typos 2023-06-03 22:43:57 +02:00
rsp-low.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
rsp-low.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
run-time-clock.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
run-time-clock.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
safe-iterator.h gdbsupport: Replace gdb::invoke_result with std::invoke_result 2023-11-21 11:52:36 +00:00
safe-strerror.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
scope-exit.h Rely on copy elision in scope-exit.h 2023-11-29 14:29:44 -07:00
scoped_fd.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
scoped_ignore_signal.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
scoped_ignore_sigttou.h gdb: Replace gdb::optional with std::optional 2023-11-21 11:52:35 +00:00
scoped_mmap.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
scoped_mmap.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
scoped_restore.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
search.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
search.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
selftest.cc gdbsupport: record and print failed selftest names 2023-11-03 14:25:59 -04:00
selftest.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
selftest.m4 Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
signals-state-save-restore.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
signals-state-save-restore.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
signals.cc [gdb] Fix typos 2023-06-03 22:43:57 +02:00
symbol.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
tdesc.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
tdesc.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
thread-pool.cc gdb: Enable early init of thread pool size 2023-12-04 14:23:17 +00:00
thread-pool.h gdb: Enable early init of thread pool size 2023-12-04 14:23:17 +00:00
traits.h Use C++17 void_t 2023-11-29 14:29:44 -07:00
underlying.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
valid-expr.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
version.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
warning.m4 Switch to -Wimplicit-fallthrough=5 2023-11-29 14:29:43 -07:00
x86-xstate.h x86: Remove X86_XSTATE_SIZE and related constants. 2023-08-28 14:18:19 -07:00
xml-utils.cc Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
xml-utils.h Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00

This is a helper library that is used by gdb and gdbserver.

To send patches, follow the gdb patch submission instructions in
../gdb/CONTRIBUTE.  For maintainers, see ../gdb/MAINTAINERS.