Debugging a plugin

Bob.Cowdery at CGI-Europe.com Bob.Cowdery at CGI-Europe.com
Wed Feb 1 14:22:34 UTC 2006


David Lewis wrote:

> I definitely don't know the best approach so hopefully someone will
> give you better answers, but in the mean time...

> A crude but effective way is to manually put printf() in the generated
> plugin, followed by (don't forget this) fflush(stdout). Ugly but it
> works. On Unix, you can just run the VM under gdb and put breakpoints
> in your plugin methods, works fine. This may also work on Windows with
> Cygwin, although I have not tried it.

Have lots of them, just can't get to them. If I run the VM under dev-C++ it
starts but does not show itself. Not sure if I need to do something
different or if it just don't work.

> I don't know that it will help with debugging plugins, but I'm attaching
> a compiled OSProcess plugin (version 4.0) for Windows that may work for
> you. I don't know how portable Windows dll's are, but I compiled this
> on a fairly recent W2k box, so hopefully it is usable. This allows you
> do to for example:

Thanks, duly installed. Running XP here.

> "Open a console window with stdin, stdout, and stderr streams attached."
> OSProcess thisOSProcess openConsole.

What console should this open. I don't get any console.

> "Write to the standard output stream, displayed on the console"
> OSProcess thisOSProcess stdOut
>   nextPutAll: 'this is the standard output stream';
>   nextPut: Character lf.

OSProcess thisOSProcess stdOut returns me nil.

> "Handy debugging messages for Smalltalk process debugging"
> OSProcess debugMessage: 'hello world'.
> OSProcess trace.
> OSProcess trace: 'hello world'.
>
> "Close the console window"
> OSProcess thisOSProcess closeConsole.

I have resorted to putting debug output to a file for now. At least I can
now see my threads are dropping out. Probably take a while to find out why.

Bob

*** Confidentiality Notice *** Proprietary/Confidential
Information belonging to CGI Group Inc. and its affiliates
may be contained in this message. If you are not a recipient
indicated or intended in this message (or responsible for
delivery of this message to such person), or you think for
any reason that this message may have been addressed to you
in error, you may not use or copy or deliver this message
to anyone else.  In such case, you should destroy this
message and are asked to notify the sender by reply email.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20060201/dc40e890/attachment.htm


More information about the Squeak-dev mailing list