Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH 9/9] [gdbserver] Split a new hostio.h file out of server.h.
  2013-09-03 20:26 [PATCH 0/9][gdbserver] Split server.h Pedro Alves
                   ` (6 preceding siblings ...)
  2013-09-03 20:26 ` [PATCH 4/9] [gdbserver] Split a new tracepoint.h " Pedro Alves
@ 2013-09-03 20:26 ` Pedro Alves
  2013-09-05 20:50   ` 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
  9 siblings, 1 reply; 22+ messages in thread
From: Pedro Alves @ 2013-09-03 20:26 UTC (permalink / raw)
  To: gdb-patches

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

	* server.h (handle_vFile, hostio_last_error_from_errno): Move
	to ...
	* hostio.h: ... this new file.
	* hostio.c, linux-low.c, server.c: Include hostio.h.
---
 gdb/gdbserver/hostio.c    |  1 +
 gdb/gdbserver/hostio.h    | 28 ++++++++++++++++++++++++++++
 gdb/gdbserver/linux-low.c |  1 +
 gdb/gdbserver/server.c    |  1 +
 gdb/gdbserver/server.h    |  6 ------
 5 files changed, 31 insertions(+), 6 deletions(-)
 create mode 100644 gdb/gdbserver/hostio.h

diff --git a/gdb/gdbserver/hostio.c b/gdb/gdbserver/hostio.c
index a74c2f8..8edbadb 100644
--- a/gdb/gdbserver/hostio.c
+++ b/gdb/gdbserver/hostio.c
@@ -20,6 +20,7 @@
 
 #include "server.h"
 #include "gdb/fileio.h"
+#include "hostio.h"
 
 #include <fcntl.h>
 #include <limits.h>
diff --git a/gdb/gdbserver/hostio.h b/gdb/gdbserver/hostio.h
new file mode 100644
index 0000000..802374c
--- /dev/null
+++ b/gdb/gdbserver/hostio.h
@@ -0,0 +1,28 @@
+/* Host file transfer support for gdbserver.
+   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 HOSTIO_H
+#define HOSTIO_H
+
+/* Functions from hostio.c.  */
+extern int handle_vFile (char *, int, int *);
+
+/* Functions from hostio-errno.c.  */
+extern void hostio_last_error_from_errno (char *own_buf);
+
+#endif /* HOSTIO_H */
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index 7c95058..799fcc9 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -46,6 +46,7 @@
 #include <sys/uio.h>
 #include "filestuff.h"
 #include "tracepoint.h"
+#include "hostio.h"
 #ifndef ELFMAG0
 /* Don't include <linux/elf.h> here.  If it got included by gdb_proc_service.h
    then ELFMAG0 will have been defined.  If it didn't get included by
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index 6ca7fe1..f4e1525 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -31,6 +31,7 @@
 #include "filestuff.h"
 #include "tracepoint.h"
 #include "dll.h"
+#include "hostio.h"
 
 /* The thread set with an `Hc' packet.  `Hc' is deprecated in favor of
    `vCont'.  Note the multi-process extensions made `vCont' a
diff --git a/gdb/gdbserver/server.h b/gdb/gdbserver/server.h
index 53127bf..05724e0 100644
--- a/gdb/gdbserver/server.h
+++ b/gdb/gdbserver/server.h
@@ -144,12 +144,6 @@ typedef int gdb_fildes_t;
 extern int handle_serial_event (int err, gdb_client_data client_data);
 extern int handle_target_event (int err, gdb_client_data client_data);
 
-/* Functions from hostio.c.  */
-extern int handle_vFile (char *, int, int *);
-
-/* Functions from hostio-errno.c.  */
-extern void hostio_last_error_from_errno (char *own_buf);
-
 #include "remote-utils.h"
 
 #include "common-utils.h"
-- 
1.7.11.7


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 8/9] [gdbserver] Split a new event-loop.h file out of server.h.
  2013-09-03 20:26 [PATCH 0/9][gdbserver] Split server.h Pedro Alves
                   ` (3 preceding siblings ...)
  2013-09-03 20:26 ` [PATCH 5/9] [gdbserver] Split a new ax.h " Pedro Alves
@ 2013-09-03 20:26 ` Pedro Alves
  2013-09-03 20:26 ` [PATCH 3/9] [gdbserver] Split a new utils.h " Pedro Alves
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 22+ messages in thread
From: Pedro Alves @ 2013-09-03 20:26 UTC (permalink / raw)
  To: gdb-patches

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

	* server.h (gdb_client_data, handler_func, callback_handler_func)
	(delete_file_handler, add_file_handler, append_callback_event)
	(delete_callback_event, start_event_loop, initialize_event_loop):
	Move to event-loop.h and include it.
	* event-loop.h: New file.
---
 gdb/gdbserver/event-loop.h | 36 ++++++++++++++++++++++++++++++++++++
 gdb/gdbserver/server.h     | 15 +--------------
 2 files changed, 37 insertions(+), 14 deletions(-)
 create mode 100644 gdb/gdbserver/event-loop.h

diff --git a/gdb/gdbserver/event-loop.h b/gdb/gdbserver/event-loop.h
new file mode 100644
index 0000000..4967389
--- /dev/null
+++ b/gdb/gdbserver/event-loop.h
@@ -0,0 +1,36 @@
+/* Event loop machinery 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 EVENT_LOOP_H
+#define EVENT_LOOP_H
+
+typedef void *gdb_client_data;
+typedef int (handler_func) (int, gdb_client_data);
+typedef int (callback_handler_func) (gdb_client_data);
+
+extern void delete_file_handler (gdb_fildes_t fd);
+extern void add_file_handler (gdb_fildes_t fd, handler_func *proc,
+			      gdb_client_data client_data);
+extern int append_callback_event (callback_handler_func *proc,
+				   gdb_client_data client_data);
+extern void delete_callback_event (int id);
+
+extern void start_event_loop (void);
+extern void initialize_event_loop (void);
+
+#endif /* EVENT_LOOP_H */
diff --git a/gdb/gdbserver/server.h b/gdb/gdbserver/server.h
index ab52738..53127bf 100644
--- a/gdb/gdbserver/server.h
+++ b/gdb/gdbserver/server.h
@@ -138,20 +138,7 @@ typedef SOCKET gdb_fildes_t;
 typedef int gdb_fildes_t;
 #endif
 
-/* Functions from event-loop.c.  */
-typedef void *gdb_client_data;
-typedef int (handler_func) (int, gdb_client_data);
-typedef int (callback_handler_func) (gdb_client_data);
-
-extern void delete_file_handler (gdb_fildes_t fd);
-extern void add_file_handler (gdb_fildes_t fd, handler_func *proc,
-			      gdb_client_data client_data);
-extern int append_callback_event (callback_handler_func *proc,
-				   gdb_client_data client_data);
-extern void delete_callback_event (int id);
-
-extern void start_event_loop (void);
-extern void initialize_event_loop (void);
+#include "event-loop.h"
 
 /* Functions from server.c.  */
 extern int handle_serial_event (int err, gdb_client_data client_data);
-- 
1.7.11.7


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 2/9] [gdbserver] Split a new remote-utils.h file out of server.h.
  2013-09-03 20:26 [PATCH 0/9][gdbserver] Split server.h 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-03 20:26 ` [PATCH 1/9] [gdbserver] Delete _ macro (gettext) Pedro Alves
@ 2013-09-03 20:26 ` Pedro Alves
  2013-09-03 20:26 ` [PATCH 5/9] [gdbserver] Split a new ax.h " Pedro Alves
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 22+ messages in thread
From: Pedro Alves @ 2013-09-03 20:26 UTC (permalink / raw)
  To: gdb-patches

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


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 7/9] [gdbserver] Split a new dll.h file out of server.h.
  2013-09-03 20:26 [PATCH 0/9][gdbserver] Split server.h Pedro Alves
@ 2013-09-03 20:26 ` Pedro Alves
  2013-09-05 20:50   ` Pedro Alves
  2013-09-03 20:26 ` [PATCH 1/9] [gdbserver] Delete _ macro (gettext) Pedro Alves
                   ` (8 subsequent siblings)
  9 siblings, 1 reply; 22+ messages in thread
From: Pedro Alves @ 2013-09-03 20:26 UTC (permalink / raw)
  To: gdb-patches

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

	* dll.c, inferiors.c, remote-utils.c, server.c: Include "dll.h".
	* server.h (struct dll_info, all_dlls, dlls_changed, clear_dlls)
	(loaded_dll, unloaded_dll): Move to ...
	* dll.h: ... this new file.
---
 gdb/gdbserver/dll.c          |  1 +
 gdb/gdbserver/dll.h          | 35 +++++++++++++++++++++++++++++++++++
 gdb/gdbserver/inferiors.c    |  1 +
 gdb/gdbserver/remote-utils.c |  2 ++
 gdb/gdbserver/server.c       |  1 +
 gdb/gdbserver/server.h       | 16 ----------------
 6 files changed, 40 insertions(+), 16 deletions(-)
 create mode 100644 gdb/gdbserver/dll.h

diff --git a/gdb/gdbserver/dll.c b/gdb/gdbserver/dll.c
index e4873eb..74978e2 100644
--- a/gdb/gdbserver/dll.c
+++ b/gdb/gdbserver/dll.c
@@ -16,6 +16,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "server.h"
+#include "dll.h"
 
 #define get_dll(inf) ((struct dll_info *)(inf))
 
diff --git a/gdb/gdbserver/dll.h b/gdb/gdbserver/dll.h
new file mode 100644
index 0000000..428c60c
--- /dev/null
+++ b/gdb/gdbserver/dll.h
@@ -0,0 +1,35 @@
+/* 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 DLL_H
+#define DLL_H
+
+struct dll_info
+{
+  struct inferior_list_entry entry;
+  char *name;
+  CORE_ADDR base_addr;
+};
+
+extern struct inferior_list all_dlls;
+extern int dlls_changed;
+
+extern void clear_dlls (void);
+extern void loaded_dll (const char *name, CORE_ADDR base_addr);
+extern void unloaded_dll (const char *name, CORE_ADDR base_addr);
+
+#endif /* DLL_H */
diff --git a/gdb/gdbserver/inferiors.c b/gdb/gdbserver/inferiors.c
index 39eb52e..5f974ca 100644
--- a/gdb/gdbserver/inferiors.c
+++ b/gdb/gdbserver/inferiors.c
@@ -22,6 +22,7 @@
 
 #include "server.h"
 #include "gdbthread.h"
+#include "dll.h"
 
 struct inferior_list all_processes;
 struct inferior_list all_threads;
diff --git a/gdb/gdbserver/remote-utils.c b/gdb/gdbserver/remote-utils.c
index 5cd6fa1..8e8a4d6 100644
--- a/gdb/gdbserver/remote-utils.c
+++ b/gdb/gdbserver/remote-utils.c
@@ -21,6 +21,8 @@
 #include "target.h"
 #include "gdbthread.h"
 #include "tdesc.h"
+#include "dll.h"
+
 #include <stdio.h>
 #include <string.h>
 #if HAVE_SYS_IOCTL_H
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index 3c70288..6ca7fe1 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -30,6 +30,7 @@
 #include "btrace-common.h"
 #include "filestuff.h"
 #include "tracepoint.h"
+#include "dll.h"
 
 /* The thread set with an `Hc' packet.  `Hc' is deprecated in favor of
    `vCont'.  Note the multi-process extensions made `vCont' a
