* [RFA] Build failure fix: Python troubles on non-python targets...
@ 2009-05-28 10:03 Pierre Muller
2009-05-28 14:56 ` Paul Pluzhnikov
2009-05-28 15:38 ` Tom Tromey
0 siblings, 2 replies; 7+ messages in thread
From: Pierre Muller @ 2009-05-28 10:03 UTC (permalink / raw)
To: gdb-patches
On DJGPP,
I now get this failure:
gcc -gstabs+ -O0 -I../../purecvs/gdb/config/djgpp \
-o gdb.exe gdb.o libgdb.a \
../readline/libreadline.a ../opcodes/libopcodes.a ../bfd/libbfd.a
..
/libiberty/libiberty.a ../libdecnumber/libdecnumber.a -ldbg -lm
../libiberty/
libiberty.a gnulib/libgnu.a
libgdb.a(valprint.o): In function `val_print':
e:/cygwin/usr/local/src/gdbcvs/djcvsbuild2/gdb/../../purecvs/gdb/valprint.c:
292:
undefined reference to `_apply_val_pretty_printer'
libgdb.a(valprint.o): In function `value_print':
e:/cygwin/usr/local/src/gdbcvs/djcvsbuild2/gdb/../../purecvs/gdb/valprint.c:
383:
undefined reference to `_apply_val_pretty_printer'
libgdb.a(cp-valprint.o): In function `cp_print_value':
e:/cygwin/usr/local/src/gdbcvs/djcvsbuild2/gdb/../../purecvs/gdb/cp-valprint
.c:4
28: undefined reference to `_apply_val_pretty_printer'
collect2: ld returned 1 exit status
python-prettyprint.o does not seem to be added to libgdb.a...
But if I try to compile it by hand I get this:
In file included from ../../purecvs/gdb/python/python-prettyprint.c:27:
../../purecvs/gdb/python/python-internal.h:49:2: #error "Unable to find
usable Python.h"
In file included from ../../purecvs/gdb/python/python-prettyprint.c:27:
../../purecvs/gdb/python/python-internal.h:66: error: parse error before '*'
token
The HAVE_PYTHON conditional is not at the right position.
It seems like python-prettyprint.o should be added
to CONFIG_OBS if no python is found or
The following two changes fixes compilation for me:
Is this patch OK?
Pierre
2009-05-28 Pierre Muller <muller@ics.u-strasbg.fr>
* configure.ac (!have_libpython): Add python-prettyprint source
and object files.
* configure: Regenerate.
* python/python-prettyprint.c: Move "#ifdef HAVE_PYTHON" before
python headers.
Index: configure.ac
===================================================================
RCS file: /cvs/src/src/gdb/configure.ac,v
retrieving revision 1.101
diff -u -p -r1.101 configure.ac
--- configure.ac 23 Apr 2009 21:28:19 -0000 1.101
+++ configure.ac 28 May 2009 09:57:53 -0000
@@ -685,8 +685,8 @@ if test "${have_libpython}" = yes; then
else
# Even if Python support is not compiled in, we need to have these files
# included in order to recognize the GDB command "python".
- CONFIG_OBS="$CONFIG_OBS python.o python-value.o"
- CONFIG_SRCS="$CONFIG_SRCS python/python.c python/python-value.c"
+ CONFIG_OBS="$CONFIG_OBS python.o python-value.o python-prettyprint.o"
+ CONFIG_SRCS="$CONFIG_SRCS python/python.c python/python-value.c
python/python-prettyprint.c"
fi
AC_SUBST(PYTHON_CFLAGS)
Index: python/python-prettyprint.c
===================================================================
RCS file: /cvs/src/src/gdb/python/python-prettyprint.c,v
retrieving revision 1.2
diff -u -p -r1.2 python-prettyprint.c
--- python/python-prettyprint.c 28 May 2009 01:09:20 -0000 1.2
+++ python/python-prettyprint.c 28 May 2009 09:57:53 -0000
@@ -23,10 +23,12 @@
#include "symtab.h"
#include "language.h"
#include "valprint.h"
+
+#ifdef HAVE_PYTHON
+
#include "python.h"
#include "python-internal.h"
-#ifdef HAVE_PYTHON
/* Helper function for find_pretty_printer which iterates over a list,
calls each function and inspects output. This will return a
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFA] Build failure fix: Python troubles on non-python targets...
2009-05-28 10:03 [RFA] Build failure fix: Python troubles on non-python targets Pierre Muller
@ 2009-05-28 14:56 ` Paul Pluzhnikov
2009-05-28 15:38 ` Tom Tromey
1 sibling, 0 replies; 7+ messages in thread
From: Paul Pluzhnikov @ 2009-05-28 14:56 UTC (permalink / raw)
To: Pierre Muller; +Cc: gdb-patches
On Thu, May 28, 2009 at 3:03 AM, Pierre Muller <muller@ics.u-strasbg.fr> wrote:
> On DJGPP,
> I now get this failure:
Current CVS Head similarly fails on Linux:
gcc -g -O2 \
-o gdbtui tui-main.o libgdb.a \
../readline/libreadline.a ../opcodes/libopcodes.a ../bfd/libbfd.a
../libiberty/libiberty.a ../libdecnumber/libdecnumber.a -lncurses
-lz -lm ../libiberty/libiberty.a gnulib/libgnu.a -ldl -rdynamic
libgdb.a(valprint.o): In function `value_print':
/home/ppluzhnikov/Archive/sourceware.org/gdb/build/gdb/../../src/gdb/valprint.c:388:
undefined reference to `apply_val_pretty_printer'
--
Paul Pluzhnikov
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFA] Build failure fix: Python troubles on non-python targets...
2009-05-28 10:03 [RFA] Build failure fix: Python troubles on non-python targets Pierre Muller
2009-05-28 14:56 ` Paul Pluzhnikov
@ 2009-05-28 15:38 ` Tom Tromey
2009-05-28 16:22 ` Pierre Muller
2009-05-28 16:31 ` Paul Pluzhnikov
1 sibling, 2 replies; 7+ messages in thread
From: Tom Tromey @ 2009-05-28 15:38 UTC (permalink / raw)
To: Pierre Muller; +Cc: gdb-patches
>>>>> "Pierre" == Pierre Muller <muller@ics.u-strasbg.fr> writes:
Pierre> On DJGPP,
Pierre> I now get this failure:
[...]
Sorry about that.
Pierre> The following two changes fixes compilation for me:
Pierre> Is this patch OK?
Nearly...
Pierre> +
Pierre> +#ifdef HAVE_PYTHON
Pierre> +
Pierre> #include "python.h"
Pierre> #include "python-internal.h"
This should unconditionally include python.h. So, the conditional
needs to be moved down a few lines. It is ok to include python.h even
if Python is not available; and in this case it is desirable so that
the declarations are picked up (and thus checked against the
definitions).
Ok with that change. Thanks.
Tom
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [RFA] Build failure fix: Python troubles on non-python targets...
2009-05-28 15:38 ` Tom Tromey
@ 2009-05-28 16:22 ` Pierre Muller
2009-05-28 16:23 ` Paul Pluzhnikov
2009-05-28 16:37 ` Tom Tromey
2009-05-28 16:31 ` Paul Pluzhnikov
1 sibling, 2 replies; 7+ messages in thread
From: Pierre Muller @ 2009-05-28 16:22 UTC (permalink / raw)
To: tromey; +Cc: gdb-patches
Here is what I get if I move it down:
$ make
make[1]: Entering directory `/usr/local/src/gdbcvs/build-nopython/gdb'
make[2]: Entering directory
`/usr/local/src/gdbcvs/build-nopython/gdb/gnulib'
make all-am
make[3]: Entering directory
`/usr/local/src/gdbcvs/build-nopython/gdb/gnulib'
if gcc -DHAVE_CONFIG_H -I. -I../../../purecvs/gdb/gnulib -I.. -gstabs+
-O0 -
MT memmem.o -MD -MP -MF ".deps/memmem.Tpo" -c -o memmem.o
../../../purecvs/gdb/g
nulib/memmem.c; \
then mv -f ".deps/memmem.Tpo" ".deps/memmem.Po"; else rm -f
".deps/memme
m.Tpo"; exit 1; fi
rm -f libgnu.a
ar cru libgnu.a dummy.o memmem.o
ranlib libgnu.a
make[3]: Leaving directory `/usr/local/src/gdbcvs/build-nopython/gdb/gnulib'
make[2]: Leaving directory `/usr/local/src/gdbcvs/build-nopython/gdb/gnulib'
make[1]: Leaving directory `/usr/local/src/gdbcvs/build-nopython/gdb'
gcc -gstabs+ -O0 -I. -I../../purecvs/gdb -I../../purecvs/gdb/common
-I../../pu
recvs/gdb/config -DLOCALEDIR="\"/usr/local/share/locale\"" -DHAVE_CONFIG_H
-I../
../purecvs/gdb/../include/opcode -I../../purecvs/gdb/../readline/.. -I../bfd
-I.
./../purecvs/gdb/../bfd -I../../purecvs/gdb/../include -I../libdecnumber
-I../..
/purecvs/gdb/../libdecnumber -I../../purecvs/gdb/gnulib -Ignulib
-DMI_OUT=1 -D
TUI=1 -DGDBTK -Wall -Wdeclaration-after-statement -Wpointer-arith
-Wformat-nonl
iteral -Wno-unused -Wno-switch -Wno-char-subscripts -Werror -c -o
python-prettyp
rint.o -MT python-prettyprint.o -MMD -MP -MF .deps/python-prettyprint.Tpo
../..
/purecvs/gdb/python/python-prettyprint.c
../../purecvs/gdb/python/python-prettyprint.c:598: error: conflicting types
for
'apply_val_pretty_printer'
../../purecvs/gdb/python/python.h:33: error: previous declaration of
'apply_val_
pretty_printer' was here
../../purecvs/gdb/python/python-prettyprint.c:598: error: conflicting types
for
'apply_val_pretty_printer'
../../purecvs/gdb/python/python.h:33: error: previous declaration of
'apply_val_
pretty_printer' was here
make: *** [python-prettyprint.o] Error 1
Pierre
> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Tom Tromey
> Envoyé : Thursday, May 28, 2009 5:32 PM
> À : Pierre Muller
> Cc : gdb-patches@sourceware.org
> Objet : Re: [RFA] Build failure fix: Python troubles on non-python
> targets...
>
> >>>>> "Pierre" == Pierre Muller <muller@ics.u-strasbg.fr> writes:
>
> Pierre> On DJGPP,
> Pierre> I now get this failure:
> [...]
>
> Sorry about that.
>
> Pierre> The following two changes fixes compilation for me:
> Pierre> Is this patch OK?
>
> Nearly...
>
> Pierre> +
> Pierre> +#ifdef HAVE_PYTHON
> Pierre> +
> Pierre> #include "python.h"
> Pierre> #include "python-internal.h"
>
> This should unconditionally include python.h. So, the conditional
> needs to be moved down a few lines. It is ok to include python.h even
> if Python is not available; and in this case it is desirable so that
> the declarations are picked up (and thus checked against the
> definitions).
>
> Ok with that change. Thanks.
>
> Tom
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFA] Build failure fix: Python troubles on non-python targets...
2009-05-28 16:22 ` Pierre Muller
@ 2009-05-28 16:23 ` Paul Pluzhnikov
2009-05-28 16:37 ` Tom Tromey
1 sibling, 0 replies; 7+ messages in thread
From: Paul Pluzhnikov @ 2009-05-28 16:23 UTC (permalink / raw)
To: Pierre Muller; +Cc: tromey, gdb-patches
On Thu, May 28, 2009 at 9:22 AM, Pierre Muller <muller@ics.u-strasbg.fr> wrote:
> Here is what I get if I move it down:
This is a separate bug.
I'll commit a fix momentarily.
--
Paul Pluzhnikov
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFA] Build failure fix: Python troubles on non-python targets...
2009-05-28 15:38 ` Tom Tromey
2009-05-28 16:22 ` Pierre Muller
@ 2009-05-28 16:31 ` Paul Pluzhnikov
1 sibling, 0 replies; 7+ messages in thread
From: Paul Pluzhnikov @ 2009-05-28 16:31 UTC (permalink / raw)
To: tromey; +Cc: Pierre Muller, gdb-patches
[-- Attachment #1: Type: text/plain, Size: 705 bytes --]
On Thu, May 28, 2009 at 8:32 AM, Tom Tromey <tromey@redhat.com> wrote:
> Ok with that change. Thanks.
The patch was line-wrapped and missing change to configure.
Also moving HAVE_PYTHON down revealed a bug: the signature of of
apply_val_pretty_printer has changed, but the prototype in the !HAVE_PYTHON
was not updated.
Attached is the patch I just committed.
--
Paul Pluzhnikov
2009-05-28 Pierre Muller <muller@ics.u-strasbg.fr>
Paul Pluzhnikov <ppluzhnikov@google.com>
* configure.ac (!have_libpython): Add python-prettyprint source
and object files.
* configure: Regenerate.
* python/python-prettyprint.c: Move "#ifdef HAVE_PYTHON" before
python headers.
[-- Attachment #2: gdb-python-20090528.txt --]
[-- Type: text/plain, Size: 2706 bytes --]
Index: configure.ac
===================================================================
RCS file: /cvs/src/src/gdb/configure.ac,v
retrieving revision 1.101
diff -u -p -u -r1.101 configure.ac
--- configure.ac 23 Apr 2009 21:28:19 -0000 1.101
+++ configure.ac 28 May 2009 16:21:19 -0000
@@ -685,8 +685,8 @@ if test "${have_libpython}" = yes; then
else
# Even if Python support is not compiled in, we need to have these files
# included in order to recognize the GDB command "python".
- CONFIG_OBS="$CONFIG_OBS python.o python-value.o"
- CONFIG_SRCS="$CONFIG_SRCS python/python.c python/python-value.c"
+ CONFIG_OBS="$CONFIG_OBS python.o python-value.o python-prettyprint.o"
+ CONFIG_SRCS="$CONFIG_SRCS python/python.c python/python-value.c python/python-prettyprint.c"
fi
AC_SUBST(PYTHON_CFLAGS)
Index: configure
===================================================================
RCS file: /cvs/src/src/gdb/configure,v
retrieving revision 1.282
diff -u -p -u -r1.282 configure
--- configure 6 May 2009 23:05:27 -0000 1.282
+++ configure 28 May 2009 16:21:20 -0000
@@ -11907,8 +11907,8 @@ echo "${ECHO_T}${PYTHON_CFLAGS}" >&6
else
# Even if Python support is not compiled in, we need to have these files
# included in order to recognize the GDB command "python".
- CONFIG_OBS="$CONFIG_OBS python.o python-value.o"
- CONFIG_SRCS="$CONFIG_SRCS python/python.c python/python-value.c"
+ CONFIG_OBS="$CONFIG_OBS python.o python-value.o python-prettyprint.o"
+ CONFIG_SRCS="$CONFIG_SRCS python/python.c python/python-value.c python/python-prettyprint.c"
fi
Index: python/python-prettyprint.c
===================================================================
RCS file: /cvs/src/src/gdb/python/python-prettyprint.c,v
retrieving revision 1.2
diff -u -p -u -r1.2 python-prettyprint.c
--- python/python-prettyprint.c 28 May 2009 01:09:20 -0000 1.2
+++ python/python-prettyprint.c 28 May 2009 16:21:20 -0000
@@ -23,10 +23,12 @@
#include "symtab.h"
#include "language.h"
#include "valprint.h"
+
#include "python.h"
-#include "python-internal.h"
#ifdef HAVE_PYTHON
+#include "python-internal.h"
+
/* Helper function for find_pretty_printer which iterates over a list,
calls each function and inspects output. This will return a
@@ -587,9 +589,8 @@ gdbpy_default_visualizer (PyObject *self
int
apply_val_pretty_printer (struct type *type, const gdb_byte *valaddr,
int embedded_offset, CORE_ADDR address,
- struct ui_file *stream, int format,
- int deref_ref, int recurse,
- enum val_prettyprint pretty,
+ struct ui_file *stream, int recurse,
+ const struct value_print_options *options,
const struct language_defn *language)
{
return 0;
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFA] Build failure fix: Python troubles on non-python targets...
2009-05-28 16:22 ` Pierre Muller
2009-05-28 16:23 ` Paul Pluzhnikov
@ 2009-05-28 16:37 ` Tom Tromey
1 sibling, 0 replies; 7+ messages in thread
From: Tom Tromey @ 2009-05-28 16:37 UTC (permalink / raw)
To: Pierre Muller; +Cc: gdb-patches
>>>>> "Pierre" == Pierre Muller <muller@ics.u-strasbg.fr> writes:
Pierre> Here is what I get if I move it down:
[...]
Pierre> ../../purecvs/gdb/python/python-prettyprint.c:598: error: conflicting types
Pierre> for
Pierre> 'apply_val_pretty_printer'
Evidently I haven't done a python-less build in a while :-(
Anyway, this is exactly the kind of error that the inclusion of
python.h is supposed to detect. So at least that is working ok :)
Go ahead and commit your patch.
Paul can then check in his additional fix.
Tom
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-05-28 16:37 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-28 10:03 [RFA] Build failure fix: Python troubles on non-python targets Pierre Muller
2009-05-28 14:56 ` Paul Pluzhnikov
2009-05-28 15:38 ` Tom Tromey
2009-05-28 16:22 ` Pierre Muller
2009-05-28 16:23 ` Paul Pluzhnikov
2009-05-28 16:37 ` Tom Tromey
2009-05-28 16:31 ` Paul Pluzhnikov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox