summaryrefslogtreecommitdiff
path: root/vm_dump.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-15 05:50:24 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-15 05:50:24 +0000
commit7475244ec44103e00f7ffe0137cd88bb4a96b41d (patch)
tree9780e60ee3d7cc8939308e8fd862e75abc96d786 /vm_dump.c
parent584829aa814a1104205ab85cefcf245f8c118987 (diff)
* vm_dump.c (bugreport_backtrace): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_dump.c')
-rw-r--r--vm_dump.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/vm_dump.c b/vm_dump.c
index 0aa8dae..7667cb6 100644
--- a/vm_dump.c
+++ b/vm_dump.c
@@ -570,12 +570,18 @@ rb_vmdebug_thread_dump_state(VALUE self)
static int
bugreport_backtrace(void *arg, VALUE file, int line, VALUE method)
{
+ const char *filename = NIL_P(file) ? "ruby" : RSTRING_PTR(file);
if (!*(int *)arg) {
fprintf(stderr, "-- Ruby level backtrace information "
"----------------------------------------\n");
*(int *)arg = 1;
}
- fprintf(stderr, "%s:%d:in `%s'\n", RSTRING_PTR(file), line, RSTRING_PTR(method));
+ if (NIL_P(method)) {
+ fprintf(stderr, "%s:%d:in unknown method\n", filename, line);
+ }
+ else {
+ fprintf(stderr, "%s:%d:in `%s'\n", filename, line, RSTRING_PTR(method));
+ }
return 0;
}