-/* Description of the remote protocol. Strictly speaking, when the
- target is open()ed, remote.c should create a per-target description
- of the remote protocol using that target's architecture.
- Unfortunately, the target stack doesn't include local state. For
- the moment keep the information in the target's architecture
- object. Sigh.. */
+/* Description of the remote protocol state for the currently
+ connected target. This is per-target state, and independent of the
+ selected architecture. */
+
+struct remote_state
+{
+ /* A buffer to use for incoming packets, and its current size. The
+ buffer is grown dynamically for larger incoming packets.
+ Outgoing packets may also be constructed in this buffer.
+ BUF_SIZE is always at least REMOTE_PACKET_SIZE;
+ REMOTE_PACKET_SIZE should be used to limit the length of outgoing
+ packets. */
+ char *buf;
+ long buf_size;
+};
+
+/* This data could be associated with a target, but we do not always
+ have access to the current target when we need it, so for now it is
+ static. This will be fine for as long as only one target is in use
+ at a time. */
+static struct remote_state remote_state;
+
+static struct remote_state *
+get_remote_state (void)
+{
+ return &remote_state;
+}
+
+/* Description of the remote protocol for a given architecture. */