Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 2/9] [gdbserver] Split a new remote-utils.h file out of server.h.
Date: Tue, 03 Sep 2013 20:26:00 -0000	[thread overview]
Message-ID: <1378239999-15533-3-git-send-email-palves@redhat.com> (raw)
In-Reply-To: <1378239999-15533-1-git-send-email-palves@redhat.com>

gdb/gdbserver/
2013-09-03  Pedro Alves  <palves@redhat.com>

	* server.h (remote_debug, noack_mode, transport_is_reliable)
	(gdb_connected, STDIO_CONNECTION_NAME, remote_connection_is_stdio)
	(read_ptid, write_ptid, putpkt, putpkt_binary, putpkt_notif)
	(getpkt, remote_prepare, remote_open, remote_close, write_ok)
	(write_enn, initialize_async_io, enable_async_io)
	(disable_async_io, check_remote_input_interrupt_request)
	(convert_ascii_to_int, convert_int_to_ascii, new_thread_notify)
	(dead_thread_notify, prepare_resume_reply)
	(decode_address_to_semicolon, decode_address, decode_m_packet)
	(decode_M_packet, decode_X_packet, decode_xfer_write)
	(decode_search_memory_packet, unhexify, hexify)
	(remote_escape_output, unpack_varlen_hex, clear_symbol_cache)
	(look_up_one_symbol, relocate_instruction)
	(monitor_output): Move to remote-utils.h, and include it.
	* remote-utils.h: New file.
---
 gdb/gdbserver/remote-utils.h | 85 ++++++++++++++++++++++++++++++++++++++++++++
 gdb/gdbserver/server.h       | 65 +--------------------------------
 2 files changed, 86 insertions(+), 64 deletions(-)
 create mode 100644 gdb/gdbserver/remote-utils.h

diff --git a/gdb/gdbserver/remote-utils.h b/gdb/gdbserver/remote-utils.h
new file mode 100644
index 0000000..5a82ad0
--- /dev/null
+++ b/gdb/gdbserver/remote-utils.h
@@ -0,0 +1,85 @@
+/* Remote utility routines for the remote server for GDB.
+   Copyright (C) 1993-2013 Free Software Foundation, Inc.
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#ifndef REMOTE_UTILS_H
+#define REMOTE_UTILS_H
+
+extern int remote_debug;
+extern int noack_mode;
+extern int transport_is_reliable;
+
+int gdb_connected (void);
+
+#define STDIO_CONNECTION_NAME "stdio"
+int remote_connection_is_stdio (void);
+
+ptid_t read_ptid (char *buf, char **obuf);
+char *write_ptid (char *buf, ptid_t ptid);
+
+int putpkt (char *buf);
+int putpkt_binary (char *buf, int len);
+int putpkt_notif (char *buf);
+int getpkt (char *buf);
+void remote_prepare (char *name);
+void remote_open (char *name);
+void remote_close (void);
+void write_ok (char *buf);
+void write_enn (char *buf);
+void initialize_async_io (void);
+void enable_async_io (void);
+void disable_async_io (void);
+void check_remote_input_interrupt_request (void);
+void convert_ascii_to_int (const char *from, unsigned char *to, int n);
+void convert_int_to_ascii (const unsigned char *from, char *to, int n);
+void new_thread_notify (int id);
+void dead_thread_notify (int id);
+void prepare_resume_reply (char *buf, ptid_t ptid,
+			   struct target_waitstatus *status);
+
+const char *decode_address_to_semicolon (CORE_ADDR *addrp, const char *start);
+void decode_address (CORE_ADDR *addrp, const char *start, int len);
+void decode_m_packet (char *from, CORE_ADDR * mem_addr_ptr,
+		      unsigned int *len_ptr);
+void decode_M_packet (char *from, CORE_ADDR * mem_addr_ptr,
+		      unsigned int *len_ptr, unsigned char **to_p);
+int decode_X_packet (char *from, int packet_len, CORE_ADDR * mem_addr_ptr,
+		     unsigned int *len_ptr, unsigned char **to_p);
+int decode_xfer_write (char *buf, int packet_len,
+		       CORE_ADDR *offset, unsigned int *len,
+		       unsigned char *data);
+int decode_search_memory_packet (const char *buf, int packet_len,
+				 CORE_ADDR *start_addrp,
+				 CORE_ADDR *search_space_lenp,
+				 gdb_byte *pattern,
+				 unsigned int *pattern_lenp);
+
+int unhexify (char *bin, const char *hex, int count);
+int hexify (char *hex, const char *bin, int count);
+int remote_escape_output (const gdb_byte *buffer, int len,
+			  gdb_byte *out_buf, int *out_len,
+			  int out_maxlen);
+char *unpack_varlen_hex (char *buff,  ULONGEST *result);
+
+void clear_symbol_cache (struct sym_cache **symcache_p);
+int look_up_one_symbol (const char *name, CORE_ADDR *addrp, int may_ask_gdb);
+
+int relocate_instruction (CORE_ADDR *to, CORE_ADDR oldloc);
+
+void monitor_output (const char *msg);
+
+#endif /* REMOTE_UTILS_H */
diff --git a/gdb/gdbserver/server.h b/gdb/gdbserver/server.h
index 371876b..4f13cd9 100644
--- a/gdb/gdbserver/server.h
+++ b/gdb/gdbserver/server.h
@@ -272,70 +272,7 @@ extern int handle_vFile (char *, int, int *);
 /* Functions from hostio-errno.c.  */
 extern void hostio_last_error_from_errno (char *own_buf);
 
