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

ruby-changes:28398

From: nobu <ko1@a...>
Date: Thu, 25 Apr 2013 01:19:12 +0900 (JST)
Subject: [ruby-changes:28398] nobu:r40450 (trunk): debug.rb: Fix debug listing

nobu	2013-04-25 01:19:00 +0900 (Thu, 25 Apr 2013)

  New Revision: 40450

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

  Log:
    debug.rb: Fix debug listing
    
    * lib/debug.rb (display_list): Fix debug listing when called from the
      same file it has been required.  patch by Dario Bertini <berdario AT
      gmail.com> [Bug #8318] [fix GH-280]

  Modified files:
    trunk/ChangeLog
    trunk/lib/debug.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 40449)
+++ ChangeLog	(revision 40450)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Apr 25 01:18:55 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* lib/debug.rb (display_list): Fix debug listing when called from the
+	  same file it has been required.  patch by Dario Bertini <berdario AT
+	  gmail.com> [Bug #8318] [fix GH-280]
+
 Wed Apr 24 21:51:13 2013  Tanaka Akira  <akr@f...>
 
 	* configure.in: Check mblen().
Index: lib/debug.rb
===================================================================
--- lib/debug.rb	(revision 40449)
+++ lib/debug.rb	(revision 40450)
@@ -753,8 +753,8 @@ EOHELP https://github.com/ruby/ruby/blob/trunk/lib/debug.rb#L753
     end
 
     def display_list(b, e, file, line)
-      stdout.printf "[%d, %d] in %s\n", b, e, file
       if lines = SCRIPT_LINES__[file] and lines != true
+        stdout.printf "[%d, %d] in %s\n", b, e, file
         b.upto(e) do |n|
           if n > 0 && lines[n-1]
             if n == line
@@ -764,6 +764,9 @@ EOHELP https://github.com/ruby/ruby/blob/trunk/lib/debug.rb#L764
             end
           end
         end
+      elsif File.exists? file
+        Tracer::Single.get_line(file, line)
+        display_list(b, e, file, line)
       else
         stdout.printf "No sourcefile available for %s\n", file
       end

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

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