# How to get the debug information of wxRuby scripts

**URL:** <https://www.ruby-forum.com/t/how-to-get-the-debug-information-of-wxruby-scripts/180184>\
**Category:** wxRuby\
**Created:** [December 14, 2009, 8:46am UTC](https://www.ruby-forum.com/t/how-to-get-the-debug-information-of-wxruby-scripts/180184 "2009-12-14T08:46:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jette](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/d9b06d/32.png) [@jette](https://www.ruby-forum.com/u/jette)\
**Post date:** [December 14, 2009, 8:46am UTC](https://www.ruby-forum.com/t/how-to-get-the-debug-information-of-wxruby-scripts/180184/1 "2009-12-14T08:46:51Z")

</div>

Hello All

I’m a newbie for wxRuby. I’ve tried wxRuby to make some of my little  
utilities.

But, when I’m learning by doing…I’ve got one question.

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 ☹

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

Please forgive me if this question was asked time and time again in the  
mail  
list ☹

---

<div class="post-metadata">

**Author:** ![jette](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/d9b06d/32.png) [@jette](https://www.ruby-forum.com/u/jette)\
**Post date:** [December 14, 2009, 9:51pm UTC](https://www.ruby-forum.com/t/how-to-get-the-debug-information-of-wxruby-scripts/180184/2 "2009-12-14T21:51:09Z")

</div>

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
