Index: src/server/gdb_server.c
===================================================================
--- src/server/gdb_server.c	(revision 2570)
+++ src/server/gdb_server.c	(working copy)
@@ -81,15 +81,19 @@
 	switch (target->debug_reason)
 	{
 		case DBG_REASON_DBGRQ:
-			return 0x2; /* SIGINT */
+			return TARGET_SIGNAL_INT; 
 		case DBG_REASON_BREAKPOINT:
 		case DBG_REASON_WATCHPOINT:
 		case DBG_REASON_WPTANDBKPT:
-			return 0x05; /* SIGTRAP */
+			return TARGET_SIGNAL_TRAP; 
 		case DBG_REASON_SINGLESTEP:
-			return 0x05; /* SIGTRAP */
+			return TARGET_SIGNAL_TRAP; 
 		case DBG_REASON_NOTHALTED:
-			return 0x0; /* no signal... shouldn't happen */
+			return TARGET_SIGNAL_0; /* no signal... shouldn't happen */
+		case DBG_REASON_SIGNAL:
+			return target->signal;
+		case DBG_REASON_SYSCALL:
+			return TARGET_SIGNAL_SYS;
 		default:
 			LOG_USER("undefined debug reason %d - target needs reset", target->debug_reason);
 			return 0x0;
@@ -666,6 +670,28 @@
 	return ERROR_OK;
 }
 
