Project

General

Profile

Bug #8318

Fix debug listing when called from the same file the debug module has been required from

Added by Zachary Scott about 3 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
ruby -v:
2.1.0dev
[ruby-core:54543]

Description

=begin
From (())

with this minimal ruby code

require 'debug'
puts
when trying to list the code, it'll fail like so:

(rdb:1) l
[-3, 6] in script.rb
No sourcefile available for script.rb
=end

280.patch Magnifier (1.06 KB) Zachary Scott, 04/24/2013 12:44 PM

Associated revisions

Revision 40450
Added by Nobuyoshi Nakada about 3 years ago

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 [Bug #8318] [fix GH-280]

Revision 40450
Added by Nobuyoshi Nakada about 3 years ago

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 [Bug #8318] [fix GH-280]

Revision 40450
Added by Nobuyoshi Nakada about 3 years ago

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 [Bug #8318] [fix GH-280]

Revision 40452
Added by Nobuyoshi Nakada about 3 years ago

debug.rb: Fix debug listing

  • lib/debug.rb (script_lines): get source lines from SCRIPT_LINES__ or read from the file.
  • lib/debug.rb (display_list): use script_lines instead of recursion. [Bug #8318]
  • lib/debug.rb (line_at): use script_lines same as display_list.

Revision 40452
Added by Nobuyoshi Nakada about 3 years ago

debug.rb: Fix debug listing

  • lib/debug.rb (script_lines): get source lines from SCRIPT_LINES__ or read from the file.
  • lib/debug.rb (display_list): use script_lines instead of recursion. [Bug #8318]
  • lib/debug.rb (line_at): use script_lines same as display_list.

Revision 40452
Added by Nobuyoshi Nakada about 3 years ago

debug.rb: Fix debug listing

  • lib/debug.rb (script_lines): get source lines from SCRIPT_LINES__ or read from the file.
  • lib/debug.rb (display_list): use script_lines instead of recursion. [Bug #8318]
  • lib/debug.rb (line_at): use script_lines same as display_list.

History

#1 [ruby-core:54548] Updated by Nobuyoshi Nakada about 3 years ago

  • Description updated (diff)

#2 Updated by Nobuyoshi Nakada about 3 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r40450.
Zachary, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


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 [Bug #8318] [fix GH-280]

Also available in: Atom PDF