Howto debug (Inputserver) add-ons?

With normal applications i always use printf() statements for debugging. Now I am playing a bit with inputserver addons and I am wondering how this code can be debugged. Using printf() doesn’t work here since the addon is loaded by the inputserver and there is no output to the concole.

So here my two questions:

  1. Is printf() the usual way for debugging "normal" apps? Or is there an OS facility for debugging applications?

  2. How do you debug an addon which you can’t load from the concole? Is there a standard Output stream to which you can send you data to be able to view it? I want to know the mouse coordinates, but don’t know how to output them when my addon is loaded.

I found this handy tool - called BeDc - on Bebits to which I can send messages…
Very usefull for debugging!!

Mauro wrote:
I found this handy tool - called BeDc - on Bebits to which I can send messages... Very usefull for debugging!!

You could also just output it to a file. Though that might not be as fast/fun ;).

For some addons you can try killing the host server and starting it back up again in a terminal window. You can then use the host server’s stdout/stdin (Assuming the server doesn’t do something funky with the aformentioned streams of course). Obviously it could be a bit tricky if you’re wanting to use printf with the input server (Ie, be damn sure the server will load up again otherwise you’re a little boned).