ruby-changes:24866
From: nobu <ko1@a...>
Date: Thu, 6 Sep 2012 14:50:02 +0900 (JST)
Subject: [ruby-changes:24866] nobu:r36917 (trunk): .gdbinit: FLONUM support
nobu 2012-09-06 14:49:51 +0900 (Thu, 06 Sep 2012) New Revision: 36917 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=36917 Log: .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. Modified files: trunk/.gdbinit trunk/ChangeLog trunk/include/ruby/ruby.h Index: .gdbinit =================================================================== --- .gdbinit (revision 36916) +++ .gdbinit (revision 36917) @@ -89,7 +89,11 @@ 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 Index: include/ruby/ruby.h =================================================================== --- include/ruby/ruby.h (revision 36916) +++ include/ruby/ruby.h (revision 36917) @@ -410,6 +410,8 @@ 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 Index: ChangeLog =================================================================== --- ChangeLog (revision 36916) +++ ChangeLog (revision 36917) @@ -1,5 +1,10 @@ -Thu Sep 6 14:48:31 2012 Nobuyoshi Nakada <nobu@r...> +Thu Sep 6 14:49:49 2012 Nobuyoshi Nakada <nobu@r...> + * .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 optimized away on non-FLONUM. -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/