From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10609 invoked by alias); 9 May 2002 22:22:36 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 10599 invoked from network); 9 May 2002 22:22:27 -0000 Received: from unknown (HELO nevyn.them.org) (128.2.145.6) by sources.redhat.com with SMTP; 9 May 2002 22:22:27 -0000 Received: from drow by nevyn.them.org with local (Exim 3.35 #1 (Debian)) id 175wIu-0002ci-00 for ; Thu, 09 May 2002 18:22:28 -0400 Date: Thu, 09 May 2002 15:22:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sources.redhat.com Subject: Re: [rfa] Always define all of TARGET_SIGNAL_* Message-ID: <20020509222228.GA14492@nevyn.them.org> Mail-Followup-To: gdb-patches@sources.redhat.com References: <20020227221148.A30753@nevyn.them.org> <3C7E456C.6090605@cygnus.com> <20020228115139.A8496@nevyn.them.org> <3C7E6634.4010209@cygnus.com> <20020310192038.A14083@nevyn.them.org> <3C8D68D8.8050403@cygnus.com> <20020311214925.C462@nevyn.them.org> <3C8D7D78.10805@cygnus.com> <20020316212737.A1589@nevyn.them.org> <3C94017B.2070201@cygnus.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3C94017B.2070201@cygnus.com> User-Agent: Mutt/1.5.1i X-SW-Source: 2002-05/txt/msg00297.txt.bz2 On Sat, Mar 16, 2002 at 09:37:47PM -0500, Andrew Cagney wrote: > >I'm thinking of the net effect pulling both this patch and the other > >>pending signal patch onto the 5.1 would have. (I'm not sure if you ment > >>this or that I was confusing this patch with the other pending patches :-) > > > > > >The only patch I'd particularly like in 5.2 (not 5.1 :)) is the one to > >make gdbserver use signals.h, which I was going to address after this > >one was done (just to reduce confusion, not because of any dependence). > >I personally believe that pulling the others, particularly this one, > >into 5.2 will do no more harm than pulling them into the trunk; every > >day we leave them there is just a greater chance they'll be used this > >way. > > I'm certaionly ok with (re-)pulling include/gdb/signals.h and > include/gdbserver into the 5.2 branch - just as long as core GDB on the > branch doesn't get modified to use them. This is also why I think > sitting on this enum patch until 5.2 is released is best/easiest. Since both of these happened... > As for what you posted, yep ok. But after 5.2 :-) Perhaphs a bug > report so it isn't forgotten. Committed, thanks. -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer 2002-05-09 Daniel Jacobowitz * signals.h: Update comments. (enum target_signal): Remove conditional compilation around Mach-specific signals. Move them to after TARGET_SIGNAL_DEFAULT. 2002-05-09 Daniel Jacobowitz * signals/signals.c (signals): Remove conditional compilation around Mach-specific signals. Move them to after TARGET_SIGNAL_DEFAULT. (target_signal_from_name): Loop until TARGET_SIGNAL_LAST. Index: gdb/signals/signals.c =================================================================== RCS file: /cvs/src/src/gdb/signals/signals.c,v retrieving revision 1.2 diff -u -p -r1.2 signals.c --- gdb/signals/signals.c 27 Mar 2002 05:12:35 -0000 1.2 +++ gdb/signals/signals.c 9 May 2002 22:18:45 -0000 @@ -180,7 +180,11 @@ static struct { {"SIG126", "Real-time event 126"}, {"SIG127", "Real-time event 127"}, -#if defined(MACH) || defined(__MACH__) + {"SIGINFO", "Information request"}, + + {NULL, "Unknown signal"}, + {NULL, "Internal error: printing TARGET_SIGNAL_DEFAULT"}, + /* Mach exceptions */ {"EXC_BAD_ACCESS", "Could not access memory"}, {"EXC_BAD_INSTRUCTION", "Illegal instruction/operand"}, @@ -188,11 +192,6 @@ static struct { {"EXC_EMULATION", "Emulation instruction"}, {"EXC_SOFTWARE", "Software generated exception"}, {"EXC_BREAKPOINT", "Breakpoint"}, -#endif - {"SIGINFO", "Information request"}, - - {NULL, "Unknown signal"}, - {NULL, "Internal error: printing TARGET_SIGNAL_DEFAULT"}, /* Last entry, used to check whether the table is the right size. */ {NULL, "TARGET_SIGNAL_MAGIC"} @@ -237,9 +236,10 @@ target_signal_from_name (char *name) /* This ugly cast brought to you by the native VAX compiler. */ for (sig = TARGET_SIGNAL_HUP; - signals[sig].name != NULL; + sig < TARGET_SIGNAL_LAST; sig = (enum target_signal) ((int) sig + 1)) - if (strcmp (name, signals[sig].name) == 0) + if (signals[sig].name != NULL + && strcmp (name, signals[sig].name) == 0) return sig; return TARGET_SIGNAL_UNKNOWN; } Index: include/gdb/signals.h =================================================================== RCS file: /cvs/src/src/include/gdb/signals.h,v retrieving revision 1.1 diff -u -p -r1.1 signals.h --- include/gdb/signals.h 11 Mar 2002 00:01:11 -0000 1.1 +++ include/gdb/signals.h 9 May 2002 22:18:45 -0000 @@ -32,7 +32,8 @@ 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. + 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 @@ -208,15 +209,6 @@ enum target_signal TARGET_SIGNAL_REALTIME_126, TARGET_SIGNAL_REALTIME_127, -#if defined(MACH) || defined(__MACH__) - /* Mach exceptions */ - TARGET_EXC_BAD_ACCESS, - TARGET_EXC_BAD_INSTRUCTION, - TARGET_EXC_ARITHMETIC, - TARGET_EXC_EMULATION, - TARGET_EXC_SOFTWARE, - TARGET_EXC_BREAKPOINT, -#endif TARGET_SIGNAL_INFO, /* Some signal we don't know about. */ @@ -225,6 +217,18 @@ enum target_signal /* 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