[前][次][番号順一覧][スレッド一覧]

ruby-changes:15448

From: nobu <ko1@a...>
Date: Thu, 15 Apr 2010 14:53:54 +0900 (JST)
Subject: [ruby-changes:15448] Ruby:r27346 (trunk): * vm_dump.c (bugreport_backtrace): ditto.

nobu	2010-04-15 14:50:24 +0900 (Thu, 15 Apr 2010)

  New Revision: 27346

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=27346

  Log:
    * vm_dump.c (bugreport_backtrace): ditto.

  Modified files:
    trunk/ChangeLog
    trunk/vm_dump.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 27345)
+++ ChangeLog	(revision 27346)
@@ -1,4 +1,4 @@
-Thu Apr 15 14:38:03 2010  Nobuyoshi Nakada  <nobu@r...>
+Thu Apr 15 14:50:19 2010  Nobuyoshi Nakada  <nobu@r...>
 
 	* vm.c (vm_backtrace_each): get rid of use of malloc from signal
 	  handler by using ruby_engine_name.  [ruby-core:29497]
@@ -6,6 +6,8 @@
 	* vm_eval.c (print_backtrace): file may be nil when segfaulted in
 	  very early stage.
 
+	* vm_dump.c (bugreport_backtrace): ditto.
+
 Thu Apr 15 11:51:49 2010  NAKAMURA Usaku  <usa@r...>
 
 	* common.mk (help): small fix.
Index: vm_dump.c
===================================================================
--- vm_dump.c	(revision 27345)
+++ vm_dump.c	(revision 27346)
@@ -570,12 +570,18 @@
 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;
 }
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]