[wxruby-users] How to get the debug information of wxRuby scripts

Alex Fenton
Mon, 14 Dec 2009 20:50:37 -0000

hi

ChenJie|?? wrote:
> I''m a newbie for wxRuby. I''ve tried wxRuby to make some
of my little
> utilities.

Welcome!

> I have one piece of wxruby script. And after run this scripts, a
> "Microsoft Visual C++ Runtime error" with my ruby.exe
>
> My question would be how to get the information about this error?
>
> I''ve created a dump file for my ruby.exe and analyze with Windbg,
but
> sorry I still can''t recognize my error correctly :-(

Unfortunately Windbg won''t help very much with the distributed gems, as
the C++ debugging information is stripped out - otherwise the gem would
be very large.

> Can I output some kinds of log files make it easier?

There are log functions in a class called Wx::Log, which can catch some
errors if you set it to Log Level - DEBUG. But this might not help if
you''re getting a straight crash.

You may want to compile a debug build of wxRuby - which needs some
familiarity with compilers - but I guess you may have this is if you
know about Windbg. Otherwise you just need to pin down where the error
is occurring. Using Ruby''s set_trace_func is one way, or ruby debugger
to step through the code. But this can be slow. Or just judicious use of
''puts'' to check what line is crashing.

If you have a good idea what method etc the error is occuring in, please
do post it on the list.

alex