public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Tom Tromey <tom@tromey.com>
Cc: Pedro Alves <palves@redhat.com>,  gdb-patches@sourceware.org
Subject: Re: [RFA 11/11] Change python_run_simple_file to use gdbpy_ref
Date: Fri, 18 Nov 2016 23:22:00 -0000	[thread overview]
Message-ID: <87h974gyqp.fsf@tromey.com> (raw)
In-Reply-To: <87mvgzi8tk.fsf@tromey.com> (Tom Tromey's message of "Wed, 16 Nov	2016 11:22:15 -0700")

>>>>> "Tom" == Tom Tromey <tom@tromey.com> writes:

Pedro> Actually, you don't really need that -- that WIN32 code should work
Pedro> on Unix as well, it's just not as efficient as the other branch.
Pedro> So you can just hack/invert the #ifndef _WIN32 locally for testing.

Tom> What if I just remove the non-win32 code here?
Tom> It might be slightly less efficient, but only slightly; with the upside
Tom> being that we'd have just a single code path to test.

I looked into this some more, and I am going to drop the patch after
all.

The main issue is that PyFile_AsFile doesn't exist in Python 3.  In
Python 3 it seems that the implementation will have to be more
complicated: it seems necessary to either evaluate Python code (perhaps
a helper in the gdb module's __init__.py); or to read the file in
python_run_simple_file, call the Python parser, and then evaluate the
result.

One of these seems necessary, but it's not really related to this series
and I'm not sure my interest extends to that.

Tom

  parent reply	other threads:[~2016-11-18 23:22 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-12 21:38 [RFA 00/11] third series of C++ use in Python layer Tom Tromey
2016-11-12 21:29 ` [RFA 11/11] Change python_run_simple_file to use gdbpy_ref Tom Tromey
2016-11-12 21:39   ` Tom Tromey
2016-11-15 15:35     ` Pedro Alves
2016-11-16 18:22       ` Tom Tromey
2016-11-16 20:10         ` Pedro Alves
2016-11-16 23:45           ` Pedro Alves
2016-11-18 23:22         ` Tom Tromey [this message]
2016-11-18 23:50           ` Pedro Alves
2016-11-19 17:03             ` Tom Tromey
2016-11-22 16:55               ` Pedro Alves
2016-11-12 21:29 ` [RFA 05/11] Use gdbpy_enter_varobj in more of varobj.c Tom Tromey
2016-11-12 21:29 ` [RFA 04/11] Use gdbpy_enter in python.c Tom Tromey
2016-11-15 15:33   ` Pedro Alves
2016-11-18 22:33     ` Tom Tromey
2016-11-12 21:29 ` [RFA 07/11] Use gdbpy_enter_varobj in varobj_value_get_print_value Tom Tromey
2016-11-12 21:29 ` [RFA 09/11] Use gdbpy_ref in py_print_frame Tom Tromey
2016-11-12 21:29 ` [RFA 03/11] Use gdbpy_enter in py-param.c Tom Tromey
2016-11-12 21:29 ` [RFA 02/11] Use gdbpy_enter in fnpy_call Tom Tromey
2016-11-12 21:29 ` [RFA 08/11] Remove ensure_python_env Tom Tromey
2016-11-15 15:34   ` Pedro Alves
2016-11-18 22:40     ` Tom Tromey
2016-11-12 21:36 ` [RFA 06/11] Change type of encoding argument to gdbpy_extract_lazy_string Tom Tromey
2016-11-15 15:34   ` Pedro Alves
2016-11-12 21:38 ` [RFA 10/11] Use gdbpy_ref in py-prettyprint.c Tom Tromey
2016-11-19 17:09   ` Tom Tromey
2016-11-22 16:52     ` Pedro Alves
2016-11-12 21:40 ` [RFA 01/11] Use gdbpy_enter in cmdpy_function Tom Tromey
2016-11-15 15:37 ` [RFA 00/11] third series of C++ use in Python layer 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=87h974gyqp.fsf@tromey.com \
    --to=tom@tromey.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).