Skip to content

Commit

Permalink
debug.c: more enums
Browse files Browse the repository at this point in the history
* debug.c (ruby_dummy_gdb_enums): add enums for RObject, RModule,
  RString, RArray.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nobu committed Jun 1, 2017
1 parent d0e7329 commit be701dc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 18 deletions.
4 changes: 4 additions & 0 deletions debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ const union {
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,
Expand Down
8 changes: 4 additions & 4 deletions include/ruby/ruby.h
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,7 @@ VALUE rb_obj_reveal(VALUE obj, VALUE klass); /* do not use this API to change kl

#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,

Expand Down Expand Up @@ -918,7 +918,7 @@ struct RObject {
#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,
Expand All @@ -941,7 +941,7 @@ VALUE rb_float_new_in_heap(double);
#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),
Expand Down Expand Up @@ -986,7 +986,7 @@ struct RString {
((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 */
Expand Down
14 changes: 0 additions & 14 deletions misc/lldb_cruby.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,6 @@ def lldb_init(debugger):
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
Expand Down

0 comments on commit be701dc

Please sign in to comment.