+static uint32_t gdb_get_string_len(struct target_s *target, uint64_t start_address)
+{
+    int retval;
+    uint32_t len;
+    uint8_t buffer;
+    
+    /* Get length of null terminated string held in the targets memory.  */
+    len = 0;
+    do 
+    {
+        retval = target_read_memory(target, start_address + len, 1, 1, &buffer);
+        len++;
+    }
+    while((retval == ERROR_OK) && (buffer != '\0'));
+    len--;
+    
+    /* Return 0 if there was an error, so that the system call will fail.  */
+    if (retval != ERROR_OK)
+        return 0;
+    else
+        return len;
+}
 
 static void gdb_frontend_halted(struct target_s *target, connection_t *connection)
 {
@@ -682,24 +708,110 @@
 	 */
 	if (gdb_connection->frontend_state == TARGET_RUNNING)
 	{
-		char sig_reply[4];
-		int signal;
+		char sig_reply[256];
+		int length;
 
 		/* stop forwarding log packets! */
 		log_remove_callback(gdb_log_callback, connection);
 
 		if (gdb_connection->ctrl_c)
 		{
-			signal = 0x2;
 			gdb_connection->ctrl_c = 0;
+			length = snprintf(sig_reply, sizeof(sig_reply), "T%2.2x", TARGET_SIGNAL_INT);
 		}
+		else if (target->debug_reason == DBG_REASON_SYSCALL)
+		{
+			switch (target->syscall)
+			{
+				case TARGET_SYSCALL_OPEN:
+					length = snprintf(sig_reply, sizeof(sig_reply), "Fopen,%llx/%lx,%lx,%lx", 
+										target->syscall_params[0], 
+										gdb_get_string_len(target, target->syscall_params[0]), 
+										(int32_t)target->syscall_params[1], 
+										(gdb_mode_t)target->syscall_params[2]);		              
+					break;
+		        
+				case TARGET_SYSCALL_CLOSE:		        
+					length = snprintf(sig_reply, sizeof(sig_reply), "Fclose,%lx", 
+										(int32_t)target->syscall_params[0]);		              		            
+					break;
+                    		        
+				case TARGET_SYSCALL_READ:
+					length = snprintf(sig_reply, sizeof(sig_reply), "Fread,%lx,%llx,%lx", 
+										(int32_t)target->syscall_params[0], 
+										target->syscall_params[1], 
+										(uint32_t)target->syscall_params[2]);		              		            
+					break;
+                    	        
+				case TARGET_SYSCALL_WRITE:
+					length = snprintf(sig_reply, sizeof(sig_reply), "Fwrite,%lx,%llx,%lx", 
+										(int32_t)target->syscall_params[0], 
+										target->syscall_params[1], 
+										(uint32_t)target->syscall_params[2]);		              		            
+					break;
+                    	        
+				case TARGET_SYSCALL_LSEEK:
+					length = snprintf(sig_reply, sizeof(sig_reply), "Fseek,%lx,%llx,%lx", 
+										(int32_t)target->syscall_params[0],		              		            
+										(int64_t)target->syscall_params[1], 
+										(int32_t)target->syscall_params[2]);		              		            
+					break;
+		        
+				case TARGET_SYSCALL_RENAME:
+					length = snprintf(sig_reply, sizeof(sig_reply), "Frename,%llx/%lx,%llx/%lx", 
+										target->syscall_params[0],		              		  
+										gdb_get_string_len(target, target->syscall_params[0]),                                                  
+										target->syscall_params[1], 
+										gdb_get_string_len(target, target->syscall_params[1]));
+					break;
+		          
+				case TARGET_SYSCALL_UNLINK:
+					length = snprintf(sig_reply, sizeof(sig_reply), "Funlink,%llx/%lx", 
+										target->syscall_params[0],		              		  
+										gdb_get_string_len(target, target->syscall_params[0]));
+					break;
+		          
+				case TARGET_SYSCALL_STAT:
+					length = snprintf(sig_reply, sizeof(sig_reply), "Fstat,%llx/%lx,%llx", 
+										target->syscall_params[0],		              		  
+										gdb_get_string_len(target, target->syscall_params[0]),
+										target->syscall_params[1]);
+					break;
+		          
+				case TARGET_SYSCALL_FSTAT:
+					length = snprintf(sig_reply, sizeof(sig_reply), "Ffstat,%lx,%llx", 
+										(int32_t)target->syscall_params[0],		              		  
+										target->syscall_params[1]);
+					break;
+		          
+				case TARGET_SYSCALL_GETTIMEOFDAY:
+					length = snprintf(sig_reply, sizeof(sig_reply), "Fgettimeofday,%llx,%llx", 
+										target->syscall_params[0],		              		  
+										target->syscall_params[1]);
+					break;
+		          
+				case TARGET_SYSCALL_ISATTY:
+					length = snprintf(sig_reply, sizeof(sig_reply), "Fisatty,%lx", 
+										(int32_t)target->syscall_params[0]);
+					break;
+		        
+				case TARGET_SYSCALL_SYSTEM:
+					length = snprintf(sig_reply, sizeof(sig_reply), "Fsystem,%llx,%lx", 
+										target->syscall_params[0],
+										gdb_get_string_len(target, target->syscall_params[0]));
+					break;
+		        
+				default:
+					LOG_WARNING("Unknown syscall %d\n", target->syscall);
+					target_syscall_resume(target, -1, GDB_ENOSYS, 0);
+					return;	        
+		    }
+		}
 		else
 		{
-			signal = gdb_last_signal(target);
+			length = snprintf(sig_reply, sizeof(sig_reply), "T%2.2x", gdb_last_signal(target));
 		}
-
-		snprintf(sig_reply, 4, "T%2.2x", signal);
-		gdb_put_packet(connection, sig_reply, 3);
+		gdb_put_packet(connection, sig_reply, length);
 		gdb_connection->frontend_state = TARGET_HALTED;
 	}
 }
@@ -2002,6 +2114,42 @@
 	return ERROR_OK;
 }
 
+static int gdb_F_packet(connection_t *connection, target_t *target, char *packet, int packet_size)
+{
+	int64_t retcode;
+	uint32_t err_no = 0;
+	uint32_t ctrl_c = 0;
+	gdb_connection_t *gdb_con = connection->priv;
+    
+	/* Skip 'F' */
+	packet++;
+	/* Get system call return code. */
+	retcode = strtoll(packet, &packet, 16);
+	if (*packet == ',')
+	{
+		/* Skip ',' */
+		packet++;
+		/* Get error number. */
+		err_no = strtoul(packet, &packet, 16);
+		if (*packet == ',')
+		{
+			/* Skip ',' */
+			packet++;
+			/* Check for Ctrl-C */
+			if (*packet == 'C')
+				ctrl_c = 1;
+		}	    
+	}
+            
+	/* Record that the target is running again. */            
+	gdb_con->frontend_state = TARGET_RUNNING;
+	log_add_callback(gdb_log_callback, connection);
+	target_call_event_callbacks(target, TARGET_EVENT_GDB_START);            
+            
+	/* Resume execution on the target. */            
+	return target_syscall_resume(target, retcode, err_no, ctrl_c);
+}
+
 static void gdb_log_callback(void *priv, const char *file, int line,
 		const char *function, const char *string)
 {
@@ -2158,6 +2306,9 @@
 					watchpoint_clear_target(gdb_service->target);
 					command_run_linef(connection->cmd_ctx, "ocd_gdb_restart %d", get_num_by_target(target));
 					break;
+				case 'F':
+					retval = gdb_F_packet(connection, target, packet, packet_size);
+					break;
 				default:
 					/* ignore unkown packets */
 					LOG_DEBUG("ignoring 0x%2.2x packet", packet[0]);
Index: src/target/target.c
===================================================================
--- src/target/target.c	(revision 2570)
+++ src/target/target.c	(working copy)
@@ -218,6 +218,8 @@
 	{ .name = "single-step"              , .value = DBG_REASON_SINGLESTEP },
 	{ .name = "target-not-halted"        , .value = DBG_REASON_NOTHALTED  },
 	{ .name = "undefined"                , .value = DBG_REASON_UNDEFINED },
+	{ .name = "signal"                   , .value = DBG_REASON_SIGNAL },
+	{ .name = "system-call"              , .value = DBG_REASON_SYSCALL },
 	{ .name = NULL, .value = -1 },
 };
 
@@ -622,6 +624,14 @@
 	return target->type->step(target, current, address, handle_breakpoints);
 }
 
