Debugging with Evennia

68 views
Skip to first unread message

Vincent LE GOFF

unread,
Mar 2, 2018, 7:13:57 AM3/2/18
to eve...@googlegroups.com
Hello all,


The new communication between server and portal is really great. It
allows much more operation and is so stable on Windows.  I just ran into
a problem though, and I wonder what the solutions are.


I just tried to debug my newly added command with pdb, the official
Python debugger included in the standard library.  Since pdb is launched
from an instruction in code, after adding it and reloading, the debugger
starts... but stdin and stdout are not connected.  Which is not so
surprising.


The old behavior was this: you inserted the magical line to invoke pdb
in your command (or wherever you wanted to debug), you reloaded the
server, you invoked the command from your client and then you had the
debugger in your console.  It required to run evennia in interactive
mode.  Since both processes are now completely distinct and the console
is only an entry-point to Evennia, which run in daemon mode, there is no
way I know of linking pdb with it.  Pdb starts, but it listens from an
input that is inaccessible as far as I know.


What would be the solution in your opinion?  I don't know if it would
affect other debuggers.  I like pdb because it's portable and doesn't
require anything to be installed.  It works wherever Python works, and
Python works in a lot of environments.  Also, being purely
CLI-oiriented, it is completely accessible with a screen reader, an
important point to underline.  So I would be sad to tell it goodbye.


Thanks for your answer,


Vincent

Griatch Art

unread,
Mar 10, 2018, 11:09:09 AM3/10/18
to Evennia
In development there is no interactive mode, as you have noticed. I have been considering adding one just for the sake of running a debugger - but such a mode would not support restarting since the server/portal would have to run in the context of the launcher itself. Which is probably fine when one just wants to debug something.
.
Griatch

Vincent LE GOFF

unread,
Mar 11, 2018, 6:20:02 AM3/11/18
to eve...@googlegroups.com

Yes, that would be something.  When I debug I often reload (which, I believe, would restart these processes altogether) because, if there's a bug in my code, there are usually two or three.  Whenever I really need the debugger it's usually for a "heavy" feature in my game that works in theory, but needs a lot of reloads to be completely tested.  However, having the opportunity to gain access to an interactive mode would be great.  I tried to come up with solutions, like allowing debugging from a client, but nothing would really be as comfortable as a plain debugger *in console or GUI,k depending on the user's choice).


Vincent

--
You received this message because you are subscribed to the Google Groups "Evennia" group.
To unsubscribe from this group and stop receiving emails from it, send an email to evennia+u...@googlegroups.com.
To post to this group, send email to eve...@googlegroups.com.
Visit this group at https://groups.google.com/group/evennia.
To view this discussion on the web visit https://groups.google.com/d/msgid/evennia/891e915f-b7e5-4061-aeec-c3a864e706b4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages