summaryrefslogtreecommitdiff
path: root/.gdbinit
diff options
context:
space:
mode:
authorJohn Hawthorn <[email protected]>2025-03-03 17:03:50 -0800
committerJohn Hawthorn <[email protected]>2025-04-10 11:33:46 -0700
commitf13e86a70edffe9af9b8bca15a0a9652cf143386 ()
tree4b4652b855420c4dc53b2b8bc5b8d01412f097ce /.gdbinit
parente3dd766e991892f1e2c0191ab6648eb0872a641c (diff)
Allow gdb's rp to work on classes offline
It's useful to be able to get information about classes without a running process, ie. when debugging a coredump.
Notes: Merged: https://.com/ruby/ruby/pull/13099
-rw-r--r--.gdbinit16
1 files changed, 8 insertions, 8 deletions
@@ -523,14 +523,14 @@ document rp_bignum
end
define rp_class
printf "(struct RClass *) %p", (void*)$arg0
- if RCLASS_ORIGIN((struct RClass *)($arg0)) != $arg0
- printf " -> %p", RCLASS_ORIGIN((struct RClass *)($arg0))
end
printf "\n"
rb_classname $arg0
- print/x *(struct RClass *)($arg0)
- print *RCLASS_EXT((struct RClass *)($arg0))
end
document rp_class
Print the content of a Class/Module.
@@ -896,10 +896,10 @@ document rb_method_entry
end
define rb_classname
- # up to 128bit int
- set $rb_classname = rb_mod_name($arg0)
- if $rb_classname != RUBY_Qnil
- rp $rb_classname
else
echo anonymous class/module\n
end