aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-06 06:11:25 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-06 06:11:25 +0000
commit0ee8bb4c2a35d81dacf27be5fc42706aa891f33f (patch)
tree1d8085bb5fac96ba8adce7cd2e4bce36923e8afd
parent12bd519a9b91fbb1b7f515b5c52b2c1e9084d85f (diff)
downloadruby-0ee8bb4c2a35d81dacf27be5fc42706aa891f33f.tar.gz
.gdbinit: print_id in rp_id [ci skip]
* .gdbinit (rp_id): use print_id instead of calling lookup_id_str() in a debugger context. * symbol.c (ID_ENTRY_UNIT): made visible to debuggers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--.gdbinit13
-rw-r--r--symbol.c2
2 files changed, 7 insertions, 8 deletions
diff --git a/.gdbinit b/.gdbinit
index 9d14fb2..356b743 100644
--- a/.gdbinit
+++ b/.gdbinit
@@ -398,12 +398,7 @@ define rp_id
end
end
printf "(%ld): ", $id
- set $str = lookup_id_str($id)
- if $str
- rp_string $str
- else
- echo undef\n
- end
+ print_id $id
end
end
end
@@ -1093,7 +1088,11 @@ define print_id
set $arylen = $ary->as.heap.len
end
set $result = $aryptr[($serial % ID_ENTRY_UNIT) * ID_ENTRY_SIZE + $t]
- print_string $result
+ if $result != RUBY_Qnil
+ print_string $result
+ else
+ echo undef\n
+ end
end
end
end
diff --git a/symbol.c b/symbol.c
index f4516eb..45d49d2 100644
--- a/symbol.c
+++ b/symbol.c
@@ -51,7 +51,7 @@ Init_op_tbl(void)
}
}
-enum {ID_ENTRY_UNIT = 512};
+static const int ID_ENTRY_UNIT = 512;
enum id_entry_type {
ID_ENTRY_STR,