+int target_syscall_resume(struct target_s *target, int64_t retcode, uint32_t err_no, uint32_t ctrl_c)
+{
+    /* Not all targets support system calls. */
+    if (target->type->syscall_resume != NULL)
+	   return target->type->syscall_resume(target, retcode, err_no, ctrl_c);
+	else
+	   return ERROR_FAIL;
+}
 
 int target_run_algorithm(struct target_s *target,
 		int num_mem_params, mem_param_t *mem_params,
Index: src/target/gdb_syscall.h
===================================================================
--- src/target/gdb_syscall.h	(revision 0)
+++ src/target/gdb_syscall.h	(revision 0)
@@ -0,0 +1,111 @@
+/***************************************************************************
+ *   Contributed by Jon Beniston <jon@beniston.com>                        *
+ *   Based on GDB Remote File I/O documentation.                           *
+ *                                                                         *
+ *   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 2 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, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#ifndef GDB_SYSCALL_H
+#define GDB_SYSCALL_H
+
+/* Syscall call identifier - only used by OpenOCD. */
+enum target_syscall 
+{
+    TARGET_SYSCALL_OPEN,
+    TARGET_SYSCALL_CLOSE,
+    TARGET_SYSCALL_READ,
+    TARGET_SYSCALL_WRITE,
+    TARGET_SYSCALL_LSEEK,
+    TARGET_SYSCALL_RENAME,
+    TARGET_SYSCALL_UNLINK,
+    TARGET_SYSCALL_STAT,
+    TARGET_SYSCALL_FSTAT,
+    TARGET_SYSCALL_GETTIMEOFDAY,
+    TARGET_SYSCALL_ISATTY,
+    TARGET_SYSCALL_SYSTEM,
+    TARGET_SYSCALL_UNSUPPORTED
+};
+
+typedef uint32_t gdb_mode_t;
+typedef uint32_t gdb_time_t;
+
+struct gdb_stat {
+    uint32_t    st_dev;      /* device */
+    uint32_t    st_ino;      /* inode */
+    gdb_mode_t  st_mode;     /* protection */
+    uint32_t    st_nlink;    /* number of hard links */
+    uint32_t    st_uid;      /* user ID of owner */
+    uint32_t    st_gid;      /* group ID of owner */
+    uint32_t    st_rdev;     /* device type (if inode device) */
+    uint64_t    st_size;     /* total size, in bytes */
+    uint64_t    st_blksize;  /* blocksize for filesystem I/O */
+    uint64_t    st_blocks;   /* number of blocks allocated */
+    gdb_time_t  st_atime_;   /* time of last access */
+    gdb_time_t  st_mtime_;   /* time of last modification */
+    gdb_time_t  st_ctime_;   /* time of last change */
+};
+
+struct gdb_timeval {
+    gdb_time_t tv_sec;  /* second */
+    int64_t    tv_usec; /* microsecond */
+};
+
+/* Open Flags.  */
+#define GDB_O_RDONLY        0x0
+#define GDB_O_WRONLY        0x1
+#define GDB_O_RDWR          0x2
+#define GDB_O_APPEND        0x8
+#define GDB_O_CREAT       0x200
+#define GDB_O_TRUNC       0x400
+#define GDB_O_EXCL        0x800
+
+/* mode_t Values.  */
+#define GDB_S_IFREG       0100000
+#define GDB_S_IFDIR        040000
+#define GDB_S_IRUSR          0400
+#define GDB_S_IWUSR          0200
+#define GDB_S_IXUSR          0100
+#define GDB_S_IRGRP           040
+#define GDB_S_IWGRP           020
+#define GDB_S_IXGRP           010
+#define GDB_S_IROTH            04
+#define GDB_S_IWOTH            02
+#define GDB_S_IXOTH            01
+
+/* Errno values.  */
+#define GDB_EPERM           1
+#define GDB_ENOENT          2
+#define GDB_EINTR           4
+#define GDB_EBADF           9
+#define GDB_EACCES         13
+#define GDB_EFAULT         14
+#define GDB_EBUSY          16
+#define GDB_EEXIST         17
+#define GDB_ENODEV         19
+#define GDB_ENOTDIR        20
+#define GDB_EISDIR         21
+#define GDB_EINVAL         22
+#define GDB_ENFILE         23
+#define GDB_EMFILE         24
+#define GDB_EFBIG          27
+#define GDB_ENOSPC         28
+#define GDB_ESPIPE         29
+#define GDB_EROFS          30
+#define GDB_ENOSYS         88
+#define GDB_ENAMETOOLONG   91
+#define GDB_EUNKNOWN       9999
+
+#endif /* #ifndef GDB_SYSCALL_H */

Index: src/target/target.h
===================================================================
--- src/target/target.h	(revision 2570)
+++ src/target/target.h	(working copy)
@@ -29,6 +29,8 @@
 #include "breakpoints.h"
 #include "algorithm.h"
 #include "command.h"
+#include "gdb_signals.h"
+#include "gdb_syscall.h"
 
 struct reg_s;
 struct trace_s;
@@ -84,7 +86,9 @@
 	DBG_REASON_WPTANDBKPT = 3,
 	DBG_REASON_SINGLESTEP = 4,
 	DBG_REASON_NOTHALTED = 5,
-	DBG_REASON_UNDEFINED = 6
+	DBG_REASON_UNDEFINED = 6,
+	DBG_REASON_SIGNAL = 7,         /* Unhandled signal - no O/S is on the target.  */
+	DBG_REASON_SYSCALL = 8         /* Unhandled system call - no O/S is on the target.  */
 };
 
 extern const Jim_Nvp nvp_target_debug_reason[];
@@ -134,6 +138,13 @@
 	uint32_t backup_working_area;			/* whether the content of the working area has to be preserved */
 	struct working_area_s *working_areas;/* list of allocated working areas */
 	enum target_debug_reason debug_reason;/* reason why the target entered debug state */
+	union {
+		enum target_signal signal;          /* signal number, if debug_reason == DBG_REASON_SIGNAL */
+		struct {
+			enum target_syscall syscall;    /* system call number, if debug reason == DBG_REASON_SYSCALL */
+			uint64_t syscall_params[3];     /* Parameters for system calls */
+		};
+	};   
 	enum target_endianess endianness;	/* target endianess */
 	// also see: target_state_name()
 	enum target_state state;			/* the current backend-state (running, halted, ...) */
@@ -318,7 +329,16 @@
  */
 int target_step(struct target_s *target,
 		int current, uint32_t address, int handle_breakpoints);
