]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2012-03-01 Pedro Alves <palves@redhat.com>
authorPedro Alves <palves@redhat.com>
Thu, 1 Mar 2012 21:11:23 +0000 (21:11 +0000)
committerPedro Alves <palves@redhat.com>
Thu, 1 Mar 2012 21:11:23 +0000 (21:11 +0000)
* common/signals.c (default_target_signal_to_host)
(default_target_signal_from_host): Move ...
* arch-utils.c: ... here.
* arch-utils.h (default_target_signal_to_host)
(default_target_signal_from_host): Declare.

* common/signals.c (target_signal_from_command): Move ...
* infrun.c: ... here.
* inferior.h (target_signal_from_command): Declare.
* target.h (target_signal_from_command)
(default_target_signal_from_host, default_target_signal_to_host):
Delete declarations.

* common/signals.c (_initialize_signals): Delete.

gdb/ChangeLog
gdb/arch-utils.c
gdb/arch-utils.h
gdb/common/signals.c
gdb/inferior.h
gdb/infrun.c
gdb/target.h

index 97c1fda69cbcafc957987a88d7153e7cf47e15a4..56beb76e7ccc52e73f312c6224faed9f2f8536b4 100644 (file)
@@ -1,3 +1,20 @@
+2012-03-01  Pedro Alves  <palves@redhat.com>
+
+       * common/signals.c (default_target_signal_to_host)
+       (default_target_signal_from_host): Move ...
+       * arch-utils.c: ... here.
+       * arch-utils.h (default_target_signal_to_host)
+       (default_target_signal_from_host): Declare.
+
+       * common/signals.c (target_signal_from_command): Move ...
+       * infrun.c: ... here.
+       * inferior.h (target_signal_from_command): Declare.
+       * target.h (target_signal_from_command)
+       (default_target_signal_from_host, default_target_signal_to_host):
+       Delete declarations.
+
+       * common/signals.c (_initialize_signals): Delete.
+
 2012-03-01  Pedro Alves  <palves@redhat.com>
 
        * jit-reader.in (plugin_is_GPL_compatible): Add declarations for
index e683a2d42b0897f1d351e9e193e41ae07b32ef04..fabb515a64bae92eb781429645473c9b3f60f756 100644 (file)
@@ -793,6 +793,18 @@ default_gen_return_address (struct gdbarch *gdbarch,
   error (_("This architecture has no method to collect a return address."));
 }
 
+int
+default_target_signal_to_host (struct gdbarch *gdbarch, enum target_signal ts)
+{
+  return target_signal_to_host (ts);
+}
+
+enum target_signal
+default_target_signal_from_host (struct gdbarch *gdbarch, int signo)
+{
+  return target_signal_from_host (signo);
+}
+
 /* */
 
 /* -Wmissing-prototypes */
index 7c398b3e8822754a50afa211fd900eab46d8ff32..c2c339860a556f01600ec4130ffce77b926a78fd 100644 (file)
@@ -172,4 +172,9 @@ extern void default_gen_return_address (struct gdbarch *gdbarch,
 extern const char *default_auto_charset (void);
 extern const char *default_auto_wide_charset (void);
 
+extern enum target_signal default_target_signal_from_host (struct gdbarch *,
+                                                          int);
+extern int default_target_signal_to_host (struct gdbarch *,
+                                         enum target_signal);
+
 #endif
index 75699dbd5afd7aceb24d68c9d52e021f7ffc501f..2e82e9cc15b1684ad8d617b9f7e6d4d7b207f637 100644 (file)
@@ -649,45 +649,3 @@ target_signal_to_host (enum target_signal oursig)
   else
     return targ_signo;
 }
-
-#ifndef GDBSERVER
-
-/* In some circumstances we allow a command to specify a numeric
-   signal.  The idea is to keep these circumstances limited so that
-   users (and scripts) develop portable habits.  For comparison,
-   POSIX.2 `kill' requires that 1,2,3,6,9,14, and 15 work (and using a
-   numeric signal at all is obsolescent.  We are slightly more
-   lenient and allow 1-15 which should match host signal numbers on
-   most systems.  Use of symbolic signal names is strongly encouraged.  */
-
-enum target_signal
-target_signal_from_command (int num)
-{
-  if (num >= 1 && num <= 15)
-    return (enum target_signal) num;
-  error (_("Only signals 1-15 are valid as numeric signals.\n\
-Use \"info signals\" for a list of symbolic signals."));
-}
-
-extern initialize_file_ftype _initialize_signals; /* -Wmissing-prototype */
-
-void
-_initialize_signals (void)
-{
-  if (strcmp (signals[TARGET_SIGNAL_LAST].string, "TARGET_SIGNAL_MAGIC") != 0)
-    internal_error (__FILE__, __LINE__, "failed internal consistency check");
-}
-
-int
-default_target_signal_to_host (struct gdbarch *gdbarch, enum target_signal ts)
-{
-  return target_signal_to_host (ts);
-}
-
-enum target_signal
-default_target_signal_from_host (struct gdbarch *gdbarch, int signo)
-{
-  return target_signal_from_host (signo);
-}
-
-#endif /* ! GDBSERVER */
index 65abf264b3c0e4663804feaea62ada02582fe331..9b2817fa1880e62c97c5453693591f9a746c62ed 100644 (file)
@@ -645,4 +645,14 @@ extern struct inferior *add_inferior_with_spaces (void);
 
 extern void update_observer_mode (void);
 
+/* In some circumstances we allow a command to specify a numeric
+   signal.  The idea is to keep these circumstances limited so that
+   users (and scripts) develop portable habits.  For comparison,
+   POSIX.2 `kill' requires that 1,2,3,6,9,14, and 15 work (and using a
+   numeric signal at all is obsolescent.  We are slightly more lenient
+   and allow 1-15 which should match host signal numbers on most
+   systems.  Use of symbolic signal names is strongly encouraged.  */
+
+enum target_signal target_signal_from_command (int num);
+
 #endif /* !defined (INFERIOR_H) */
index 81d1e5cf522f73f6edc703d66626d59cf6d5151e..e383d7717e1a0d00849728895e5004520da17580 100644 (file)
@@ -6445,6 +6445,15 @@ xdb_handle_command (char *args, int from_tty)
   do_cleanups (old_chain);
 }
 
+enum target_signal
+target_signal_from_command (int num)
+{
+  if (num >= 1 && num <= 15)
+    return (enum target_signal) num;
+  error (_("Only signals 1-15 are valid as numeric signals.\n\
+Use \"info signals\" for a list of symbolic signals."));
+}
+
 /* Print current contents of the tables set by the handle command.
    It is possible we should just be printing signals actually used
    by the current target (but for things to work right when switching
index e786817b330043af0325d06b0a7071b475355499..e5679b1188003592bbf33ff60a2fbb80e491ad1f 100644 (file)
@@ -1827,16 +1827,6 @@ extern int remote_timeout;
 /* This is for native targets which use a unix/POSIX-style waitstatus.  */
 extern void store_waitstatus (struct target_waitstatus *, int);
 
-/* These are in common/signals.c, but they're only used by gdb.  */
-extern enum target_signal default_target_signal_from_host (struct gdbarch *,
-                                                          int);
-extern int default_target_signal_to_host (struct gdbarch *, 
-                                         enum target_signal);
-
-/* Convert from a number used in a GDB command to an enum target_signal.  */
-extern enum target_signal target_signal_from_command (int);
-/* End of files in common/signals.c.  */
-
 /* Set the show memory breakpoints mode to show, and installs a cleanup
    to restore it back to the current value.  */
 extern struct cleanup *make_show_memory_breakpoints_cleanup (int show);