A patch for gnu-regex

H . J . Lu hjl@valinux.com
Tue Mar 7 14:33:00 GMT 2000


I believe gnu-regex is maintained in glibc 2. I'd like to use the one
in glibc 2 instead of the one in gdb.


H.J.
---
2000-03-07 H.J. Lu  <hjl@gnu.org>

	* config/alpha/alpha-linux.mh (REGEX, REGEX1): Clear.
	* config/i386/linux.mh: Likewise.
	* config/m68k/linux.mh: Likewise.
	* config/powerpc/linux.mh: Likewise.
	* config/sparc/linux.mh: Likewise.

	* config/alpha/alpha-linuxlibc1.mh: New.
	* config/i386/linuxlibc1.mh: Likewise.
	* config/powerpc/linuxlibc1.mh: Likewise.
	* config/sparc/linuxlibc1.mh: Likewise.

	* configure.host (alpha*-*-linux*libc1): New host.
	(i[3456]86-*-linux*libc1): Likewise.
	(i[3456]86-*-linux*libc5): Likewise.
	(powerpc-*-linux*libc1): Likewise.
	(sparc-*-linux*libc1): Likewise.
	(sparc-*-linux*libc5): Likewise.

	* irix5-nat.c: Include <regex.h> instead of "gnu-regex.h" for
	glibc 2.
	* monitor.c: Likewise.
	* osfsolib.c: Likewise.
	* solib.c: Likewise.
	* source.c: Likewise.
	* symtab.c: Likewise.

Index: config/alpha/alpha-linux.mh
===================================================================
RCS file: /work/cvs/gnu/gdb/gdb/config/alpha/alpha-linux.mh,v
retrieving revision 1.1.1.3
diff -u -p -r1.1.1.3 alpha-linux.mh
--- config/alpha/alpha-linux.mh	2000/03/07 18:42:19	1.1.1.3
+++ config/alpha/alpha-linux.mh	2000/03/07 18:44:07
@@ -1,4 +1,9 @@
 # Host: Little-endian Alpha running Linux
+
+# We should use the one in glibc 2.
+REGEX=
+REGEX1=
+
 XDEPFILES= ser-tcp.o
 XM_FILE= xm-alphalinux.h
 NAT_FILE= nm-linux.h
Index: config/i386/linux.mh
===================================================================
RCS file: /work/cvs/gnu/gdb/gdb/config/i386/linux.mh,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -p -r1.1.1.2 -r1.2
--- config/i386/linux.mh	2000/01/18 17:07:18	1.1.1.2
+++ config/i386/linux.mh	2000/03/07 21:31:30	1.2
@@ -1,10 +1,14 @@
 # Host: Intel 386 running GNU/Linux
 
+# We should use the one in glibc 2.
+REGEX=
+REGEX1=
+
 XM_FILE= xm-linux.h
 XDEPFILES= ser-tcp.o
 
 NAT_FILE= nm-linux.h
 NATDEPFILES= infptrace.o solib.o inftarg.o fork-child.o corelow.o \
-	core-aout.o i386v-nat.o i386-linux-nat.o linux-thread.o lin-thread.o
+	core-aout.o i386-linux-nat.o linux-thread.o lin-thread.o
 
 LOADLIBES = -ldl -rdynamic
Index: config/m68k/linux.mh
===================================================================
RCS file: /work/cvs/gnu/gdb/gdb/config/m68k/linux.mh,v
retrieving revision 1.1.1.2
diff -u -p -r1.1.1.2 linux.mh
--- config/m68k/linux.mh	2000/01/18 17:07:22	1.1.1.2
+++ config/m68k/linux.mh	2000/01/18 17:08:57
@@ -1,5 +1,9 @@
 # Host: Motorola m68k running Linux
 
+# We should use the one in glibc 2.
+REGEX=
+REGEX1=
+
 XM_FILE= xm-linux.h
 XDEPFILES= ser-tcp.o
 
Index: config/powerpc/linux.mh
===================================================================
RCS file: /work/cvs/gnu/gdb/gdb/config/powerpc/linux.mh,v
retrieving revision 1.1.1.2
diff -u -p -r1.1.1.2 linux.mh
--- config/powerpc/linux.mh	2000/03/07 18:42:23	1.1.1.2
+++ config/powerpc/linux.mh	2000/03/07 18:44:08
@@ -1,5 +1,9 @@
 # Host: PowerPC, running Linux
 
+# We should use the one in glibc 2.
+REGEX=
+REGEX1=
+
 XM_FILE= xm-linux.h
 XDEPFILES= ser-tcp.o
 XM_CLIBS=
Index: config/sparc/linux.mh
===================================================================
RCS file: /work/cvs/gnu/gdb/gdb/config/sparc/linux.mh,v
retrieving revision 1.1.1.2
diff -u -p -r1.1.1.2 linux.mh
--- config/sparc/linux.mh	2000/01/18 17:07:30	1.1.1.2
+++ config/sparc/linux.mh	2000/01/18 17:08:58
@@ -1,4 +1,9 @@
 # Host: Sparcstation, running Linux
+
+# We should use the one in glibc 2.
+REGEX=
+REGEX1=
+
 XDEPFILES= ser-tcp.o
 XM_FILE= xm-linux.h
 NAT_FILE= nm-linux.h
Index: configure.host
===================================================================
RCS file: /work/cvs/gnu/gdb/gdb/configure.host,v
retrieving revision 1.1.1.2
diff -u -p -r1.1.1.2 configure.host
--- configure.host	2000/01/18 17:06:53	1.1.1.2
+++ configure.host	2000/01/18 17:08:52
@@ -34,6 +34,7 @@ a29k-*-*)		gdb_host=ultra3 ;;
 alpha*-*-osf1*)		gdb_host=alpha-osf1 ;;
 alpha*-*-osf2*)		gdb_host=alpha-osf2 ;;
 alpha*-*-osf[3456789]*)	gdb_host=alpha-osf3 ;;
+alpha*-*-linux*libc1)	gdb_host=alpha-linuxlibc1 ;;
 alpha*-*-linux*)	gdb_host=alpha-linux ;;
 
 arm*-*-linux*)		gdb_host=linux ;;
@@ -60,6 +61,8 @@ i[3456]86-*-freebsd*)	gdb_host=fbsd ;;
 i[3456]86-*-netbsd*)	gdb_host=nbsd ;;
 i[3456]86-*-go32*)	gdb_host=go32 ;;
 i[3456]86-*-msdosdjgpp*) gdb_host=go32 ;;
+i[3456]86-*-linux*libc1|i[3456]86-*-linux*libc5)
+			gdb_host=linuxlibc1 ;;
 i[3456]86-*-linux*)	gdb_host=linux ;;
 i[3456]86-*-lynxos*)	gdb_host=i386lynx ;;
 i[3456]86-*-mach3*)	gdb_host=i386m3 ;;
@@ -134,6 +137,7 @@ ns32k-utek-sysv*)	gdb_host=merlin ;;
 powerpc-*-aix*)		gdb_host=aix ;;
 powerpcle-*-cygwin*)	gdb_host=cygwin ;;
 powerpcle-*-solaris*)	gdb_host=solaris ;;
+powerpc-*-linux*libc1)	gdb_host=linuxlibc1 ;;
 powerpc-*-linux*)	gdb_host=linux ;;
 
 # OBSOLETE pn-*-*)		gdb_host=pn ;;
@@ -146,6 +150,8 @@ rs6000-*-lynxos*)	gdb_host=rs6000lynx ;;
 rs6000-*-aix4*)		gdb_host=aix4 ;;
 rs6000-*-*)		gdb_host=rs6000 ;;
 
+sparc-*-linux*libc1|sparc-*-linux*libc5)
+			gdb_host=linuxlibc1 ;;
 sparc-*-linux*)		gdb_host=linux ;;
 sparc-*-lynxos*)	gdb_host=sparclynx ;;
 sparc-*-netbsdelf*)	gdb_host=nbsdelf ;;
Index: irix5-nat.c
===================================================================
RCS file: /work/cvs/gnu/gdb/gdb/irix5-nat.c,v
retrieving revision 1.1.1.3
diff -u -p -r1.1.1.3 irix5-nat.c
--- irix5-nat.c	1999/11/19 23:38:46	1.1.1.3
+++ irix5-nat.c	1999/11/19 23:40:52
@@ -278,10 +278,14 @@ fetch_core_registers (core_reg_sect, cor
 #include "objfiles.h"
 #include "command.h"
 #include "frame.h"
-#include "gnu-regex.h"
 #include "inferior.h"
 #include "language.h"
 #include "gdbcmd.h"
+#if defined __GLIBC__ && __GLIBC__ >= 2
+#include <regex.h>
+#else
+#include "gnu-regex.h"
+#endif
 
 /* The symbol which starts off the list of shared libraries.  */
 #define DEBUG_BASE "__rld_obj_head"
Index: monitor.c
===================================================================
RCS file: /work/cvs/gnu/gdb/gdb/monitor.c,v
retrieving revision 1.1.1.5
diff -u -p -r1.1.1.5 monitor.c
--- monitor.c	2000/03/07 18:42:14	1.1.1.5
+++ monitor.c	2000/03/07 18:44:06
@@ -50,9 +50,13 @@
 #include "monitor.h"
 #include "gdbcmd.h"
 #include "inferior.h"
-#include "gnu-regex.h"
 #include "dcache.h"
 #include "srec.h"
+#if defined __GLIBC__ && __GLIBC__ >= 2
+#include <regex.h>
+#else
+#include "gnu-regex.h"
+#endif
 
 static char *dev_name;
 static struct target_ops *targ_ops;
Index: osfsolib.c
===================================================================
RCS file: /work/cvs/gnu/gdb/gdb/osfsolib.c,v
retrieving revision 1.1.1.3
diff -u -p -r1.1.1.3 osfsolib.c
--- osfsolib.c	1999/11/19 23:38:50	1.1.1.3
+++ osfsolib.c	1999/11/19 23:40:52
@@ -36,10 +36,14 @@
 #include "command.h"
 #include "target.h"
 #include "frame.h"
-#include "gnu-regex.h"
 #include "inferior.h"
 #include "language.h"
 #include "gdbcmd.h"
+#if defined __GLIBC__ && __GLIBC__ >= 2
+#include <regex.h>
+#else
+#include "gnu-regex.h"
+#endif
 
 #define MAX_PATH_SIZE 1024	/* FIXME: Should be dynamic */
 
Index: solib.c
===================================================================
RCS file: /work/cvs/gnu/gdb/gdb/solib.c,v
retrieving revision 1.1.1.4
diff -u -p -r1.1.1.4 solib.c
--- solib.c	2000/03/07 18:42:17	1.1.1.4
+++ solib.c	2000/03/07 21:32:29
@@ -49,11 +49,15 @@
 #include "command.h"
 #include "target.h"
 #include "frame.h"
-#include "gnu-regex.h"
 #include "inferior.h"
 #include "environ.h"
 #include "language.h"
 #include "gdbcmd.h"
+#if defined __GLIBC__ && __GLIBC__ >= 2
+#include <regex.h>
+#else
+#include "gnu-regex.h"
+#endif
 
 #define MAX_PATH_SIZE 512	/* FIXME: Should be dynamic */
 
Index: source.c
===================================================================
RCS file: /work/cvs/gnu/gdb/gdb/source.c,v
retrieving revision 1.1.1.3
diff -u -p -r1.1.1.3 source.c
--- source.c	2000/02/04 20:21:58	1.1.1.3
+++ source.c	2000/02/04 21:36:33
@@ -33,11 +33,15 @@
 #include "gdb_stat.h"
 #include <fcntl.h>
 #include "gdbcore.h"
-#include "gnu-regex.h"
 #include "symfile.h"
 #include "objfiles.h"
 #include "annotate.h"
 #include "gdbtypes.h"
+#if defined __GLIBC__ && __GLIBC__ >= 2
+#include <regex.h>
+#else
+#include "gnu-regex.h"
+#endif
 #ifdef UI_OUT
 #include "ui-out.h"
 #endif
Index: symtab.c
===================================================================
RCS file: /work/cvs/gnu/gdb/gdb/symtab.c,v
retrieving revision 1.1.1.4
diff -u -p -r1.1.1.4 symtab.c
--- symtab.c	2000/03/07 18:42:17	1.1.1.4
+++ symtab.c	2000/03/07 18:44:06
@@ -30,7 +30,6 @@
 #include "objfiles.h"
 #include "gdbcmd.h"
 #include "call-cmds.h"
-#include "gnu-regex.h"
 #include "expression.h"
 #include "language.h"
 #include "demangle.h"
@@ -43,6 +42,11 @@
 #include "gdb_string.h"
 #include "gdb_stat.h"
 #include <ctype.h>
+#if defined __GLIBC__ && __GLIBC__ >= 2
+#include <regex.h>
+#else
+#include "gnu-regex.h"
+#endif
 
 /* Prototype for one function in parser-defs.h,
    instead of including that entire file. */
--- /dev/null	Tue May  5 13:32:27 1998
+++ config/alpha/alpha-linuxlibc1.mh	Tue Oct 19 09:50:12 1999
@@ -0,0 +1,10 @@
+# Host: Little-endian Alpha running Linux with the GNU C library 1.
+
+XDEPFILES= 
+XM_FILE= xm-alphalinux.h
+NAT_FILE= nm-linux.h
+NATDEPFILES= infptrace.o inftarg.o corelow.o core-regset.o alpha-nat.o \
+	fork-child.o solib.o
+
+MMALLOC = 
+MMALLOC_CFLAGS = -DNO_MMALLOC 
--- /dev/null	Tue May  5 13:32:27 1998
+++ config/i386/linuxlibc1.mh	Tue Oct 19 09:50:21 1999
@@ -0,0 +1,8 @@
+# Host: Intel 386 running GNU/Linux with the Linux C library 5.
+
+XM_FILE= xm-linux.h
+XDEPFILES= ser-tcp.o
+
+NAT_FILE= nm-linux.h
+NATDEPFILES= infptrace.o solib.o inftarg.o fork-child.o corelow.o \
+  core-aout.o core-regset.o i386lnx-nat.o lnx-thread.o lnx-nat.o
--- /dev/null	Tue May  5 13:32:27 1998
+++ config/powerpc/linuxlibc1.mh	Tue Mar  7 13:35:15 2000
@@ -0,0 +1,10 @@
+# Host: PowerPC, running Linux with the GNU C library 1.
+
+XM_FILE= xm-linux.h
+XDEPFILES= ser-tcp.o
+XM_CLIBS=
+
+NAT_FILE= nm-linux.h
+NATDEPFILES= infptrace.o solib.o inftarg.o fork-child.o corelow.o core-aout.o core-regset.o ppc-linux-nat.o linux-thread.o
+
+GDBSERVER_DEPFILES= low-linux.o
--- /dev/null	Tue May  5 13:32:27 1998
+++ config/sparc/linuxlibc1.mh	Tue Oct 19 09:53:46 1999
@@ -0,0 +1,9 @@
+# Host: Sparcstation, running Linux with the Linux C library 5.
+
+XDEPFILES= ser-tcp.o
+XM_FILE= xm-linux.h
+NAT_FILE= nm-linux.h
+NATDEPFILES= fork-child.o infptrace.o inftarg.o corelow.o \
+  core-regset.o sparc-nat.o
+HOST_IPC=-DBSD_IPC
+GDBSERVER_DEPFILES= low-sparc.o


More information about the Gdb mailing list