Permalink
Browse files

.gdbinit: FLONUM support

* .gdbinit (rp): FLONUM support.
* include/ruby/ruby.h (ruby_special_consts): define FLONUM constants
  always, so that they are available from gdb.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
1 parent 38d0cbc commit 977bec12363e7e87a19ad81aa063fbf2b4112493 @nobu committed Sep 6, 2012
Showing with 13 additions and 2 deletions.
  1. +5 −1 .gdbinit
  2. +6 −1 ChangeLog
  3. +2 −0 include/ruby/ruby.h
View
@@ -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
View
@@ -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
View
@@ -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

0 comments on commit 977bec1

Please sign in to comment.