diff --git a/gdb/gdbserver/server.h b/gdb/gdbserver/server.h
index a696121..ab52738 100644
--- a/gdb/gdbserver/server.h
+++ b/gdb/gdbserver/server.h
@@ -102,26 +102,10 @@ typedef unsigned long long ULONGEST;
 #include "gdbthread.h"
 #include "inferiors.h"
 
-struct dll_info
-{
-  struct inferior_list_entry entry;
-  char *name;
-  CORE_ADDR base_addr;
-};
-
 /* Target-specific functions */
 
 void initialize_low ();
 
-/* From dll.c.  */
-
-extern struct inferior_list all_dlls;
-extern int dlls_changed;
-extern void clear_dlls (void);
-
-void loaded_dll (const char *name, CORE_ADDR base_addr);
-void unloaded_dll (const char *name, CORE_ADDR base_addr);
-
 /* Public variables in server.c */
 
 extern ptid_t cont_thread;
-- 
1.7.11.7


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 4/9] [gdbserver] Split a new tracepoint.h file out of server.h.
  2013-09-03 20:26 [PATCH 0/9][gdbserver] Split server.h Pedro Alves
                   ` (5 preceding siblings ...)
  2013-09-03 20:26 ` [PATCH 3/9] [gdbserver] Split a new utils.h " Pedro Alves
@ 2013-09-03 20:26 ` Pedro Alves
  2013-09-03 20:26 ` [PATCH 9/9] [gdbserver] Split a new hostio.h " Pedro Alves
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 22+ messages in thread
From: Pedro Alves @ 2013-09-03 20:26 UTC (permalink / raw)
  To: gdb-patches

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

	* ax.c, linux-low.c, linux-x86-low.c, server.c: Include
	tracepoint.h.
	* server.h (IPA_BUFSIZ, initialize_tracepoint, tracing)
	(disconnected_tracing, tracepoint_look_up_symbols, stop_tracing
	(handle_tracepoint_general_set, handle_tracepoint_query)
	(tracepoint_finished_step, tracepoint_was_hit)
	(release_while_stepping_state_list, current_traceframe)
	(in_readonly_region, traceframe_read_mem)
	(fetch_traceframe_registers, traceframe_read_sdata)
	(traceframe_read_info, struct fast_tpoint_collect_status)
	(fast_tracepoint_collecting, force_unlock_trace_buffer)
	(handle_tracepoit_bkpts, initialize_low_tracepoint)
	(supply_fast_tracepoint_registers)
	(supply_static_tracepoint_registers, set_trampoline_buffer_space)
	(ipa_tdesc, claim_trampoline_space)
	(have_fast_tracepoint_trampoline_buffer, gdb_agent_about_to_close)
	(agent_mem_read, agent_get_trace_state_variable_value)
	(agent_set_trace_state_variable_value, agent_tsv_read)
	(agent_mem_read_string, get_raw_reg_func_addr)
	(get_get_tsv_func_addr, get_set_tsv_func_addr): Move to ...
	* tracepoint.h: ... this new file.
---
 gdb/gdbserver/ax.c            |   1 +
 gdb/gdbserver/linux-low.c     |   1 +
 gdb/gdbserver/linux-x86-low.c |   1 +
 gdb/gdbserver/server.c        |   1 +
 gdb/gdbserver/server.h        | 112 -----------------------------------
 gdb/gdbserver/target.c        |   1 +
 gdb/gdbserver/tracepoint.c    |   1 +
 gdb/gdbserver/tracepoint.h    | 132 ++++++++++++++++++++++++++++++++++++++++++
 8 files changed, 138 insertions(+), 112 deletions(-)
 create mode 100644 gdb/gdbserver/tracepoint.h

diff --git a/gdb/gdbserver/ax.c b/gdb/gdbserver/ax.c
index b6824a2..d4768e1 100644
--- a/gdb/gdbserver/ax.c
+++ b/gdb/gdbserver/ax.c
@@ -19,6 +19,7 @@
 #include "server.h"
 #include "ax.h"
 #include "format.h"
+#include "tracepoint.h"
 
 static void ax_vdebug (const char *, ...) ATTRIBUTE_PRINTF (1, 2);
 
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index 7db1fc8..7c95058 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -45,6 +45,7 @@
 #include <sys/vfs.h>
 #include <sys/uio.h>
 #include "filestuff.h"
+#include "tracepoint.h"
 #ifndef ELFMAG0
 /* Don't include <linux/elf.h> here.  If it got included by gdb_proc_service.h
    then ELFMAG0 will have been defined.  If it didn't get included by
diff --git a/gdb/gdbserver/linux-x86-low.c b/gdb/gdbserver/linux-x86-low.c
index 3a4f007..afb4ef7 100644
--- a/gdb/gdbserver/linux-x86-low.c
+++ b/gdb/gdbserver/linux-x86-low.c
@@ -31,6 +31,7 @@
 #include "gdb_proc_service.h"
 #include "agent.h"
 #include "tdesc.h"
+#include "tracepoint.h"
 
 #ifdef __x86_64__
 /* Defined in auto-generated file amd64-linux.c.  */
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index d450779..3c70288 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -29,6 +29,7 @@
 #include "gdb_wait.h"
 #include "btrace-common.h"
 #include "filestuff.h"
+#include "tracepoint.h"
 
 /* The thread set with an `Hc' packet.  `Hc' is deprecated in favor of
    `vCont'.  Note the multi-process extensions made `vCont' a
diff --git a/gdb/gdbserver/server.h b/gdb/gdbserver/server.h
index 45c2ae3..94feba7 100644
--- a/gdb/gdbserver/server.h
+++ b/gdb/gdbserver/server.h
@@ -288,109 +288,6 @@ extern void hostio_last_error_from_errno (char *own_buf);
    as large as the largest register set supported by gdbserver.  */
 #define PBUFSIZ 16384
 
-/* Functions from tracepoint.c */
-
-/* Size for a small buffer to report problems from the in-process
-   agent back to GDBserver.  */
-#define IPA_BUFSIZ 100
-
-void initialize_tracepoint (void);
-
-extern int tracing;
-extern int disconnected_tracing;
-
-void tracepoint_look_up_symbols (void);
-
-void stop_tracing (void);
-
-int handle_tracepoint_general_set (char *own_buf);
-int handle_tracepoint_query (char *own_buf);
-
-int tracepoint_finished_step (struct thread_info *tinfo, CORE_ADDR stop_pc);
-int tracepoint_was_hit (struct thread_info *tinfo, CORE_ADDR stop_pc);
-
-void release_while_stepping_state_list (struct thread_info *tinfo);
-
-extern int current_traceframe;
-
-int in_readonly_region (CORE_ADDR addr, ULONGEST length);
-int traceframe_read_mem (int tfnum, CORE_ADDR addr,
-			 unsigned char *buf, ULONGEST length,
-			 ULONGEST *nbytes);
-int fetch_traceframe_registers (int tfnum,
-				struct regcache *regcache,
-				int regnum);
-
-int traceframe_read_sdata (int tfnum, ULONGEST offset,
-			   unsigned char *buf, ULONGEST length,
-			   ULONGEST *nbytes);
-
-int traceframe_read_info (int tfnum, struct buffer *buffer);
-
-/* If a thread is determined to be collecting a fast tracepoint, this
-   structure holds the collect status.  */
-
-struct fast_tpoint_collect_status
-{
-  /* The tracepoint that is presently being collected.  */
-  int tpoint_num;
-  CORE_ADDR tpoint_addr;
-
-  /* The address range in the jump pad of where the original
-     instruction the tracepoint jump was inserted was relocated
-     to.  */
-  CORE_ADDR adjusted_insn_addr;
-  CORE_ADDR adjusted_insn_addr_end;
-};
-
-int fast_tracepoint_collecting (CORE_ADDR thread_area,
-				CORE_ADDR stop_pc,
-				struct fast_tpoint_collect_status *status);
-void force_unlock_trace_buffer (void);
-
-int handle_tracepoint_bkpts (struct thread_info *tinfo, CORE_ADDR stop_pc);
-
-#ifdef IN_PROCESS_AGENT
-void initialize_low_tracepoint (void);
-void supply_fast_tracepoint_registers (struct regcache *regcache,
-				       const unsigned char *regs);
-void supply_static_tracepoint_registers (struct regcache *regcache,
-					 const unsigned char *regs,
-					 CORE_ADDR pc);
-void set_trampoline_buffer_space (CORE_ADDR begin, CORE_ADDR end,
-				  char *errmsg);
-
-extern const struct target_desc *ipa_tdesc;
-
-#else
-void stop_tracing (void);
-
-int claim_trampoline_space (ULONGEST used, CORE_ADDR *trampoline);
-int have_fast_tracepoint_trampoline_buffer (char *msgbuf);
-void gdb_agent_about_to_close (int pid);
-#endif
-
-struct traceframe;
-struct eval_agent_expr_context;
-
-/* Do memory copies for bytecodes.  */
-/* Do the recording of memory blocks for actions and bytecodes.  */
-
-int agent_mem_read (struct eval_agent_expr_context *ctx,
-		    unsigned char *to, CORE_ADDR from,
-		    ULONGEST len);
-
-LONGEST agent_get_trace_state_variable_value (int num);
-void agent_set_trace_state_variable_value (int num, LONGEST val);
-
-/* Record the value of a trace state variable.  */
-
-int agent_tsv_read (struct eval_agent_expr_context *ctx, int n);
-int agent_mem_read_string (struct eval_agent_expr_context *ctx,
-			   unsigned char *to,
-			   CORE_ADDR from,
-			   ULONGEST len);
-
 /* Bytecode compilation function vector.  */
 
 struct emit_ops
@@ -444,15 +341,6 @@ struct emit_ops
   void (*emit_ge_goto) (int *offset_p, int *size_p);
 };
 
