16RUBY_SYMBOL_EXPORT_BEGIN
18#define dpv(h,v) ruby_debug_print_value(-1, 0, (h), (v))
19#define dp(v) ruby_debug_print_value(-1, 0, "", (v))
20#define dpi(i) ruby_debug_print_id(-1, 0, "", (i))
21#define dpn(n) ruby_debug_print_node(-1, 0, "", (n))
25VALUE ruby_debug_print_value(
int level,
int debug_level,
const char *header,
VALUE v);
26ID ruby_debug_print_id(
int level,
int debug_level,
const char *header,
ID id);
27struct RNode *ruby_debug_print_node(
int level,
int debug_level,
const char *header,
const struct RNode *node);
28int ruby_debug_print_indent(
int level,
int debug_level,
int indent_level);
29void ruby_debug_gc_check_func(
void);
30void ruby_set_debug_option(
const char *str);
34#ifndef USE_RUBY_DEBUG_LOG
35#define USE_RUBY_DEBUG_LOG 0
77extern enum ruby_debug_log_mode {
78 ruby_debug_log_disabled = 0x00,
79 ruby_debug_log_memory = 0x01,
80 ruby_debug_log_stderr = 0x02,
81 ruby_debug_log_file = 0x04,
85void ruby_debug_log(const
char *file,
int line, const
char *func_name, const
char *fmt, ...);
86void ruby_debug_log_print(
unsigned int n);
87bool ruby_debug_log_filter(const
char *func_name, const
char *file_name);
89#if RBIMPL_COMPILER_IS(GCC) && defined(__OPTIMIZE__)
90# define ruby_debug_log(...) \
91 RB_GNUC_EXTENSION_BLOCK( \
92 RBIMPL_WARNING_PUSH(); \
93 RBIMPL_WARNING_IGNORED(-Wformat-zero-length); \
94 ruby_debug_log(__VA_ARGS__); \
100#define _RUBY_DEBUG_LOG(...) ruby_debug_log(__FILE__, __LINE__, RUBY_FUNCTION_NAME_STRING, "" __VA_ARGS__)
102#if USE_RUBY_DEBUG_LOG
103# define RUBY_DEBUG_LOG_ENABLED(func_name, file_name) \
104 (ruby_debug_log_mode && ruby_debug_log_filter(func_name, file_name))
106#define RUBY_DEBUG_LOG(...) do { \
107 if (RUBY_DEBUG_LOG_ENABLED(RUBY_FUNCTION_NAME_STRING, __FILE__)) \
108 ruby_debug_log(__FILE__, __LINE__, RUBY_FUNCTION_NAME_STRING, "" __VA_ARGS__); \
111#define RUBY_DEBUG_LOG2(file, line, ...) do { \
112 if (RUBY_DEBUG_LOG_ENABLED(RUBY_FUNCTION_NAME_STRING, file)) \
113 ruby_debug_log(file, line, RUBY_FUNCTION_NAME_STRING, "" __VA_ARGS__); \
118#define RUBY_DEBUG_LOG(...)
119#define RUBY_DEBUG_LOG2(file, line, ...)
uintptr_t VALUE
Type that represents a Ruby object.
uintptr_t ID
Type that represents a Ruby identifier such as a variable name.