Fix up a couple oddities in GDB's signal names and strings.
authorPedro Alves <palves@redhat.com>
Tue, 22 Oct 2013 11:16:51 +0000 (12:16 +0100)
committerTom Tromey <tromey@sourceware.org>
Fri, 25 Oct 2013 14:02:58 +0000 (14:02 +0000)
- The Mach exception/signals escaped the TARGET_ -> GDB_ prefix change
  done a while ago, but there's no real reason for that.  I grepped
  for TARGET_EXC and fixed all found, which unsurprisingly, means
  darwin-nat.c needed fixing.  I think the change there is as obvious
  and trivial as it can get, so I'd be quite surprised if this broke
  anything there somehow.

- GDB_SIGNAL_LAST's description string was unnecessarily inconsistent
  with the enum name.

Built on x86_64 Fedora 17.

gdb/
2013-10-22  Pedro Alves  <palves@redhat.com>

* include/gdb/signals.def (TARGET_EXC_BAD_ACCESS): Rename to
GDB_EXC_BAD_ACCESS.
(TARGET_EXC_BAD_INSTRUCTION): Rename to GDB_EXC_BAD_INSTRUCTION.
(TARGET_EXC_ARITHMETIC): Rename to GDB_EXC_ARITHMETIC.
(TARGET_EXC_EMULATION): Rename to GDB_EXC_EMULATION.
(TARGET_EXC_SOFTWARE): Rename to GDB_EXC_SOFTWARE.
(TARGET_EXC_BREAKPOINT): Rename to GDB_EXC_BREAKPOINT.
(GDB_SIGNAL_LAST): Change description string.
* common/signals.c (gdb_signal_from_host, do_gdb_signal_to_host):
Adjust to signal renaming.
* darwin-nat.c (darwin_decode_message): Likewise.

gdb/common/signals.c
gdb/darwin-nat.c
include/gdb/signals.def

index 4b3b951bddf8d09ca4d2409350a86d99a079908f..8fe4bedcb4d71928ac8468f6b485dcd2c78a60e9 100644 (file)
@@ -306,27 +306,27 @@ gdb_signal_from_host (int hostsig)
   /* 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;
+    return GDB_EXC_BAD_ACCESS;
 #endif
 #if defined (EXC_BAD_INSTRUCTION) && defined (_NSIG)
   if (hostsig == _NSIG + EXC_BAD_INSTRUCTION)
-    return TARGET_EXC_BAD_INSTRUCTION;
+    return GDB_EXC_BAD_INSTRUCTION;
 #endif
 #if defined (EXC_ARITHMETIC) && defined (_NSIG)
   if (hostsig == _NSIG + EXC_ARITHMETIC)
-    return TARGET_EXC_ARITHMETIC;
+    return GDB_EXC_ARITHMETIC;
 #endif
 #if defined (EXC_EMULATION) && defined (_NSIG)
   if (hostsig == _NSIG + EXC_EMULATION)
-    return TARGET_EXC_EMULATION;
+    return GDB_EXC_EMULATION;
 #endif
 #if defined (EXC_SOFTWARE) && defined (_NSIG)
   if (hostsig == _NSIG + EXC_SOFTWARE)
-    return TARGET_EXC_SOFTWARE;
+    return GDB_EXC_SOFTWARE;
 #endif
 #if defined (EXC_BREAKPOINT) && defined (_NSIG)
   if (hostsig == _NSIG + EXC_BREAKPOINT)
-    return TARGET_EXC_BREAKPOINT;
+    return GDB_EXC_BREAKPOINT;
 #endif
 
 #if defined (SIGINFO)
@@ -562,27 +562,27 @@ do_gdb_signal_to_host (enum gdb_signal oursig,
 
       /* Mach exceptions.  Assumes that the values for EXC_ are positive! */
 #if defined (EXC_BAD_ACCESS) && defined (_NSIG)
-    case TARGET_EXC_BAD_ACCESS:
+    case GDB_EXC_BAD_ACCESS:
       return _NSIG + EXC_BAD_ACCESS;
 #endif
 #if defined (EXC_BAD_INSTRUCTION) && defined (_NSIG)
-    case TARGET_EXC_BAD_INSTRUCTION:
+    case GDB_EXC_BAD_INSTRUCTION:
       return _NSIG + EXC_BAD_INSTRUCTION;
 #endif
 #if defined (EXC_ARITHMETIC) && defined (_NSIG)
-    case TARGET_EXC_ARITHMETIC:
+    case GDB_EXC_ARITHMETIC:
       return _NSIG + EXC_ARITHMETIC;
 #endif
 #if defined (EXC_EMULATION) && defined (_NSIG)
-    case TARGET_EXC_EMULATION:
+    case GDB_EXC_EMULATION:
       return _NSIG + EXC_EMULATION;
 #endif
 #if defined (EXC_SOFTWARE) && defined (_NSIG)
-    case TARGET_EXC_SOFTWARE:
+    case GDB_EXC_SOFTWARE:
       return _NSIG + EXC_SOFTWARE;
 #endif
 #if defined (EXC_BREAKPOINT) && defined (_NSIG)
-    case TARGET_EXC_BREAKPOINT:
+    case GDB_EXC_BREAKPOINT:
       return _NSIG + EXC_BREAKPOINT;
 #endif
 
index 153ffd0ac8df12a4b3cac4ccf10d8fa7b0c79b67..6995c2565f56d3dc7f8015c6b6358e7f50597b71 100644 (file)
@@ -897,16 +897,16 @@ darwin_decode_message (mach_msg_header_t *hdr,
       switch (thread->event.ex_type)
        {
        case EXC_BAD_ACCESS:
-         status->value.sig = TARGET_EXC_BAD_ACCESS;
+         status->value.sig = GDB_EXC_BAD_ACCESS;
          break;
        case EXC_BAD_INSTRUCTION:
-         status->value.sig = TARGET_EXC_BAD_INSTRUCTION;
+         status->value.sig = GDB_EXC_BAD_INSTRUCTION;
          break;
        case EXC_ARITHMETIC:
-         status->value.sig = TARGET_EXC_ARITHMETIC;
+         status->value.sig = GDB_EXC_ARITHMETIC;
          break;
        case EXC_EMULATION:
-         status->value.sig = TARGET_EXC_EMULATION;
+         status->value.sig = GDB_EXC_EMULATION;
          break;
        case EXC_SOFTWARE:
          if (thread->event.ex_data[0] == EXC_SOFT_SIGNAL)
@@ -928,11 +928,11 @@ darwin_decode_message (mach_msg_header_t *hdr,
                }
            }
          else
-           status->value.sig = TARGET_EXC_SOFTWARE;
+           status->value.sig = GDB_EXC_SOFTWARE;
          break;
        case EXC_BREAKPOINT:
          /* Many internal GDB routines expect breakpoints to be reported
-            as GDB_SIGNAL_TRAP, and will report TARGET_EXC_BREAKPOINT
+            as GDB_SIGNAL_TRAP, and will report GDB_EXC_BREAKPOINT
             as a spurious signal.  */
          status->value.sig = GDB_SIGNAL_TRAP;
          break;
index 637d00def0cd50ac2cb43437151f1862b2f747d9..aff5fa5e1905592d4957c823c1cc6a13a600c990 100644 (file)
@@ -186,15 +186,15 @@ SET (GDB_SIGNAL_DEFAULT, 144, NULL,
 /* Mach exceptions.  In versions of GDB before 5.2, these were just before
    GDB_SIGNAL_INFO if you were compiling on a Mach host (and missing
    otherwise).  */
-SET (TARGET_EXC_BAD_ACCESS, 145, "EXC_BAD_ACCESS", "Could not access memory")
-SET (TARGET_EXC_BAD_INSTRUCTION, 146, "EXC_BAD_INSTRUCTION",
+SET (GDB_EXC_BAD_ACCESS, 145, "EXC_BAD_ACCESS", "Could not access memory")
+SET (GDB_EXC_BAD_INSTRUCTION, 146, "EXC_BAD_INSTRUCTION",
      "Illegal instruction/operand")
-SET (TARGET_EXC_ARITHMETIC, 147, "EXC_ARITHMETIC", "Arithmetic exception")
-SET (TARGET_EXC_EMULATION, 148, "EXC_EMULATION", "Emulation instruction")
-SET (TARGET_EXC_SOFTWARE, 149, "EXC_SOFTWARE", "Software generated exception")
-SET (TARGET_EXC_BREAKPOINT, 150, "EXC_BREAKPOINT", "Breakpoint")
+SET (GDB_EXC_ARITHMETIC, 147, "EXC_ARITHMETIC", "Arithmetic exception")
+SET (GDB_EXC_EMULATION, 148, "EXC_EMULATION", "Emulation instruction")
+SET (GDB_EXC_SOFTWARE, 149, "EXC_SOFTWARE", "Software generated exception")
+SET (GDB_EXC_BREAKPOINT, 150, "EXC_BREAKPOINT", "Breakpoint")
 
 /* If you are adding a new signal, add it just above this comment.  */
 
 /* Last and unused enum value, for sizing arrays, etc.  */
-SET (GDB_SIGNAL_LAST, 151, NULL, "GDB_SIGNAL_MAGIC")
+SET (GDB_SIGNAL_LAST, 151, NULL, "GDB_SIGNAL_LAST")