Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [rfa] gdbserver 2/n - signals
@ 2001-07-19 12:01 Daniel Jacobowitz
  2001-07-19 14:00 ` Andrew Cagney
  0 siblings, 1 reply; 15+ messages in thread
From: Daniel Jacobowitz @ 2001-07-19 12:01 UTC (permalink / raw)
  To: gdb-patches

This updates the remote protocol documentation and the gdbserver signal code
so that signals are converted properly before being sent.  The documentation
needs (a lot) more work; this doc change is mostly to remind me to revisit
the Protocol node later.

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer

2001-07-19  Daniel Jacobowitz  <drow@mvista.com>

	* gdbserver/server.c (main): Call target_signal_to_host_p
	and target_signal_to_host on signals received from the remote.
	* gdbserver/remote-utils.c (prepare_resume_reply): Call
	target_signal_from_host on signals sent to the remote.
	* gdbserver/signals.c: New file.
	* gdbserver/Makefile.in: Add signals.o.

2001-07-19  Daniel Jacobowitz  <drow@mvista.com>

	* gdb.texinfo (Protocol): Mention that signal numbers
	are defined by the target_signal enum.

--- server.c	Thu Jul 19 11:44:35 2001
+++ server.c	Thu Jul 19 11:47:02 2001
@@ -130,13 +133,21 @@
 	      break;
 	    case 'C':
 	      convert_ascii_to_int (own_buf + 1, &sig, 1);
-	      myresume (0, sig);
+	      if (target_signal_to_host_p (sig))
+		signal = target_signal_to_host (sig);
+	      else
+		signal = 0;
+	      myresume (0, signal);
 	      signal = mywait (&status);
 	      prepare_resume_reply (own_buf, status, signal);
 	      break;
 	    case 'S':
 	      convert_ascii_to_int (own_buf + 1, &sig, 1);
-	      myresume (1, sig);
+	      if (target_signal_to_host_p (sig))
+		signal = target_signal_to_host (sig);
+	      else
+		signal = 0;
+	      myresume (1, signal);
 	      signal = mywait (&status);
 	      prepare_resume_reply (own_buf, status, signal);
 	      break;
--- /dev/null	Wed Dec 31 16:00:00 1969
+++ signals.c	Tue Jul 17 13:48:06 2001
@@ -0,0 +1,589 @@
+/* Functions to convert to and from the target signal protocol.
+   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+   2000, 2001 Free Software Foundation, Inc.
+   Contributed by Cygnus Support.
+
+   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 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.  */
+
+#include "defs.h"
+#include "target.h"
+
+#include <signal.h>
+
+/* Convert host signal to our signals.  */
+enum target_signal
+target_signal_from_host (int hostsig)
+{
+  /* A switch statement would make sense but would require special kludges
+     to deal with the cases where more than one signal has the same number.  */
+
+  if (hostsig == 0)
+    return TARGET_SIGNAL_0;
+
+#if defined (SIGHUP)
+  if (hostsig == SIGHUP)
+    return TARGET_SIGNAL_HUP;
+#endif
+#if defined (SIGINT)
+  if (hostsig == SIGINT)
+    return TARGET_SIGNAL_INT;
+#endif
+#if defined (SIGQUIT)
+  if (hostsig == SIGQUIT)
+    return TARGET_SIGNAL_QUIT;
+#endif
+#if defined (SIGILL)
+  if (hostsig == SIGILL)
+    return TARGET_SIGNAL_ILL;
+#endif
+#if defined (SIGTRAP)
+  if (hostsig == SIGTRAP)
+    return TARGET_SIGNAL_TRAP;
+#endif
+#if defined (SIGABRT)
+  if (hostsig == SIGABRT)
+    return TARGET_SIGNAL_ABRT;
+#endif
+#if defined (SIGEMT)
+  if (hostsig == SIGEMT)
+    return TARGET_SIGNAL_EMT;
+#endif
+#if defined (SIGFPE)
+  if (hostsig == SIGFPE)
+    return TARGET_SIGNAL_FPE;
+#endif
+#if defined (SIGKILL)
+  if (hostsig == SIGKILL)
+    return TARGET_SIGNAL_KILL;
+#endif
+#if defined (SIGBUS)
+  if (hostsig == SIGBUS)
+    return TARGET_SIGNAL_BUS;
+#endif
+#if defined (SIGSEGV)
+  if (hostsig == SIGSEGV)
+    return TARGET_SIGNAL_SEGV;
+#endif
+#if defined (SIGSYS)
+  if (hostsig == SIGSYS)
+    return TARGET_SIGNAL_SYS;
+#endif
+#if defined (SIGPIPE)
+  if (hostsig == SIGPIPE)
+    return TARGET_SIGNAL_PIPE;
+#endif
+#if defined (SIGALRM)
+  if (hostsig == SIGALRM)
+    return TARGET_SIGNAL_ALRM;
+#endif
+#if defined (SIGTERM)
+  if (hostsig == SIGTERM)
+    return TARGET_SIGNAL_TERM;
+#endif
+#if defined (SIGUSR1)
+  if (hostsig == SIGUSR1)
+    return TARGET_SIGNAL_USR1;
+#endif
+#if defined (SIGUSR2)
+  if (hostsig == SIGUSR2)
+    return TARGET_SIGNAL_USR2;
+#endif
+#if defined (SIGCLD)
+  if (hostsig == SIGCLD)
+    return TARGET_SIGNAL_CHLD;
+#endif
+#if defined (SIGCHLD)
+  if (hostsig == SIGCHLD)
+    return TARGET_SIGNAL_CHLD;
+#endif
+#if defined (SIGPWR)
+  if (hostsig == SIGPWR)
+    return TARGET_SIGNAL_PWR;
+#endif
+#if defined (SIGWINCH)
+  if (hostsig == SIGWINCH)
+    return TARGET_SIGNAL_WINCH;
+#endif
+#if defined (SIGURG)
+  if (hostsig == SIGURG)
+    return TARGET_SIGNAL_URG;
+#endif
+#if defined (SIGIO)
+  if (hostsig == SIGIO)
+    return TARGET_SIGNAL_IO;
+#endif
+#if defined (SIGPOLL)
+  if (hostsig == SIGPOLL)
+    return TARGET_SIGNAL_POLL;
+#endif
+#if defined (SIGSTOP)
+  if (hostsig == SIGSTOP)
+    return TARGET_SIGNAL_STOP;
+#endif
+#if defined (SIGTSTP)
+  if (hostsig == SIGTSTP)
+    return TARGET_SIGNAL_TSTP;
+#endif
+#if defined (SIGCONT)
+  if (hostsig == SIGCONT)
+    return TARGET_SIGNAL_CONT;
+#endif
+#if defined (SIGTTIN)
+  if (hostsig == SIGTTIN)
+    return TARGET_SIGNAL_TTIN;
+#endif
+#if defined (SIGTTOU)
+  if (hostsig == SIGTTOU)
+    return TARGET_SIGNAL_TTOU;
+#endif
+#if defined (SIGVTALRM)
+  if (hostsig == SIGVTALRM)
+    return TARGET_SIGNAL_VTALRM;
+#endif
+#if defined (SIGPROF)
+  if (hostsig == SIGPROF)
+    return TARGET_SIGNAL_PROF;
+#endif
+#if defined (SIGXCPU)
+  if (hostsig == SIGXCPU)
+    return TARGET_SIGNAL_XCPU;
+#endif
+#if defined (SIGXFSZ)
+  if (hostsig == SIGXFSZ)
+    return TARGET_SIGNAL_XFSZ;
+#endif
+#if defined (SIGWIND)
+  if (hostsig == SIGWIND)
+    return TARGET_SIGNAL_WIND;
+#endif
+#if defined (SIGPHONE)
+  if (hostsig == SIGPHONE)
+    return TARGET_SIGNAL_PHONE;
+#endif
+#if defined (SIGLOST)
+  if (hostsig == SIGLOST)
+    return TARGET_SIGNAL_LOST;
+#endif
+#if defined (SIGWAITING)
+  if (hostsig == SIGWAITING)
+    return TARGET_SIGNAL_WAITING;
+#endif
+#if defined (SIGCANCEL)
+  if (hostsig == SIGCANCEL)
+    return TARGET_SIGNAL_CANCEL;
+#endif
+#if defined (SIGLWP)
+  if (hostsig == SIGLWP)
+    return TARGET_SIGNAL_LWP;
+#endif
+#if defined (SIGDANGER)
+  if (hostsig == SIGDANGER)
+    return TARGET_SIGNAL_DANGER;
+#endif
+#if defined (SIGGRANT)
+  if (hostsig == SIGGRANT)
+    return TARGET_SIGNAL_GRANT;
+#endif
+#if defined (SIGRETRACT)
+  if (hostsig == SIGRETRACT)
+    return TARGET_SIGNAL_RETRACT;
+#endif
+#if defined (SIGMSG)
+  if (hostsig == SIGMSG)
+    return TARGET_SIGNAL_MSG;
+#endif
+#if defined (SIGSOUND)
+  if (hostsig == SIGSOUND)
+    return TARGET_SIGNAL_SOUND;
+#endif
+#if defined (SIGSAK)
+  if (hostsig == SIGSAK)
+    return TARGET_SIGNAL_SAK;
+#endif
+#if defined (SIGPRIO)
+  if (hostsig == SIGPRIO)
+    return TARGET_SIGNAL_PRIO;
+#endif
+
+  /* Mach exceptions.  Assumes that the values for EXC_ are positive! */
+#if defined (EXC_BAD_ACCESS) && defined (_NSIG)
+  if (hostsig == _NSIG + EXC_BAD_ACCESS)
+    return TARGET_EXC_BAD_ACCESS;
+#endif
+#if defined (EXC_BAD_INSTRUCTION) && defined (_NSIG)
+  if (hostsig == _NSIG + EXC_BAD_INSTRUCTION)
+    return TARGET_EXC_BAD_INSTRUCTION;
+#endif
+#if defined (EXC_ARITHMETIC) && defined (_NSIG)
+  if (hostsig == _NSIG + EXC_ARITHMETIC)
+    return TARGET_EXC_ARITHMETIC;
+#endif
+#if defined (EXC_EMULATION) && defined (_NSIG)
+  if (hostsig == _NSIG + EXC_EMULATION)
+    return TARGET_EXC_EMULATION;
+#endif
+#if defined (EXC_SOFTWARE) && defined (_NSIG)
+  if (hostsig == _NSIG + EXC_SOFTWARE)
+    return TARGET_EXC_SOFTWARE;
+#endif
+#if defined (EXC_BREAKPOINT) && defined (_NSIG)
+  if (hostsig == _NSIG + EXC_BREAKPOINT)
+    return TARGET_EXC_BREAKPOINT;
+#endif
+
+#if defined (SIGINFO)
+  if (hostsig == SIGINFO)
+    return TARGET_SIGNAL_INFO;
+#endif
+
+#if defined (REALTIME_LO)
+  if (hostsig >= REALTIME_LO && hostsig < REALTIME_HI)
+    {
+      /* This block of TARGET_SIGNAL_REALTIME value is in order.  */
+      if (33 <= hostsig && hostsig <= 63)
+	return (enum target_signal)
+	  (hostsig - 33 + (int) TARGET_SIGNAL_REALTIME_33);
+      else if (hostsig == 32)
+	return TARGET_SIGNAL_REALTIME_32;
+      else if (64 <= hostsig && hostsig <= 127)
+	return (enum target_signal)
+	  (hostsig - 64 + (int) TARGET_SIGNAL_REALTIME_64);
+      else
+	error ("GDB bug: target.c (target_signal_from_host): unrecognized real-time signal");
+    }
+#endif
+
+#if defined (SIGRTMIN)
+  if (hostsig >= SIGRTMIN && hostsig <= SIGRTMAX)
+    {
+      /* This block of TARGET_SIGNAL_REALTIME value is in order.  */
+      if (33 <= hostsig && hostsig <= 63)
+	return (enum target_signal)
+	  (hostsig - 33 + (int) TARGET_SIGNAL_REALTIME_33);
+      else if (hostsig == 64)
+	return TARGET_SIGNAL_REALTIME_64;
+      else
+	error ("GDB bug: target.c (target_signal_from_host): unrecognized real-time signal");
+    }
+#endif
+  return TARGET_SIGNAL_UNKNOWN;
+}
+
+/* Convert a OURSIG (an enum target_signal) to the form used by the
+   target operating system (refered to as the ``host'') or zero if the
+   equivalent host signal is not available.  Set/clear OURSIG_OK
+   accordingly. */
+
+static int
+do_target_signal_to_host (enum target_signal oursig,
+			  int *oursig_ok)
+{
+  *oursig_ok = 1;
+  switch (oursig)
+    {
+    case TARGET_SIGNAL_0:
+      return 0;
+
+#if defined (SIGHUP)
+    case TARGET_SIGNAL_HUP:
+      return SIGHUP;
+#endif
+#if defined (SIGINT)
+    case TARGET_SIGNAL_INT:
+      return SIGINT;
+#endif
+#if defined (SIGQUIT)
+    case TARGET_SIGNAL_QUIT:
+      return SIGQUIT;
+#endif
+#if defined (SIGILL)
+    case TARGET_SIGNAL_ILL:
+      return SIGILL;
+#endif
+#if defined (SIGTRAP)
+    case TARGET_SIGNAL_TRAP:
+      return SIGTRAP;
+#endif
+#if defined (SIGABRT)
+    case TARGET_SIGNAL_ABRT:
+      return SIGABRT;
+#endif
+#if defined (SIGEMT)
+    case TARGET_SIGNAL_EMT:
+      return SIGEMT;
+#endif
+#if defined (SIGFPE)
+    case TARGET_SIGNAL_FPE:
+      return SIGFPE;
+#endif
+#if defined (SIGKILL)
+    case TARGET_SIGNAL_KILL:
+      return SIGKILL;
+#endif
+#if defined (SIGBUS)
+    case TARGET_SIGNAL_BUS:
+      return SIGBUS;
+#endif
+#if defined (SIGSEGV)
+    case TARGET_SIGNAL_SEGV:
+      return SIGSEGV;
+#endif
+#if defined (SIGSYS)
+    case TARGET_SIGNAL_SYS:
+      return SIGSYS;
+#endif
+#if defined (SIGPIPE)
+    case TARGET_SIGNAL_PIPE:
+      return SIGPIPE;
+#endif
+#if defined (SIGALRM)
+    case TARGET_SIGNAL_ALRM:
+      return SIGALRM;
+#endif
+#if defined (SIGTERM)
+    case TARGET_SIGNAL_TERM:
+      return SIGTERM;
+#endif
+#if defined (SIGUSR1)
+    case TARGET_SIGNAL_USR1:
+      return SIGUSR1;
+#endif
+#if defined (SIGUSR2)
+    case TARGET_SIGNAL_USR2:
+      return SIGUSR2;
+#endif
+#if defined (SIGCHLD) || defined (SIGCLD)
+    case TARGET_SIGNAL_CHLD:
+#if defined (SIGCHLD)
+      return SIGCHLD;
+#else
+      return SIGCLD;
+#endif
+#endif /* SIGCLD or SIGCHLD */
+#if defined (SIGPWR)
+    case TARGET_SIGNAL_PWR:
+      return SIGPWR;
+#endif
+#if defined (SIGWINCH)
+    case TARGET_SIGNAL_WINCH:
+      return SIGWINCH;
+#endif
+#if defined (SIGURG)
+    case TARGET_SIGNAL_URG:
+      return SIGURG;
+#endif
+#if defined (SIGIO)
+    case TARGET_SIGNAL_IO:
+      return SIGIO;
+#endif
+#if defined (SIGPOLL)
+    case TARGET_SIGNAL_POLL:
+      return SIGPOLL;
+#endif
+#if defined (SIGSTOP)
+    case TARGET_SIGNAL_STOP:
+      return SIGSTOP;
+#endif
+#if defined (SIGTSTP)
+    case TARGET_SIGNAL_TSTP:
+      return SIGTSTP;
+#endif
+#if defined (SIGCONT)
+    case TARGET_SIGNAL_CONT:
+      return SIGCONT;
+#endif
+#if defined (SIGTTIN)
+    case TARGET_SIGNAL_TTIN:
+      return SIGTTIN;
+#endif
+#if defined (SIGTTOU)
+    case TARGET_SIGNAL_TTOU:
+      return SIGTTOU;
+#endif
+#if defined (SIGVTALRM)
+    case TARGET_SIGNAL_VTALRM:
+      return SIGVTALRM;
+#endif
+#if defined (SIGPROF)
+    case TARGET_SIGNAL_PROF:
+      return SIGPROF;
+#endif
+#if defined (SIGXCPU)
+    case TARGET_SIGNAL_XCPU:
+      return SIGXCPU;
+#endif
+#if defined (SIGXFSZ)
+    case TARGET_SIGNAL_XFSZ:
+      return SIGXFSZ;
+#endif
+#if defined (SIGWIND)
+    case TARGET_SIGNAL_WIND:
+      return SIGWIND;
+#endif
+#if defined (SIGPHONE)
+    case TARGET_SIGNAL_PHONE:
+      return SIGPHONE;
+#endif
+#if defined (SIGLOST)
+    case TARGET_SIGNAL_LOST:
+      return SIGLOST;
+#endif
+#if defined (SIGWAITING)
+    case TARGET_SIGNAL_WAITING:
+      return SIGWAITING;
+#endif
+#if defined (SIGCANCEL)
+    case TARGET_SIGNAL_CANCEL:
+      return SIGCANCEL;
+#endif
+#if defined (SIGLWP)
+    case TARGET_SIGNAL_LWP:
+      return SIGLWP;
+#endif
+#if defined (SIGDANGER)
+    case TARGET_SIGNAL_DANGER:
+      return SIGDANGER;
+#endif
+#if defined (SIGGRANT)
+    case TARGET_SIGNAL_GRANT:
+      return SIGGRANT;
+#endif
+#if defined (SIGRETRACT)
+    case TARGET_SIGNAL_RETRACT:
+      return SIGRETRACT;
+#endif
+#if defined (SIGMSG)
+    case TARGET_SIGNAL_MSG:
+      return SIGMSG;
+#endif
+#if defined (SIGSOUND)
+    case TARGET_SIGNAL_SOUND:
+      return SIGSOUND;
+#endif
+#if defined (SIGSAK)
+    case TARGET_SIGNAL_SAK:
+      return SIGSAK;
+#endif
+#if defined (SIGPRIO)
+    case TARGET_SIGNAL_PRIO:
+      return SIGPRIO;
+#endif
+
+      /* Mach exceptions.  Assumes that the values for EXC_ are positive! */
+#if defined (EXC_BAD_ACCESS) && defined (_NSIG)
+    case TARGET_EXC_BAD_ACCESS:
+      return _NSIG + EXC_BAD_ACCESS;
+#endif
+#if defined (EXC_BAD_INSTRUCTION) && defined (_NSIG)
+    case TARGET_EXC_BAD_INSTRUCTION:
+      return _NSIG + EXC_BAD_INSTRUCTION;
+#endif
+#if defined (EXC_ARITHMETIC) && defined (_NSIG)
+    case TARGET_EXC_ARITHMETIC:
+      return _NSIG + EXC_ARITHMETIC;
+#endif
+#if defined (EXC_EMULATION) && defined (_NSIG)
+    case TARGET_EXC_EMULATION:
+      return _NSIG + EXC_EMULATION;
+#endif
+#if defined (EXC_SOFTWARE) && defined (_NSIG)
+    case TARGET_EXC_SOFTWARE:
+      return _NSIG + EXC_SOFTWARE;
+#endif
+#if defined (EXC_BREAKPOINT) && defined (_NSIG)
+    case TARGET_EXC_BREAKPOINT:
+      return _NSIG + EXC_BREAKPOINT;
+#endif
+
+#if defined (SIGINFO)
+    case TARGET_SIGNAL_INFO:
+      return SIGINFO;
+#endif
+
+    default:
+#if defined (REALTIME_LO)
+      if (oursig >= TARGET_SIGNAL_REALTIME_33
+	  && oursig <= TARGET_SIGNAL_REALTIME_63)
+	{
+	  /* This block of signals is continuous, and
+             TARGET_SIGNAL_REALTIME_33 is 33 by definition.  */
+	  int retsig =
+	    (int) oursig - (int) TARGET_SIGNAL_REALTIME_33 + 33;
+	  if (retsig >= REALTIME_LO && retsig < REALTIME_HI)
+	    return retsig;
+	}
+#if (REALTIME_LO < 33)
+      else if (oursig == TARGET_SIGNAL_REALTIME_32)
+	{
+	  /* TARGET_SIGNAL_REALTIME_32 isn't contiguous with
+             TARGET_SIGNAL_REALTIME_33.  It is 32 by definition.  */
+	  return 32;
+	}
+#endif
+#if (REALTIME_HI > 64)
+      if (oursig >= TARGET_SIGNAL_REALTIME_64
+	  && oursig <= TARGET_SIGNAL_REALTIME_127)
+	{
+	  /* This block of signals is continuous, and
+             TARGET_SIGNAL_REALTIME_64 is 64 by definition.  */
+	  int retsig =
+	    (int) oursig - (int) TARGET_SIGNAL_REALTIME_64 + 64;
+	  if (retsig >= REALTIME_LO && retsig < REALTIME_HI)
+	    return retsig;
+	}
+      
+#endif
+#endif
+
+#if defined (SIGRTMIN)
+      if (oursig >= TARGET_SIGNAL_REALTIME_33
+	  && oursig <= TARGET_SIGNAL_REALTIME_63)
+	{
+	  /* This block of signals is continuous, and
+             TARGET_SIGNAL_REALTIME_33 is 33 by definition.  */
+	  int retsig =
+	    (int) oursig - (int) TARGET_SIGNAL_REALTIME_33 + 33;
+	  if (retsig >= SIGRTMIN && retsig <= SIGRTMAX)
+	    return retsig;
+	}
+      else if (oursig == TARGET_SIGNAL_REALTIME_64)
+	return 64;
+#endif
+      *oursig_ok = 0;
+      return 0;
+    }
+}
+
+int
+target_signal_to_host_p (enum target_signal oursig)
+{
+  int oursig_ok;
+  do_target_signal_to_host (oursig, &oursig_ok);
+  return oursig_ok;
+}
+
+int
+target_signal_to_host (enum target_signal oursig)
+{
+  int oursig_ok;
+  int targ_signo = do_target_signal_to_host (oursig, &oursig_ok);
+  if (!oursig_ok)
+    return 0;
+  else
+    return targ_signo;
+}
Index: remote-utils.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/remote-utils.c,v
retrieving revision 1.7
diff -u -r1.7 remote-utils.c
--- remote-utils.c	2001/07/12 21:04:35	1.7
+++ remote-utils.c	2001/07/19 18:50:33
@@ -459,17 +459,15 @@
 void
 prepare_resume_reply (char *buf, char status, unsigned char signo)
 {
-  int nib;
+  int nib, sig;
 
   *buf++ = status;
 
-  /* FIXME!  Should be converting this signal number (numbered
-     according to the signal numbering of the system we are running on)
-     to the signal numbers used by the gdb protocol (see enum target_signal
-     in gdb/target.h).  */
-  nib = ((signo & 0xf0) >> 4);
+  sig = (int)target_signal_from_host (signo);
+
+  nib = ((sig & 0xf0) >> 4);
   *buf++ = tohex (nib);
-  nib = signo & 0x0f;
+  nib = sig & 0x0f;
   *buf++ = tohex (nib);
 
   if (status == 'T')
Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/Makefile.in,v
retrieving revision 1.3
diff -u -r1.3 Makefile.in
--- Makefile.in	2001/03/06 08:21:43	1.3
+++ Makefile.in	2001/07/19 18:51:48
@@ -137,7 +137,7 @@
 SOURCES = $(SFILES) $(ALLDEPFILES)
 TAGFILES = $(SOURCES) ${HFILES} ${ALLPARAM} ${POSSLIBS} 
 
-OBS = utils.o $(GDBSERVER_DEPFILES) server.o remote-utils.o
+OBS = utils.o $(GDBSERVER_DEPFILES) server.o remote-utils.o signals.o
 
 # Prevent Sun make from putting in the machine type.  Setting
 # TARGET_ARCH to nothing works for SunOS 3, 4.0, but not for 4.1.
Index: gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.44
diff -u -r1.44 gdb.texinfo
--- gdb.texinfo	2001/07/06 04:07:29	1.44
+++ gdb.texinfo	2001/07/19 18:56:55
@@ -10211,8 +10211,8 @@
 receive any of the below as a reply.  In the case of the @samp{C},
 @samp{c}, @samp{S} and @samp{s} packets, that reply is only returned
 when the target halts.  In the below the exact meaning of @samp{signal
-number} is poorly defined.  In general one of the UNIX signal numbering
-conventions is used.
+number} is defined by the type @code{enum target_signal}.  For the most
+common signals this corresponds to the UNIX signal numbering conventions.
 
 @multitable @columnfractions .4 .6
 


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

* Re: [rfa] gdbserver 2/n - signals
  2001-07-19 12:01 [rfa] gdbserver 2/n - signals Daniel Jacobowitz
@ 2001-07-19 14:00 ` Andrew Cagney
  2001-07-19 14:17   ` Daniel Jacobowitz
  0 siblings, 1 reply; 15+ messages in thread
From: Andrew Cagney @ 2001-07-19 14:00 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches

Daniel,

Things I noticed from a brief glance:

o 
I think you'll also need to change
	gdbserver/remote-utils.c:prepare_resume_reply().

o 
I don't understand the need for the file
	gdbserver/signals.c.  Isn't that what
	gdb/signals.c is for?

o 
What are your cleanup plans for gdb/signals.c
	- signals.h? s/STREQ/.../?

I take it you've also got a few more steps planned, can you give a quick 
sketch of where you're going?

	Andrew


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

* Re: [rfa] gdbserver 2/n - signals
  2001-07-19 14:00 ` Andrew Cagney
@ 2001-07-19 14:17   ` Daniel Jacobowitz
  2001-07-19 14:49     ` Andrew Cagney
  2001-07-19 17:22     ` Kevin Buettner
  0 siblings, 2 replies; 15+ messages in thread
From: Daniel Jacobowitz @ 2001-07-19 14:17 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb-patches

On Thu, Jul 19, 2001 at 05:00:13PM -0400, Andrew Cagney wrote:
> Daniel,
> 
> Things I noticed from a brief glance:
> 
> o 
> I think you'll also need to change
> 	gdbserver/remote-utils.c:prepare_resume_reply().

        * gdbserver/remote-utils.c (prepare_resume_reply): Call                                         
        target_signal_from_host on signals sent to the remote.                                          
It was there.

> o 
> I don't understand the need for the file
> 	gdbserver/signals.c.  Isn't that what
> 	gdb/signals.c is for?

I was going to use that, except for a few small problems:
 - wasted space, a couple of functions and the large name table.
   I'm not really bothered by this one.
 - warning() and internal_error() calls, which gdbserver doesn't
   provide.

Perhaps re-using it despite those minor hurdles would be wiser.  I'll
tweak the patch.

> o 
> What are your cleanup plans for gdb/signals.c
> 	- signals.h? s/STREQ/.../?

Nothing terribly complicated:
  - Removing the MACH #ifdefs, or at least changing.  The values of
    things in the target_signal enum change depending on preprocessor
    conditionals, which is no good for a protocol.
  - a few minor typo cleanups, in comments
  - removing <signal.h> from target.c, after verifying that I got
    everything I meant to get out of that file.

Adding a signals.h would be nice too, yes.  And fixing that lone STREQ.

> I take it you've also got a few more steps planned, can you give a quick 
> sketch of where you're going?

Short term: enough to make gdbserver compile on any targets it still
currently builds on (I have no clue which these are, for lack of test
hosts on many of the types) as well as more Linux targets.  If you're
willing, I'd like to do this somewhat messily and before the release of
5.1.  It doesn't matter too much to me, since I've got no real
compunctions about shipping a CVS snapshot instead, but it goes against
my instincts to let gdbserver out the door building on so many fewer
targets than it did in 5.0.

What I envision from here, longer term:
  - gdbserver registers cleanup.  This will mean precisely defining,
    according to present usage, the register packets of every
    gdbserver-supported target, or at least the ones I can test or
    find someone to test for me.  A lot of documentation; a lot of
    duplicate code elimination in gdbserver.  I'm also going to try to
    define the gdbserver register layout in such a way that GDB can use
    it too (possibly by your flexible string description approach, or
    just a shared structure).

  - remote architecture query; I'm not yet sure what information it
    will be able to or should provide, but I think this is definitely
    the way to go.  Connect to a remote target and gdb figures out what
    processor and ISA/ABI we're dealing with from the stub.

There's a lot of documentation work in there, also.

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer


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

* Re: [rfa] gdbserver 2/n - signals
  2001-07-19 14:17   ` Daniel Jacobowitz
