This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA 11/11] Change python_run_simple_file to use gdbpy_ref


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]