-/* Returns the address of the get_raw_reg function in the IPA.  */
-CORE_ADDR get_raw_reg_func_addr (void);
-/* Returns the address of the get_trace_state_variable_value
-   function in the IPA.  */
-CORE_ADDR get_get_tsv_func_addr (void);
-/* Returns the address of the set_trace_state_variable_value
-   function in the IPA.  */
-CORE_ADDR get_set_tsv_func_addr (void);
-
 extern CORE_ADDR current_insn_ptr;
 extern int emit_error;
 
diff --git a/gdb/gdbserver/target.c b/gdb/gdbserver/target.c
index a47053c..1a0dee2 100644
--- a/gdb/gdbserver/target.c
+++ b/gdb/gdbserver/target.c
@@ -19,6 +19,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "server.h"
+#include "tracepoint.h"
 
 struct target_ops *the_target;
 
diff --git a/gdb/gdbserver/tracepoint.c b/gdb/gdbserver/tracepoint.c
index 1327845..3288a13 100644
--- a/gdb/gdbserver/tracepoint.c
+++ b/gdb/gdbserver/tracepoint.c
@@ -17,6 +17,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "server.h"
+#include "tracepoint.h"
 #include "gdbthread.h"
 #include "agent.h"
 
diff --git a/gdb/gdbserver/tracepoint.h b/gdb/gdbserver/tracepoint.h
new file mode 100644
index 0000000..7759033
--- /dev/null
+++ b/gdb/gdbserver/tracepoint.h
@@ -0,0 +1,132 @@
+/* Tracepoint code for 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 TRACEPOINT_H
+#define TRACEPOINT_H
+
+/* Size for a small buffer to report problems from the in-process
+   agent back to GDBserver.  */
+#define IPA_BUFSIZ 100
+
+void initialize_tracepoint (void);
+
+extern int tracing;
+extern int disconnected_tracing;
+
+void tracepoint_look_up_symbols (void);
+
+void stop_tracing (void);
+
+int handle_tracepoint_general_set (char *own_buf);
+int handle_tracepoint_query (char *own_buf);
+
+int tracepoint_finished_step (struct thread_info *tinfo, CORE_ADDR stop_pc);
+int tracepoint_was_hit (struct thread_info *tinfo, CORE_ADDR stop_pc);
+
+void release_while_stepping_state_list (struct thread_info *tinfo);
+
+extern int current_traceframe;
+
+int in_readonly_region (CORE_ADDR addr, ULONGEST length);
+int traceframe_read_mem (int tfnum, CORE_ADDR addr,
+			 unsigned char *buf, ULONGEST length,
+			 ULONGEST *nbytes);
+int fetch_traceframe_registers (int tfnum,
+				struct regcache *regcache,
+				int regnum);
+
+int traceframe_read_sdata (int tfnum, ULONGEST offset,
+			   unsigned char *buf, ULONGEST length,
+			   ULONGEST *nbytes);
+
+int traceframe_read_info (int tfnum, struct buffer *buffer);
+
+/* If a thread is determined to be collecting a fast tracepoint, this
+   structure holds the collect status.  */
+
+struct fast_tpoint_collect_status
+{
+  /* The tracepoint that is presently being collected.  */
+  int tpoint_num;
+  CORE_ADDR tpoint_addr;
+
+  /* The address range in the jump pad of where the original
+     instruction the tracepoint jump was inserted was relocated
+     to.  */
+  CORE_ADDR adjusted_insn_addr;
+  CORE_ADDR adjusted_insn_addr_end;
+};
+
+int fast_tracepoint_collecting (CORE_ADDR thread_area,
+				CORE_ADDR stop_pc,
+				struct fast_tpoint_collect_status *status);
+void force_unlock_trace_buffer (void);
+
+int handle_tracepoint_bkpts (struct thread_info *tinfo, CORE_ADDR stop_pc);
+
+#ifdef IN_PROCESS_AGENT
+void initialize_low_tracepoint (void);
+void supply_fast_tracepoint_registers (struct regcache *regcache,
+				       const unsigned char *regs);
+void supply_static_tracepoint_registers (struct regcache *regcache,
+					 const unsigned char *regs,
+					 CORE_ADDR pc);
+void set_trampoline_buffer_space (CORE_ADDR begin, CORE_ADDR end,
+				  char *errmsg);
+
+extern const struct target_desc *ipa_tdesc;
+
+#else
+void stop_tracing (void);
+
+int claim_trampoline_space (ULONGEST used, CORE_ADDR *trampoline);
+int have_fast_tracepoint_trampoline_buffer (char *msgbuf);
+void gdb_agent_about_to_close (int pid);
+#endif
+
+struct traceframe;
+struct eval_agent_expr_context;
+
+/* Do memory copies for bytecodes.  */
+/* Do the recording of memory blocks for actions and bytecodes.  */
+
+int agent_mem_read (struct eval_agent_expr_context *ctx,
+		    unsigned char *to, CORE_ADDR from,
+		    ULONGEST len);
+
+LONGEST agent_get_trace_state_variable_value (int num);
+void agent_set_trace_state_variable_value (int num, LONGEST val);
+
+/* Record the value of a trace state variable.  */
+
+int agent_tsv_read (struct eval_agent_expr_context *ctx, int n);
+int agent_mem_read_string (struct eval_agent_expr_context *ctx,
+			   unsigned char *to,
+			   CORE_ADDR from,
+			   ULONGEST len);
+
+/* Returns the address of the get_raw_reg function in the IPA.  */
+CORE_ADDR get_raw_reg_func_addr (void);
+/* Returns the address of the get_trace_state_variable_value
+   function in the IPA.  */
+CORE_ADDR get_get_tsv_func_addr (void);
+/* Returns the address of the set_trace_state_variable_value
+   function in the IPA.  */
+CORE_ADDR get_set_tsv_func_addr (void);
+
+#endif /* TRACEPOINT_H */
-- 
1.7.11.7


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 1/9] [gdbserver] Delete _ macro (gettext).
  2013-09-03 20:26 [PATCH 0/9][gdbserver] Split server.h 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-03 20:26 ` Pedro Alves
  2013-09-03 20:26 ` [PATCH 2/9] [gdbserver] Split a new remote-utils.h file out of server.h Pedro Alves
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 22+ messages in thread
From: Pedro Alves @ 2013-09-03 20:26 UTC (permalink / raw)
  To: gdb-patches

server.h nowadays includes gdb_locale.h, which already brings this in.

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

	* server.h (_): Delete.
---
 gdb/gdbserver/server.h | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/gdb/gdbserver/server.h b/gdb/gdbserver/server.h
index 1a1d9b2..371876b 100644
--- a/gdb/gdbserver/server.h
+++ b/gdb/gdbserver/server.h
@@ -73,12 +73,6 @@ extern int vasprintf(char **strp, const char *fmt, va_list ap);
 int vsnprintf(char *str, size_t size, const char *format, va_list ap);
 #endif
 
-/* Define underscore macro, if not available, to be able to use it inside
-   code shared with gdb in common directory.  */
-#ifndef _
-#define _(String) (String)
-#endif
-
 #ifdef IN_PROCESS_AGENT
 #  define PROG "ipa"
 #else
-- 
1.7.11.7


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 3/9] [gdbserver] Split a new utils.h file out of server.h.
  2013-09-03 20:26 [PATCH 0/9][gdbserver] Split server.h Pedro Alves
                   ` (4 preceding siblings ...)
  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 ` Pedro Alves
  2013-09-03 20:26 ` [PATCH 4/9] [gdbserver] Split a new tracepoint.h " Pedro Alves
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 22+ messages in thread
From: Pedro Alves @ 2013-09-03 20:26 UTC (permalink / raw)
  To: gdb-patches

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

	* server.h (perror_with_name, error, fatal, warning, paddress)
	(pulongest, plongest, phex_nz, pfildes): Move to utils.h, and
	include it.
	* utils.h: New file.
---
 gdb/gdbserver/server.h | 12 +-----------
 gdb/gdbserver/utils.h  | 32 ++++++++++++++++++++++++++++++++
 2 files changed, 33 insertions(+), 11 deletions(-)
 create mode 100644 gdb/gdbserver/utils.h

diff --git a/gdb/gdbserver/server.h b/gdb/gdbserver/server.h
index 4f13cd9..45c2ae3 100644
--- a/gdb/gdbserver/server.h
+++ b/gdb/gdbserver/server.h
@@ -274,18 +274,8 @@ extern void hostio_last_error_from_errno (char *own_buf);
 
 #include "remote-utils.h"
 
-/* Functions from utils.c */
 #include "common-utils.h"
-
-void perror_with_name (const char *string);
-void error (const char *string,...) ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (1, 2);
-void fatal (const char *string,...) ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (1, 2);
-void warning (const char *string,...) ATTRIBUTE_PRINTF (1, 2);
-char *paddress (CORE_ADDR addr);
-char *pulongest (ULONGEST u);
-char *plongest (LONGEST l);
-char *phex_nz (ULONGEST l, int sizeof_l);
-char *pfildes (gdb_fildes_t fd);
+#include "utils.h"
 
 #include "gdb_assert.h"
 
diff --git a/gdb/gdbserver/utils.h b/gdb/gdbserver/utils.h
new file mode 100644
index 0000000..7f5f1d9
--- /dev/null
+++ b/gdb/gdbserver/utils.h
@@ -0,0 +1,32 @@
+/* General 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 UTILS_H
+#define UTILS_H
+
+void perror_with_name (const char *string);
+void error (const char *string,...) ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (1, 2);
+void fatal (const char *string,...) ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (1, 2);
+void warning (const char *string,...) ATTRIBUTE_PRINTF (1, 2);
+char *paddress (CORE_ADDR addr);
+char *pulongest (ULONGEST u);
+char *plongest (LONGEST l);
+char *phex_nz (ULONGEST l, int sizeof_l);
+char *pfildes (gdb_fildes_t fd);
+
+#endif /* UTILS_H */
-- 
1.7.11.7


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 0/9][gdbserver] Split server.h.
@ 2013-09-03 20:26 Pedro Alves
  2013-09-03 20:26 ` [PATCH 7/9] [gdbserver] Split a new dll.h file out of server.h Pedro Alves
                   ` (9 more replies)
  0 siblings, 10 replies; 22+ messages in thread
From: Pedro Alves @ 2013-09-03 20:26 UTC (permalink / raw)
  To: gdb-patches

The recurring theme of doing:

 #ifdef GDBSERVER
 #include "server.h"
 #else
 #include "defs.h"
 #endif

in common/ code is a bit annoying.  I think we'll end up proving a
defs.h in gdbserver, and we'll want to share as much with gdb's as
possible.

I considered just renaming server.h to defs.h, but looking at
server.h, I think it's better to first split out things that don't
really need to be there.  Now that gdbserver's Makefile does automatic
dependency tracking, it's easy enough to split the parts that actually
define interfaces of specific modules to their own files.  This series
does that.  Some of the new headers remain included in server.h (at
least for now), for they define things that are truly used throughout
the code, and I was hating the fact that I was ending up adding
#include remote-utils.h throughout in a previous attempt, with "utils"
being yet another kitchensink, which I prefer avoiding.  Still, I
think it still makes things clearer this way.

I think we should do the same on the gdb side too.

Tested on x86_64 Fedora 17.  I'll apply it tomorrow, barring comments.

Pedro Alves (9):
  [gdbserver] Delete _ macro (gettext).
  [gdbserver] Split a new remote-utils.h file out of server.h.
  [gdbserver] Split a new utils.h file out of server.h.
  [gdbserver] Split a new tracepoint.h file out of server.h.
  [gdbserver] Split a new ax.h file out of server.h.
  [gdbserver] Split a new inferiors.h file out of server.h.
  [gdbserver] Split a new dll.h file out of server.h.
  [gdbserver] Split a new event-loop.h file out of server.h.
  [gdbserver] Split a new hostio.h file out of server.h.

 gdb/gdbserver/ax.c            |   1 +
 gdb/gdbserver/ax.h            |  57 +++++++
 gdb/gdbserver/dll.c           |   1 +
 gdb/gdbserver/dll.h           |  35 ++++
 gdb/gdbserver/event-loop.h    |  36 ++++
 gdb/gdbserver/gdbthread.h     |   1 +
 gdb/gdbserver/hostio.c        |   1 +
 gdb/gdbserver/hostio.h        |  28 +++
 gdb/gdbserver/inferiors.c     |   1 +
 gdb/gdbserver/inferiors.h     | 114 +++++++++++++
 gdb/gdbserver/linux-low.c     |   2 +
 gdb/gdbserver/linux-x86-low.c |   2 +
 gdb/gdbserver/remote-utils.c  |   2 +
 gdb/gdbserver/remote-utils.h  |  85 ++++++++++
 gdb/gdbserver/server.c        |   3 +
 gdb/gdbserver/server.h        | 385 +-----------------------------------------
 gdb/gdbserver/target.c        |   1 +
 gdb/gdbserver/target.h        |   1 +
 gdb/gdbserver/tracepoint.c    |   1 +
 gdb/gdbserver/tracepoint.h    | 132 +++++++++++++++
 gdb/gdbserver/utils.h         |  32 ++++
 21 files changed, 541 insertions(+), 380 deletions(-)
 create mode 100644 gdb/gdbserver/dll.h
 create mode 100644 gdb/gdbserver/event-loop.h
 create mode 100644 gdb/gdbserver/hostio.h
 create mode 100644 gdb/gdbserver/inferiors.h
 create mode 100644 gdb/gdbserver/remote-utils.h
 create mode 100644 gdb/gdbserver/tracepoint.h
 create mode 100644 gdb/gdbserver/utils.h

-- 
1.7.11.7


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 5/9] [gdbserver] Split a new ax.h file out of server.h.
  2013-09-03 20:26 [PATCH 0/9][gdbserver] Split server.h Pedro Alves
                   ` (2 preceding siblings ...)
  2013-09-03 20:26 ` [PATCH 2/9] [gdbserver] Split a new remote-utils.h file out of server.h Pedro Alves
@ 2013-09-03 20:26 ` 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 ` [PATCH 8/9] [gdbserver] Split a new event-loop.h file out of server.h Pedro Alves
                   ` (5 subsequent siblings)
  9 siblings, 1 reply; 22+ messages in thread
From: Pedro Alves @ 2013-09-03 20:26 UTC (permalink / raw)
  To: gdb-patches

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

	* server.h (struct emit_ops, current_insn_ptr, emit_error): Move
	to ...
        * ax.h: ... this new file.
---
 gdb/gdbserver/ax.h            | 57 +++++++++++++++++++++++++++++++++++++++++++
 gdb/gdbserver/linux-x86-low.c |  1 +
 gdb/gdbserver/server.h        | 56 ------------------------------------------
 3 files changed, 58 insertions(+), 56 deletions(-)

diff --git a/gdb/gdbserver/ax.h b/gdb/gdbserver/ax.h
index b2b4e3a..3ecc5d8 100644
--- a/gdb/gdbserver/ax.h
+++ b/gdb/gdbserver/ax.h
@@ -83,4 +83,61 @@ enum eval_result_type
   gdb_eval_agent_expr (struct eval_agent_expr_context *ctx,
 		       struct agent_expr *aexpr,
 		       ULONGEST *rslt);
+
+/* Bytecode compilation function vector.  */
+
+struct emit_ops
+{
+  void (*emit_prologue) (void);
+  void (*emit_epilogue) (void);
+  void (*emit_add) (void);
+  void (*emit_sub) (void);
+  void (*emit_mul) (void);
+  void (*emit_lsh) (void);
+  void (*emit_rsh_signed) (void);
+  void (*emit_rsh_unsigned) (void);
+  void (*emit_ext) (int arg);
+  void (*emit_log_not) (void);
+  void (*emit_bit_and) (void);
+  void (*emit_bit_or) (void);
+  void (*emit_bit_xor) (void);
+  void (*emit_bit_not) (void);
+  void (*emit_equal) (void);
+  void (*emit_less_signed) (void);
+  void (*emit_less_unsigned) (void);
+  void (*emit_ref) (int size);
+  void (*emit_if_goto) (int *offset_p, int *size_p);
+  void (*emit_goto) (int *offset_p, int *size_p);
+  void (*write_goto_address) (CORE_ADDR from, CORE_ADDR to, int size);
+  void (*emit_const) (LONGEST num);
+  void (*emit_call) (CORE_ADDR fn);
+  void (*emit_reg) (int reg);
+  void (*emit_pop) (void);
+  void (*emit_stack_flush) (void);
+  void (*emit_zero_ext) (int arg);
+  void (*emit_swap) (void);
+  void (*emit_stack_adjust) (int n);
+
+  /* Emit code for a generic function that takes one fixed integer
+     argument and returns a 64-bit int (for instance, tsv getter).  */
+  void (*emit_int_call_1) (CORE_ADDR fn, int arg1);
+
+  /* Emit code for a generic function that takes one fixed integer
+     argument and a 64-bit int from the top of the stack, and returns
+     nothing (for instance, tsv setter).  */
+  void (*emit_void_call_2) (CORE_ADDR fn, int arg1);
+
+  /* Emit code specialized for common combinations of compare followed
+     by a goto.  */
+  void (*emit_eq_goto) (int *offset_p, int *size_p);
+  void (*emit_ne_goto) (int *offset_p, int *size_p);
+  void (*emit_lt_goto) (int *offset_p, int *size_p);
+  void (*emit_le_goto) (int *offset_p, int *size_p);
+  void (*emit_gt_goto) (int *offset_p, int *size_p);
+  void (*emit_ge_goto) (int *offset_p, int *size_p);
+};
+
+extern CORE_ADDR current_insn_ptr;
+extern int emit_error;
+
 #endif /* AX_H */
diff --git a/gdb/gdbserver/linux-x86-low.c b/gdb/gdbserver/linux-x86-low.c
index afb4ef7..cf61872 100644
--- a/gdb/gdbserver/linux-x86-low.c
+++ b/gdb/gdbserver/linux-x86-low.c
@@ -32,6 +32,7 @@
 #include "agent.h"
 #include "tdesc.h"
 #include "tracepoint.h"
+#include "ax.h"
 
 #ifdef __x86_64__
 /* Defined in auto-generated file amd64-linux.c.  */
diff --git a/gdb/gdbserver/server.h b/gdb/gdbserver/server.h
index 94feba7..e21012a 100644
--- a/gdb/gdbserver/server.h
+++ b/gdb/gdbserver/server.h
@@ -288,60 +288,4 @@ extern void hostio_last_error_from_errno (char *own_buf);
    as large as the largest register set supported by gdbserver.  */
 #define PBUFSIZ 16384
 
