From: Simon Marchi <simon.marchi@ericsson.com>
To: Pedro Alves <palves@redhat.com>, <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Fix build with Python 3.4 (PR python/16784)
Date: Fri, 05 Dec 2014 21:49:00 -0000 [thread overview]
Message-ID: <5482287D.9030500@ericsson.com> (raw)
In-Reply-To: <5480A49F.1010904@redhat.com>
On 2014-12-04 01:14 PM, Pedro Alves wrote:
> On 11/26/2014 01:47 PM, Simon Marchi wrote:
>> The type of the function pointer PyOS_ReadlineFunctionPointer (part of the
>> Python C API), which we use, slightly changed starting with Python 3.4. The
>> signature when from
>
> "went from"
Done.
>> I changed the signature of deprecated_readline_hook. I would've changed any
>> user of it, but it seems like nothing is using it,
>
> You'd probably find it in the insight/gdbtk code.
Is this something that I need to update, or insight is not maintained anymore?
>> --- a/gdb/python/py-gdb-readline.c
>> +++ b/gdb/python/py-gdb-readline.c
>> @@ -26,10 +26,13 @@
>> cases, sys_stdin and sys_stdout are always stdin and stdout
>> respectively, as far as I can tell; they are ignored and
>> command_line_input is used instead. */
>> -
>> static char *
>
> Don't lose the empty line.
Done.
>> gdbpy_readline_wrapper (FILE *sys_stdin, FILE *sys_stdout,
>> +#if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 4
>> + const char *prompt)
>> +#else
>> char *prompt)
>> +#endif
>>
>
>> @@ -938,6 +938,8 @@ command_line_input (char *prompt_arg, int repeat, char *annotation_suffix)
>> strcat (local_prompt, "\n\032\032");
>> strcat (local_prompt, annotation_suffix);
>> strcat (local_prompt, "\n");
>> +
>> + prompt_arg = local_prompt;
>
> I think it'd be even clearer if we avoided changing
> the variable that is called "arg". How about we add:
>
> const char *prompt = prompt_arg;
>
> at the top, and then use "prompt" throughout, where
> you're using "prompt_arg"?
How about we just don't call it *_arg?
I don't see the point in having both a prompt and a prompt_arg. If we needed to use both at the same time, of course, but it's not the case.
> The 'local_prompt' variable could move to the "annotation_level > 1"
> block too, for clarity.
Yes, for sure.
Thanks,
Simon
next prev parent reply other threads:[~2014-12-05 21:49 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1417009634-2356-1-git-send-email-simon.marchi@ericsson.com>
2014-12-04 18:15 ` Pedro Alves
2014-12-05 21:49 ` Simon Marchi [this message]
2014-12-05 23:00 ` Sergio Durigan Junior
2014-12-05 23:07 ` Keith Seitz
2014-12-08 16:22 ` Simon Marchi
2014-12-08 17:50 ` Patrick Monnerat
2014-12-16 11:20 ` Patrick Monnerat
2014-12-08 16:44 ` Simon Marchi
2014-12-12 15:02 ` 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=5482287D.9030500@ericsson.com \
--to=simon.marchi@ericsson.com \
--cc=gdb-patches@sourceware.org \
--cc=palves@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