ruby-changes:46867
From: nobu <ko1@a...>
Date: Thu, 1 Jun 2017 13:43:07 +0900 (JST)
Subject: [ruby-changes:46867] nobu:r58982 (trunk): debug.c: more enums
nobu 2017-06-01 13:43:03 +0900 (Thu, 01 Jun 2017) New Revision: 58982 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58982 Log: debug.c: more enums * debug.c (ruby_dummy_gdb_enums): add enums for RObject, RModule, RString, RArray. Modified files: trunk/debug.c trunk/include/ruby/ruby.h trunk/misc/lldb_cruby.py Index: debug.c =================================================================== --- debug.c (revision 58981) +++ debug.c (revision 58982) @@ -29,6 +29,10 @@ const union { https://github.com/ruby/ruby/blob/trunk/debug.c#L29 enum ruby_encoding_consts encoding_consts; enum ruby_coderange_type enc_coderange_types; enum ruby_econv_flag_type econv_flag_types; + enum ruby_robject_flags robject_flags; + enum ruby_rmodule_flags rmodule_flags; + enum ruby_rstring_flags rstring_flags; + enum ruby_rarray_flags rarray_flags; enum { RUBY_NODE_TYPESHIFT = NODE_TYPESHIFT, RUBY_NODE_TYPEMASK = NODE_TYPEMASK, Index: include/ruby/ruby.h =================================================================== --- include/ruby/ruby.h (revision 58981) +++ include/ruby/ruby.h (revision 58982) @@ -879,7 +879,7 @@ VALUE rb_obj_reveal(VALUE obj, VALUE kla https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L879 #define ROBJECT_EMBED_LEN_MAX ROBJECT_EMBED_LEN_MAX #define ROBJECT_EMBED ROBJECT_EMBED -enum { +enum ruby_robject_flags { ROBJECT_EMBED_LEN_MAX = 3, ROBJECT_EMBED = RUBY_FL_USER1, @@ -918,7 +918,7 @@ struct RObject { https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L918 #define RMODULE_IS_OVERLAID RMODULE_IS_OVERLAID #define RMODULE_IS_REFINEMENT RMODULE_IS_REFINEMENT #define RMODULE_INCLUDED_INTO_REFINEMENT RMODULE_INCLUDED_INTO_REFINEMENT -enum { +enum ruby_rmodule_flags { RMODULE_IS_OVERLAID = RUBY_FL_USER2, RMODULE_IS_REFINEMENT = RUBY_FL_USER3, RMODULE_INCLUDED_INTO_REFINEMENT = RUBY_FL_USER4, @@ -941,7 +941,7 @@ VALUE rb_float_new_in_heap(double); https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L941 #define RSTRING_EMBED_LEN_SHIFT RSTRING_EMBED_LEN_SHIFT #define RSTRING_EMBED_LEN_MAX RSTRING_EMBED_LEN_MAX #define RSTRING_FSTR RSTRING_FSTR -enum { +enum ruby_rstring_flags { RSTRING_NOEMBED = RUBY_FL_USER1, RSTRING_EMBED_LEN_MASK = (RUBY_FL_USER2|RUBY_FL_USER3|RUBY_FL_USER4| RUBY_FL_USER5|RUBY_FL_USER6), @@ -986,7 +986,7 @@ struct RString { https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L986 ((ptrvar) = RSTRING(str)->as.ary, (lenvar) = RSTRING_EMBED_LEN(str)) : \ ((ptrvar) = RSTRING(str)->as.heap.ptr, (lenvar) = RSTRING(str)->as.heap.len)) -enum { +enum ruby_rarray_flags { RARRAY_EMBED_LEN_MAX = 3, RARRAY_EMBED_FLAG = RUBY_FL_USER1, /* RUBY_FL_USER2 is for ELTS_SHARED */ Index: misc/lldb_cruby.py =================================================================== --- misc/lldb_cruby.py (revision 58981) +++ misc/lldb_cruby.py (revision 58982) @@ -22,20 +22,6 @@ def lldb_init(debugger): https://github.com/ruby/ruby/blob/trunk/misc/lldb_cruby.py#L22 name = member.GetName() value = member.GetValueAsUnsigned() g[name] = value - global ROBJECT_EMBED_LEN_MAX, ROBJECT_EMBED - ROBJECT_EMBED_LEN_MAX = 3 - ROBJECT_EMBED = RUBY_FL_USER1 - global RMODULE_IS_OVERLAID, RMODULE_IS_REFINEMENT, RMODULE_INCLUDED_INTO_REFINEMENT - RMODULE_IS_OVERLAID = RUBY_FL_USER2 - RMODULE_IS_REFINEMENT = RUBY_FL_USER3 - RMODULE_INCLUDED_INTO_REFINEMENT = RUBY_FL_USER4 - global RSTRING_NOEMBED, RSTRING_EMBED_LEN_MASK, RSTRING_EMBED_LEN_SHIFT, RSTRING_EMBED_LEN_MAX, RSTRING_FSTR - RSTRING_NOEMBED = RUBY_FL_USER1 - RSTRING_EMBED_LEN_MASK = (RUBY_FL_USER2|RUBY_FL_USER3|RUBY_FL_USER4| - RUBY_FL_USER5|RUBY_FL_USER6) - RSTRING_EMBED_LEN_SHIFT = (RUBY_FL_USHIFT+2) - RSTRING_EMBED_LEN_MAX = (SIZEOF_VALUE*3)-1 - RSTRING_FSTR = RUBY_FL_USER17 def fixnum_p(x): return x & RUBY_FIXNUM_FLAG != 0 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/