-/* Bytecode compilation function vector.  */
-
-struct emit_ops
-{
-  void (*emit_prologue) (void);
-  void (*emit_epilogue) (void);
-  void (*emit_add) (void);
-  void (*emit_sub) (void);
-  void (*emit_mul) (void);
-  void (*emit_lsh) (void);
-  void (*emit_rsh_signed) (void);
-  void (*emit_rsh_unsigned) (void);
-  void (*emit_ext) (int arg);
-  void (*emit_log_not) (void);
-  void (*emit_bit_and) (void);
-  void (*emit_bit_or) (void);
-  void (*emit_bit_xor) (void);
-  void (*emit_bit_not) (void);
-  void (*emit_equal) (void);
-  void (*emit_less_signed) (void);
-  void (*emit_less_unsigned) (void);
-  void (*emit_ref) (int size);
-  void (*emit_if_goto) (int *offset_p, int *size_p);
-  void (*emit_goto) (int *offset_p, int *size_p);
-  void (*write_goto_address) (CORE_ADDR from, CORE_ADDR to, int size);
-  void (*emit_const) (LONGEST num);
-  void (*emit_call) (CORE_ADDR fn);
-  void (*emit_reg) (int reg);
-  void (*emit_pop) (void);
-  void (*emit_stack_flush) (void);
-  void (*emit_zero_ext) (int arg);
-  void (*emit_swap) (void);
-  void (*emit_stack_adjust) (int n);
-
-  /* Emit code for a generic function that takes one fixed integer
-     argument and returns a 64-bit int (for instance, tsv getter).  */
-  void (*emit_int_call_1) (CORE_ADDR fn, int arg1);
-
-  /* Emit code for a generic function that takes one fixed integer
-     argument and a 64-bit int from the top of the stack, and returns
-     nothing (for instance, tsv setter).  */
-  void (*emit_void_call_2) (CORE_ADDR fn, int arg1);
-
-  /* Emit code specialized for common combinations of compare followed
-     by a goto.  */
-  void (*emit_eq_goto) (int *offset_p, int *size_p);
-  void (*emit_ne_goto) (int *offset_p, int *size_p);
-  void (*emit_lt_goto) (int *offset_p, int *size_p);
-  void (*emit_le_goto) (int *offset_p, int *size_p);
-  void (*emit_gt_goto) (int *offset_p, int *size_p);
-  void (*emit_ge_goto) (int *offset_p, int *size_p);
-};
-
-extern CORE_ADDR current_insn_ptr;
-extern int emit_error;
-
 #endif /* SERVER_H */
-- 
1.7.11.7


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH 6/9] [gdbserver] Split a new inferiors.h file out of server.h.
  2013-09-03 20:26 [PATCH 0/9][gdbserver] Split server.h Pedro Alves
                   ` (7 preceding siblings ...)
  2013-09-03 20:26 ` [PATCH 9/9] [gdbserver] Split a new hostio.h " Pedro Alves
@ 2013-09-03 20:54 ` Pedro Alves
  2013-09-05 20:47 ` [COMMIT] Re: [PATCH 0/9][gdbserver] Split server.h Pedro Alves
  9 siblings, 0 replies; 22+ messages in thread
From: Pedro Alves @ 2013-09-03 20:54 UTC (permalink / raw)
  To: gdb-patches

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

	* server.h (current_process, get_thread_process, all_processes)
	(add_inferior_to_list, for_each_inferior, current_inferior)
	(remove_inferior, add_process, remove_process, find_process_pid)
	(have_started_inferiors_p, have_attached_inferiors_p)
	(thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id)
	(clear_inferiors, find_inferior, find_inferior_id)
	(inferior_target_data, set_inferior_target_data)
	(inferior_regcache_data, set_inferior_regcache_data): Move to
	inferiors.h, and include it.
	* inferiors.h: New file.
---
 gdb/gdbserver/gdbthread.h |   1 +
 gdb/gdbserver/inferiors.h | 114 ++++++++++++++++++++++++++++++++++++++++++++++
 gdb/gdbserver/server.h    |  97 +--------------------------------------
 gdb/gdbserver/target.h    |   1 +
 4 files changed, 118 insertions(+), 95 deletions(-)
 create mode 100644 gdb/gdbserver/inferiors.h

diff --git a/gdb/gdbserver/gdbthread.h b/gdb/gdbserver/gdbthread.h
index 5d4955b..b43d676 100644
--- a/gdb/gdbserver/gdbthread.h
+++ b/gdb/gdbserver/gdbthread.h
@@ -20,6 +20,7 @@
 #define GDB_THREAD_H
 
 #include "server.h"
+#include "inferiors.h"
 
 struct btrace_target_info;
 
diff --git a/gdb/gdbserver/inferiors.h b/gdb/gdbserver/inferiors.h
new file mode 100644
index 0000000..ba28d5a
--- /dev/null
+++ b/gdb/gdbserver/inferiors.h
@@ -0,0 +1,114 @@
+/* Inferior process information 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 INFERIORS_H
+#define INFERIORS_H
+
+/* Generic information for tracking a list of ``inferiors'' - threads,
+   processes, etc.  */
+struct inferior_list
+{
+  struct inferior_list_entry *head;
+  struct inferior_list_entry *tail;
+};
+struct inferior_list_entry
+{
+  ptid_t id;
+  struct inferior_list_entry *next;
+};
+
+struct thread_info;
+struct target_desc;
+struct sym_cache;
+struct breakpoint;
+struct raw_breakpoint;
+struct fast_tracepoint_jump;
+struct process_info_private;
+
+struct process_info
+{
+  struct inferior_list_entry head;
+
+  /* Nonzero if this child process was attached rather than
+     spawned.  */
+  int attached;
+
+  /* True if GDB asked us to detach from this process, but we remained
+     attached anyway.  */
+  int gdb_detached;
+
+  /* The symbol cache.  */
+  struct sym_cache *symbol_cache;
+
+  /* The list of memory breakpoints.  */
+  struct breakpoint *breakpoints;
+
+  /* The list of raw memory breakpoints.  */
+  struct raw_breakpoint *raw_breakpoints;
+
+  /* The list of installed fast tracepoints.  */
+  struct fast_tracepoint_jump *fast_tracepoint_jumps;
+
+  const struct target_desc *tdesc;
+
+  /* Private target data.  */
+  struct process_info_private *private;
+};
+
+/* Return a pointer to the process that corresponds to the current
+   thread (current_inferior).  It is an error to call this if there is
+   no current thread selected.  */
+
+struct process_info *current_process (void);
+struct process_info *get_thread_process (struct thread_info *);
+
+extern struct inferior_list all_processes;
+
+void add_inferior_to_list (struct inferior_list *list,
+			   struct inferior_list_entry *new_inferior);
+void for_each_inferior (struct inferior_list *list,
+			void (*action) (struct inferior_list_entry *));
+
+extern struct thread_info *current_inferior;
+void remove_inferior (struct inferior_list *list,
+		      struct inferior_list_entry *entry);
+
+struct process_info *add_process (int pid, int attached);
+void remove_process (struct process_info *process);
+struct process_info *find_process_pid (int pid);
+int have_started_inferiors_p (void);
+int have_attached_inferiors_p (void);
+
+ptid_t thread_id_to_gdb_id (ptid_t);
+ptid_t thread_to_gdb_id (struct thread_info *);
+ptid_t gdb_id_to_thread_id (ptid_t);
+
+void clear_inferiors (void);
+struct inferior_list_entry *find_inferior
+     (struct inferior_list *,
+      int (*func) (struct inferior_list_entry *,
+		   void *),
+      void *arg);
+struct inferior_list_entry *find_inferior_id (struct inferior_list *list,
+					      ptid_t id);
+void *inferior_target_data (struct thread_info *);
+void set_inferior_target_data (struct thread_info *, void *);
+void *inferior_regcache_data (struct thread_info *);
+void set_inferior_regcache_data (struct thread_info *, void *);
+
+#endif /* INFERIORS_H */
diff --git a/gdb/gdbserver/server.h b/gdb/gdbserver/server.h
index e21012a..a696121 100644
--- a/gdb/gdbserver/server.h
+++ b/gdb/gdbserver/server.h
@@ -94,30 +94,13 @@ typedef long long CORE_ADDR;
 typedef long long LONGEST;
 typedef unsigned long long ULONGEST;
 
-/* Generic information for tracking a list of ``inferiors'' - threads,
-   processes, etc.  */
-struct inferior_list
-{
-  struct inferior_list_entry *head;
-  struct inferior_list_entry *tail;
-};
-struct inferior_list_entry
-{
-  ptid_t id;
-  struct inferior_list_entry *next;
-};
-
-struct thread_info;
-struct process_info;
-struct regcache;
-struct target_desc;
-
 #include "regcache.h"
 #include "gdb/signals.h"
 #include "gdb_signals.h"
 #include "target.h"
 #include "mem-break.h"
 #include "gdbthread.h"
+#include "inferiors.h"
 
 struct dll_info
 {
@@ -126,92 +109,16 @@ struct dll_info
   CORE_ADDR base_addr;
 };
 
-struct sym_cache;
-struct breakpoint;
-struct raw_breakpoint;
-struct fast_tracepoint_jump;
-struct process_info_private;
-
-struct process_info
-{
-  struct inferior_list_entry head;
-
-  /* Nonzero if this child process was attached rather than
-     spawned.  */
-  int attached;
-
-  /* True if GDB asked us to detach from this process, but we remained
-     attached anyway.  */
-  int gdb_detached;
-
-  /* The symbol cache.  */
-  struct sym_cache *symbol_cache;
-
-  /* The list of memory breakpoints.  */
-  struct breakpoint *breakpoints;
-
-  /* The list of raw memory breakpoints.  */
-  struct raw_breakpoint *raw_breakpoints;
-
-  /* The list of installed fast tracepoints.  */
-  struct fast_tracepoint_jump *fast_tracepoint_jumps;
-
-  const struct target_desc *tdesc;
-
-  /* Private target data.  */
-  struct process_info_private *private;
-};
-
-/* Return a pointer to the process that corresponds to the current
-   thread (current_inferior).  It is an error to call this if there is
-   no current thread selected.  */
-
-struct process_info *current_process (void);
-struct process_info *get_thread_process (struct thread_info *);
-
 /* Target-specific functions */
 
 void initialize_low ();
 
-/* From inferiors.c.  */
+/* From dll.c.  */
 
-extern struct inferior_list all_processes;
 extern struct inferior_list all_dlls;
 extern int dlls_changed;
 extern void clear_dlls (void);
 
-void add_inferior_to_list (struct inferior_list *list,
-			   struct inferior_list_entry *new_inferior);
-void for_each_inferior (struct inferior_list *list,
-			void (*action) (struct inferior_list_entry *));
-
-extern struct thread_info *current_inferior;
-void remove_inferior (struct inferior_list *list,
-		      struct inferior_list_entry *entry);
-
-struct process_info *add_process (int pid, int attached);
-void remove_process (struct process_info *process);
-struct process_info *find_process_pid (int pid);
-int have_started_inferiors_p (void);
-int have_attached_inferiors_p (void);
-
-ptid_t thread_id_to_gdb_id (ptid_t);
-ptid_t thread_to_gdb_id (struct thread_info *);
-ptid_t gdb_id_to_thread_id (ptid_t);
-
-void clear_inferiors (void);
-struct inferior_list_entry *find_inferior
-     (struct inferior_list *,
-      int (*func) (struct inferior_list_entry *,
-		   void *),
-      void *arg);
-struct inferior_list_entry *find_inferior_id (struct inferior_list *list,
-					      ptid_t id);
-void *inferior_target_data (struct thread_info *);
-void set_inferior_target_data (struct thread_info *, void *);
-void *inferior_regcache_data (struct thread_info *);
-void set_inferior_regcache_data (struct thread_info *, void *);
-
 void loaded_dll (const char *name, CORE_ADDR base_addr);
 void unloaded_dll (const char *name, CORE_ADDR base_addr);
 
diff --git a/gdb/gdbserver/target.h b/gdb/gdbserver/target.h
index 7629b14..c5e6fee 100644
--- a/gdb/gdbserver/target.h
+++ b/gdb/gdbserver/target.h
@@ -28,6 +28,7 @@
 struct emit_ops;
 struct btrace_target_info;
 struct buffer;
+struct process_info;
 
 /* This structure describes how to resume a particular thread (or all
    threads) based on the client's request.  If thread is -1, then this
-- 
1.7.11.7


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [COMMIT] Re: [PATCH 0/9][gdbserver] Split server.h.
  2013-09-03 20:26 [PATCH 0/9][gdbserver] Split server.h Pedro Alves
                   ` (8 preceding siblings ...)
  2013-09-03 20:54 ` [PATCH 6/9] [gdbserver] Split a new inferiors.h " Pedro Alves
@ 2013-09-05 20:47 ` Pedro Alves
  2013-09-05 22:22   ` Pedro Alves
  9 siblings, 1 reply; 22+ messages in thread
From: Pedro Alves @ 2013-09-05 20:47 UTC (permalink / raw)
  To: gdb-patches

On 09/03/2013 09:26 PM, Pedro Alves wrote:
> The recurring theme of doing:
> 
>  #ifdef GDBSERVER
>  #include "server.h"
>  #else
>  #include "defs.h"
>  #endif
> 
> in common/ code is a bit annoying.  I think we'll end up proving a
> defs.h in gdbserver, and we'll want to share as much with gdb's as
> possible.
> 
> I considered just renaming server.h to defs.h, but looking at
> server.h, I think it's better to first split out things that don't
> really need to be there.  Now that gdbserver's Makefile does automatic
> dependency tracking, it's easy enough to split the parts that actually
> define interfaces of specific modules to their own files.  This series
> does that.  Some of the new headers remain included in server.h (at
> least for now), for they define things that are truly used throughout
> the code, and I was hating the fact that I was ending up adding
> #include remote-utils.h throughout in a previous attempt, with "utils"
> being yet another kitchensink, which I prefer avoiding.  Still, I
> think it still makes things clearer this way.
> 
> I think we should do the same on the gdb side too.
> 
> Tested on x86_64 Fedora 17.  I'll apply it tomorrow, barring comments.

I remembered to try cross building gdbserver for mingw, and that showed
a couple problems.  I fixed them, and pushed the series in.  I'll send
the final versions of the patches that needed adjustments.

-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [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.)
  2013-09-03 20:26 ` [PATCH 5/9] [gdbserver] Split a new ax.h " Pedro Alves
@ 2013-09-05 20:49   ` Pedro Alves
  0 siblings, 0 replies; 22+ messages in thread
From: Pedro Alves @ 2013-09-05 20:49 UTC (permalink / raw)
  To: gdb-patches

The ChangeLog and the subject were wrong...  This is not a new file.
Otherwise, the patch went in unchanged.

------
[gdbserver] Move bytecode compilation bits from server.h to ax.h.

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

	* server.h (struct emit_ops, current_insn_ptr, emit_error):
	Move ...
        * ax.h: ... here.
---
 gdb/gdbserver/ax.h            |   57 +++++++++++++++++++++++++++++++++++++++++
 gdb/gdbserver/linux-x86-low.c |    1 +
 gdb/gdbserver/server.h        |   56 ----------------------------------------
 3 files changed, 58 insertions(+), 56 deletions(-)

diff --git a/gdb/gdbserver/ax.h b/gdb/gdbserver/ax.h
index b2b4e3a..3ecc5d8 100644
--- a/gdb/gdbserver/ax.h
+++ b/gdb/gdbserver/ax.h
@@ -83,4 +83,61 @@ enum eval_result_type
   gdb_eval_agent_expr (struct eval_agent_expr_context *ctx,
 		       struct agent_expr *aexpr,
 		       ULONGEST *rslt);
+
+/* Bytecode compilation function vector.  */
+
+struct emit_ops
+{
+  void (*emit_prologue) (void);
+  void (*emit_epilogue) (void);
+  void (*emit_add) (void);
+  void (*emit_sub) (void);
+  void (*emit_mul) (void);
+  void (*emit_lsh) (void);
+  void (*emit_rsh_signed) (void);
+  void (*emit_rsh_unsigned) (void);
+  void (*emit_ext) (int arg);
+  void (*emit_log_not) (void);
+  void (*emit_bit_and) (void);
+  void (*emit_bit_or) (void);
+  void (*emit_bit_xor) (void);
+  void (*emit_bit_not) (void);
+  void (*emit_equal) (void);
+  void (*emit_less_signed) (void);
+  void (*emit_less_unsigned) (void);
+  void (*emit_ref) (int size);
+  void (*emit_if_goto) (int *offset_p, int *size_p);
+  void (*emit_goto) (int *offset_p, int *size_p);
+  void (*write_goto_address) (CORE_ADDR from, CORE_ADDR to, int size);
+  void (*emit_const) (LONGEST num);
+  void (*emit_call) (CORE_ADDR fn);
+  void (*emit_reg) (int reg);
+  void (*emit_pop) (void);
+  void (*emit_stack_flush) (void);
+  void (*emit_zero_ext) (int arg);
+  void (*emit_swap) (void);
+  void (*emit_stack_adjust) (int n);
+
+  /* Emit code for a generic function that takes one fixed integer
+     argument and returns a 64-bit int (for instance, tsv getter).  */
+  void (*emit_int_call_1) (CORE_ADDR fn, int arg1);
+
+  /* Emit code for a generic function that takes one fixed integer
+     argument and a 64-bit int from the top of the stack, and returns
+     nothing (for instance, tsv setter).  */
+  void (*emit_void_call_2) (CORE_ADDR fn, int arg1);
+
+  /* Emit code specialized for common combinations of compare followed
+     by a goto.  */
+  void (*emit_eq_goto) (int *offset_p, int *size_p);
+  void (*emit_ne_goto) (int *offset_p, int *size_p);
+  void (*emit_lt_goto) (int *offset_p, int *size_p);
+  void (*emit_le_goto) (int *offset_p, int *size_p);
+  void (*emit_gt_goto) (int *offset_p, int *size_p);
+  void (*emit_ge_goto) (int *offset_p, int *size_p);
+};
+
+extern CORE_ADDR current_insn_ptr;
+extern int emit_error;
+
 #endif /* AX_H */
diff --git a/gdb/gdbserver/linux-x86-low.c b/gdb/gdbserver/linux-x86-low.c
index afb4ef7..cf61872 100644
--- a/gdb/gdbserver/linux-x86-low.c
+++ b/gdb/gdbserver/linux-x86-low.c
@@ -32,6 +32,7 @@
 #include "agent.h"
 #include "tdesc.h"
 #include "tracepoint.h"
+#include "ax.h"

 #ifdef __x86_64__
 /* Defined in auto-generated file amd64-linux.c.  */
diff --git a/gdb/gdbserver/server.h b/gdb/gdbserver/server.h
index 94feba7..e21012a 100644
--- a/gdb/gdbserver/server.h
+++ b/gdb/gdbserver/server.h
@@ -288,60 +288,4 @@ extern void hostio_last_error_from_errno (char *own_buf);
    as large as the largest register set supported by gdbserver.  */
 #define PBUFSIZ 16384

-/* Bytecode compilation function vector.  */
-
-struct emit_ops
-{
-  void (*emit_prologue) (void);
-  void (*emit_epilogue) (void);
-  void (*emit_add) (void);
-  void (*emit_sub) (void);
-  void (*emit_mul) (void);
-  void (*emit_lsh) (void);
-  void (*emit_rsh_signed) (void);
-  void (*emit_rsh_unsigned) (void);
-  void (*emit_ext) (int arg);
-  void (*emit_log_not) (void);
-  void (*emit_bit_and) (void);
-  void (*emit_bit_or) (void);
-  void (*emit_bit_xor) (void);
-  void (*emit_bit_not) (void);
-  void (*emit_equal) (void);
-  void (*emit_less_signed) (void);
-  void (*emit_less_unsigned) (void);
-  void (*emit_ref) (int size);
-  void (*emit_if_goto) (int *offset_p, int *size_p);
-  void (*emit_goto) (int *offset_p, int *size_p);
-  void (*write_goto_address) (CORE_ADDR from, CORE_ADDR to, int size);
-  void (*emit_const) (LONGEST num);
-  void (*emit_call) (CORE_ADDR fn);
-  void (*emit_reg) (int reg);
-  void (*emit_pop) (void);
-  void (*emit_stack_flush) (void);
-  void (*emit_zero_ext) (int arg);
-  void (*emit_swap) (void);
-  void (*emit_stack_adjust) (int n);
-
-  /* Emit code for a generic function that takes one fixed integer
-     argument and returns a 64-bit int (for instance, tsv getter).  */
-  void (*emit_int_call_1) (CORE_ADDR fn, int arg1);
-
-  /* Emit code for a generic function that takes one fixed integer
-     argument and a 64-bit int from the top of the stack, and returns
-     nothing (for instance, tsv setter).  */
-  void (*emit_void_call_2) (CORE_ADDR fn, int arg1);
-
-  /* Emit code specialized for common combinations of compare followed
-     by a goto.  */
-  void (*emit_eq_goto) (int *offset_p, int *size_p);
-  void (*emit_ne_goto) (int *offset_p, int *size_p);
-  void (*emit_lt_goto) (int *offset_p, int *size_p);
-  void (*emit_le_goto) (int *offset_p, int *size_p);
-  void (*emit_gt_goto) (int *offset_p, int *size_p);
-  void (*emit_ge_goto) (int *offset_p, int *size_p);
-};
-
-extern CORE_ADDR current_insn_ptr;
-extern int emit_error;
-
 #endif /* SERVER_H */


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 9/9] [gdbserver] Split a new hostio.h file out of server.h.
  2013-09-03 20:26 ` [PATCH 9/9] [gdbserver] Split a new hostio.h " Pedro Alves
@ 2013-09-05 20:50   ` Pedro Alves
  0 siblings, 0 replies; 22+ messages in thread
