procfs.c: Move find_signalled_thread and find_stop_signal.
authorJoel Brobecker <brobecker@gnat.com>
Tue, 20 Apr 2010 22:34:09 +0000 (22:34 +0000)
committerJoel Brobecker <brobecker@gnat.com>
Tue, 20 Apr 2010 22:34:09 +0000 (22:34 +0000)
These two functions are only used from procfs_make_note_section, which
itself is only defined if:

    #if defined (UNIXWARE) || defined (PIOCOPENLWP) || defined (PCAGENT)

So these two functions are unused on mips-irix, and they get flagged
by -Wunused-function. This patch simply moves these functions closer
to the function that uses them, which also has the effect of putting
them inside the same #if block as procfs_make_note_section.  Thus
they are defined only when used.

gdb/ChangeLog:

        * procfs.c (find_signalled_thread, find_stop_signal): Move
        these functions down to define them only when used.

gdb/ChangeLog
gdb/procfs.c

index dcf9cc5ba603ed609921bbb6187192bec96cbb34..965467847c201c35312883ec7e7575a81569cb73 100644 (file)
@@ -1,3 +1,8 @@
+2010-04-20  Joel Brobecker  <brobecker@adacore.com>
+
+       * procfs.c (find_signalled_thread, find_stop_signal): Move
+       these functions down to define them only when used.
+
 2010-04-20  Joel Brobecker  <brobecker@adacore.com>
 
        * valprint.c (common_val_print): Fix the value before extracting
index 6413ed039bf63cb9b88a8b7418fbc1e2e1c96d36..0ee72dc3944e1bb1ebba5b5ca95f97f2e7bc9656 100644 (file)
@@ -6049,28 +6049,6 @@ procfs_first_available (void)
   return pid_to_ptid (procinfo_list ? procinfo_list->pid : -1);
 }
 
-static int
-find_signalled_thread (struct thread_info *info, void *data)
-{
-  if (info->stop_signal != TARGET_SIGNAL_0
-      && ptid_get_pid (info->ptid) == ptid_get_pid (inferior_ptid))
-    return 1;
-
-  return 0;
-}
-
-static enum target_signal
-find_stop_signal (void)
-{
-  struct thread_info *info =
-    iterate_over_threads (find_signalled_thread, NULL);
-
-  if (info)
-    return info->stop_signal;
-  else
-    return TARGET_SIGNAL_0;
-}
-
 /* ===================  GCORE .NOTE "MODULE" =================== */
 #if defined (UNIXWARE) || defined (PIOCOPENLWP) || defined (PCAGENT)
 /* gcore only implemented on solaris and unixware (so far) */
@@ -6148,6 +6126,28 @@ procfs_corefile_thread_callback (procinfo *pi, procinfo *thread, void *data)
   return 0;
 }
 
+static int
+find_signalled_thread (struct thread_info *info, void *data)
+{
+  if (info->stop_signal != TARGET_SIGNAL_0
+      && ptid_get_pid (info->ptid) == ptid_get_pid (inferior_ptid))
+    return 1;
+
+  return 0;
+}
+
+static enum target_signal
+find_stop_signal (void)
+{
+  struct thread_info *info =
+    iterate_over_threads (find_signalled_thread, NULL);
+
+  if (info)
+    return info->stop_signal;
+  else
+    return TARGET_SIGNAL_0;
+}
+
 static char *
 procfs_make_note_section (bfd *obfd, int *note_size)
 {
This page took 0.030077 seconds and 4 git commands to generate.