Debugging wxruby programs

Yes, I've installed both ruby and wxruby. The problem I have is that
if the app fails to start, it is sometimes due to syntax errors and
sometimes due to runtime errors (e.g. a nil member variable, etc.).
Without a DOS/Command window, firstly, I've no idea if it's a syntax
error,

Syntax errors are always reported by the Ruby parser, nothing to do with
wxRuby. If you have a syntax error you will get the appropriate message
when you load the file.

secondly, even if it does start, I can't use 'print' to print
out debugging statements to help me find out where I got to and what
went wrong (OK, I can open an auxilliary window and write to that, but
I could lose that window if the app dies).

That sounds weird. I have no problem writing to stdout from within a
wxRuby app. In fact I used it frequently until I integrated Log4R in the
app.
What is your setup (os/ruby/wxruby versions etc)?

How do you experts debug wxruby apps? Any help would be appreciated.

As mentioned, Log4R is invaluable. I also sometimes use Florian Gross's
breakpoint module [ruby-talk:111523].

Mehr, Assaph (Assaph) wrote:

ly, even if it does start, I can't use 'print' to print
out debugging statements to help me find out where I got to and what
went wrong (OK, I can open an auxilliary window and write to that, but
I could lose that window if the app dies).
   
That sounds weird. I have no problem writing to stdout from within a
wxRuby app. In fact I used it frequently until I integrated Log4R in the
app.

I have seen this problem when running inside of some editors like Eclipse. Once you exit the application it prints all of the text. I have always called $stdout.flush after any debugging "puts". Is there a way to genericaly tell $stdout not to buffer?

Zach

Put this line as the first executable line of your
program:

STDOUT.sync = true

HTH,
--shanko

···

--- Zach Dennis <zdennis@mktec.com> wrote:

I have
always called $stdout.flush after any debugging
"puts". Is there a way
to genericaly tell $stdout not to buffer?

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around

$stdout.sync = true

···

On Fri, 17 Sep 2004 23:19:09 +0900, Zach Dennis <zdennis@mktec.com> wrote:

I have seen this problem when running inside of some editors like
Eclipse. Once you exit the application it prints all of the text. I have
always called $stdout.flush after any debugging "puts". Is there a way
to genericaly tell $stdout not to buffer?

--
Bill Guindon (aka aGorilla)