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


On 11/18/2016 11:22 PM, Tom Tromey wrote:
>>>>>> "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.

Curious, that means that nobody is building mingw gdb against
Python 3 then.

I did git blame on that function now, and that point at git commit
4c63965b8, which shows that we used to do the longer path everywhere,
and from the git log it sounds like we don't want to go back.

So looks like we're back to the original suggestion of hacking the
WIN32 condition locally and test against Python 2.  If that works,
push it in.

Thanks,
Pedro Alves


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