+		
 /**
+ * Resume execution after handling a system call.
+ * 
+ * This routine is a wrapper for target->type->syscall_resume.
+ */
+extern int target_syscall_resume(struct target_s *target, int64_t retcode, 
+        uint32_t err_no, uint32_t ctrl_c);   		
+		
+/**
  * Run an algorithm on the @a target given.
  *
  * This routine is a wrapper for target->type->run_algorithm.
Index: src/target/target_type.h
===================================================================
--- src/target/target_type.h	(revision 2570)
+++ src/target/target_type.h	(working copy)
@@ -59,6 +59,7 @@
 	int (*halt)(struct target_s *target);
 	int (*resume)(struct target_s *target, int current, uint32_t address, int handle_breakpoints, int debug_execution);
 	int (*step)(struct target_s *target, int current, uint32_t address, int handle_breakpoints);
+	int (*syscall_resume)(struct target_s *target, int64_t retcode, uint32_t err_no, uint32_t ctrl_c);
 
 	/* target reset control. assert reset can be invoked when OpenOCD and
 	 * the target is out of sync.
Index: src/target/gdb_signals.h
===================================================================
--- src/target/gdb_signals.h	(revision 0)
+++ src/target/gdb_signals.h	(revision 0)
@@ -0,0 +1,234 @@
+/* Target signal numbers for GDB and the GDB remote protocol.
+   Copyright 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
+   1998, 1999, 2000, 2001, 2002, 2007, 2008 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 GDB_SIGNALS_H
+#define GDB_SIGNALS_H
+
+/* The numbering of these signals is chosen to match traditional unix
+   signals (insofar as various unices use the same numbers, anyway).
+   It is also the numbering of the GDB remote protocol.  Other remote
+   protocols, if they use a different numbering, should make sure to
+   translate appropriately.
+
+   Since these numbers have actually made it out into other software
+   (stubs, etc.), you mustn't disturb the assigned numbering.  If you
+   need to add new signals here, add them to the end of the explicitly
+   numbered signals, at the comment marker.  Add them unconditionally,
+   not within any #if or #ifdef.
+
+   This is based strongly on Unix/POSIX signals for several reasons:
+   (1) This set of signals represents a widely-accepted attempt to
+   represent events of this sort in a portable fashion, (2) we want a
+   signal to make it from wait to child_wait to the user intact, (3) many
+   remote protocols use a similar encoding.  However, it is
+   recognized that this set of signals has limitations (such as not
+   distinguishing between various kinds of SIGSEGV, or not
+   distinguishing hitting a breakpoint from finishing a single step).
+   So in the future we may get around this either by adding additional
+   signals for breakpoint, single-step, etc., or by adding signal
+   codes; the latter seems more in the spirit of what BSD, System V,
+   etc. are doing to address these issues.  */
+
+/* For an explanation of what each signal means, see
+   target_signal_to_string.  */
+
+enum target_signal
+  {
+    /* Used some places (e.g. stop_signal) to record the concept that
+       there is no signal.  */
+    TARGET_SIGNAL_0 = 0,
+    TARGET_SIGNAL_FIRST = 0,
+    TARGET_SIGNAL_HUP = 1,
+    TARGET_SIGNAL_INT = 2,
+    TARGET_SIGNAL_QUIT = 3,
+    TARGET_SIGNAL_ILL = 4,
+    TARGET_SIGNAL_TRAP = 5,
+    TARGET_SIGNAL_ABRT = 6,
+    TARGET_SIGNAL_EMT = 7,
+    TARGET_SIGNAL_FPE = 8,
+    TARGET_SIGNAL_KILL = 9,
+    TARGET_SIGNAL_BUS = 10,
+    TARGET_SIGNAL_SEGV = 11,
+    TARGET_SIGNAL_SYS = 12,
+    TARGET_SIGNAL_PIPE = 13,
+    TARGET_SIGNAL_ALRM = 14,
+    TARGET_SIGNAL_TERM = 15,
+    TARGET_SIGNAL_URG = 16,
+    TARGET_SIGNAL_STOP = 17,
+    TARGET_SIGNAL_TSTP = 18,
+    TARGET_SIGNAL_CONT = 19,
+    TARGET_SIGNAL_CHLD = 20,
+    TARGET_SIGNAL_TTIN = 21,
+    TARGET_SIGNAL_TTOU = 22,
+    TARGET_SIGNAL_IO = 23,
+    TARGET_SIGNAL_XCPU = 24,
+    TARGET_SIGNAL_XFSZ = 25,
+    TARGET_SIGNAL_VTALRM = 26,
+    TARGET_SIGNAL_PROF = 27,
+    TARGET_SIGNAL_WINCH = 28,
+    TARGET_SIGNAL_LOST = 29,
+    TARGET_SIGNAL_USR1 = 30,
+    TARGET_SIGNAL_USR2 = 31,
+    TARGET_SIGNAL_PWR = 32,
+    /* Similar to SIGIO.  Perhaps they should have the same number.  */
+    TARGET_SIGNAL_POLL = 33,
+    TARGET_SIGNAL_WIND = 34,
+    TARGET_SIGNAL_PHONE = 35,
+    TARGET_SIGNAL_WAITING = 36,
+    TARGET_SIGNAL_LWP = 37,
+    TARGET_SIGNAL_DANGER = 38,
+    TARGET_SIGNAL_GRANT = 39,
+    TARGET_SIGNAL_RETRACT = 40,
+    TARGET_SIGNAL_MSG = 41,
+    TARGET_SIGNAL_SOUND = 42,
+    TARGET_SIGNAL_SAK = 43,
+    TARGET_SIGNAL_PRIO = 44,
+    TARGET_SIGNAL_REALTIME_33 = 45,
+    TARGET_SIGNAL_REALTIME_34 = 46,
+    TARGET_SIGNAL_REALTIME_35 = 47,
+    TARGET_SIGNAL_REALTIME_36 = 48,
+    TARGET_SIGNAL_REALTIME_37 = 49,
+    TARGET_SIGNAL_REALTIME_38 = 50,
+    TARGET_SIGNAL_REALTIME_39 = 51,
+    TARGET_SIGNAL_REALTIME_40 = 52,
+    TARGET_SIGNAL_REALTIME_41 = 53,
+    TARGET_SIGNAL_REALTIME_42 = 54,
+    TARGET_SIGNAL_REALTIME_43 = 55,
+    TARGET_SIGNAL_REALTIME_44 = 56,
+    TARGET_SIGNAL_REALTIME_45 = 57,
+    TARGET_SIGNAL_REALTIME_46 = 58,
+    TARGET_SIGNAL_REALTIME_47 = 59,
+    TARGET_SIGNAL_REALTIME_48 = 60,
+    TARGET_SIGNAL_REALTIME_49 = 61,
+    TARGET_SIGNAL_REALTIME_50 = 62,
+    TARGET_SIGNAL_REALTIME_51 = 63,
+    TARGET_SIGNAL_REALTIME_52 = 64,
+    TARGET_SIGNAL_REALTIME_53 = 65,
+    TARGET_SIGNAL_REALTIME_54 = 66,
+    TARGET_SIGNAL_REALTIME_55 = 67,
+    TARGET_SIGNAL_REALTIME_56 = 68,
+    TARGET_SIGNAL_REALTIME_57 = 69,
+    TARGET_SIGNAL_REALTIME_58 = 70,
+    TARGET_SIGNAL_REALTIME_59 = 71,
+    TARGET_SIGNAL_REALTIME_60 = 72,
+    TARGET_SIGNAL_REALTIME_61 = 73,
+    TARGET_SIGNAL_REALTIME_62 = 74,
+    TARGET_SIGNAL_REALTIME_63 = 75,
+
+    /* Used internally by Solaris threads.  See signal(5) on Solaris.  */
+    TARGET_SIGNAL_CANCEL = 76,
+
+    /* Yes, this pains me, too.  But LynxOS didn't have SIG32, and now
+       GNU/Linux does, and we can't disturb the numbering, since it's
+       part of the remote protocol.  Note that in some GDB's
+       TARGET_SIGNAL_REALTIME_32 is number 76.  */
+    TARGET_SIGNAL_REALTIME_32,
+    /* Yet another pain, IRIX 6 has SIG64. */
+    TARGET_SIGNAL_REALTIME_64,
+    /* Yet another pain, GNU/Linux MIPS might go up to 128. */
+    TARGET_SIGNAL_REALTIME_65,
+    TARGET_SIGNAL_REALTIME_66,
+    TARGET_SIGNAL_REALTIME_67,
+    TARGET_SIGNAL_REALTIME_68,
+    TARGET_SIGNAL_REALTIME_69,
+    TARGET_SIGNAL_REALTIME_70,
+    TARGET_SIGNAL_REALTIME_71,
+    TARGET_SIGNAL_REALTIME_72,
+    TARGET_SIGNAL_REALTIME_73,
+    TARGET_SIGNAL_REALTIME_74,
+    TARGET_SIGNAL_REALTIME_75,
+    TARGET_SIGNAL_REALTIME_76,
+    TARGET_SIGNAL_REALTIME_77,
+    TARGET_SIGNAL_REALTIME_78,
+    TARGET_SIGNAL_REALTIME_79,
+    TARGET_SIGNAL_REALTIME_80,
+    TARGET_SIGNAL_REALTIME_81,
+    TARGET_SIGNAL_REALTIME_82,
+    TARGET_SIGNAL_REALTIME_83,
+    TARGET_SIGNAL_REALTIME_84,
+    TARGET_SIGNAL_REALTIME_85,
+    TARGET_SIGNAL_REALTIME_86,
+    TARGET_SIGNAL_REALTIME_87,
+    TARGET_SIGNAL_REALTIME_88,
+    TARGET_SIGNAL_REALTIME_89,
+    TARGET_SIGNAL_REALTIME_90,
+    TARGET_SIGNAL_REALTIME_91,
+    TARGET_SIGNAL_REALTIME_92,
+    TARGET_SIGNAL_REALTIME_93,
+    TARGET_SIGNAL_REALTIME_94,
+    TARGET_SIGNAL_REALTIME_95,
+    TARGET_SIGNAL_REALTIME_96,
+    TARGET_SIGNAL_REALTIME_97,
+    TARGET_SIGNAL_REALTIME_98,
+    TARGET_SIGNAL_REALTIME_99,
+    TARGET_SIGNAL_REALTIME_100,
+    TARGET_SIGNAL_REALTIME_101,
+    TARGET_SIGNAL_REALTIME_102,
+    TARGET_SIGNAL_REALTIME_103,
+    TARGET_SIGNAL_REALTIME_104,
+    TARGET_SIGNAL_REALTIME_105,
+    TARGET_SIGNAL_REALTIME_106,
+    TARGET_SIGNAL_REALTIME_107,
+    TARGET_SIGNAL_REALTIME_108,
+    TARGET_SIGNAL_REALTIME_109,
+    TARGET_SIGNAL_REALTIME_110,
+    TARGET_SIGNAL_REALTIME_111,
+    TARGET_SIGNAL_REALTIME_112,
+    TARGET_SIGNAL_REALTIME_113,
+    TARGET_SIGNAL_REALTIME_114,
+    TARGET_SIGNAL_REALTIME_115,
+    TARGET_SIGNAL_REALTIME_116,
+    TARGET_SIGNAL_REALTIME_117,
+    TARGET_SIGNAL_REALTIME_118,
+    TARGET_SIGNAL_REALTIME_119,
+    TARGET_SIGNAL_REALTIME_120,
+    TARGET_SIGNAL_REALTIME_121,
+    TARGET_SIGNAL_REALTIME_122,
+    TARGET_SIGNAL_REALTIME_123,
+    TARGET_SIGNAL_REALTIME_124,
+    TARGET_SIGNAL_REALTIME_125,
+    TARGET_SIGNAL_REALTIME_126,
+    TARGET_SIGNAL_REALTIME_127,
+
+    TARGET_SIGNAL_INFO,
+
+    /* Some signal we don't know about.  */
+    TARGET_SIGNAL_UNKNOWN,
+
+    /* Use whatever signal we use when one is not specifically specified
+       (for passing to proceed and so on).  */
+    TARGET_SIGNAL_DEFAULT,
+
+    /* Mach exceptions.  In versions of GDB before 5.2, these were just before
+       TARGET_SIGNAL_INFO if you were compiling on a Mach host (and missing
+       otherwise).  */
+    TARGET_EXC_BAD_ACCESS,
+    TARGET_EXC_BAD_INSTRUCTION,
+    TARGET_EXC_ARITHMETIC,
+    TARGET_EXC_EMULATION,
+    TARGET_EXC_SOFTWARE,
+    TARGET_EXC_BREAKPOINT,
+
+    /* If you are adding a new signal, add it just above this comment.  */
+
+    /* Last and unused enum value, for sizing arrays, etc.  */
+    TARGET_SIGNAL_LAST
+  };
+
+#endif /* #ifndef GDB_SIGNALS_H */