@ 2001-07-19 14:49     ` Andrew Cagney
  2001-07-19 14:52       ` Daniel Jacobowitz
  2001-07-19 17:22     ` Kevin Buettner
  1 sibling, 1 reply; 15+ messages in thread
From: Andrew Cagney @ 2001-07-19 14:49 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches

> 
> I was going to use that, except for a few small problems:
>  - wasted space, a couple of functions and the large name table.
>    I'm not really bothered by this one.
>  - warning() and internal_error() calls, which gdbserver doesn't
>    provide.
> 
> Perhaps re-using it despite those minor hurdles would be wiser.  I'll
> tweak the patch.


The compiler/linker should be able to eliminate the unused code (can 
GCC?).  Adding warning() and internal_error() wouldn't hurt.

	Andrew




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

* Re: [rfa] gdbserver 2/n - signals
  2001-07-19 14:49     ` Andrew Cagney
@ 2001-07-19 14:52       ` Daniel Jacobowitz
  2001-07-19 15:21         ` Andrew Cagney
  2001-07-20  0:32         ` Eli Zaretskii
  0 siblings, 2 replies; 15+ messages in thread
From: Daniel Jacobowitz @ 2001-07-19 14:52 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb-patches

On Thu, Jul 19, 2001 at 05:48:57PM -0400, Andrew Cagney wrote:
> > 
> > I was going to use that, except for a few small problems:
> >  - wasted space, a couple of functions and the large name table.
> >    I'm not really bothered by this one.
> >  - warning() and internal_error() calls, which gdbserver doesn't
> >    provide.
> > 
> > Perhaps re-using it despite those minor hurdles would be wiser.  I'll
> > tweak the patch.
> 
> 
> The compiler/linker should be able to eliminate the unused code (can 
> GCC?).  Adding warning() and internal_error() wouldn't hurt.

Only if you're using -ffunction-sections.  Otherwise you're stuck with
the whole object file.  At least, I think so...

This better?

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer

2001-07-19  Daniel Jacobowitz  <drow@mvista.com>

	* gdbserver/server.c (main): Call target_signal_to_host_p
	and target_signal_to_host on signals received from the remote.
	* gdbserver/remote-utils.c (prepare_resume_reply): Call
	target_signal_from_host on signals sent to the remote.
	* gdbserver/Makefile.in: Add signals.o, built from
	the parent directory.

2001-07-19  Daniel Jacobowitz  <drow@mvista.com>

	* gdb.texinfo (Protocol): Mention that signal numbers
	are defined by the target_signal enum.

Index: gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.44
diff -u -r1.44 gdb.texinfo
--- gdb.texinfo	2001/07/06 04:07:29	1.44
+++ gdb.texinfo	2001/07/19 18:56:55
@@ -10211,8 +10211,8 @@
 receive any of the below as a reply.  In the case of the @samp{C},
 @samp{c}, @samp{S} and @samp{s} packets, that reply is only returned
 when the target halts.  In the below the exact meaning of @samp{signal
-number} is poorly defined.  In general one of the UNIX signal numbering
-conventions is used.
+number} is defined by the type @code{enum target_signal}.  For the most
+common signals this corresponds to the UNIX signal numbering conventions.
 
 @multitable @columnfractions .4 .6
Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/Makefile.in,v
retrieving revision 1.3
diff -u -r1.3 Makefile.in
--- Makefile.in	2001/03/06 08:21:43	1.3
+++ Makefile.in	2001/07/19 21:41:43
@@ -137,7 +137,7 @@
 SOURCES = $(SFILES) $(ALLDEPFILES)
 TAGFILES = $(SOURCES) ${HFILES} ${ALLPARAM} ${POSSLIBS} 
 
-OBS = utils.o $(GDBSERVER_DEPFILES) server.o remote-utils.o
+OBS = utils.o $(GDBSERVER_DEPFILES) server.o remote-utils.o signals.o
 
 # Prevent Sun make from putting in the machine type.  Setting
 # TARGET_ARCH to nothing works for SunOS 3, 4.0, but not for 4.1.
@@ -247,5 +247,7 @@
 low-sun3.o : $(srcdir)/low-sun3.c $(srcdir)/server.h
 low-hppabsd.o : $(srcdir)/low-hppabsd.c $(srcdir)/server.h
 utils.o : ${srcdir}/utils.c ${srcdir}/server.h
+signals.o : ${srcdir}/../signals.c
+	${CC} -c ${INTERNAL_CFLAGS} $<
 
 # This is the end of "Makefile.in".
Index: remote-utils.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/remote-utils.c,v
retrieving revision 1.7
diff -u -r1.7 remote-utils.c
--- remote-utils.c	2001/07/12 21:04:35	1.7
+++ remote-utils.c	2001/07/19 21:41:47
@@ -459,17 +459,15 @@
 void
 prepare_resume_reply (char *buf, char status, unsigned char signo)
 {
-  int nib;
+  int nib, sig;
 
   *buf++ = status;
 
-  /* FIXME!  Should be converting this signal number (numbered
-     according to the signal numbering of the system we are running on)
-     to the signal numbers used by the gdb protocol (see enum target_signal
-     in gdb/target.h).  */
-  nib = ((signo & 0xf0) >> 4);
+  sig = (int)target_signal_from_host (signo);
+
+  nib = ((sig & 0xf0) >> 4);
   *buf++ = tohex (nib);
-  nib = signo & 0x0f;
+  nib = sig & 0x0f;
   *buf++ = tohex (nib);
 
   if (status == 'T')
Index: server.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/server.c,v
retrieving revision 1.3
diff -u -r1.3 server.c
--- server.c	2001/03/06 08:21:44	1.3
+++ server.c	2001/07/19 21:41:47
@@ -130,13 +133,21 @@
 	      break;
 	    case 'C':
 	      convert_ascii_to_int (own_buf + 1, &sig, 1);
-	      myresume (0, sig);
+	      if (target_signal_to_host_p (sig))
+		signal = target_signal_to_host (sig);
+	      else
+		signal = 0;
+	      myresume (0, signal);
 	      signal = mywait (&status);
 	      prepare_resume_reply (own_buf, status, signal);
 	      break;
 	    case 'S':
 	      convert_ascii_to_int (own_buf + 1, &sig, 1);
-	      myresume (1, sig);
+	      if (target_signal_to_host_p (sig))
+		signal = target_signal_to_host (sig);
+	      else
+		signal = 0;
+	      myresume (1, signal);
 	      signal = mywait (&status);
 	      prepare_resume_reply (own_buf, status, signal);
 	      break;
Index: utils.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/utils.c,v
retrieving revision 1.4
diff -u -r1.4 utils.c
--- utils.c	2001/03/06 08:21:44	1.4
+++ utils.c	2001/07/19 21:41:47
@@ -53,6 +53,21 @@
   error ("%s.", combined);
 }
 
+/* Print a warning message.
+   The first argument STRING is the warning message, used as a fprintf string,
+   and the remaining args are passed as arguments to it.
+   The primary difference between warnings and errors is that a warning
+   does not force the return to command level.  */
+void
+warning (const char *string,...)
+{
+  va_list args;
+  va_start (args, string);
+  fflush (stdout);
+  vfprintf (stderr, string, args);
+  fprintf (stderr, "\n");
+}
+
 /* Print an error message and return to command level.
    STRING is the error message, used as a fprintf string,
    and ARG is passed as an argument to it.  */
@@ -84,4 +99,16 @@
   fprintf (stderr, "\n");
   va_end (args);
   exit (1);
+}
+
+void
+internal_error (const char *file, int line, const char *string, ...)
+{
+  va_list args;
+  va_start (args, string);
+  fprintf (stderr, "gdb internal error (%s:%d): ", file, line);
+  vfprintf (stderr, string, args);
+  fprintf (stderr, "\n");
+  va_end (args);
+  exit (1);  
 }


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

* Re: [rfa] gdbserver 2/n - signals
  2001-07-19 14:52       ` Daniel Jacobowitz
