This is the mail archive of the gdb-testers@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] remote: multiple remote_arch_state instances per arch


*** TEST RESULTS FOR COMMIT 9d6eea31325e4027b5f035e941864fa6d780a8ca ***

Author: Pedro Alves <palves@redhat.com>
Branch: master
Commit: 9d6eea31325e4027b5f035e941864fa6d780a8ca

remote: multiple remote_arch_state instances per arch

Currently, we associate gdbarch-related remote protocol state on a
per-gdbarch data object.  Things like the size of the g/G packet, and
the max remote packet size.  If we'll support being connected to
different remote servers at the same time, then we need to cope with
each having their own packet sizes, even if they are each debugging
programs of the same architecture.  I.e., a single instance of
remote_arch_state per arch is not sufficient.

This patch moves the remote_arch_state object to a map of
gdbarch-to-remote_arch_state saved in the remote_state structure.
Usually there will only be one entry in the map, though we may see
more with stubs that support multi-process and/or archs with multiple
ABIs (e.g, one remote_arch_state for 64-bit inferiors and another for
32-bit inferiors).

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

	* remote.c: Include <unordered_map>.
	(remote_state): Now a class.
	(remote_state) <get_remote_arch_state>: Declare method.
	<get_remote_arch_state>: New field.
	(remote_arch_state) <remote_arch_state>: Declare ctor.
	<regs>: Now a unique_ptr.
	(remote_gdbarch_data_handle): Delete.
	(get_remote_arch_state): Delete.
	(remote_state::get_remote_arch_state): New.
	(get_remote_state): Adjust to call remote_state's
	get_remote_arch_state method.
	(init_remote_state): Delete, bits factored out to ...
	(remote_arch_state::remote_arch_state): ... this new method.
	(get_remote_packet_size, get_memory_packet_size)
	(process_g_packet, remote_target::fetch_registers)
	(remote_target::prepare_to_store, store_registers_using_G)
	(remote_target::store_registers, remote_target::get_trace_status):
	Adjust to call remote_state's method.
	(_initialize_remote): Remove reference to
	remote_gdbarch_data_handle.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]