From: Pedro Alves @ 2013-09-05 20:50 UTC (permalink / raw)
  To: gdb-patches

A couple other ports need to include hostio.h as well.

------------
[gdbserver] Split a new hostio.h file out of server.h.

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

	* server.h (handle_vFile, hostio_last_error_from_errno): Move
	to ...
	* hostio.h: ... this new file.
	* hostio.c, server.c, linux-low.c, nto-low.c, spu-low,
	win32-low.c: Include hostio.h.
---
 gdb/gdbserver/hostio.c    |    1 +
 gdb/gdbserver/hostio.h    |   28 ++++++++++++++++++++++++++++
 gdb/gdbserver/linux-low.c |    1 +
 gdb/gdbserver/nto-low.c   |    1 +
 gdb/gdbserver/server.c    |    1 +
 gdb/gdbserver/server.h    |    6 ------
 gdb/gdbserver/spu-low.c   |    1 +
 gdb/gdbserver/win32-low.c |    1 +
 8 files changed, 34 insertions(+), 6 deletions(-)
 create mode 100644 gdb/gdbserver/hostio.h

diff --git a/gdb/gdbserver/hostio.c b/gdb/gdbserver/hostio.c
index a74c2f8..8edbadb 100644
--- a/gdb/gdbserver/hostio.c
+++ b/gdb/gdbserver/hostio.c
@@ -20,6 +20,7 @@
 
 #include "server.h"
 #include "gdb/fileio.h"
+#include "hostio.h"
 
 #include <fcntl.h>
 #include <limits.h>
diff --git a/gdb/gdbserver/hostio.h b/gdb/gdbserver/hostio.h
new file mode 100644
index 0000000..802374c
--- /dev/null
+++ b/gdb/gdbserver/hostio.h
@@ -0,0 +1,28 @@
+/* Host file transfer support for gdbserver.
+   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 HOSTIO_H
+#define HOSTIO_H
+
+/* Functions from hostio.c.  */
+extern int handle_vFile (char *, int, int *);
+
+/* Functions from hostio-errno.c.  */
+extern void hostio_last_error_from_errno (char *own_buf);
+
+#endif /* HOSTIO_H */
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index 7c95058..799fcc9 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -46,6 +46,7 @@
 #include <sys/uio.h>
 #include "filestuff.h"
 #include "tracepoint.h"
+#include "hostio.h"
 #ifndef ELFMAG0
 /* Don't include <linux/elf.h> here.  If it got included by gdb_proc_service.h
    then ELFMAG0 will have been defined.  If it didn't get included by
diff --git a/gdb/gdbserver/nto-low.c b/gdb/gdbserver/nto-low.c
index 3670133..6f764ff 100644
--- a/gdb/gdbserver/nto-low.c
+++ b/gdb/gdbserver/nto-low.c
@@ -21,6 +21,7 @@
 #include "server.h"
 #include "gdbthread.h"
 #include "nto-low.h"
+#include "hostio.h"
 
 #include <limits.h>
 #include <fcntl.h>
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index 6ca7fe1..f4e1525 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -31,6 +31,7 @@
 #include "filestuff.h"
 #include "tracepoint.h"
 #include "dll.h"
+#include "hostio.h"
 
 /* The thread set with an `Hc' packet.  `Hc' is deprecated in favor of
    `vCont'.  Note the multi-process extensions made `vCont' a
diff --git a/gdb/gdbserver/server.h b/gdb/gdbserver/server.h
index 53127bf..05724e0 100644
--- a/gdb/gdbserver/server.h
+++ b/gdb/gdbserver/server.h
@@ -144,12 +144,6 @@ typedef int gdb_fildes_t;
 extern int handle_serial_event (int err, gdb_client_data client_data);
 extern int handle_target_event (int err, gdb_client_data client_data);
 
-/* Functions from hostio.c.  */
-extern int handle_vFile (char *, int, int *);
-
-/* Functions from hostio-errno.c.  */
-extern void hostio_last_error_from_errno (char *own_buf);
-
 #include "remote-utils.h"
 
 #include "common-utils.h"
diff --git a/gdb/gdbserver/spu-low.c b/gdb/gdbserver/spu-low.c
index e604b9f..49b02a6 100644
--- a/gdb/gdbserver/spu-low.c
+++ b/gdb/gdbserver/spu-low.c
@@ -30,6 +30,7 @@
 #include <errno.h>
 #include <sys/syscall.h>
 #include "filestuff.h"
+#include "hostio.h"
 
 /* Some older glibc versions do not define this.  */
 #ifndef __WNOTHREAD
diff --git a/gdb/gdbserver/win32-low.c b/gdb/gdbserver/win32-low.c
index a32cea4..979eedd 100644
--- a/gdb/gdbserver/win32-low.c
+++ b/gdb/gdbserver/win32-low.c
@@ -26,6 +26,7 @@
 #include "win32-low.h"
 #include "gdbthread.h"
 #include "dll.h"
+#include "hostio.h"
 
 #include <stdint.h>
 #include <windows.h>


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH 7/9] [gdbserver] Split a new dll.h file out of server.h.
  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
  0 siblings, 0 replies; 22+ messages in thread
From: Pedro Alves @ 2013-09-05 20:50 UTC (permalink / raw)
  To: gdb-patches

win32-low.c needs to include dll.h as well.

--------
[gdbserver] Split a new dll.h file out of server.h.

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

	* dll.c, inferiors.c, remote-utils.c, server.c: Include "dll.h".
	* server.h (struct dll_info, all_dlls, dlls_changed, clear_dlls)
	(loaded_dll, unloaded_dll): Move to ...
	* dll.h: ... this new file.
	* inferiors.c, remote-utils.c, win32-low.c: Include "dll.h".
---
 gdb/gdbserver/dll.c          |    1 +
 gdb/gdbserver/dll.h          |   35 +++++++++++++++++++++++++++++++++++
 gdb/gdbserver/inferiors.c    |    1 +
 gdb/gdbserver/remote-utils.c |    2 ++
 gdb/gdbserver/server.c       |    1 +
 gdb/gdbserver/server.h       |   16 ----------------
 gdb/gdbserver/win32-low.c    |    1 +
 7 files changed, 41 insertions(+), 16 deletions(-)
 create mode 100644 gdb/gdbserver/dll.h

diff --git a/gdb/gdbserver/dll.c b/gdb/gdbserver/dll.c
index e4873eb..74978e2 100644
--- a/gdb/gdbserver/dll.c
+++ b/gdb/gdbserver/dll.c
@@ -16,6 +16,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "server.h"
+#include "dll.h"
 
 #define get_dll(inf) ((struct dll_info *)(inf))
 
diff --git a/gdb/gdbserver/dll.h b/gdb/gdbserver/dll.h
new file mode 100644
index 0000000..428c60c
--- /dev/null
+++ b/gdb/gdbserver/dll.h
@@ -0,0 +1,35 @@
+/* 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 DLL_H
+#define DLL_H
+
+struct dll_info
+{
+  struct inferior_list_entry entry;
+  char *name;
+  CORE_ADDR base_addr;
+};
+
+extern struct inferior_list all_dlls;
+extern int dlls_changed;
+
+extern void clear_dlls (void);
+extern void loaded_dll (const char *name, CORE_ADDR base_addr);
+extern void unloaded_dll (const char *name, CORE_ADDR base_addr);
+
+#endif /* DLL_H */
diff --git a/gdb/gdbserver/inferiors.c b/gdb/gdbserver/inferiors.c
index 39eb52e..5f974ca 100644
--- a/gdb/gdbserver/inferiors.c
+++ b/gdb/gdbserver/inferiors.c
@@ -22,6 +22,7 @@
 
 #include "server.h"
 #include "gdbthread.h"
+#include "dll.h"
 
 struct inferior_list all_processes;
 struct inferior_list all_threads;
diff --git a/gdb/gdbserver/remote-utils.c b/gdb/gdbserver/remote-utils.c
index 5cd6fa1..8e8a4d6 100644
--- a/gdb/gdbserver/remote-utils.c
+++ b/gdb/gdbserver/remote-utils.c
@@ -21,6 +21,8 @@
 #include "target.h"
 #include "gdbthread.h"
 #include "tdesc.h"
+#include "dll.h"
+
 #include <stdio.h>
 #include <string.h>
 #if HAVE_SYS_IOCTL_H
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index 3c70288..6ca7fe1 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -30,6 +30,7 @@
 #include "btrace-common.h"
 #include "filestuff.h"
 #include "tracepoint.h"
+#include "dll.h"
 
 /* The thread set with an `Hc' packet.  `Hc' is deprecated in favor of
    `vCont'.  Note the multi-process extensions made `vCont' a
diff --git a/gdb/gdbserver/server.h b/gdb/gdbserver/server.h
index a696121..ab52738 100644
--- a/gdb/gdbserver/server.h
+++ b/gdb/gdbserver/server.h
@@ -102,26 +102,10 @@ typedef unsigned long long ULONGEST;
 #include "gdbthread.h"
 #include "inferiors.h"
 
-struct dll_info
-{
-  struct inferior_list_entry entry;
-  char *name;
-  CORE_ADDR base_addr;
-};
-
 /* Target-specific functions */
 
 void initialize_low ();
 
-/* From dll.c.  */
-
-extern struct inferior_list all_dlls;
-extern int dlls_changed;
-extern void clear_dlls (void);
-
-void loaded_dll (const char *name, CORE_ADDR base_addr);
-void unloaded_dll (const char *name, CORE_ADDR base_addr);
-
 /* Public variables in server.c */
 
 extern ptid_t cont_thread;
diff --git a/gdb/gdbserver/win32-low.c b/gdb/gdbserver/win32-low.c
index 549c29f..a32cea4 100644
--- a/gdb/gdbserver/win32-low.c
+++ b/gdb/gdbserver/win32-low.c
@@ -25,6 +25,7 @@
 #include "mem-break.h"
 #include "win32-low.h"
 #include "gdbthread.h"
+#include "dll.h"
 
 #include <stdint.h>
 #include <windows.h>


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [COMMIT] Re: [PATCH 0/9][gdbserver] Split server.h.
  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
  0 siblings, 2 replies; 22+ messages in thread
From: Pedro Alves @ 2013-09-05 22:22 UTC (permalink / raw)
  To: gdb-patches

On 09/05/2013 09:47 PM, Pedro Alves wrote:

> I fixed them, and pushed the series in.

Gah, and completely forgot to 'cvs add' all the new
headers, so the gdbserver build is broken now for
everyone.   :-/  Now fixed...

/me longs for 'git push'.

-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [COMMIT] Re: [PATCH 0/9][gdbserver] Split server.h.
  2013-09-05 22:22   ` Pedro Alves
@ 2013-09-05 23:52     ` Joel Brobecker
  2013-09-06  5:47     ` Eli Zaretskii
  1 sibling, 0 replies; 22+ messages in thread
From: Joel Brobecker @ 2013-09-05 23:52 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

> Gah, and completely forgot to 'cvs add' all the new
> headers, so the gdbserver build is broken now for
> everyone.   :-/  Now fixed...
> 
> /me longs for 'git push'.

git cvsexportcommit handles this situation also :).

-- 
Joel


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [COMMIT] Re: [PATCH 0/9][gdbserver] Split server.h.
  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  9:36       ` Pedro Alves
  1 sibling, 2 replies; 22+ messages in thread
From: Eli Zaretskii @ 2013-09-06  5:47 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

> Date: Thu, 05 Sep 2013 23:22:50 +0100
> From: Pedro Alves <palves@redhat.com>
> 
> Gah, and completely forgot to 'cvs add' all the new
> headers, so the gdbserver build is broken now for
> everyone.   :-/  Now fixed...
> 
> /me longs for 'git push'.

Git doesn't save you from having to "git add" new files, does it?


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [COMMIT] Re: [PATCH 0/9][gdbserver] Split server.h.
  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
  1 sibling, 1 reply; 22+ messages in thread
From: Ricard Wanderlof @ 2013-09-06  6:51 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: gdb-patches


On Fri, 6 Sep 2013, Eli Zaretskii wrote:

>> From: Pedro Alves <palves@redhat.com>
>>
>> Gah, and completely forgot to 'cvs add' all the new
>> headers, so the gdbserver build is broken now for
>> everyone.   :-/  Now fixed...
>>
>> /me longs for 'git push'.
>
> Git doesn't save you from having to "git add" new files, does it?

With git, you need to use 'git add' for all files you're going to commit, 
both existing ones and new ones, so there's less of a chance of forgetting 
it since you need it all the time.

/Ricard
-- 
Ricard Wolf Wanderlöf                           ricardw(at)axis.com
Axis Communications AB, Lund, Sweden            www.axis.com
Phone +46 46 272 2016                           Fax +46 46 13 61 30


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [COMMIT] Re: [PATCH 0/9][gdbserver] Split server.h.
  2013-09-06  6:51       ` Ricard Wanderlof
@ 2013-09-06  7:42         ` Eli Zaretskii
  0 siblings, 0 replies; 22+ messages in thread
From: Eli Zaretskii @ 2013-09-06  7:42 UTC (permalink / raw)
  To: Ricard Wanderlof; +Cc: gdb-patches

> Date: Fri, 6 Sep 2013 08:51:20 +0200
> From: Ricard Wanderlof <ricard.wanderlof@axis.com>
> CC: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
> 
> > Git doesn't save you from having to "git add" new files, does it?
> 
> With git, you need to use 'git add' for all files you're going to commit, 
> both existing ones and new ones, so there's less of a chance of forgetting 
> it since you need it all the time.

If you use only, git, I can imagine this to be true (although if you
use 'add' all the time, how come you forget that with CVS? that
doesn't compute).  Not so if you also have to use a couple of other
VCSes.  In fact, git is the odd one out here, AFAIK, as hg, bzr, svn,
and cvs all have the same semantics of 'add', while git doesn't.

I avoid using "git add" for known files by using "git commit -a" (I
have an alias called, not surprisingly, "git ci" to do that
automatically); then I only need "git add" when I add new files.  That
saves me from insanity of remembering the subtly different semantics
of 'add' in git.


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [COMMIT] Re: [PATCH 0/9][gdbserver] Split server.h.
  2013-09-06  5:47     ` Eli Zaretskii
  2013-09-06  6:51       ` Ricard Wanderlof
@ 2013-09-06  9:36       ` Pedro Alves
  2013-09-06 10:05         ` Agovic, Sanimir
  1 sibling, 1 reply; 22+ messages in thread
From: Pedro Alves @ 2013-09-06  9:36 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: gdb-patches

On 09/06/2013 06:46 AM, Eli Zaretskii wrote:
>> Date: Thu, 05 Sep 2013 23:22:50 +0100
>> From: Pedro Alves <palves@redhat.com>
>>
>> Gah, and completely forgot to 'cvs add' all the new
>> headers, so the gdbserver build is broken now for
>> everyone.   :-/  Now fixed...
>>
>> /me longs for 'git push'.
> 
> Git doesn't save you from having to "git add" new files, does it?

No.  But when you use git for all the development work
(excluding the final commit), there's no way to forget it.
git shows the new files in the diff, and if you forget to
add the file, it won't appear in the submitted patch, for
example.  This is a fault in my workflow, of course.
The issue is when moving the patch from git/patch to
cvs, for final commit.  I always do:

 $ cvs diff > leftovers.diff
 $ less leftovers.diff

before and after committing a patch.  cvs diff
by default doesn't show you new files - instead it says:

 cvs diff: dll.h is a new entry, no comparison available

Even before using git/stgit for development, I was using
quilt on top of cvs to manage my patches/series.  I still
use that, particularly when moving patches from git -> cvs.
I do

 $ stg export -d patches

in my stg/git checkout, and that puts a quilt-ready patch
series in the patches directory.

I then have a separate gdb cvs checkout that I only use
for commits, that has src/patches symlinked to the
git checkout's src/patches.  So to push a series, I just
go to the cvs checkout dir (I always have a terminal open
for that alone), and manually do:

for each patch in series; do
 quilt push
 quilt diff
 move ChangeLog text from patch header to ChangeLog file
 cvs diff
 cvs ci
done

quilt diff does show new files in the diff (diffed
against /dev/null), yet another thing conspiring for me
missing cvs add.

For some I-can't-justify reason, I've trained my brain to
not expect to see new files in the "cvs diff" step.
That "is a new entry, no comparison available" warning goes
to stderr, but I failed to notice in the first patch.  And
then as I pushed the series in sequence, I skipped
that 'cvs diff' step in between committing patches, so I ended
up forgetting to add all new files...

The simple fix for me without learning a whole new workflow
seems to be to just use cvs diff -N.  My ~/.cvsrc now has:

 diff -upN

train myself to expect to see the new files in the
resulting diff, and perhaps write a little wrapper script
around cvs diff that warns me if there are non-added files
in the resulting diff (the ? lines), unless there's already
something like that in the set of cvs commands (cvs status
seems to be practically useless, I never use it).

Hopefully that'll help catch this mistake going forward.

(BTW, I also long for git push for being able to push a
series of patches with a single command)

-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 22+ messages in thread

* RE: [COMMIT] Re: [PATCH 0/9][gdbserver] Split server.h.
  2013-09-06  9:36       ` Pedro Alves
@ 2013-09-06 10:05         ` Agovic, Sanimir
  2013-09-06 10:09           ` Pedro Alves
  0 siblings, 1 reply; 22+ messages in thread
From: Agovic, Sanimir @ 2013-09-06 10:05 UTC (permalink / raw)
  To: 'Pedro Alves', Eli Zaretskii; +Cc: gdb-patches

> -----Original Message-----
> From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-owner@sourceware.org] On Behalf
> Of Pedro Alves
> Sent: Friday, September 06, 2013 11:36 AM
> To: Eli Zaretskii
> Cc: gdb-patches@sourceware.org
> Subject: Re: [COMMIT] Re: [PATCH 0/9][gdbserver] Split server.h.
> 
> For some I-can't-justify reason, I've trained my brain to
> not expect to see new files in the "cvs diff" step.
> That "is a new entry, no comparison available" warning goes
> to stderr, but I failed to notice in the first patch.  And
> then as I pushed the series in sequence, I skipped
> that 'cvs diff' step in between committing patches, so I ended
> up forgetting to add all new files...
> 
> The simple fix for me without learning a whole new workflow
> seems to be to just use cvs diff -N.  My ~/.cvsrc now has:
> 
>  diff -upN
> 
> train myself to expect to see the new files in the
> resulting diff, and perhaps write a little wrapper script
> around cvs diff that warns me if there are non-added files
> in the resulting diff (the ? lines), unless there's already
> something like that in the set of cvs commands (cvs status
> seems to be practically useless, I never use it).
> 
> Hopefully that'll help catch this mistake going forward.
> 
Pedro, I use git-cvsexportcommit[1], it saves me from all the trouble.

[1] https://www.kernel.org/pub/software/scm/git/docs/git-cvsexportcommit.html

 -Sanimir

Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [COMMIT] Re: [PATCH 0/9][gdbserver] Split server.h.
  2013-09-06 10:05         ` Agovic, Sanimir
@ 2013-09-06 10:09           ` Pedro Alves
  0 siblings, 0 replies; 22+ messages in thread
From: Pedro Alves @ 2013-09-06 10:09 UTC (permalink / raw)
  To: Agovic, Sanimir; +Cc: Eli Zaretskii, gdb-patches

On 09/06/2013 11:05 AM, Agovic, Sanimir wrote:

> Pedro, I use git-cvsexportcommit[1], it saves me from all the trouble.
> 
> [1] https://www.kernel.org/pub/software/scm/git/docs/git-cvsexportcommit.html

Yeah, thanks.  I know about it, but I never got used to it.
Old habits die hard, I guess.  I'll force myself to try
it out soon.

-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2013-09-06 10:09 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-03 20:26 [PATCH 0/9][gdbserver] Split server.h 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 1/9] [gdbserver] Delete _ macro (gettext) Pedro Alves
2013-09-03 20:26 ` [PATCH 2/9] [gdbserver] Split a new remote-utils.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 ` [PATCH 8/9] [gdbserver] Split a new event-loop.h file out of server.h Pedro Alves
2013-09-03 20:26 ` [PATCH 3/9] [gdbserver] Split a new utils.h " 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: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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox