This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit] Cleanup: Remove unnecessary nm-linux.h macro


Hello,

while I was looking at nm-linux.h, I noticed that GET_THREAD_SIGNALS is no
longer needed.  This mechanism was originally used in an attempt to separate
linux-thread-db.c from linux-nat.c.  But this is no longer useful, as the
file is only used on Linux native targets; and today there are a number of
other direct calls from linux-thread-db.c to linux-nat.c anyway.

The patch removes the macro and just performs a direct call instead.

The only remaining definitions in nm-linux.h are now GDB_GREGSET_T and
GDB_FPREGSET_T, which are still necessary at this point ...

Tested on i386-linux, committed to mainline.

Bye,
Ulrich


ChangeLog:

	* config/nm-linux.h (struct target_ops): Remove forward declaration.
	(lin_thread_get_thread_signals): Remove prototype.
	(GET_THREAD_SIGNALS): Remove.
	* linux-nat.h (lin_thread_get_thread_signals): Add prototype.
	* linux-thread-db.c (check_thread_signals): Directly call
	lin_thread_get_thread_signals; do not check GET_THREAD_SIGNALS.

Index: gdb/linux-nat.h
===================================================================
RCS file: /cvs/src/src/gdb/linux-nat.h,v
retrieving revision 1.34
diff -u -p -r1.34 linux-nat.h
--- gdb/linux-nat.h	12 Jan 2010 21:40:24 -0000	1.34
+++ gdb/linux-nat.h	10 Jun 2010 18:01:59 -0000
@@ -118,6 +118,9 @@ void check_for_thread_db (void);
 
 int thread_db_attach_lwp (ptid_t ptid);
 
+/* Return the set of signals used by the threads library.  */
+extern void lin_thread_get_thread_signals (sigset_t *mask);
+
 /* Find process PID's pending signal set from /proc/pid/status.  */
 void linux_proc_pending_signals (int pid, sigset_t *pending, sigset_t *blocked, sigset_t *ignored);
 
Index: gdb/linux-thread-db.c
===================================================================
RCS file: /cvs/src/src/gdb/linux-thread-db.c,v
retrieving revision 1.74
diff -u -p -r1.74 linux-thread-db.c
--- gdb/linux-thread-db.c	14 May 2010 23:41:05 -0000	1.74
+++ gdb/linux-thread-db.c	10 Jun 2010 18:02:00 -0000
@@ -928,13 +928,12 @@ disable_thread_event_reporting (struct t
 static void
 check_thread_signals (void)
 {
-#ifdef GET_THREAD_SIGNALS
   if (!thread_signals)
     {
       sigset_t mask;
       int i;
 
-      GET_THREAD_SIGNALS (&mask);
+      lin_thread_get_thread_signals (&mask);
       sigemptyset (&thread_stop_set);
       sigemptyset (&thread_print_set);
 
@@ -950,7 +949,6 @@ check_thread_signals (void)
 	    }
 	}
     }
-#endif
 }
 
 /* Check whether thread_db is usable.  This function is called when
Index: gdb/config/nm-linux.h
===================================================================
RCS file: /cvs/src/src/gdb/config/nm-linux.h,v
retrieving revision 1.34
diff -u -p -r1.34 nm-linux.h
--- gdb/config/nm-linux.h	1 Jan 2010 07:31:47 -0000	1.34
+++ gdb/config/nm-linux.h	10 Jun 2010 18:02:00 -0000
@@ -18,11 +18,6 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-struct target_ops;
-
-extern void lin_thread_get_thread_signals (sigset_t *mask);
-#define GET_THREAD_SIGNALS(mask) lin_thread_get_thread_signals (mask)
-
 /* Use elf_gregset_t and elf_fpregset_t, rather than
    gregset_t and fpregset_t.  */
 
-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]