-/* From remote-utils.c */
-
-extern int remote_debug;
-extern int noack_mode;
-extern int transport_is_reliable;
-
-int gdb_connected (void);
-
-#define STDIO_CONNECTION_NAME "stdio"
-int remote_connection_is_stdio (void);
-
-ptid_t read_ptid (char *buf, char **obuf);
-char *write_ptid (char *buf, ptid_t ptid);
-
-int putpkt (char *buf);
-int putpkt_binary (char *buf, int len);
-int putpkt_notif (char *buf);
-int getpkt (char *buf);
-void remote_prepare (char *name);
-void remote_open (char *name);
-void remote_close (void);
-void write_ok (char *buf);
-void write_enn (char *buf);
-void initialize_async_io (void);
-void enable_async_io (void);
-void disable_async_io (void);
-void check_remote_input_interrupt_request (void);
-void convert_ascii_to_int (const char *from, unsigned char *to, int n);
-void convert_int_to_ascii (const unsigned char *from, char *to, int n);
-void new_thread_notify (int id);
-void dead_thread_notify (int id);
-void prepare_resume_reply (char *buf, ptid_t ptid,
-			   struct target_waitstatus *status);
-
-const char *decode_address_to_semicolon (CORE_ADDR *addrp, const char *start);
-void decode_address (CORE_ADDR *addrp, const char *start, int len);
-void decode_m_packet (char *from, CORE_ADDR * mem_addr_ptr,
-		      unsigned int *len_ptr);
-void decode_M_packet (char *from, CORE_ADDR * mem_addr_ptr,
-		      unsigned int *len_ptr, unsigned char **to_p);
-int decode_X_packet (char *from, int packet_len, CORE_ADDR * mem_addr_ptr,
-		     unsigned int *len_ptr, unsigned char **to_p);
-int decode_xfer_write (char *buf, int packet_len,
-		       CORE_ADDR *offset, unsigned int *len,
-		       unsigned char *data);
-int decode_search_memory_packet (const char *buf, int packet_len,
-				 CORE_ADDR *start_addrp,
-				 CORE_ADDR *search_space_lenp,
-				 gdb_byte *pattern,
-				 unsigned int *pattern_lenp);
-
-int unhexify (char *bin, const char *hex, int count);
-int hexify (char *hex, const char *bin, int count);
-int remote_escape_output (const gdb_byte *buffer, int len,
-			  gdb_byte *out_buf, int *out_len,
-			  int out_maxlen);
-char *unpack_varlen_hex (char *buff,  ULONGEST *result);
-
-void clear_symbol_cache (struct sym_cache **symcache_p);
-int look_up_one_symbol (const char *name, CORE_ADDR *addrp, int may_ask_gdb);
-
-int relocate_instruction (CORE_ADDR *to, CORE_ADDR oldloc);
-
-void monitor_output (const char *msg);
+#include "remote-utils.h"
 
 /* Functions from utils.c */
 #include "common-utils.h"
-- 
1.7.11.7


  parent reply	other threads:[~2013-09-03 20:26 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-03 20:26 [PATCH 0/9][gdbserver] Split server.h Pedro Alves
2013-09-03 20:26 ` [PATCH 8/9] [gdbserver] Split a new event-loop.h file out of server.h Pedro Alves
2013-09-03 20:26 ` [PATCH 5/9] [gdbserver] Split a new ax.h " Pedro Alves
2013-09-05 20:49   ` [PATCH 5/9] [gdbserver] Move bytecode compilation bits from server.h to ax.h. (was: Re: [PATCH 5/9] [gdbserver] Split a new ax.h file out of server.h.) Pedro Alves
2013-09-03 20:26 ` Pedro Alves [this message]
2013-09-03 20:26 ` [PATCH 1/9] [gdbserver] Delete _ macro (gettext) Pedro Alves
2013-09-03 20:26 ` [PATCH 7/9] [gdbserver] Split a new dll.h file out of server.h Pedro Alves
2013-09-05 20:50   ` Pedro Alves
2013-09-03 20:26 ` [PATCH 4/9] [gdbserver] Split a new tracepoint.h " Pedro Alves
2013-09-03 20:26 ` [PATCH 9/9] [gdbserver] Split a new hostio.h " Pedro Alves
2013-09-05 20:50   ` Pedro Alves
2013-09-03 20:26 ` [PATCH 3/9] [gdbserver] Split a new utils.h " Pedro Alves
2013-09-03 20:54 ` [PATCH 6/9] [gdbserver] Split a new inferiors.h " Pedro Alves
2013-09-05 20:47 ` [COMMIT] Re: [PATCH 0/9][gdbserver] Split server.h Pedro Alves
2013-09-05 22:22   ` Pedro Alves
2013-09-05 23:52     ` Joel Brobecker
2013-09-06  5:47     ` Eli Zaretskii
2013-09-06  6:51       ` Ricard Wanderlof
2013-09-06  7:42         ` Eli Zaretskii
2013-09-06  9:36       ` Pedro Alves
2013-09-06 10:05         ` Agovic, Sanimir
2013-09-06 10:09           ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1378239999-15533-3-git-send-email-palves@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox