Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Re: [rfa] gdb_thread_db.h: #errror if no uintptr_t
@ 2003-02-26 17:19 Michael Elizabeth Chastain
  2003-02-26 18:39 ` Joel Brobecker
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Elizabeth Chastain @ 2003-02-26 17:19 UTC (permalink / raw)
  To: drow; +Cc: gdb-patches

Version #2.  This updates the error message to Daniel J's wording.
Re-tested.

I am committing this now.

Michael C

2003-02-26  Michael Chastain  <mec@shout.net>

	Close PR build/660.
	PROBLEMS (i[3456]86-*-linux*): Note explicit error message
	for old libc5/glibc.
	gdb_thread_db.h: Die if not HAVE_UINTPTR_T.

Index: PROBLEMS
===================================================================
RCS file: /cvs/src/src/gdb/PROBLEMS,v
retrieving revision 1.13
diff -u -r1.13 PROBLEMS
--- PROBLEMS	25 Feb 2003 21:58:20 -0000	1.13
+++ PROBLEMS	26 Feb 2003 17:16:20 -0000
@@ -69,9 +69,9 @@
 i[3456]86-*-linux*
 ------------------
 
-gdb/660: gdb does not build with linux libc5.  The symptom is a parse
-error before `uintptr_t'.  Upgrade to glibc 2.1.3 or later, which
-defines uintptr_t.
+gdb/660: gdb does not build with GNU/Linux libc5.  The symptom is a
+parse error before `uintptr_t' or an error message about `uintptr_t'.
+Upgrade to glibc 2.1.3 or later, which defines uintptr_t.
 
 gdb/1030: GNU binutils 2.12.1 and earlier versions do not work properly
 with gdb.  If you use GNU binutils, upgrade to version 2.13 or later.
Index: gdb_thread_db.h
===================================================================
RCS file: /cvs/src/src/gdb/gdb_thread_db.h,v
retrieving revision 1.4
diff -u -r1.4 gdb_thread_db.h
--- gdb_thread_db.h	12 Nov 2002 02:39:40 -0000	1.4
+++ gdb_thread_db.h	26 Feb 2003 17:16:21 -0000
@@ -198,6 +198,16 @@
     int syscallno;		/* Number of system call used.  */
   } u;
 } td_notify_t;
+
+/* Some people still have libc5 or old glibc with no uintptr_t.
+   They lose.  glibc 2.1.3 was released on 2000-02-25, and it has
+   uintptr_t, so it's reasonable to force these people to upgrade.  */
+
+#ifndef HAVE_UINTPTR_T
+#error No uintptr_t available; your C library is too old.
+/* Inhibit further compilation errors after this error.  */
+#define uintptr_t void *
+#endif
 
 /* Structure used to report event.  */
 typedef struct td_event_msg


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [rfa] gdb_thread_db.h: #errror if no uintptr_t
  2003-02-26 17:19 [rfa] gdb_thread_db.h: #errror if no uintptr_t Michael Elizabeth Chastain
@ 2003-02-26 18:39 ` Joel Brobecker
  2003-02-26 18:45   ` Daniel Jacobowitz
  0 siblings, 1 reply; 7+ messages in thread
From: Joel Brobecker @ 2003-02-26 18:39 UTC (permalink / raw)
  To: Michael Elizabeth Chastain; +Cc: gdb-patches

> +#ifndef HAVE_UINTPTR_T
> +#error No uintptr_t available; your C library is too old.
> +/* Inhibit further compilation errors after this error.  */
> +#define uintptr_t void *
> +#endif

Forgive my curiosity, why adding the "#define uintptr_t"? Isn't the
compilation going to stop with the #error message anyway?

-- 
Joel


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [rfa] gdb_thread_db.h: #errror if no uintptr_t
  2003-02-26 18:39 ` Joel Brobecker
@ 2003-02-26 18:45   ` Daniel Jacobowitz
  0 siblings, 0 replies; 7+ messages in thread
From: Daniel Jacobowitz @ 2003-02-26 18:45 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: Michael Elizabeth Chastain, gdb-patches

