summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gdbinit6
-rw-r--r--ChangeLog7
-rw-r--r--include/ruby/ruby.h2
3 files changed, 13 insertions, 2 deletions
diff --git a/.gdbinit b/.gdbinit
index 956a534..b67115b 100644
--- a/.gdbinit
+++ b/.gdbinit
@@ -89,7 +89,11 @@ define rp
echo undef\n
else
if (VALUE)($arg0) & RUBY_IMMEDIATE_MASK
- echo immediate\n
+ if ((VALUE)($arg0) & RUBY_FLONUM_MASK) == RUBY_FLONUM_FLAG
+ printf "FLONUM: %g\n", (double)rb_float_value($arg0)
+ else
+ echo immediate\n
+ end
else
set $flags = ((struct RBasic*)($arg0))->flags
if ($flags & RUBY_T_MASK) == RUBY_T_NONE
diff --git a/ChangeLog b/ChangeLog
index a305df6..17e5106 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,9 @@
-Thu Sep 6 14:48:31 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Thu Sep 6 14:49:49 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * .gdbinit (rp): FLONUM support.
+
+ * include/ruby/ruby.h (ruby_special_consts): define FLONUM constants
+ always, so that they are available from gdb.
* include/ruby/ruby.h (RB_FLOAT_TYPE_P): merge FLONUM and non-FLONUM
versions. inline TYPE() comparison and FLONUM_P() should be
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index 61a5a50..bab4a00 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -410,6 +410,8 @@ enum ruby_special_consts {
RUBY_IMMEDIATE_MASK = 0x03,
RUBY_FIXNUM_FLAG = 0x01,
+ RUBY_FLONUM_MASK = 0x00, /* any values ANDed with FLONUM_MASK cannot be FLONUM_FLAG */
+ RUBY_FLONUM_FLAG = 0x02,
RUBY_SYMBOL_FLAG = 0x0e,
RUBY_SPECIAL_SHIFT = 8
#endif