Project

General

Profile

Bug #848

debug.rb doesn't have access to the source file under test until it has run

Added by pragdave (Dave Thomas) almost 11 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Target version:
ruby -v:
Backport:
[ruby-core:20450]

Description

=begin
dave[RUBY3/Book 14:51:21*] ruby -v -r debug t.rb
ruby 1.9.1 (2008-12-10 revision 20602) [i386-darwin9.5.0]
Debug.rb
Emacs support available.

/usr/local/rubybook/lib/ruby/1.9.1/debug.rb:904:
(rdb:1) l
[899, 908] in /usr/local/rubybook/lib/ruby/1.9.1/debug.rb
No sourcefile available for /usr/local/rubybook/lib/ruby/1.9.1/debug.rb <<<< !!!

(rdb:1) step
t.rb:1:var = 'cat'
(rdb:1) l
[-4, 5] in t.rb
=> 1 var = 'cat'
2 def escape(l, s); l; end
3

4 while l.length > 70

Also, not line number range of [-4,5]
=end


Related issues

Related to Ruby master - Bug #847: debug.rb reports extraneous informationClosed12/11/200801/20/2009Actions

Associated revisions

Revision e4092873
Added by ko1 (Koichi Sasada) almost 11 years ago

  • ruby.c (process_options): decrement parse_in_eval to recognize parsing main or normal eval script.
  • compile.c (rb_parse_in_main): return 1 if parsing main script. (if parse_in_eval is negative value, it means main script)
  • parse.y (yycompile0): check rb_parse_in_main() to accumulate script text. Bug #848 [ruby-core:20450]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 21571
Added by ko1 (Koichi Sasada) almost 11 years ago

  • ruby.c (process_options): decrement parse_in_eval to recognize parsing main or normal eval script.
  • compile.c (rb_parse_in_main): return 1 if parsing main script. (if parse_in_eval is negative value, it means main script)
  • parse.y (yycompile0): check rb_parse_in_main() to accumulate script text. Bug #848 [ruby-core:20450]

Revision 21571
Added by ko1 (Koichi Sasada) almost 11 years ago

  • ruby.c (process_options): decrement parse_in_eval to recognize parsing main or normal eval script.
  • compile.c (rb_parse_in_main): return 1 if parsing main script. (if parse_in_eval is negative value, it means main script)
  • parse.y (yycompile0): check rb_parse_in_main() to accumulate script text. Bug #848 [ruby-core:20450]

Revision 21571
Added by ko1 (Koichi Sasada) almost 11 years ago

  • ruby.c (process_options): decrement parse_in_eval to recognize parsing main or normal eval script.
  • compile.c (rb_parse_in_main): return 1 if parsing main script. (if parse_in_eval is negative value, it means main script)
  • parse.y (yycompile0): check rb_parse_in_main() to accumulate script text. Bug #848 [ruby-core:20450]

Revision 21571
Added by ko1 (Koichi Sasada) almost 11 years ago

  • ruby.c (process_options): decrement parse_in_eval to recognize parsing main or normal eval script.
  • compile.c (rb_parse_in_main): return 1 if parsing main script. (if parse_in_eval is negative value, it means main script)
  • parse.y (yycompile0): check rb_parse_in_main() to accumulate script text. Bug #848 [ruby-core:20450]

Revision 21571
Added by ko1 (Koichi Sasada) almost 11 years ago

  • ruby.c (process_options): decrement parse_in_eval to recognize parsing main or normal eval script.
  • compile.c (rb_parse_in_main): return 1 if parsing main script. (if parse_in_eval is negative value, it means main script)
  • parse.y (yycompile0): check rb_parse_in_main() to accumulate script text. Bug #848 [ruby-core:20450]

Revision 21571
Added by ko1 (Koichi Sasada) almost 11 years ago

  • ruby.c (process_options): decrement parse_in_eval to recognize parsing main or normal eval script.
  • compile.c (rb_parse_in_main): return 1 if parsing main script. (if parse_in_eval is negative value, it means main script)
  • parse.y (yycompile0): check rb_parse_in_main() to accumulate script text. Bug #848 [ruby-core:20450]

Revision 1bf3fe1d
Added by yugui (Yuki Sonoda) almost 11 years ago

merges r21571 from trunk into ruby_1_9_1.

  • ruby.c (process_options): decrement parse_in_eval to recognize parsing main or normal eval script.
  • compile.c (rb_parse_in_main): return 1 if parsing main script. (if parse_in_eval is negative value, it means main script)
  • parse.y (yycompile0): check rb_parse_in_main() to accumulate script text. Bug #848 [ruby-core:20450]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@21576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

History

#1

Updated by yugui (Yuki Sonoda) almost 11 years ago

  • Assignee set to ko1 (Koichi Sasada)
  • Target version set to 1.9.1 Release Candidate

=begin

=end

#2

Updated by yugui (Yuki Sonoda) almost 11 years ago

  • Due date set to 12/24/2008

=begin

=end

#3

Updated by yugui (Yuki Sonoda) almost 11 years ago

  • Category set to YARV
  • Priority changed from Normal to 3

=begin

=end

#4

Updated by yugui (Yuki Sonoda) almost 11 years ago

  • Due date changed from 12/24/2008 to 01/20/2009
  • Target version changed from 1.9.1 Release Candidate to 1.9.1 RC2

=begin

=end

#5

Updated by wsobel (William Sobel) almost 11 years ago

=begin
Found a patch that fixes this bug, not sure if it's correct. The problem is the compile_for_eval is always 1 (coming from the th->parse_in_eval flag.) The parse_in_eval is incremented in the process_options function, not sure why. I tried to change the value and things broke in a most horrible manor.

Found a quick fix that seems to work correctly, just removed the check for compile_in_eval. The check for debug_lines seems to do the right thing. Not sure if this is a help, just trying to be useful. ;-)

Hope this helps,

  • Will Sobel

Index: parse.y
===================================================================
--- parse.y (revision 21497)
+++ parse.y (working copy)
@@ -4977,7 +4977,7 @@
NODE *tree;
struct parser_params *parser = (struct parser_params *)arg;

  • if (!compile_for_eval && rb_safe_level() == 0) {
  • if (rb_safe_level() == 0) { ruby_debug_lines = debug_lines(ruby_sourcefile); if (ruby_debug_lines && ruby_sourceline > 0) { VALUE str = STR_NEW0();

=end

#6

Updated by ko1 (Koichi Sasada) almost 11 years ago

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

=begin
Applied in changeset r21571.
=end

Also available in: Atom PDF