@ 2001-07-19 15:21         ` Andrew Cagney
  2001-07-20  0:32         ` Eli Zaretskii
  1 sibling, 0 replies; 15+ messages in thread
From: Andrew Cagney @ 2001-07-19 15:21 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches

> On Thu, Jul 19, 2001 at 05:48:57PM -0400, Andrew Cagney wrote:
> 
>> > 
>> > I was going to use that, except for a few small problems:
>> > - wasted space, a couple of functions and the large name table.
>> > I'm not really bothered by this one.
>> > - warning() and internal_error() calls, which gdbserver doesn't
>> > provide.
>> > 
>> > Perhaps re-using it despite those minor hurdles would be wiser.  I'll
>> > tweak the patch.
> 
>> 
>> 
>> The compiler/linker should be able to eliminate the unused code (can 
>> GCC?).  Adding warning() and internal_error() wouldn't hurt.
> 
> 
> Only if you're using -ffunction-sections.  Otherwise you're stuck with
> the whole object file.  At least, I think so...


If someone is that despearate about the size of their executable, the'll 
be using -ffunction-sections regardless :-)


> This better?


looks ok with me.  You may want to see of J.T. has any comments about 
gdbserver and definitly Eli about the documentation.

	Andrew

> 2001-07-19  Daniel Jacobowitz  <drow@mvista.com>
> 
> * gdbserver/server.c (main): Call target_signal_to_host_p
> 	and target_signal_to_host on signals received from the remote.
> 	* gdbserver/remote-utils.c (prepare_resume_reply): Call
> 	target_signal_from_host on signals sent to the remote.
> 	* gdbserver/Makefile.in: Add signals.o, built from
> 	the parent directory.
> 
> 2001-07-19  Daniel Jacobowitz  <drow@mvista.com>
> 
> * gdb.texinfo (Protocol): Mention that signal numbers
> 	are defined by the target_signal enum.





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

