aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2020-01-03 04:46:51 +0900
committerKoichi Sasada <ko1@atdot.net>2020-01-03 04:46:51 +0900
commit9f460e017b341fc8378f00315b0776e300107ccd (patch)
treec4769a642548b9b77970217c5a7e8c3536635a7c
parent6f5ee1f092414e4d60a403d82a57cf023b38c0b9 (diff)
downloadruby-9f460e017b341fc8378f00315b0776e300107ccd.tar.gz
move internal/debug.h definitions to internal.h
Debug utilities should be accessible from any internal code.
-rw-r--r--common.mk3
-rw-r--r--compile.c1
-rw-r--r--debug.c1
-rw-r--r--hash.c1
-rw-r--r--internal.h24
-rw-r--r--internal/debug.h39
-rw-r--r--vm.c1
7 files changed, 24 insertions, 46 deletions
diff --git a/common.mk b/common.mk
index 2ab2855b6f..0d69e1b298 100644
--- a/common.mk
+++ b/common.mk
@@ -1802,7 +1802,6 @@ compile.$(OBJEXT): $(top_srcdir)/internal/bits.h
compile.$(OBJEXT): $(top_srcdir)/internal/compile.h
compile.$(OBJEXT): $(top_srcdir)/internal/compilers.h
compile.$(OBJEXT): $(top_srcdir)/internal/complex.h
-compile.$(OBJEXT): $(top_srcdir)/internal/debug.h
compile.$(OBJEXT): $(top_srcdir)/internal/encoding.h
compile.$(OBJEXT): $(top_srcdir)/internal/error.h
compile.$(OBJEXT): $(top_srcdir)/internal/fixnum.h
@@ -1942,7 +1941,6 @@ debug.$(OBJEXT): $(hdrdir)/ruby.h
debug.$(OBJEXT): $(hdrdir)/ruby/ruby.h
debug.$(OBJEXT): $(top_srcdir)/internal/array.h
debug.$(OBJEXT): $(top_srcdir)/internal/compilers.h
-debug.$(OBJEXT): $(top_srcdir)/internal/debug.h
debug.$(OBJEXT): $(top_srcdir)/internal/gc.h
debug.$(OBJEXT): $(top_srcdir)/internal/imemo.h
debug.$(OBJEXT): $(top_srcdir)/internal/serial.h
@@ -4110,7 +4108,6 @@ vm.$(OBJEXT): $(top_srcdir)/internal/compar.h
vm.$(OBJEXT): $(top_srcdir)/internal/compile.h
vm.$(OBJEXT): $(top_srcdir)/internal/compilers.h
vm.$(OBJEXT): $(top_srcdir)/internal/cont.h
-vm.$(OBJEXT): $(top_srcdir)/internal/debug.h
vm.$(OBJEXT): $(top_srcdir)/internal/error.h
vm.$(OBJEXT): $(top_srcdir)/internal/eval.h
vm.$(OBJEXT): $(top_srcdir)/internal/fixnum.h
diff --git a/compile.c b/compile.c
index 200670f826..0eb94da3e0 100644
--- a/compile.c
+++ b/compile.c
@@ -23,7 +23,6 @@
#include "internal/array.h"
#include "internal/compile.h"
#include "internal/complex.h"
-#include "internal/debug.h"
#include "internal/encoding.h"
#include "internal/error.h"
#include "internal/hash.h"
diff --git a/debug.c b/debug.c
index 7bb9d02052..b15a08999a 100644
--- a/debug.c
+++ b/debug.c
@@ -15,7 +15,6 @@
#include "eval_intern.h"
#include "id.h"
-#include "internal/debug.h"
#include "internal/signal.h"
#include "internal/util.h"
#include "ruby/encoding.h"
diff --git a/hash.c b/hash.c
index 04c821ac79..606d5d3930 100644
--- a/hash.c
+++ b/hash.c
@@ -49,7 +49,6 @@
#if HASH_DEBUG
#include "gc.h"
-#include "internal/debug.h"
#endif
#define HAS_EXTRA_STATES(hash, klass) ( \
diff --git a/internal.h b/internal.h
index 7479c73563..4d95fe704e 100644
--- a/internal.h
+++ b/internal.h
@@ -74,4 +74,28 @@
#define rb_funcallv(...) rb_nonexistent_symbol(__VA_ARGS__)
#define rb_method_basic_definition_p(...) rb_nonexistent_symbol(__VA_ARGS__)
+
+/* MRI debug support */
+
+/* gc.c */
+void rb_obj_info_dump(VALUE obj);
+void rb_obj_info_dump_loc(VALUE obj, const char *file, int line, const char *func);
+
+/* debug.c */
+void ruby_debug_breakpoint(void);
+PRINTF_ARGS(void ruby_debug_printf(const char*, ...), 1, 2);
+
+// show obj data structure without any side-effect
+#define rp(obj) rb_obj_info_dump_loc((VALUE)(obj), __FILE__, __LINE__, __func__)
+
+// 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()
+
#endif /* RUBY_INTERNAL_H */
diff --git a/internal/debug.h b/internal/debug.h
deleted file mode 100644
index 276991027c..0000000000
--- a/internal/debug.h
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef INTERNAL_DEBUG_H /* -*- C -*- */
-#define INTERNAL_DEBUG_H
-/**
- * @file
- * @brief Internal header for debugging.
- * @author \@shyouhei
- * @copyright This file is a part of the programming language Ruby.
- * Permission is hereby granted, to either redistribute and/or
- * modify this file, provided that the conditions mentioned in the
- * file COPYING are met. Consult the file for details.
- */
-#include "ruby/config.h"
-#include <stdio.h> /* for fprintf */
-#include "ruby/ruby.h" /* for VALUE */
-
-/* MRI debug support */
-
-/* gc.c */
-void rb_obj_info_dump(VALUE obj);
-void rb_obj_info_dump_loc(VALUE obj, const char *file, int line, const char *func);
-
-/* debug.c */
-void ruby_debug_breakpoint(void);
-PRINTF_ARGS(void ruby_debug_printf(const char*, ...), 1, 2);
-
-// show obj data structure without any side-effect
-#define rp(obj) rb_obj_info_dump_loc((VALUE)(obj), __FILE__, __LINE__, __func__)
-
-// 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()
-
-#endif /* INTERNAL_DEBUG_H */
diff --git a/vm.c b/vm.c
index d4a1d4437e..e432cb13aa 100644
--- a/vm.c
+++ b/vm.c
@@ -15,7 +15,6 @@
#include "internal.h"
#include "internal/compile.h"
#include "internal/cont.h"
-#include "internal/debug.h"
#include "internal/error.h"
#include "internal/eval.h"
#include "internal/inits.h"