Description of problem: When I was investigating an uncaught Python exception generated by ABRT when it was processing a new core file, I found out that 'gdb python execfile("script-name")' no longer works. This is probably caused by the fact that 'execfile' was removed from Python 3 and users are supposed to use 'exec(open("script-name").read())' [1]. Version-Release number of selected component (if applicable): gdb-7.9.90.20150717-12.fc24.x86_64 How reproducible: Always Steps to Reproduce: 1. gdb -ex "python execfile ('/usr/libexec/abrt-gdb-exploitable')" Actual results: ... Traceback (most recent call last): File "<string>", line 1, in <module> NameError: name 'execfile' is not defined Error while executing Python code. ... Expected results: No exception raised by Python. Additional info: The following command works as expected but it looks weird: $ gdb -ex "python exec(open("/usr/libexec/abrt-gdb-exploitable").read())" [1]: https://docs.python.org/3.3/whatsnew/3.0.html?highlight=execfile#builtins
This is a Python change, I find it unrelated to GDB. You can use that exec(open(...).read()) form as you wrote. The only GDB bug I see that GDB Manual uses 'python execfile' in one example so the doc should be changed. Otherwise I do not see what to change - or do you? Thanks for the bugreport.
(In reply to Jan Kratochvil from comment #1) > Otherwise I do not see what to change - or do you? Thanks for the bugreport. Me too. My intention was to write a public note that could be found by gdb users who hit the same issue.