summaryrefslogtreecommitdiff
path: root/debug.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-07-25 08:00:46 (GMT)
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-07-25 08:00:46 (GMT)
commite5c6454efa01aaeddf4bc59a5f32d5f1b872d5ec (patch)
tree5c2e37ffb5dfa351377c15a3491170bc72ee5fea /debug.c
parentc3236250fe404863297e55dbc28f218bf6c6091e (diff)
* debug.c (ruby_debug_printf): use rb_raw_obj_info()
instead of rb_inspect() because it is more robust way to see object internal. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'debug.c')
-rw-r--r--debug.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/debug.c b/debug.c
index a600259..8a5e69b 100644
--- a/debug.c
+++ b/debug.c
@@ -59,14 +59,16 @@ ruby_debug_printf(const char *format, ...)
va_end(ap);
}
+#include "gc.h"
+
VALUE
ruby_debug_print_value(int level, int debug_level, const char *header, VALUE obj)
{
if (level < debug_level) {
- VALUE str;
- str = rb_inspect(obj);
- fprintf(stderr, "DBG> %s: %s\n", header,
- obj == (VALUE)(SIGNED_VALUE)-1 ? "" : StringValueCStr(str));
+ char buff[0x100];
+ rb_raw_obj_info(buff, 0x100, obj);
+
+ fprintf(stderr, "DBG> %s: %s\n", header, buff);
fflush(stderr);
}
return obj;