* Re: [rfa] gdbserver 2/n - signals
  2001-07-19 14:17   ` Daniel Jacobowitz
  2001-07-19 14:49     ` Andrew Cagney
@ 2001-07-19 17:22     ` Kevin Buettner
  1 sibling, 0 replies; 15+ messages in thread
From: Kevin Buettner @ 2001-07-19 17:22 UTC (permalink / raw)
  To: Daniel Jacobowitz, Andrew Cagney; +Cc: gdb-patches

On Jul 19,  2:17pm, Daniel Jacobowitz wrote:

> > o 
> > I don't understand the need for the file
> > 	gdbserver/signals.c.  Isn't that what
> > 	gdb/signals.c is for?
> 
> I was going to use that, except for a few small problems:
>  - wasted space, a couple of functions and the large name table.
>    I'm not really bothered by this one.
>  - warning() and internal_error() calls, which gdbserver doesn't
>    provide.
> 
> Perhaps re-using it despite those minor hurdles would be wiser.  I'll
> tweak the patch.

I'm not convinced that it's a good idea to share code between gdb and
gdbserver.  The problem with sharing code is that it's really easy to
break gdbserver if you're not careful.  I think it might be better to
revamp gdbserver so that it shares no code in common with gdb.

The other alternative is to go to the other extreme and attempt to do
maximal sharing.  But I think this will be harder to do and I suspect
the end result will be much less useful than some people think.  I
used gdbserver a while back to do the initial development of the IA-64
port.  I really liked it that gdbserver was small and required very
little work to bring up on a new machine.  I think we should continue
to strive to keep gdbserver as small as possible.

Kevin


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

* Re: [rfa] gdbserver 2/n - signals
  2001-07-19 14:52       ` Daniel Jacobowitz
  2001-07-19 15:21         ` Andrew Cagney
@ 2001-07-20  0:32         ` Eli Zaretskii
  2001-07-20  8:33           ` Daniel Jacobowitz
  1 sibling, 1 reply; 15+ messages in thread
From: Eli Zaretskii @ 2001-07-20  0:32 UTC (permalink / raw)
  To: dmj+; +Cc: ac131313, gdb-patches

> Date: Thu, 19 Jul 2001 14:52:37 -0700
> From: Daniel Jacobowitz <dmj+@andrew.cmu.edu>
> 
> 2001-07-19  Daniel Jacobowitz  <drow@mvista.com>
> 
> 	* gdb.texinfo (Protocol): Mention that signal numbers
> 	are defined by the target_signal enum.
> 
> Index: gdb.texinfo
> ===================================================================
> RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
> retrieving revision 1.44
> diff -u -r1.44 gdb.texinfo
> --- gdb.texinfo	2001/07/06 04:07:29	1.44
> +++ gdb.texinfo	2001/07/19 18:56:55
> @@ -10211,8 +10211,8 @@
>  receive any of the below as a reply.  In the case of the @samp{C},
>  @samp{c}, @samp{S} and @samp{s} packets, that reply is only returned
>  when the target halts.  In the below the exact meaning of @samp{signal
> -number} is poorly defined.  In general one of the UNIX signal numbering
> -conventions is used.
> +number} is defined by the type @code{enum target_signal}.  For the most
> +common signals this corresponds to the UNIX signal numbering conventions.

I don't really understand the rationale for this change.  This is a
user's manual; why should it matter to a user to know the name of the
enum which defines signal numbers?  I don't see how it makes the issue
better defined (since you removed the ``poorly defined'' phrase).

If we do want to leave the `enum target_signal' info in the manual, at
the very least please say what source file is that defined on.


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

