summaryrefslogtreecommitdiff
path: root/debug.c
diff options
context:
space:
mode:
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 a600259818..8a5e69bbf5 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;