mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
vm_dump.c: no new strings in signal context
* vm_dump.c (rb_vm_bugreport): get rid of making new strings inside signal context. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49780 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
badb4de72a
commit
dbffdff1e7
2 changed files with 15 additions and 3 deletions
|
@ -1,4 +1,7 @@
|
||||||
Sat Feb 28 15:42:27 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Sat Feb 28 15:44:20 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* vm_dump.c (rb_vm_bugreport): get rid of making new strings
|
||||||
|
inside signal context.
|
||||||
|
|
||||||
* variable.c (rb_tmp_class_path): defer making temporary class
|
* variable.c (rb_tmp_class_path): defer making temporary class
|
||||||
path string.
|
path string.
|
||||||
|
|
13
vm_dump.c
13
vm_dump.c
|
@ -1000,12 +1000,21 @@ rb_vm_bugreport(const void *ctx)
|
||||||
else if (RB_TYPE_P(name, T_CLASS) || RB_TYPE_P(name, T_MODULE)) {
|
else if (RB_TYPE_P(name, T_CLASS) || RB_TYPE_P(name, T_MODULE)) {
|
||||||
const char *const type = RB_TYPE_P(name, T_CLASS) ?
|
const char *const type = RB_TYPE_P(name, T_CLASS) ?
|
||||||
"class" : "module";
|
"class" : "module";
|
||||||
name = rb_class_name(name);
|
name = rb_search_class_path(rb_class_real(name));
|
||||||
|
if (!RB_TYPE_P(name, T_STRING)) {
|
||||||
|
fprintf(stderr, " %4d %s:<unnamed>\n", i, type);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
fprintf(stderr, " %4d %s:%.*s\n", i, type,
|
fprintf(stderr, " %4d %s:%.*s\n", i, type,
|
||||||
LIMITED_NAME_LENGTH(name), RSTRING_PTR(name));
|
LIMITED_NAME_LENGTH(name), RSTRING_PTR(name));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
VALUE klass = rb_class_name(CLASS_OF(name));
|
VALUE klass = rb_search_class_path(rb_obj_class(name));
|
||||||
|
if (!RB_TYPE_P(klass, T_STRING)) {
|
||||||
|
fprintf(stderr, " %4d #<%p:%p>\n", i,
|
||||||
|
(void *)CLASS_OF(name), (void *)name);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
fprintf(stderr, " %4d #<%.*s:%p>\n", i,
|
fprintf(stderr, " %4d #<%.*s:%p>\n", i,
|
||||||
LIMITED_NAME_LENGTH(klass), RSTRING_PTR(klass),
|
LIMITED_NAME_LENGTH(klass), RSTRING_PTR(klass),
|
||||||
(void *)name);
|
(void *)name);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue