E
ext-golla.anil-kumar
Hi,
I want to debug a ruby script using -rdebug option.
The following is the source code: with file fact.rb.
Fact.rb
def fact(n)
return 1 if n =3D=3D 0
f =3D 1
n.downto(1) do |i|
f *=3D i
end
return f
end
print fact(2), "\n"
Debugging
When I run the following command and type 'n' for debugin the next line, it=
is going in to some other files.
As shown below.
C:\ruby\samples\RubySrc-1.8.6-p111\sample>ruby -rdebug fact.rb
Debug.rb
Emacs support available.
c:/ruby/lib/ruby/site_ruby/1.8/ubygems.rb:10:require 'rubygems'
(rdb:1) list
[5, 14] in c:/ruby/lib/ruby/site_ruby/1.8/ubygems.rb
5 # All rights reserved.
6 # See LICENSE.txt for permissions.
7 #++
8
9
=3D> 10 require 'rubygems'
(rdb:1) n
c:/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:10:require 'rbconfig'
(rdb:1) n
c:/ruby/lib/ruby/1.8/i386-mswin32/rbconfig.rb:5:module Config
(rdb:1) n
c:/ruby/lib/ruby/1.8/i386-mswin32/rbconfig.rb:153:RbConfig =3D Config # com=
patibility for ruby-1.9
(rdb:1) n
c:/ruby/lib/ruby/1.8/i386-mswin32/rbconfig.rb:154:CROSS_COMPILING =3D nil u=
nless defined? CROSS_COMPILING
(rdb:1) n
c:/ruby/lib/ruby/1.8/i386-mswin32/rbconfig.rb:154:CROSS_COMPILING =3D nil u=
nless defined? CROSS_COMPILING
(rdb:1) n
c:/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:12:module Gem
(rdb:1) n
c:/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:18:module Kernel
(rdb:1)'
What is the command that iam supposed to used to debug actual source code, =
line by line( with out moving to other files)?
Thanks and Regards,
Anil kumar
I want to debug a ruby script using -rdebug option.
The following is the source code: with file fact.rb.
Fact.rb
def fact(n)
return 1 if n =3D=3D 0
f =3D 1
n.downto(1) do |i|
f *=3D i
end
return f
end
print fact(2), "\n"
Debugging
When I run the following command and type 'n' for debugin the next line, it=
is going in to some other files.
As shown below.
C:\ruby\samples\RubySrc-1.8.6-p111\sample>ruby -rdebug fact.rb
Debug.rb
Emacs support available.
c:/ruby/lib/ruby/site_ruby/1.8/ubygems.rb:10:require 'rubygems'
(rdb:1) list
[5, 14] in c:/ruby/lib/ruby/site_ruby/1.8/ubygems.rb
5 # All rights reserved.
6 # See LICENSE.txt for permissions.
7 #++
8
9
=3D> 10 require 'rubygems'
(rdb:1) n
c:/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:10:require 'rbconfig'
(rdb:1) n
c:/ruby/lib/ruby/1.8/i386-mswin32/rbconfig.rb:5:module Config
(rdb:1) n
c:/ruby/lib/ruby/1.8/i386-mswin32/rbconfig.rb:153:RbConfig =3D Config # com=
patibility for ruby-1.9
(rdb:1) n
c:/ruby/lib/ruby/1.8/i386-mswin32/rbconfig.rb:154:CROSS_COMPILING =3D nil u=
nless defined? CROSS_COMPILING
(rdb:1) n
c:/ruby/lib/ruby/1.8/i386-mswin32/rbconfig.rb:154:CROSS_COMPILING =3D nil u=
nless defined? CROSS_COMPILING
(rdb:1) n
c:/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:12:module Gem
(rdb:1) n
c:/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:18:module Kernel
(rdb:1)'
What is the command that iam supposed to used to debug actual source code, =
line by line( with out moving to other files)?
Thanks and Regards,
Anil kumar