summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-01 04:43:03 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-01 04:43:03 (GMT)
commitbe701dc57f8b1a370c74b648a8826f266c5fbd02 (patch)
treef6d9dcec657a4ff18a8ff52d6bbecf7a74718505
parentd0e7329df3ea43cb9e469ad32aafdbf7267ba2d0 (diff)
debug.c: more enums
* 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
-rw-r--r--debug.c4
-rw-r--r--include/ruby/ruby.h8
-rwxr-xr-xmisc/lldb_cruby.py14
3 files changed, 8 insertions, 18 deletions
diff --git a/debug.c b/debug.c
index 65d8687..296646c 100644
--- a/debug.c
+++ b/debug.c
@@ -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,
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index 97cfe1f..57ca849 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -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,
@@ -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,
@@ -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),
@@ -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 */
diff --git a/misc/lldb_cruby.py b/misc/lldb_cruby.py
index 8284ac8..78325b8 100755
--- a/misc/lldb_cruby.py
+++ b/misc/lldb_cruby.py
@@ -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