--000e0cd211cc0df39d046066695f
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

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  ebug_lines(ruby_sourcefile);
        if (ruby_debug_lines && ruby_sourceline > 0) {
            VALUE str  TR_NEW0();


On Wed, Dec 10, 2008 at 12:46 PM, Dave Thomas <redmine / ruby-lang.org> wrote:

> Bug #848: debug.rb doesn't have access to the source file under test until
> it has run
> http://redmine.ruby-lang.org/issues/show/848
>
> Author: Dave Thomas
> Status: Open, Priority: Normal
>
> 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]
>
>
> ----------------------------------------
> http://redmine.ruby-lang.org
>
>

--000e0cd211cc0df39d046066695f
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div><br></div><div>Found a patch that fixes this bug, not sure if it&#39;sorrect. The problem is the compile_for_eval is always 1 (coming from the th-&gt;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.</div>
<div><br></div><div>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. ;-)</div>
<div><br></div><div>Hope this helps,</div><div>- Will Sobel</div><div><br></div><div><div>Index: parse.y</div><div>===================================================================</div><div>--- parse.y &nbsp; &nbsp; (revision 21497)</div>
<div>+++ parse.y &nbsp; &nbsp; (working copy)</div><div>@@ -4977,7 +4977,7 @@</div><div>&nbsp;&nbsp; &nbsp; NODE *tree;</div><div>&nbsp;&nbsp; &nbsp; struct parser_params *parser = (struct parser_params *)arg;</div><div>&nbsp;</div><div>- &nbsp; &nbsp;if (!compile_for_eval &amp;&amp; rb_safe_level() == 0) {</div>
<div>+ &nbsp; &nbsp;if (rb_safe_level() == 0) {</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;ruby_debug_lines = debug_lines(ruby_sourcefile);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;if (ruby_debug_lines &amp;&amp; ruby_sourceline &gt; 0) {</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;VALUE str = STR_NEW0();</div>
</div><br><br><div class="gmail_quote">On Wed, Dec 10, 2008 at 12:46 PM, Dave Thomas <span dir="ltr">&lt;redmine / ruby-lang.org&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Bug #848: debug.rb doesn&#39;t have access to the source file under test until it has run<br>
<a href="http://redmine.ruby-lang.org/issues/show/848" target="_blank">http://redmine.ruby-lang.org/issues/show/848</a><br>
<br>
Author: Dave Thomas<br>
Status: Open, Priority: Normal<br>
<br>
dave[RUBY3/Book 14:51:21*] ruby -v -r debug t.rb<br>
ruby 1.9.1 (2008-12-10 revision 20602) [i386-darwin9.5.0]<br>
Debug.rb<br>
Emacs support available.<br>
<br>
/usr/local/rubybook/lib/ruby/1.9.1/debug.rb:904:<br>
(rdb:1) l<br>
[899, 908] in /usr/local/rubybook/lib/ruby/1.9.1/debug.rb<br>
No sourcefile available for /usr/local/rubybook/lib/ruby/1.9.1/debug.rb &nbsp; &nbsp;&lt;&lt;&lt;&lt; !!!<br>
<br>
<br>
<br>
(rdb:1) step<br>
t.rb:1:var = &#39;cat&#39;<br>
(rdb:1) l<br>
[-4, 5] in t.rb<br>
=&gt; 1 &nbsp;var = &#39;cat&#39;<br>
 &nbsp; 2 &nbsp;def escape(l, s); l; end<br>
 &nbsp; 3<br>
 &nbsp; 4 &nbsp;while l.length &gt; 70<br>
<br>
<br>
<br>
Also, not line number range of [-4,5]<br>
<br>
<br>
----------------------------------------<br>
<a href="http://redmine.ruby-lang.org" target="_blank">http://redmine.ruby-lang.org</a><br>
<br>
</blockquote></div><br>

--000e0cd211cc0df39d046066695f--