On Wed, Feb 26, 2003 at 10:39:12AM -0800, Joel Brobecker wrote:
> > +#ifndef HAVE_UINTPTR_T
> > +#error No uintptr_t available; your C library is too old.
> > +/* Inhibit further compilation errors after this error.  */
> > +#define uintptr_t void *
> > +#endif
> 
> Forgive my curiosity, why adding the "#define uintptr_t"? Isn't the
> compilation going to stop with the #error message anyway?

I thought so too, so I tried it.  Bizarre... but he's right.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [rfa] gdb_thread_db.h: #errror if no uintptr_t
@ 2003-02-26 19:56 Michael Elizabeth Chastain
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Elizabeth Chastain @ 2003-02-26 19:56 UTC (permalink / raw)
  To: brobecker; +Cc: gdb-patches

Hi Joel,

mec> +#ifndef HAVE_UINTPTR_T
mec> +#error No uintptr_t available; your C library is too old.
mec> +/* Inhibit further compilation errors after this error.  */
mec> +#define uintptr_t void *
mec> +#endif

joel> Forgive my curiosity, why adding the "#define uintptr_t"? Isn't the
joel> compilation going to stop with the #error message anyway?

No, the compilation will keep on going to the end of the file,
so my nice #error message gets followed by 20 lines of errors.
I want to have a directive for 'stop processing now' but #error
does not do that.  I suppose a line like '#include +cpp_syntax_error+'
would achieve the desired effect.

A smart user might notice that if they take the #error out, but leave the
#define in, then the build runs to completion.  But if they do that,
then they are smart enough to realize that when their gdb doesn't work,
it's their fault.

I hope.

Michael C


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [rfa] gdb_thread_db.h: #errror if no uintptr_t
@ 2003-02-26 17:31 Michael Elizabeth Chastain
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Elizabeth Chastain @ 2003-02-26 17:31 UTC (permalink / raw)
  To: gdb-patches, mec

Committed (the second version).

Another PR down, 641 to go.

Michael C

2003-02-26  Michael Chastain  <mec@shout.net>

	Close PR build/660.
	PROBLEMS (i[3456]86-*-linux*): Note explicit error messages
	for old libc5/glibc.
	gdb_thread_db.h: Die if not HAVE_UINTPTR_T.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [rfa] gdb_thread_db.h: #errror if no uintptr_t
  2003-02-26 16:52 Michael Elizabeth Chastain
@ 2003-02-26 16:59 ` Daniel Jacobowitz
  0 siblings, 0 replies; 7+ messages in thread
From: Daniel Jacobowitz @ 2003-02-26 16:59 UTC (permalink / raw)
  To: Michael Elizabeth Chastain; +Cc: gdb-patches

On Wed, Feb 26, 2003 at 10:52:00AM -0600, Michael Elizabeth Chastain wrote:
> This patch updates gdb_thread_db.h to die with a more explicit error
> message if HAVE_UINTPTR_T is not defined.  'uintptr_t' is defined in
> glibc 2.1.3 and later.  It might be defined in glibc versions earlier
> than 2.1.3, too, but 2.1.3 is already three years old so I figure that
> is enough.
> 
> Instead of dying, gdb_thread_db.h could substitute some definition
> for uintptr_t.  I chose not to do this because if glibc is that old
> then I don't want to support it anyways.  But a case could be made
> for doing so.
> 
> Note that gdb_thread_db.h is used only on *-*-*linux* and s390-*-*.
> 
> Testing: again, I fiddled with my /usr/include/stdint.h to see both
> code paths.  I also had to disable thread_db.h because my system is
> new enough to actually use this file instead of the copy embedded
> in gdb_thread_db.h.
> 
> This will close PR build/660.
> 
> OK to commit?

> +#error Unable to find uintptr_t type in <stdint.h>.
> +#error Your libc or glibc is too old!
> +#error You must upgrade to glibc 2.1.3 or later.

How about just:
#error No uintptr_t available; your C library is too old.

[This file might be used in non-glibc systems at some point.]

OK with that change.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [rfa] gdb_thread_db.h: #errror if no uintptr_t
@ 2003-02-26 16:52 Michael Elizabeth Chastain
  2003-02-26 16:59 ` Daniel Jacobowitz
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Elizabeth Chastain @ 2003-02-26 16:52 UTC (permalink / raw)
  To: gdb-patches

This patch updates gdb_thread_db.h to die with a more explicit error
message if HAVE_UINTPTR_T is not defined.  'uintptr_t' is defined in
glibc 2.1.3 and later.  It might be defined in glibc versions earlier
than 2.1.3, too, but 2.1.3 is already three years old so I figure that
is enough.

Instead of dying, gdb_thread_db.h could substitute some definition
for uintptr_t.  I chose not to do this because if glibc is that old
then I don't want to support it anyways.  But a case could be made
for doing so.

Note that gdb_thread_db.h is used only on *-*-*linux* and s390-*-*.

Testing: again, I fiddled with my /usr/include/stdint.h to see both
code paths.  I also had to disable thread_db.h because my system is
new enough to actually use this file instead of the copy embedded
in gdb_thread_db.h.

This will close PR build/660.

OK to commit?

Michael C

2003-02-26  Michael Chastain  <mec@shout.net>

	Close PR build/660.
	PROBLEMS (i[3456]86-*-linux*): Note explicit error messages
	for old libc5/glibc.
	gdb_thread_db.h: Die if not HAVE_UINTPTR_T.

Index: PROBLEMS
===================================================================
RCS file: /cvs/src/src/gdb/PROBLEMS,v
retrieving revision 1.13
diff -u -r1.13 PROBLEMS
--- PROBLEMS	25 Feb 2003 21:58:20 -0000	1.13
+++ PROBLEMS	26 Feb 2003 16:41:58 -0000
@@ -69,9 +69,9 @@
 i[3456]86-*-linux*
 ------------------
 
-gdb/660: gdb does not build with linux libc5.  The symptom is a parse
-error before `uintptr_t'.  Upgrade to glibc 2.1.3 or later, which
-defines uintptr_t.
+gdb/660: gdb does not build with GNU/Linux libc5.  The symptom is a
+parse error before `uintptr_t' or an error message about `uintptr_t'.
+Upgrade to glibc 2.1.3 or later, which defines uintptr_t.
 
 gdb/1030: GNU binutils 2.12.1 and earlier versions do not work properly
 with gdb.  If you use GNU binutils, upgrade to version 2.13 or later.
Index: gdb_thread_db.h
===================================================================
RCS file: /cvs/src/src/gdb/gdb_thread_db.h,v
retrieving revision 1.4
diff -u -r1.4 gdb_thread_db.h
--- gdb_thread_db.h	12 Nov 2002 02:39:40 -0000	1.4
+++ gdb_thread_db.h	26 Feb 2003 16:41:58 -0000
@@ -199,6 +199,18 @@
   } u;
 } td_notify_t;
 
+/* Some people still have libc5 or old glibc with no uintptr_t.
+   They lose.  glibc 2.1.3 was released on 2000-02-25, and it has
+   uintptr_t, so it's reasonable to force these people to upgrade.  */
+
+#ifndef HAVE_UINTPTR_T
+#error Unable to find uintptr_t type in <stdint.h>.
+#error Your libc or glibc is too old!
+#error You must upgrade to glibc 2.1.3 or later.
+/* Inhibit compilation errors after these errors.  */
+#define uintptr_t void *
+#endif
+
 /* Structure used to report event.  */
 typedef struct td_event_msg
 {


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-02-26 19:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-26 17:19 [rfa] gdb_thread_db.h: #errror if no uintptr_t Michael Elizabeth Chastain
2003-02-26 18:39 ` Joel Brobecker
2003-02-26 18:45   ` Daniel Jacobowitz
  -- strict thread matches above, loose matches on Subject: below --
2003-02-26 19:56 Michael Elizabeth Chastain
2003-02-26 17:31 Michael Elizabeth Chastain
2003-02-26 16:52 Michael Elizabeth Chastain
2003-02-26 16:59 ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox