[issue1654367] [PATCH] Debuggers need a way to change the locals of a frame
Armin Rigo added the comment: Sorry to hijack CPython's bug tracker for that, but can you check if this makes sense to you? I added a function 'locals_to_fast()' to the __pypy__ built-in module which just calls the PyPy equivalent to PyFrame_LocalsToFast(). Your tests are passing, so I guess there should be no problem. The diff is here: http://bpaste.net/show/176119/ (are you ok with having your name put into the test file?). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1654367 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1654367] [PATCH] Debuggers need a way to change the locals of a frame
Fabio Zadrozny added the comment: Hi Armin, That does make sense to me, but maybe it could be nice providing a standard API across Python implementations to make that call (even if the CPython version uses ctypes underneath and the PyPy version uses RPython), but I'll leave that up to CPython and PyPy devs to discuss -- so, for me, if that call is in the __pypy__ namespace, I'll do the proper check and use it in the PyDev debugger :) p.s.: no problem on putting my name on the test case (and distributing in whatever license PyPy or CPython is under). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1654367 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1654367] [PATCH] Debuggers need a way to change the locals of a frame
Fabio Zadrozny added the comment: Sure, no problems on my side :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1654367 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1654367] [PATCH] Debuggers need a way to change the locals of a frame
Armin Rigo added the comment: CPython 2.7 is in feature-freeze, so we need to add it to __pypy__. If people here decide to add it more officially to CPython 3.x, then we'll also add it into pypy3, obviously. I'm sure a debugger can cope with a few extra ifs to check on which platform it is really running :-) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1654367 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1654367] [PATCH] Debuggers need a way to change the locals of a frame
Fabio Zadrozny added the comment: Just a note for anyone interested: ctypes can be used to access that function: http://pydev.blogspot.com.br/2014/02/changing-locals-of-frame-frameflocals.html So, I think that the changes I proposed shouldn't be applied (it'd only be worth if someone provided an implementation that did frame.f_locals writable...). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1654367 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1654367] [PATCH] Debuggers need a way to change the locals of a frame
Armin Rigo added the comment: Hi Fabio! This is admittedly a corner-case use case, but if you think it would be worth it, we can very easily add this as a feature to PyPy (by making frame.f_locals writeable). Then we can add the write inside pdb, and you could do the same for PyDev when running on PyPy. It's certainly something that goes beyond the standard of CPython 2.7 but we'd consider it because it's obviously debug-only. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1654367 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1654367] [PATCH] Debuggers need a way to change the locals of a frame
Armin Rigo added the comment: Also, can you provide a concrete case? Trying around in CPython 2.7, it seems that locals of the current frame can always be modified from a pdb.set_trace(). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1654367 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1654367] [PATCH] Debuggers need a way to change the locals of a frame
Fabio Zadrozny added the comment: Hi Armin, Sure, just attached the test case with tests failing (on the top, comment the save_locals(frame) which has a 'pass' to see it working). Mostly, it happens when editing something not in the top-frame (but sometimes I think it could fail there too, depending whether it's a cellvar or freevar). -- Added file: http://bugs.python.org/file33917/test_save_locals.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1654367 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1654367] [PATCH] Debuggers need a way to change the locals of a frame
Changes by Mark Lawrence breamore...@yahoo.co.uk: -- nosy: -BreamoreBoy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1654367 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1654367] [PATCH] Debuggers need a way to change the locals of a frame
Fabio Zadrozny fab...@users.sourceforge.net added the comment: I agree that it'd be cleaner making the frame locals a dict-like object with write access, but I wouldn't be able to do that because of time constraints (and I'd have to research more how to do it and it'd be much more intrusive I guess). So, if it's guaranteed that it'll be accepted I can provide a patch (changing the clear to 1) of the savelocals() version. I guess I don't agree this falls in the language moratorium, but if that's the case I can wait 1 or 2 more years before submitting the patch :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1654367 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1654367] [PATCH] Debuggers need a way to change the locals of a frame
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: I think this falls under the language moratorium in that it requires core changes that make it more difficult for other implementations to catch-up. -- nosy: +rhettinger versions: +Python 3.3 -Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1654367 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1654367] [PATCH] Debuggers need a way to change the locals of a frame
Changes by Terry J. Reedy tjre...@udel.edu: -- versions: +Python 3.2 -Python 2.7, Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1654367 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1654367] [PATCH] Debuggers need a way to change the locals of a frame
Mark Lawrence breamore...@yahoo.co.uk added the comment: Fabio, could you please supply a patch as requested by Martin in msg55004? Also note Armin's comments in msg55005. -- nosy: +BreamoreBoy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1654367 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1654367] [PATCH] Debuggers need a way to change the locals of a frame
Changes by Daniel Diniz aja...@gmail.com: -- keywords: +patch stage: - patch review versions: +Python 2.7, Python 3.1 -Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1654367 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com