* Re: [rfa] gdbserver 2/n - signals
  2001-07-20  0:32         ` Eli Zaretskii
@ 2001-07-20  8:33           ` Daniel Jacobowitz
  2001-07-20 11:31             ` Eli Zaretskii
  2001-07-20 16:42             ` Andrew Cagney
  0 siblings, 2 replies; 15+ messages in thread
From: Daniel Jacobowitz @ 2001-07-20  8:33 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: ac131313, gdb-patches

On Fri, Jul 20, 2001 at 10:31:08AM +0300, Eli Zaretskii wrote:
> > Date: Thu, 19 Jul 2001 14:52:37 -0700
> > From: Daniel Jacobowitz <dmj+@andrew.cmu.edu>
> > 
> > 2001-07-19  Daniel Jacobowitz  <drow@mvista.com>
> > 
> > 	* gdb.texinfo (Protocol): Mention that signal numbers
> > 	are defined by the target_signal enum.
> > 
> > Index: gdb.texinfo
> > ===================================================================
> > RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
> > retrieving revision 1.44
> > diff -u -r1.44 gdb.texinfo
> > --- gdb.texinfo	2001/07/06 04:07:29	1.44
> > +++ gdb.texinfo	2001/07/19 18:56:55
> > @@ -10211,8 +10211,8 @@
> >  receive any of the below as a reply.  In the case of the @samp{C},
> >  @samp{c}, @samp{S} and @samp{s} packets, that reply is only returned
> >  when the target halts.  In the below the exact meaning of @samp{signal
> > -number} is poorly defined.  In general one of the UNIX signal numbering
> > -conventions is used.
> > +number} is defined by the type @code{enum target_signal}.  For the most
> > +common signals this corresponds to the UNIX signal numbering conventions.
> 
> I don't really understand the rationale for this change.  This is a
> user's manual; why should it matter to a user to know the name of the
> enum which defines signal numbers?  I don't see how it makes the issue
> better defined (since you removed the ``poorly defined'' phrase).
> 
> If we do want to leave the `enum target_signal' info in the manual, at
> the very least please say what source file is that defined on.

Well, the way I see it is that the signal numbering convention is part
of the remote protocol, and so should be documented in the manual; at
the same time I didn't really want to duplicate the hundred and
something signals inline in the texinfo documentation.

I don't really understand why the remote protocol is documented in the
user's manual, either :)


-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer


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

* Re: [rfa] gdbserver 2/n - signals
  2001-07-20  8:33           ` Daniel Jacobowitz
@ 2001-07-20 11:31             ` Eli Zaretskii
  2001-07-20 11:34               ` Daniel Jacobowitz
  2001-07-20 16:48               ` Andrew Cagney
  2001-07-20 16:42             ` Andrew Cagney
  1 sibling, 2 replies; 15+ messages in thread
From: Eli Zaretskii @ 2001-07-20 11:31 UTC (permalink / raw)
  To: dmj+; +Cc: ac131313, gdb-patches

> Date: Fri, 20 Jul 2001 08:32:49 -0700
> From: Daniel Jacobowitz <dmj+@andrew.cmu.edu>
> > 
> > I don't really understand the rationale for this change.  This is a
> > user's manual; why should it matter to a user to know the name of the
> > enum which defines signal numbers?  I don't see how it makes the issue
> > better defined (since you removed the ``poorly defined'' phrase).
> > 
> > If we do want to leave the `enum target_signal' info in the manual, at
> > the very least please say what source file is that defined on.
> 
> Well, the way I see it is that the signal numbering convention is part
> of the remote protocol, and so should be documented in the manual; at
> the same time I didn't really want to duplicate the hundred and
> something signals inline in the texinfo documentation.

Then perhaps this info shouldn't be in the manual.

> I don't really understand why the remote protocol is documented in the
> user's manual, either :)

There's a difference between documenting a protocol and talking about
enumerations from GDB sources.


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

* Re: [rfa] gdbserver 2/n - signals
  2001-07-20 11:31             ` Eli Zaretskii
@ 2001-07-20 11:34               ` Daniel Jacobowitz
  2001-07-21  0:38                 ` Eli Zaretskii
  2001-07-20 16:48               ` Andrew Cagney
  1 sibling, 1 reply; 15+ messages in thread
From: Daniel Jacobowitz @ 2001-07-20 11:34 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: ac131313, gdb-patches

On Fri, Jul 20, 2001 at 09:31:36PM +0300, Eli Zaretskii wrote:
> > Well, the way I see it is that the signal numbering convention is part
> > of the remote protocol, and so should be documented in the manual; at
> > the same time I didn't really want to duplicate the hundred and
> > something signals inline in the texinfo documentation.
> 
> Then perhaps this info shouldn't be in the manual.
> 
> > I don't really understand why the remote protocol is documented in the
> > user's manual, either :)
> 
> There's a difference between documenting a protocol and talking about
> enumerations from GDB sources.

The signal numbers are a part of the protocol.  I think they should be
documented somewhere beside GDB source; would you prefer that I simply
list them in the manual somewhere?

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer


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

* Re: [rfa] gdbserver 2/n - signals
  2001-07-20  8:33           ` Daniel Jacobowitz
  2001-07-20 11:31             ` Eli Zaretskii
@ 2001-07-20 16:42             ` Andrew Cagney
  1 sibling, 0 replies; 15+ messages in thread
From: Andrew Cagney @ 2001-07-20 16:42 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: Eli Zaretskii, gdb-patches

> 
> Well, the way I see it is that the signal numbering convention is part
> of the remote protocol, and so should be documented in the manual; at
> the same time I didn't really want to duplicate the hundred and
> something signals inline in the texinfo documentation.


> I don't really understand why the remote protocol is documented in the
> user's manual, either :)


The user guide documents public interfaces and the protocol is a public 
interface.  Check the e-mail archives for more detailed rationale.

	Andrew




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

* Re: [rfa] gdbserver 2/n - signals
  2001-07-20 11:31             ` Eli Zaretskii
  2001-07-20 11:34               ` Daniel Jacobowitz
@ 2001-07-20 16:48               ` Andrew Cagney
  2001-07-21  1:04                 ` Eli Zaretskii
  1 sibling, 1 reply; 15+ messages in thread
From: Andrew Cagney @ 2001-07-20 16:48 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: dmj+, gdb-patches

>> Date: Fri, 20 Jul 2001 08:32:49 -0700
>> From: Daniel Jacobowitz <dmj+@andrew.cmu.edu>
> 
>> > 
>> > I don't really understand the rationale for this change.  This is a
>> > user's manual; why should it matter to a user to know the name of the
>> > enum which defines signal numbers?  I don't see how it makes the issue
>> > better defined (since you removed the ``poorly defined'' phrase).
>> > 
>> > If we do want to leave the `enum target_signal' info in the manual, at
>> > the very least please say what source file is that defined on.
> 
>> 
>> Well, the way I see it is that the signal numbering convention is part
>> of the remote protocol, and so should be documented in the manual; at
>> the same time I didn't really want to duplicate the hundred and
>> something signals inline in the texinfo documentation.
> 
> 
> Then perhaps this info shouldn't be in the manual.


Something needs to be documented - a recent question on the bug-gdb list 
about those exact values confirms this.

Perhaphs list the values that GDB treats as significant - $SIGNONE, 
$SIGBREAK, $SIGINT and a reference to the file.

	Andrew


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

* Re: [rfa] gdbserver 2/n - signals
  2001-07-20 11:34               ` Daniel Jacobowitz
@ 2001-07-21  0:38                 ` Eli Zaretskii
  0 siblings, 0 replies; 15+ messages in thread
From: Eli Zaretskii @ 2001-07-21  0:38 UTC (permalink / raw)
  To: dmj+; +Cc: ac131313, gdb-patches

> Date: Fri, 20 Jul 2001 11:34:29 -0700
> From: Daniel Jacobowitz <dmj+@andrew.cmu.edu>
> 
> The signal numbers are a part of the protocol.  I think they should be
> documented somewhere beside GDB source; would you prefer that I simply
> list them in the manual somewhere?

If we want the users to know the numbers, let's document them
explicitly, or at least some important part of them.

But I don't really understand the need for documenting that; see my
other message.


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

* Re: [rfa] gdbserver 2/n - signals
  2001-07-20 16:48               ` Andrew Cagney
@ 2001-07-21  1:04                 ` Eli Zaretskii
  0 siblings, 0 replies; 15+ messages in thread
From: Eli Zaretskii @ 2001-07-21  1:04 UTC (permalink / raw)
  To: ac131313; +Cc: dmj+, gdb-patches

> Date: Fri, 20 Jul 2001 19:48:46 -0400
> From: Andrew Cagney <ac131313@cygnus.com>
> 
> Something needs to be documented - a recent question on the bug-gdb list 
> about those exact values confirms this.

I was unable to find the message with such a question.  Could you
point me to it?  Thanks.


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

end of thread, other threads:[~2001-07-21  1:04 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-19 12:01 [rfa] gdbserver 2/n - signals Daniel Jacobowitz
2001-07-19 14:00 ` Andrew Cagney
2001-07-19 14:17   ` Daniel Jacobowitz
2001-07-19 14:49     ` Andrew Cagney
2001-07-19 14:52       ` Daniel Jacobowitz
2001-07-19 15:21         ` Andrew Cagney
2001-07-20  0:32         ` Eli Zaretskii
2001-07-20  8:33           ` Daniel Jacobowitz
2001-07-20 11:31             ` Eli Zaretskii
2001-07-20 11:34               ` Daniel Jacobowitz
2001-07-21  0:38                 ` Eli Zaretskii
2001-07-20 16:48               ` Andrew Cagney
2001-07-21  1:04                 ` Eli Zaretskii
2001-07-20 16:42             ` Andrew Cagney
2001-07-19 17:22     ` Kevin Buettner

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