diff options
author | Koichi Sasada <[email protected]> | 2019-08-21 01:04:08 +0900 |
---|---|---|
committer | GitHub <[email protected]> | 2019-08-21 01:04:08 +0900 |
commit | 88b1f2dac430d7b10fc98c5a072c4edfeb51b27a (patch) | |
tree | 028cf6e5a461578e0a47646a54d76c888af740ed /gc.c | |
parent | d10e28b875a58e2c4422b8df8f4bbcc2fb0362d0 (diff) |
`rp(obj)` shows func, file and line. (#2394)
rp() macro for debug also shows file location and function name
such as:
[OBJ_INFO:[email protected]:73] 0x000056147741b248 ...
Notes
Notes:
Merged-By: ko1
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -11449,6 +11449,13 @@ rb_obj_info_dump(VALUE obj) fprintf(stderr, "rb_obj_info_dump: %s\n", rb_raw_obj_info(buff, 0x100, obj)); } +void +rb_obj_info_dump_loc(VALUE obj, const char *file, int line, const char *func) +{ + char buff[0x100]; + fprintf(stderr, "<OBJ_INFO:%s@%s:%d> %s\n", func, file, line, rb_raw_obj_info(buff, 0x100, obj)); +} + #if GC_DEBUG void |