debug doesn't work for me!

R

rayreeves

E:\Ruby\work>ruby -r debug fact.rb
Debug.rb
Emacs support available.

e:/ruby/lib/ruby/site_ruby/1.8/ubygems.rb:4:require 'rubygems'
(rdb:1) [1,4] in fact.rb
e:/ruby/lib/ruby/site_ruby/1.8/ubygems.rb:4:compile error
e:/ruby/lib/ruby/site_ruby/1.8/ubygems.rb:4: parse error, unexpected kIN,
expect
ing $
[1,4] in fact.rb
^

Set breakpoint has the same problem.

Notice there also seems to be a line missing before the (rdb:1) prompt.

Ray Reeves
 
R

rayreeves

def fact(n)
if n <= 0
1
else
n * fact(n-1)
end
end

p fact(4)

Senthilnayagam said:
can you paste your fact.rb source



senthil

http://senthilnayagam.com
E:\Ruby\work>ruby -r debug fact.rb
Debug.rb
Emacs support available.

e:/ruby/lib/ruby/site_ruby/1.8/ubygems.rb:4:require 'rubygems'
(rdb:1) [1,4] in fact.rb
e:/ruby/lib/ruby/site_ruby/1.8/ubygems.rb:4:compile error
e:/ruby/lib/ruby/site_ruby/1.8/ubygems.rb:4: parse error, unexpected kIN,
expect
ing $
[1,4] in fact.rb
^

Set breakpoint has the same problem.

Notice there also seems to be a line missing before the (rdb:1) prompt.

Ray Reeves
 
S

Senthilnayagam

C:\rails\ruby>ruby -rdebug fact.rb
Debug.rb
Emacs support available.

c:/ruby/lib/ruby/site_ruby/1.8/ubygems.rb:4:require 'rubygems'
(rdb:1) b 2
Set breakpoint 1 at c:/ruby/lib/ruby/site_ruby/1.8/ubygems.rb:2
(rdb:1) c
24


works perfectly for me

not sure why it did not work for you

regards
Senthil
http://senthilnayagam.com

def fact(n)
if n <= 0
1
else
n * fact(n-1)
end
end

p fact(4)

Senthilnayagam said:
can you paste your fact.rb source



senthil

http://senthilnayagam.com
E:\Ruby\work>ruby -r debug fact.rb
Debug.rb
Emacs support available.

e:/ruby/lib/ruby/site_ruby/1.8/ubygems.rb:4:require 'rubygems'
(rdb:1) [1,4] in fact.rb
e:/ruby/lib/ruby/site_ruby/1.8/ubygems.rb:4:compile error
e:/ruby/lib/ruby/site_ruby/1.8/ubygems.rb:4: parse error, unexpected kIN,
expect
ing $
[1,4] in fact.rb
^

Set breakpoint has the same problem.

Notice there also seems to be a line missing before the (rdb:1) prompt.

Ray Reeves
 
R

rayreeves

But it doesn't stop at line 2!
And this command from the manual doesn't parse:
[1,4] in fact.rb

Ray Reeves
 
R

rayreeves

Tim Hoolihan said:
Try this:

(irb:1)break fact.rb:1
(irb:1)c
E:\Ruby\work>irb
irb(main):001:0> break fact.rb:1
SyntaxError: compile error
(irb):1: parse error, unexpected tINTEGER, expecting tSTRING_CONTENT or
tSTRING_
DBEG or tSTRING_DVAR or tSTRING_END
from (irb):1
If you've been running this in windows, I think ruby includes a file in
order to work smoothly with the windows command line. Your breakpoint
were getting set in that code, not your code.

Well, that's no use!
Notice that Senthilnaya's code didn't work either
Could it be that Ruby debug simply doesn't work under XP?

Ray Reeves
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,120
Latest member
ShelaWalli
Top