From: Stefan R. <Ste...@gm...> - 2017-03-29 16:30:54
|
<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div> <div>I suggest this could be implemented in ThreadStateMapping like this:</div> <div>(on top of that an implementation in PySystemState is straight forward)</div> <div> </div> <div> public static PyObject _current_frames() {<br/> @SuppressWarnings("unchecked")<br/> Map.Entry<Thread, ThreadState>[] entries = new Map.Entry[globalThreadStates.size()];<br/> entries = globalThreadStates.entrySet().toArray(entries);<br/> PyObject elements[] = new PyObject[entries.length];<br/> int pos = 0;<br/> for (Map.Entry<Thread, ThreadState> entry: entries) {<br/> elements[pos++] = Py.newInteger(entry.getKey().getId());<br/> elements[pos++] = entry.getValue().frame;<br/> }<br/> return new PyDictionary(elements);<br/> }</div> <div> </div> <div>Opinions?</div> <div> </div> <div>-Stefan</div> <div> <div style="margin: 10.0px 5.0px 5.0px 10.0px;padding: 10.0px 0 10.0px 10.0px;border-left: 2.0px solid rgb(195,217,229);"> <div style="margin: 0 0 10.0px 0;"><b>Gesendet:</b> Mittwoch, 29. März 2017 um 17:30 Uhr<br/> <b>Von:</b> "Fabio Zadrozny" <fa...@gm...><br/> <b>An:</b> "Jython Developers" <jyt...@li...><br/> <b>Betreff:</b> [Jython-dev] Support for sys._current_frames</div> <div> <div> <div class="gmail_default" style="color: rgb(0,0,0);">Hi Jython devs,</div> <div class="gmail_default" style="color: rgb(0,0,0);"> </div> <div class="gmail_default" style="color: rgb(0,0,0);">I've just updated the PyDev debugger to drop support for older Python versions and it seems I ended up breaking debugging in the current Jython version because of it...</div> <div class="gmail_default" style="color: rgb(0,0,0);"> </div> <div class="gmail_default" style="color: rgb(0,0,0);">The issue is that PyDev now requires sys._current_frames to be implemented by the interpreter (available since Python 2.5), but it seems this is not available for Jython -- this is needed so that the debugger can be faster (i.e.: it runs with untraced frames until some breakpoint is actually added -- at that point it gets the current frames and sets the tracing in them).</div> <div class="gmail_default" style="color: rgb(0,0,0);"> </div> <div class="gmail_default" style="color: rgb(0,0,0);">So, I'd like to check how feasible it'd be to have this support in Jython.</div> <div class="gmail_default" style="color: rgb(0,0,0);"> </div> <div class="gmail_default" style="color: rgb(0,0,0);">Thanks,</div> <div class="gmail_default" style="color: rgb(0,0,0);"> </div> <div class="gmail_default" style="color: rgb(0,0,0);">Fabio</div> </div> ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! <a href="http://sdm.link/slashdot_______________________________________________" target="_blank">http://sdm.link/slashdot_______________________________________________</a> Jython-dev mailing list Jyt...@li... <a href="https://lists.sourceforge.net/lists/listinfo/jython-dev" target="_blank">https://lists.sourceforge.net/lists/listinfo/jython-dev</a></div> </div> </div> </div></div></body></html> |