diff options
author | Peter Zhu <[email protected]> | 2023-10-01 21:16:53 -0400 |
---|---|---|
committer | Peter Zhu <[email protected]> | 2023-10-02 09:49:13 -0400 |
commit | 63e504d6e65765740a592ee785147e5eff0d9aed (patch) | |
tree | b6ad75c52cdff948b6afc3185237973a053522e6 /ext/objspace/objspace_dump.c | |
parent | 1943ea06a6be4dddc235011a2dadc3fb326080a9 (diff) |
Dump name of method for imemo callinfo
This commit dumps the `mid` of the imemo callinfo when calling
`ObjectSpace.dump_all`.
Diffstat (limited to 'ext/objspace/objspace_dump.c')
-rw-r--r-- | ext/objspace/objspace_dump.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/ext/objspace/objspace_dump.c b/ext/objspace/objspace_dump.c index 39584e03b8..14d78c862b 100644 --- a/ext/objspace/objspace_dump.c +++ b/ext/objspace/objspace_dump.c @@ -28,6 +28,7 @@ #include "ruby/debug.h" #include "ruby/util.h" #include "ruby/io.h" +#include "vm_callinfo.h" #include "vm_core.h" RUBY_EXTERN const char ruby_hexdigits[]; @@ -429,6 +430,17 @@ dump_object(VALUE obj, struct dump_config *dc) dump_append(dc, ", \"imemo_type\":\""); dump_append(dc, rb_imemo_name(imemo_type(obj))); dump_append(dc, "\""); + + switch (imemo_type(obj)) { + case imemo_callinfo: + dump_append(dc, ", \"mid\":\""); + dump_append(dc, RSTRING_PTR(rb_id2str(vm_ci_mid((const struct rb_callinfo *)obj)))); + dump_append(dc, "\""); + break; + + default: + break; + } break; case T_SYMBOL: |