Re: [RFA] Build failure fix: Python troubles on non-python targets...

Paul Pluzhnikov
2009-05-28T16:31:38Z

[-- 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;