mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* compile.c, compile.h (compile_debug): made runtime option.
* debug.c (ruby_debug_print_indent): returns if debug_level exceeds the threashold. * debug.c (ruby_debug_printf): printf to stderr. * iseq.c (make_compile_option, make_compile_option_value): added debug_level option. * vm_core.h (rb_compile_option_t): added debug_level. * vm_core.h (struct iseq_compile_data): added node_level. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16003 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
6be7386218
commit
6866bce757
7 changed files with 172 additions and 88 deletions
13
debug.c
13
debug.c
|
@ -67,13 +67,24 @@ static const union {
|
|||
|
||||
const VALUE RUBY_FL_USER20 = FL_USER20;
|
||||
|
||||
void
|
||||
int
|
||||
ruby_debug_print_indent(int level, int debug_level, int indent_level)
|
||||
{
|
||||
if (level < debug_level) {
|
||||
fprintf(stderr, "%*s", indent_level, "");
|
||||
fflush(stderr);
|
||||
return Qtrue;
|
||||
}
|
||||
return Qfalse;
|
||||
}
|
||||
|
||||
void
|
||||
ruby_debug_printf(const char *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start(ap, format);
|
||||
vfprintf(stderr, format, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
VALUE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue