This post originated from an RSS feed registered with Ruby Buzz
by Red Handed.
Original Post: The Ruby-GDB Arms Race Now At a Standoff
Feed Title: RedHanded
Feed URL: http://redhanded.hobix.com/index.xml
Feed Description: sneaking Ruby through the system
The session-ruby command loads Mauricio’s functions. Standard out gets redirected to the file /tmp/ruby-debug.[pid]. In the above, the rb_object_counts will make a list of all the classes with instantiated objects and a count of objects created of that class.
32640 String
2435 Array
951 Regexp
819 Class
...
Jamis’ library (gdb.rb) takes a totally different approach by offering a Ruby wrapper for GDB and preferring dissecting Ruby structs byte by byte. So you don’t have to redirect STDOUT.
I don’t know about you guys, but I’m kind of freaking out that I can do all this from irb. It’s been a thrilling couple of days watching this unfold. (Jamis’ original post and his explanation of the library.)