* Building current gdb on centos-5
@ 2013-05-29 21:35 Julian Smith
2013-05-30 8:08 ` Pedro Alves
0 siblings, 1 reply; 5+ messages in thread
From: Julian Smith @ 2013-05-29 21:35 UTC (permalink / raw)
To: gdb
Hello
Is the latest gdb in cvs, expected to build on centos-5 ?
I'm seeing this build failure:
...
gcc -g -O2 -I. -I. -I./common -I./config -DLOCALEDIR="\"/usr/local/share/locale\"" -DHAVE_CONFIG_H -I./../include/opcode -I./../opcodes/.. -I./../readline/.. -I../bfd -I./../bfd -I./../include -I../libdecnumber -I./../libdecnumber -I./gn
ulib/import -Ibuild-gnulib/import -DTUI=1 -I/usr/include/python2.4 -I/usr/include/python2.4 -Wall -Wdeclaration-after-statement -Wpointer-arith -Wpointer-sign -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts
-Wmissing-prototypes -Wdeclaration-after-statement -Wformat-nonliteral -c -o mi-main.o -MT mi-main.o -MMD -MP -MF .deps/mi-main.Tpo ./mi/mi-main.c
In file included from ./mi/mi-main.c:56:
./python/python-internal.h: In function 'gdb_Py_DECREF':
./python/python-internal.h:179: warning: dereferencing 'void *' pointer
./python/python-internal.h:179: error: request for member 'ob_refcnt' in something not a structure or union
I'm building with:
cd ~/gdb_cvs_dir/src
./configure --disable-werror
make
My centos-5 has python-2.4 (python-devel.i386 2.4.3-24.el5).
Many thanks,
- Julian
--
http://op59.net/
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: Building current gdb on centos-5
2013-05-29 21:35 Building current gdb on centos-5 Julian Smith
@ 2013-05-30 8:08 ` Pedro Alves
2013-05-30 8:14 ` Pedro Alves
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Pedro Alves @ 2013-05-30 8:08 UTC (permalink / raw)
To: Julian Smith; +Cc: gdb
On 05/29/2013 09:50 PM, Julian Smith wrote:
> Is the latest gdb in cvs, expected to build on centos-5 ?
It should, but looks like I broke it.
> I'm seeing this build failure:
>
> ...
> gcc -g -O2 -I. -I. -I./common -I./config -DLOCALEDIR="\"/usr/local/share/locale\"" -DHAVE_CONFIG_H -I./../include/opcode -I./../opcodes/.. -I./../readline/.. -I../bfd -I./../bfd -I./../include -I../libdecnumber -I./../libdecnumber -I./gn
> ulib/import -Ibuild-gnulib/import -DTUI=1 -I/usr/include/python2.4 -I/usr/include/python2.4 -Wall -Wdeclaration-after-statement -Wpointer-arith -Wpointer-sign -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts
> -Wmissing-prototypes -Wdeclaration-after-statement -Wformat-nonliteral -c -o mi-main.o -MT mi-main.o -MMD -MP -MF .deps/mi-main.Tpo ./mi/mi-main.c
> In file included from ./mi/mi-main.c:56:
> ./python/python-internal.h: In function 'gdb_Py_DECREF':
> ./python/python-internal.h:179: warning: dereferencing 'void *' pointer
> ./python/python-internal.h:179: error: request for member 'ob_refcnt' in something not a structure or union
Thanks. gdb_Py_DECREF is a recent addition:
/* Python 2.6 did not wrap Py_DECREF in 'do {...} while (0)', leading
to 'suggest explicit braces to avoid ambiguous ‘else’' gcc errors.
Wrap it ourselves, so that callers don't need to care. */
static inline void
gdb_Py_DECREF (void *op) /* ARI: editCase function */
{
Py_DECREF (op);
}
Making that:
- Py_DECREF (op);
+ Py_DECREF ((PyObject*) op);
should fix this. I'll push a fix.
On my system's Python 2.7, Py_DECREF always casts its argument
to (PyObject*), so it didn't seem necessary to cast it ourselves:
#define Py_DECREF(op) \
do { \
if (_Py_DEC_REFTOTAL _Py_REF_DEBUG_COMMA \
--((PyObject*)(op))->ob_refcnt != 0) \
_Py_CHECK_REFCNT(op) \
else \
_Py_Dealloc((PyObject *)(op)); \
} while (0)
> My centos-5 has python-2.4 (python-devel.i386 2.4.3-24.el5).
For the archives, could you please paste what Py_DECREF looks
like in 2.4? Thanks!
--
Pedro Alves
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: Building current gdb on centos-5
2013-05-30 8:08 ` Pedro Alves
@ 2013-05-30 8:14 ` Pedro Alves
2013-05-30 8:35 ` Julian Smith
2013-05-30 8:59 ` Pedro Alves
2 siblings, 0 replies; 5+ messages in thread
From: Pedro Alves @ 2013-05-30 8:14 UTC (permalink / raw)
To: Julian Smith; +Cc: gdb
On 05/30/2013 09:08 AM, Pedro Alves wrote:
> For the archives, could you please paste what Py_DECREF looks
> like in 2.4? Thanks!
Nevermind, downloading the 2.4.6's sources only took a minute. :-)
2.4:
#define Py_DECREF(op) \
if (_Py_DEC_REFTOTAL _Py_REF_DEBUG_COMMA \
--(op)->ob_refcnt != 0) \
_Py_CHECK_REFCNT(op) \
else \
_Py_Dealloc((PyObject *)(op))
2.7:
#define Py_DECREF(op) \
do { \
if (_Py_DEC_REFTOTAL _Py_REF_DEBUG_COMMA \
--((PyObject*)(op))->ob_refcnt != 0) \
_Py_CHECK_REFCNT(op) \
else \
_Py_Dealloc((PyObject *)(op)); \
} while (0)
--
Pedro Alves
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: Building current gdb on centos-5
2013-05-30 8:08 ` Pedro Alves
2013-05-30 8:14 ` Pedro Alves
@ 2013-05-30 8:35 ` Julian Smith
2013-05-30 8:59 ` Pedro Alves
2 siblings, 0 replies; 5+ messages in thread
From: Julian Smith @ 2013-05-30 8:35 UTC (permalink / raw)
To: gdb
On Thu, 30 May 2013 09:08:26 +0100
Pedro Alves <palves@redhat.com> wrote:
> On 05/29/2013 09:50 PM, Julian Smith wrote:
>
> > Is the latest gdb in cvs, expected to build on centos-5 ?
>
> It should, but looks like I broke it.
>
> > I'm seeing this build failure:
> >
> > ...
> > gcc -g -O2 -I. -I. -I./common -I./config -DLOCALEDIR="\"/usr/local/share/locale\"" -DHAVE_CONFIG_H -I./../include/opcode -I./../opcodes/.. -I./../readline/.. -I../bfd -I./../bfd -I./../include -I../libdecnumber -I./../libdecnumber -I./gn
> > ulib/import -Ibuild-gnulib/import -DTUI=1 -I/usr/include/python2.4 -I/usr/include/python2.4 -Wall -Wdeclaration-after-statement -Wpointer-arith -Wpointer-sign -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts
> > -Wmissing-prototypes -Wdeclaration-after-statement -Wformat-nonliteral -c -o mi-main.o -MT mi-main.o -MMD -MP -MF .deps/mi-main.Tpo ./mi/mi-main.c
> > In file included from ./mi/mi-main.c:56:
> > ./python/python-internal.h: In function 'gdb_Py_DECREF':
> > ./python/python-internal.h:179: warning: dereferencing 'void *' pointer
> > ./python/python-internal.h:179: error: request for member 'ob_refcnt' in something not a structure or union
>
> Thanks. gdb_Py_DECREF is a recent addition:
>
> /* Python 2.6 did not wrap Py_DECREF in 'do {...} while (0)', leading
> to 'suggest explicit braces to avoid ambiguous âelseâ' gcc errors.
> Wrap it ourselves, so that callers don't need to care. */
>
> static inline void
> gdb_Py_DECREF (void *op) /* ARI: editCase function */
> {
> Py_DECREF (op);
> }
>
> Making that:
>
> - Py_DECREF (op);
> + Py_DECREF ((PyObject*) op);
>
> should fix this. I'll push a fix.
Thanks.
>
> On my system's Python 2.7, Py_DECREF always casts its argument
> to (PyObject*), so it didn't seem necessary to cast it ourselves:
>
> #define Py_DECREF(op) \
> do { \
> if (_Py_DEC_REFTOTAL _Py_REF_DEBUG_COMMA \
> --((PyObject*)(op))->ob_refcnt != 0) \
> _Py_CHECK_REFCNT(op) \
> else \
> _Py_Dealloc((PyObject *)(op)); \
> } while (0)
>
> > My centos-5 has python-2.4 (python-devel.i386 2.4.3-24.el5).
>
> For the archives, could you please paste what Py_DECREF looks
> like in 2.4? Thanks!
Here it is, in /usr/include/python2.4/object.h:
#define Py_DECREF(op) \
if (_Py_DEC_REFTOTAL _Py_REF_DEBUG_COMMA \
--(op)->ob_refcnt != 0) \
_Py_CHECK_REFCNT(op) \
else \
_Py_Dealloc((PyObject *)(op))
Thanks,
- Julian
--
http://op59.net/
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: Building current gdb on centos-5
2013-05-30 8:08 ` Pedro Alves
2013-05-30 8:14 ` Pedro Alves
2013-05-30 8:35 ` Julian Smith
@ 2013-05-30 8:59 ` Pedro Alves
2 siblings, 0 replies; 5+ messages in thread
From: Pedro Alves @ 2013-05-30 8:59 UTC (permalink / raw)
To: Julian Smith; +Cc: gdb
On 05/30/2013 09:08 AM, Pedro Alves wrote:
> Making that:
>
> - Py_DECREF (op);
> + Py_DECREF ((PyObject*) op);
>
> should fix this. I'll push a fix.
Done. http://sourceware.org/ml/gdb-patches/2013-05/msg01045.html
Thanks for reporting.
--
Pedro Alves
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-05-30 8:59 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-29 21:35 Building current gdb on centos-5 Julian Smith
2013-05-30 8:08 ` Pedro Alves
2013-05-30 8:14 ` Pedro Alves
2013-05-30 8:35 ` Julian Smith
2013-05-30 8:59 ` Pedro Alves
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox