Skip to content
This repository was archived by the owner on Jun 11, 2025. It is now read-only.

freshworks/gdb-ruby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

GDB extension for Ruby (tested with Ruby 2.1, 2.2 and 2.3)

Not just live process, also works with coredump

Install

Download the gdb_ruby.py and then when invoking gdb:

(gdb) source /path/to/gdb_ruby.py

or

gdb ... -ex 'source /path/to/gdb_ruby.py' ...

To use with coredump:

gdb `which ruby` --ex 'source /tmp/gdb_ruby.py' /tmp/core_dump.28467

Usage

To get callstack:

(gdb) ruby_bt

To get callstack of all threads:

(gdb) thread apply all ruby_bt

To get callstack of "current" Ruby thread, one holding GVL lock:

(gdb) ruby_bt_curr

To print local variables:

(gdb) ruby_locals

To print global variables:

(gdb) ruby_globals

To print ruby variable from some other variable (like Ruby VM C variable etc, in this case 'klass' local variable in C)

(gdb) python print_ruby_value(gdb.parse_and_eval('klass'))

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages