Skip to content
This repository has been archived by the owner on Jul 25, 2022. It is now read-only.

Commit

Permalink
* debug.c (ruby_debug_printf): use rb_raw_obj_info()
Browse files Browse the repository at this point in the history
  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
  • Loading branch information
ko1 committed Jul 25, 2016
1 parent c323625 commit e5c6454
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Mon Jul 25 16:59:00 2016 Koichi Sasada <ko1@atdot.net>

* debug.c (ruby_debug_printf): use rb_raw_obj_info()
instead of rb_inspect() because it is more robust way
to see object internal.

Sun Jul 24 16:33:13 2016 Martin Duerst <duerst@it.aoyama.ac.jp>

* regenc.h/c, include/ruby/oniguruma.h, enc/ascii.c, big5.c, cp949.c,
Expand Down
10 changes: 6 additions & 4 deletions debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e5c6454

Please sign in to comment.