[OT] Re: gdb vs. glibc (glibc-devel-2.0.7-19, aka RedHat 5.1) vs , linux 2.1.124

Clifford Wolf (clifford@clifford.at)
Wed, 7 Oct 1998 10:51:58 +0200 (MEST)


On Tue, 6 Oct 1998, Michael Meissner wrote:

> It appears that there is a discrepancy between glibc 2.0.7-19 as
> shipped with RedHat 5.1 and the current kernel 2.1.124 that prevents
> native gdb from being built. In particular, gdb includes the
> following file because it believes the 386 has hardware watchpoints:
>
> <sys/debugreg.h>
>
> /usr/include/sys/debugreg.h has:
>
> #include <linux/debugreg.h>
>
> There is no file /usr/src/linux/include/linux/debugreg.h, but there is
> a version in /usr/src/linux/include/asm-i386 (ie <asm/debugreg.h>).
> It looks like the change was made in 2.1.113.

To compile gdb 4.17 together with glibc 2.0.96 and kernel 2.1.123 for i386
I use this little q+d patch to gdb (should work with your versions too):

--- gdb/i386v-nat.c Thu Jan 4 21:07:50 1996
+++ gdb/i386v-nat.c Tue Aug 25 17:41:34 1998
@@ -35,7 +35,7 @@
#include <fcntl.h>

#ifdef TARGET_HAS_HARDWARE_WATCHPOINTS
-#include <sys/debugreg.h>
+#include <asm/debugreg.h>
#endif

#include <sys/file.h>
--- gdb/main.c Sat Apr 13 06:51:36 1996
+++ gdb/main.c Mon Aug 31 18:58:05 1998
@@ -102,6 +102,8 @@
register int i;

long time_at_startup = get_run_time ();
+
+ (void) calloc(1,1);

START_PROGRESS (argv[0], 0);

--- gdb/config/i386/nm-linux.h Wed Apr 22 03:23:16 1998
+++ gdb/config/i386/nm-linux.h Thu Sep 24 18:04:01 1998
@@ -35,7 +35,7 @@

/* GNU/Linux uses the SYSV i386v-nat.c support, but doesn't have <sys/reg.h> */

-#define NO_SYS_REG_H
+// #define NO_SYS_REG_H

/* GNU/Linux supports the 386 hardware debugging registers. */

--- gdb/infptrace.c~ Fri Feb 6 21:56:49 1998
+++ gdb/infptrace.c Thu Sep 24 18:16:00 1998
@@ -34,13 +34,7 @@
#include <signal.h>
#include <sys/ioctl.h>

-#ifndef NO_PTRACE_H
-#ifdef PTRACE_IN_WRONG_PLACE
-#include <ptrace.h>
-#else
#include <sys/ptrace.h>
-#endif
-#endif /* NO_PTRACE_H */

#if !defined (PT_READ_I)
#define PT_READ_I 1 /* Read word from text space */
--- gdb/i386v4-nat.c~ Fri Jun 13 19:30:02 1997
+++ gdb/i386v4-nat.c Thu Sep 24 18:18:50 1998
@@ -19,6 +19,10 @@

#include "defs.h"

+#ifndef NO_SYS_REG_H
+#include <sys/reg.h>
+#endif
+
#ifdef HAVE_SYS_PROCFS_H

#include <sys/procfs.h>

-- -- -- -- -- -- -- -- -- -- -- -- --
Clifford Wolf (CEO and CTO)
The ROCK Projects Workgoup IRC: IRCnet / clifford
http://www.rock-projects.com/ http://www.clifford.at/
e-mail: c.wolf@rock-projects.com email: god@clifford.at

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/