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] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40450 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
66ad210df8
commit
9e97f6ca63
@ -1,3 +1,9 @@
|
|||||||
|
Thu Apr 25 01:18:55 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* 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@fsij.org>
|
Wed Apr 24 21:51:13 2013 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* configure.in: Check mblen().
|
* configure.in: Check mblen().
|
||||||
|
@ -753,8 +753,8 @@ EOHELP
|
|||||||
end
|
end
|
||||||
|
|
||||||
def display_list(b, e, file, line)
|
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
|
if lines = SCRIPT_LINES__[file] and lines != true
|
||||||
|
stdout.printf "[%d, %d] in %s\n", b, e, file
|
||||||
b.upto(e) do |n|
|
b.upto(e) do |n|
|
||||||
if n > 0 && lines[n-1]
|
if n > 0 && lines[n-1]
|
||||||
if n == line
|
if n == line
|
||||||
@ -764,6 +764,9 @@ EOHELP
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
elsif File.exists? file
|
||||||
|
Tracer::Single.get_line(file, line)
|
||||||
|
display_list(b, e, file, line)
|
||||||
else
|
else
|
||||||
stdout.printf "No sourcefile available for %s\n", file
|
stdout.printf "No sourcefile available for %s\n", file
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user