eightbitraptor[wiki]

Debugging

Running arbitrary scripts

Useful for running small changes that you want to run with your miniruby or whatever, without having to write an actual test. This is also tied into the debuggers and stuff.

Make sure that a test.rb file exists inside your ruby checkout directory and then after you’ve build.

Running a specific test and attaching lldb

You can add RUNRUBYOPT to any test run command (see [running-tests]). An example:

make test-all TESTS='test/ruby/test_gc_compact.rb -n test_complex_hash_keys' RUNRUBYOPT=--debugger=lldb

Then when you get the lldb prompt type process launch or run to start debugging

also see [lldb-tips] and [ruby-inspecting-structs-lldb] for information about how to use lldb effectively in CRuby.

Ruby devel logs

There are a few options and config flags that can be used to make Ruby log a lot of output about what the VM is doing.

It looks like RUBY_DEVEL=yes has been superceded by --enable-devel at configure time. I’m not sure what this opion does properly yet.

There’s also USE_RUBY_DEBUG_LOG which can be set in cppflags