diff options
-rw-r--r-- | common.mk | 1 | ||||
-rw-r--r-- | gc.h | 1 | ||||
-rw-r--r-- | internal.h | 16 | ||||
-rw-r--r-- | thread.c | 1 | ||||
-rw-r--r-- | vm_debug.h | 3 |
5 files changed, 16 insertions, 6 deletions
@@ -3035,7 +3035,6 @@ thread.$(OBJEXT): {$(VPATH)}debug_counter.h thread.$(OBJEXT): {$(VPATH)}defines.h thread.$(OBJEXT): {$(VPATH)}encoding.h thread.$(OBJEXT): {$(VPATH)}eval_intern.h -thread.$(OBJEXT): {$(VPATH)}gc.h thread.$(OBJEXT): {$(VPATH)}hrtime.h thread.$(OBJEXT): {$(VPATH)}id.h thread.$(OBJEXT): {$(VPATH)}intern.h @@ -100,7 +100,6 @@ int ruby_get_stack_grow_direction(volatile VALUE *addr); const char *rb_obj_info(VALUE obj); const char *rb_raw_obj_info(char *buff, const int buff_size, VALUE obj); -void rb_obj_info_dump(VALUE obj); VALUE rb_gc_disable_no_rest(void); diff --git a/internal.h b/internal.h index c502fe076c..76c10c8bf5 100644 --- a/internal.h +++ b/internal.h @@ -1388,6 +1388,22 @@ rb_ary_entry_internal(VALUE ary, long offset) return ptr[offset]; } +/* MRI debug support */ +void rb_obj_info_dump(VALUE obj); +void ruby_debug_breakpoint(void); + +// show obj data structure without any side-effect +#define rp(obj) rb_obj_info_dump((VALUE)obj); +// same as rp, but add message header +#define rp_m(msg, obj) do { \ + fprintf(stderr, "%s", (msg)); \ + rb_obj_info_dump((VALUE)obj); \ +} while (0) + +// `ruby_debug_breakpoint()` does nothing, +// but breakpoint is set in run.gdb, so `make gdb` can stop here. +#define bp() ruby_debug_breakpoint() + /* bignum.c */ extern const char ruby_digitmap[]; double rb_big_fdiv_double(VALUE x, VALUE y); @@ -66,7 +66,6 @@ #include "ruby/config.h" #include "ruby/io.h" #include "eval_intern.h" -#include "gc.h" #include "timev.h" #include "ruby/thread.h" #include "ruby/thread_native.h" diff --git a/vm_debug.h b/vm_debug.h index 32e060732c..8e0350d147 100644 --- a/vm_debug.h +++ b/vm_debug.h @@ -22,13 +22,10 @@ RUBY_SYMBOL_EXPORT_BEGIN #define dpi(i) ruby_debug_print_id(-1, 0, "", (i)) #define dpn(n) ruby_debug_print_node(-1, 0, "", (n)) -#define bp() ruby_debug_breakpoint() - VALUE ruby_debug_print_value(int level, int debug_level, const char *header, VALUE v); ID ruby_debug_print_id(int level, int debug_level, const char *header, ID id); NODE *ruby_debug_print_node(int level, int debug_level, const char *header, const NODE *node); int ruby_debug_print_indent(int level, int debug_level, int indent_level); -void ruby_debug_breakpoint(void); void ruby_debug_gc_check_func(void); void ruby_set_debug_option(const char *str); |