From: Ken Werner <ken@linux.vnet.ibm.com>
To: Phil Muldoon <pmuldoon@redhat.com>, Tom Tromey <tromey@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch] Add solib_address and decode_line Python functionality
Date: Fri, 13 Aug 2010 14:07:00 -0000 [thread overview]
Message-ID: <201008131607.09618.ken@linux.vnet.ibm.com> (raw)
In-Reply-To: <m3tyn2comu.fsf@fleche.redhat.com>
[-- Attachment #1: Type: Text/Plain, Size: 680 bytes --]
On Tuesday, August 10, 2010 08:24:09 pm Tom Tromey wrote:
> >>>>> "Phil" == Phil Muldoon <pmuldoon@redhat.com> writes:
> Tom> So, could you make this conditional?
>
> Phil> Sure, what do you think of the attached patch?
>
> Thanks for persevering. This is ok.
Hi,
It looks like the const qualifier of the format string argument of the
PyArg_Parse* routines has been introduced after the Python 2.4 release:
http://svn.python.org/view?view=rev&revision=41638
In case gdb is built against libpython 2.4 the current code would generate a
warning. One solution would be to just remove the const qualifier. A small
patch is attached. Any comments are appreciated.
Thanks
Ken
[-- Attachment #2: python.patch --]
[-- Type: text/x-patch, Size: 889 bytes --]
ChangeLog:
2010-08-13 Ken Werner <ken.werner@de.ibm.com>
* gdb/python/python.c (gdbpy_solib_name): Remove the const qualifier of
the format strings to be compatible with Python 2.4.
Index: gdb/python/python.c
===================================================================
RCS file: /cvs/src/src/gdb/python/python.c,v
retrieving revision 1.47
diff -p -u -r1.47 python.c
--- gdb/python/python.c 11 Aug 2010 20:54:11 -0000 1.47
+++ gdb/python/python.c 13 Aug 2010 13:44:16 -0000
@@ -388,10 +388,11 @@ gdbpy_solib_name (PyObject *self, PyObje
PyObject *str_obj;
#ifdef PY_LONG_LONG
unsigned PY_LONG_LONG pc;
- const char *format = "K";
+ /* To be compatible with Python 2.4 the format strings are not const. */
+ char *format = "K";
#else
unsigned long pc;
- const char *format = "k";
+ char *format = "k";
#endif
if (!PyArg_ParseTuple (args, format, &pc))
next prev parent reply other threads:[~2010-08-13 14:07 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-19 15:43 Phil Muldoon
2010-07-27 16:26 ` Joel Brobecker
2010-07-28 11:35 ` Phil Muldoon
2010-07-28 17:39 ` Joel Brobecker
2010-07-28 17:48 ` Eli Zaretskii
2010-07-29 20:39 ` Tom Tromey
2010-08-06 13:55 ` Phil Muldoon
2010-08-06 15:36 ` Eli Zaretskii
2010-08-06 22:39 ` Tom Tromey
2010-08-10 11:17 ` Phil Muldoon
2010-08-10 17:07 ` Eli Zaretskii
2010-08-10 18:24 ` Tom Tromey
2010-08-11 13:16 ` Phil Muldoon
2010-08-13 14:07 ` Ken Werner [this message]
2010-08-13 14:14 ` Phil Muldoon
2010-08-13 15:48 ` Tom Tromey
2010-08-13 16:22 ` Ken Werner
2010-08-18 23:55 ` Pedro Alves
2010-08-19 16:32 ` Tom Tromey
2010-08-19 17:04 ` Pedro Alves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201008131607.09618.ken@linux.vnet.ibm.com \
--to=ken@linux.vnet.ibm.com \
--cc=gdb-patches@sourceware.org \
--cc=pmuldoon@redhat.com \
--cc=tromey@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).