Index: gdb/gdbarch.h
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.h,v
retrieving revision 1.372
diff -u -3 -p -r1.372 gdbarch.h
--- gdb/gdbarch.h	6 Dec 2007 16:32:59 -0000	1.372
+++ gdb/gdbarch.h	13 Dec 2007 16:07:16 -0000
@@ -664,6 +664,16 @@ typedef const struct target_desc * (gdba
 extern const struct target_desc * gdbarch_core_read_description (struct gdbarch *gdbarch, struct target_ops *target, bfd *abfd);
 extern void set_gdbarch_core_read_description (struct gdbarch *gdbarch, gdbarch_core_read_description_ftype *core_read_description);
 
+/* Name rationale: 'target_signal' comes from 'enum target_signal',
+     'from_target' means from target as in inferior. */
+
+extern int gdbarch_target_signal_from_target_p (struct gdbarch *gdbarch);
+
+typedef enum target_signal (gdbarch_target_signal_from_target_ftype) (int signo);
+extern enum target_signal gdbarch_target_signal_from_target (struct gdbarch *gdbarch, int signo);
+extern void set_gdbarch_target_signal_from_target (struct gdbarch *gdbarch, gdbarch_target_signal_from_target_ftype *target_signal_from_target);
+
+
 /* Handle special encoding of static variables in stabs debug info. */
 
 extern int gdbarch_static_transform_name_p (struct gdbarch *gdbarch);
Index: gdb/gdbarch.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.c,v
retrieving revision 1.418
diff -u -3 -p -r1.418 gdbarch.c
--- gdb/gdbarch.c	6 Dec 2007 16:32:59 -0000	1.418
+++ gdb/gdbarch.c	13 Dec 2007 16:07:16 -0000
@@ -227,6 +227,7 @@ struct gdbarch
   gdbarch_skip_permanent_breakpoint_ftype *skip_permanent_breakpoint;
   gdbarch_overlay_update_ftype *overlay_update;
   gdbarch_core_read_description_ftype *core_read_description;
+  gdbarch_target_signal_from_target_ftype *target_signal_from_target;
   gdbarch_static_transform_name_ftype *static_transform_name;
   int sofun_address_maybe_missing;
 };
@@ -348,6 +349,7 @@ struct gdbarch startup_gdbarch =
   0,  /* skip_permanent_breakpoint */
   0,  /* overlay_update */
   0,  /* core_read_description */
+  0,  /* target_signal_from_target */
   0,  /* static_transform_name */
   0,  /* sofun_address_maybe_missing */
   /* startup_gdbarch() */
@@ -584,6 +586,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
   /* Skip verify of skip_permanent_breakpoint, has predicate */
   /* Skip verify of overlay_update, has predicate */
   /* Skip verify of core_read_description, has predicate */
+  /* Skip verify of target_signal_from_target, has predicate */
   /* Skip verify of static_transform_name, has predicate */
   /* Skip verify of sofun_address_maybe_missing, invalid_p == 0 */
   buf = ui_file_xstrdup (log, &dummy);
@@ -687,6 +690,12 @@ gdbarch_dump (struct gdbarch *gdbarch, s
                       "gdbarch_dump: core_read_description = <0x%lx>\n",
                       (long) gdbarch->core_read_description);
   fprintf_unfiltered (file,
+                      "gdbarch_dump: gdbarch_target_signal_from_target_p() = %d\n",
+                      gdbarch_target_signal_from_target_p (gdbarch));
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: target_signal_from_target = <0x%lx>\n",
+                      (long) gdbarch->target_signal_from_target);
+  fprintf_unfiltered (file,
                       "gdbarch_dump: gdbarch_core_xfer_shared_libraries_p() = %d\n",
                       gdbarch_core_xfer_shared_libraries_p (gdbarch));
   fprintf_unfiltered (file,
@@ -2917,6 +2926,32 @@ set_gdbarch_core_read_description (struc
 }
 
 int
+gdbarch_target_signal_from_target_p (struct gdbarch *gdbarch)
+{
+  gdb_assert (gdbarch != NULL);
+  return gdbarch->target_signal_from_target != NULL;
+}
+
+enum target_signal
+gdbarch_target_signal_from_target (struct gdbarch *gdbarch, int signo)
+{
+  gdb_assert (gdbarch != NULL);
+  if (gdbarch_debug >= 2)
+    fprintf_unfiltered (gdb_stdlog, 
+                        "gdbarch_target_signal_from_target called\n");
+  gdb_assert (gdbarch_target_signal_from_target_p (gdbarch));
+  return gdbarch->target_signal_from_target (signo);
+}
+
+void
+set_gdbarch_target_signal_from_target (struct gdbarch *gdbarch, 
+           gdbarch_target_signal_from_target_ftype target_signal_from_target)
+{
+  gdbarch->target_signal_from_target = target_signal_from_target;
+}
+
+
+int
 gdbarch_static_transform_name_p (struct gdbarch *gdbarch)
 {
   gdb_assert (gdbarch != NULL);
Index: gdb/corelow.c
===================================================================
RCS file: /cvs/src/src/gdb/corelow.c,v
retrieving revision 1.70
diff -u -3 -p -r1.70 corelow.c
--- gdb/corelow.c	15 Nov 2007 06:14:26 -0000	1.70
+++ gdb/corelow.c	13 Dec 2007 16:07:17 -0000
@@ -353,12 +353,19 @@ core_open (char *filename, int from_tty)
 
   siggy = bfd_core_file_failing_signal (core_bfd);
   if (siggy > 0)
+    {
+      enum target_signal gdb_sig;
+      if (core_gdbarch && gdbarch_target_signal_from_target_p (core_gdbarch))
+	gdb_sig = gdbarch_target_signal_from_target (core_gdbarch, siggy);
+      else
+	gdb_sig = target_signal_from_host (siggy);
     /* NOTE: target_signal_from_host() converts a target signal value
        into gdb's internal signal value.  Unfortunately gdb's internal
        value is called ``target_signal'' and this function got the
        name ..._from_host(). */
-    printf_filtered (_("Program terminated with signal %d, %s.\n"), siggy,
-		     target_signal_to_string (target_signal_from_host (siggy)));
+      printf_filtered (_("Program terminated with signal %d, %s.\n"), siggy,
+		     target_signal_to_string (gdb_sig));
+    }
 
   /* Build up thread list from BFD sections. */
 
@@ -496,7 +503,7 @@ get_core_registers (struct regcache *reg
   get_core_register_section (regcache,
 			     ".reg-xfp", 3, "extended floating-point", 0);
   get_core_register_section (regcache,
-  			     ".reg-ppc-vmx", 3, "ppc Altivec", 0);
+			     ".reg-ppc-vmx", 3, "ppc Altivec", 0);
 
   /* Supply dummy value for all registers not found in the core.  */
   for (i = 0; i < gdbarch_num_regs (get_regcache_arch (regcache)); i++)
