Back to Top

Wednesday, April 09, 2008

A small warning about ptkdb

ptkdb is a GUI debugger (as opposed to the default console-based one) for Perl using the Tk toolkit for its windows. As far as I know it is one of the most advanced ones, discounting debuggers built into IDEs. An other advantage of it is its availability for many platforms (including Windows), including sources like the PPM repositories for ActivePerl (this is probably because Tk is available on all of these platforms, because it doesn't have any major dependencies, which is understandable given that the debugger subsystem for Perl is very "pluggable" and you can write a custom debugger / profiler / run-time monitor in a couple of lines of Perl code). However there a gotcha which can bite you in some corner cases:

If you switch color depth during using it, the interface will break (the keyboard shortcuts like Alt+R for running or Alt+Q for quitting will still work, but you will be unable see anything in the interface). I tested it with Windows and ActivePerl 5.8.8, but probably it also is true for other versions. First of all you might ask, why would you change the color depth? That's because I'm using RDP to work on the system and depending on the available bandwidth I either choose to go full color or with 8 bits per pixel. So if I'm debugging a long-running process, and reconnect using the lower color-depth, the interface is gone. To be fair, this is a very edge case and also probably not the fault of ptkdb, but rather of Tk, but it just happens that I observed it using ptkdb.

The GUI can't be "revived" by reconnecting with the correct color depth. My current solution is to make sure to always connect using the correct (same) color depth. Also, I haven't tested it in the other direction (going from 8 bits to 24 bits) which may work.


Post a Comment

You can use some HTML tags, such as <b>, <i>, <a>. Comments are moderated, so there will be a delay until the comment appears. However if you comment, I follow.