binutils-gdb/gdb/python/lib/gdb
Christian Biesinger 272044897e Make GDB compile with Python 3 on MinGW
PyFile_FromString and PyFile_AsFile have been removed in Python 3.
There is no obvious replacement that works here, and we can't just
pass our FILE* to a DLL in Windows because it may use a different
C runtime.

So we just call a Python function which reads and executes file
contents. Care must be taken to execute it in the context of
__main__.

Tested by inverting the ifdef and running the testsuite on Debian
Linux (even without the patch, I failed at running the testsuite
on Windows). I did test with both Python 2 and 3.

gdb/ChangeLog:

2019-08-22  Christian Biesinger  <cbiesinger@google.com>

	* python/lib/gdb/__init__.py (_execute_file): New function.
	* python/python.c (python_run_simple_file): Call gdb._execute_file
	on Windows.
2019-08-22 17:44:58 -05:00
..
command Fix incorrect use of 'is' operator for comparison in python/lib/gdb/command/prompt.py 2019-05-04 15:52:20 -04:00
function Make first and last lines of 'command help documentation' consistent. 2019-08-07 00:04:33 +02:00
printer Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
__init__.py Make GDB compile with Python 3 on MinGW 2019-08-22 17:44:58 -05:00
FrameDecorator.py Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
FrameIterator.py Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
frames.py Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
printing.py Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
prompt.py Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
types.py Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
unwinder.py Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00
xmethod.py Update copyright year range in all GDB files. 2019-01-01 10:01:51 +04:00