On Saturday, June 30, 2018 at 4:58:55 AM UTC-5, Edward K. Ream wrote:
> The last step will be to connect the QueueStdin class to an actual
Queue. This should have zero effect on performance because the call to
qc.get in QueueStdin.readline will block until the user (in Leo) gives it
something.
And here is the working code. The XPdb class itself remains unchanged,
although it should be a daemon.
@g.command('debugger-input')
def db_in(event):
c = event.get('c')
def callback(args, c, event):
g.app.debugger_qc.put(args[0])
c.interactive(callback, event, prompts=['Debugger command: '])
class QueueStdin(object):
def readline(self):
s = g.app.debugger_qc.get() # blocks
print(s)
return s
This concludes the first phase of the prototype envisaged by #915
<https://github.com/leo-editor/leo-editor/issues/915>.
The next step will be to have the debugger request that Leo select lines
when a breakpoint is reached. The Queue machinery should suffice. Leo's
main thread will inspect the g.app.debugger_qr queue at idle time.
Edward
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.