libcc1: share GDB plugin code
authorTom Tromey <tom@tromey.com>
Tue, 4 May 2021 21:26:58 +0000 (15:26 -0600)
committerTom Tromey <tom@tromey.com>
Wed, 5 May 2021 06:06:17 +0000 (00:06 -0600)
commit1a51cb299070920280d4d38c6a59788c0c621658
tree120bb198598925cb02ed976d8958aaa886b9028f
parent0624823260f953050447a909da87f031488dba13
libcc1: share GDB plugin code

The two GDB plugins in libcc1 share a fair amount of code.  This was
done by copy-and-paste, though in reality the underlying code is
nearly identical.

libcc1

* libcp1.cc (struct libcp1): Derive from base_gdb_plugin.  Remove
shared code.
(class libcp1_connection): Remove.
(rpc): Remove.
(libcp1_set_verbose, libcp1_compile): Update.
(cp_call_binding_oracle, cp_call_symbol_address)
(cp_call_enter_scope, cp_call_leave_scope): Update.
* libcc1.cc (struct libcc1): Derive from base_gdb_plugin.  Remove
shared code.
(class libcc1_connection): Remove.
(c_call_binding_oracle, c_call_symbol_address): Update.
(rpc): Remove.
(libcc1_set_verbose, libcc1_compile): Update.
* gdbctx.hh: New file.
libcc1/gdbctx.hh [new file with mode: 0644]
libcc1/libcc1.cc
libcc1/libcp1.cc