Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Undefined uintptr_t with mingw
@ 2010-12-21 16:35 Alberto Luaces
  2010-12-22  4:00 ` Joel Brobecker
  0 siblings, 1 reply; 6+ messages in thread
From: Alberto Luaces @ 2010-12-21 16:35 UTC (permalink / raw)
  To: gdb-patches

Hello,

while building gdb with the mingw cross-compiler from Debian
(4.4.4-0.1+b1) I run across this error:

i586-mingw32msvc-gcc -c -Wall -g -O2 -D__USE_MINGW_ACCESS    -I. -I../../../gdb-7.2/gdb/gdbserver -I../../../gdb-7.2/gdb/gdbserver/../common -I../../../gdb-7.2/gdb/gdbserver/../regformats -I../../../gdb-7.2/gdb/gdbserver/../../include ../../../gdb-7.2/gdb/gdbserver/win32-low.c
../../../gdb-7.2/gdb/gdbserver/win32-low.c: In function ‘child_add_thread’:
../../../gdb-7.2/gdb/gdbserver/win32-low.c:192: error: ‘uintptr_t’ undeclared (first use in this function)
../../../gdb-7.2/gdb/gdbserver/win32-low.c:192: error: (Each undeclared identifier is reported only once
../../../gdb-7.2/gdb/gdbserver/win32-low.c:192: error: for each function it appears in.)
../../../gdb-7.2/gdb/gdbserver/win32-low.c:192: error: expected ‘;’ before ‘tlb’
../../../gdb-7.2/gdb/gdbserver/win32-low.c: In function ‘child_xfer_memory’:
../../../gdb-7.2/gdb/gdbserver/win32-low.c:283: error: ‘uintptr_t’ undeclared (first use in this function)
../../../gdb-7.2/gdb/gdbserver/win32-low.c:283: error: expected ‘;’ before ‘addr’
../../../gdb-7.2/gdb/gdbserver/win32-low.c:287: error: ‘addr’ undeclared (first use in this function)
../../../gdb-7.2/gdb/gdbserver/win32-low.c: In function ‘handle_load_dll’:
../../../gdb-7.2/gdb/gdbserver/win32-low.c:1208: error: ‘uintptr_t’ undeclared (first use in this function)
../../../gdb-7.2/gdb/gdbserver/win32-low.c:1208: error: expected ‘;’ before ‘event’
../../../gdb-7.2/gdb/gdbserver/win32-low.c: In function ‘handle_unload_dll’:
../../../gdb-7.2/gdb/gdbserver/win32-low.c:1216: error: ‘uintptr_t’ undeclared (first use in this function)
../../../gdb-7.2/gdb/gdbserver/win32-low.c:1216: error: expected ‘,’ or ‘;’ before ‘current_event’
../../../gdb-7.2/gdb/gdbserver/win32-low.c: In function ‘handle_exception’:
../../../gdb-7.2/gdb/gdbserver/win32-low.c:1317: error: ‘uintptr_t’ undeclared (first use in this function)
../../../gdb-7.2/gdb/gdbserver/win32-low.c:1317: error: expected ‘)’ before ‘current_event’
../../../gdb-7.2/gdb/gdbserver/win32-low.c:1317: error: too few arguments to function ‘phex_nz’
make[4]: *** [win32-low.o] Error 1

Since uintptr_t is defined in <stdint.h>, I succesfully built gdb with
this change:

diff -ur gdb-7.2orig/gdb/gdbserver/win32-low.c gdb-7.2/gdb/gdbserver/win32-low.c
--- gdb-7.2orig/gdb/gdbserver/win32-low.c	2010-12-21 16:27:10.000000000 +0100
+++ gdb-7.2/gdb/gdbserver/win32-low.c	2010-12-21 17:21:56.000000000 +0100
@@ -33,6 +33,7 @@
 #include <sys/param.h>
 #include <malloc.h>
 #include <process.h>
+#include <stdint.h>
 
 #ifndef USE_WIN32API
 #include <sys/cygwin.h>

Does it sound right to apply to GDB?

Thanks,

-- 
Alberto


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

* Re: Undefined uintptr_t with mingw
  2010-12-21 16:35 Undefined uintptr_t with mingw Alberto Luaces
@ 2010-12-22  4:00 ` Joel Brobecker
  2010-12-22 12:29   ` Pedro Alves
  0 siblings, 1 reply; 6+ messages in thread
From: Joel Brobecker @ 2010-12-22  4:00 UTC (permalink / raw)
  To: Alberto Luaces; +Cc: gdb-patches

[I changed the subject to include "gdbserver" in the subject]

> diff -ur gdb-7.2orig/gdb/gdbserver/win32-low.c gdb-7.2/gdb/gdbserver/win32-low.c
> --- gdb-7.2orig/gdb/gdbserver/win32-low.c	2010-12-21 16:27:10.000000000 +0100
> +++ gdb-7.2/gdb/gdbserver/win32-low.c	2010-12-21 17:21:56.000000000 +0100
> @@ -33,6 +33,7 @@
>  #include <sys/param.h>
>  #include <malloc.h>
>  #include <process.h>
> +#include <stdint.h>

Pedro is the current expert for gdbserver, so please wait for his
review, but I'm thinking that we should probably do the same as GDB,
which is include stdlib in the gdbserver equivalent of defs.h (i.e.
server.h).

-- 
Joel


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

* Re: Undefined uintptr_t with mingw
  2010-12-22  4:00 ` Joel Brobecker
@ 2010-12-22 12:29   ` Pedro Alves
  2010-12-22 13:11     ` Pedro Alves
  2010-12-22 14:32     ` Joel Brobecker
  0 siblings, 2 replies; 6+ messages in thread
From: Pedro Alves @ 2010-12-22 12:29 UTC (permalink / raw)
  To: gdb-patches; +Cc: Joel Brobecker, Alberto Luaces, gdb-patches

On Wednesday 22 December 2010 04:00:05, Joel Brobecker wrote:
> [I changed the subject to include "gdbserver" in the subject]
> 
> > diff -ur gdb-7.2orig/gdb/gdbserver/win32-low.c gdb-7.2/gdb/gdbserver/win32-low.c
> > --- gdb-7.2orig/gdb/gdbserver/win32-low.c	2010-12-21 16:27:10.000000000 +0100
> > +++ gdb-7.2/gdb/gdbserver/win32-low.c	2010-12-21 17:21:56.000000000 +0100
> > @@ -33,6 +33,7 @@
> >  #include <sys/param.h>
> >  #include <malloc.h>
> >  #include <process.h>
> > +#include <stdint.h>

Odd that nobody reported this before.  It kind of sounds like
something's different on debian's mingw...

ISTR that on mingw, stdint.h used to not be available.  ISTR
that's the reason we have the stdint.h inclusion
in gdbserver/tracepoint.c guarded by HAVE_STDINT_H.  Unless
someone calls me mad, this is okay, with such a guard added.

> Pedro is the current expert for gdbserver, so please wait for his
> review, but I'm thinking that we should probably do the same as GDB,
> which is include stdlib in the gdbserver equivalent of defs.h (i.e.
> server.h).

This is fine with me as well, but note that gdb/defs.h is
including stdint.h unconditionally, because it can rely that gdb/gnulib
provides one if the host doesn't have such a header, or if
it finds the system one misses features.  If we go this path,
we should also wrap it in HAVE_STDINT_H.

-- 
Pedro Alves


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

* Re: Undefined uintptr_t with mingw
  2010-12-22 12:29   ` Pedro Alves
@ 2010-12-22 13:11     ` Pedro Alves
  2010-12-22 14:32     ` Joel Brobecker
  1 sibling, 0 replies; 6+ messages in thread
From: Pedro Alves @ 2010-12-22 13:11 UTC (permalink / raw)
  To: gdb-patches; +Cc: Joel Brobecker, Alberto Luaces, gdb-patches

On Wednesday 22 December 2010 04:00:05, Joel Brobecker wrote:
> [I changed the subject to include "gdbserver" in the subject]
> 
> > diff -ur gdb-7.2orig/gdb/gdbserver/win32-low.c gdb-7.2/gdb/gdbserver/win32-low.c
> > --- gdb-7.2orig/gdb/gdbserver/win32-low.c	2010-12-21 16:27:10.000000000 +0100
> > +++ gdb-7.2/gdb/gdbserver/win32-low.c	2010-12-21 17:21:56.000000000 +0100
> > @@ -33,6 +33,7 @@
> >  #include <sys/param.h>
> >  #include <malloc.h>
> >  #include <process.h>
> > +#include <stdint.h>

Odd that nobody reported this before.  It kind of sounds like
something's different on debian's mingw...

ISTR that on mingw, stdint.h used to not be available.  ISTR
that's the reason we have the stdint.h inclusion
in gdbserver/tracepoint.c guarded by HAVE_STDINT_H.  Unless
someone calls me mad, this is okay, with such a guard added.

> Pedro is the current expert for gdbserver, so please wait for his
> review, but I'm thinking that we should probably do the same as GDB,
> which is include stdlib in the gdbserver equivalent of defs.h (i.e.
> server.h).

This is fine with me as well, but note that gdb/defs.h is
including stdint.h unconditionally, because it can rely that gdb/gnulib
provides one if the host doesn't have such a header, or if
it finds the system one misses features.  If we go this path,
we should also wrap it in HAVE_STDINT_H.

-- 
Pedro Alves


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

* Re: Undefined uintptr_t with mingw
  2010-12-22 14:32     ` Joel Brobecker
@ 2010-12-22 13:12       ` Joel Brobecker
  0 siblings, 0 replies; 6+ messages in thread
From: Joel Brobecker @ 2010-12-22 13:12 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches, Alberto Luaces, gdb-patches

> This is fine with me as well, but note that gdb/defs.h is
> including stdint.h unconditionally, because it can rely that gdb/gnulib
> provides one if the host doesn't have such a header, or if
> it finds the system one misses features.  If we go this path,
> we should also wrap it in HAVE_STDINT_H.

I thought we were configuring the gnulib directory in gdbserver
as well. That's why I thought that the unconditional include was OK.

-- 
Joel


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

* Re: Undefined uintptr_t with mingw
  2010-12-22 12:29   ` Pedro Alves
  2010-12-22 13:11     ` Pedro Alves
@ 2010-12-22 14:32     ` Joel Brobecker
  2010-12-22 13:12       ` Joel Brobecker
  1 sibling, 1 reply; 6+ messages in thread
From: Joel Brobecker @ 2010-12-22 14:32 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches, Alberto Luaces, gdb-patches

> This is fine with me as well, but note that gdb/defs.h is
> including stdint.h unconditionally, because it can rely that gdb/gnulib
> provides one if the host doesn't have such a header, or if
> it finds the system one misses features.  If we go this path,
> we should also wrap it in HAVE_STDINT_H.

I thought we were configuring the gnulib directory in gdbserver
as well. That's why I thought that the unconditional include was OK.

-- 
Joel


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

end of thread, other threads:[~2010-12-22 13:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-21 16:35 Undefined uintptr_t with mingw Alberto Luaces
2010-12-22  4:00 ` Joel Brobecker
2010-12-22 12:29   ` Pedro Alves
2010-12-22 13:11     ` Pedro Alves
2010-12-22 14:32     ` Joel Brobecker
2010-12-22 13:12       ` Joel Brobecker

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