debig an infinite loop

T

trans. (T. Onoma)

Pointers on debug'n, especially tracking an infinite loop.

Also is there a Ruby "binding" for ddd?

Thanx.

--
( o _ カラãƒ
// trans.
/ \ (e-mail address removed)

I don't give a damn for a man that can only spell a word one way.
-Mark Twain
 
G

Gavin Sinclair

transami said:
Pointers on debug'n, especially tracking an infinite loop.

My preferred method of debugging is to open an irb shell from the program.
This lets you evaluate local variables, etc. See Florian Weber's recent
"breakpoint.rb" announcement.

loop do
...
breakpoint if some_condition
...
end

For an infinite loop, I'm guessing printf-debugging would help as well.
Thus: puts/logger/log4r.
Also is there a Ruby "binding" for ddd?

I sincerely doubt it.

Cheers,
Gavin
 
F

Florian Gross

Gavin said:
My preferred method of debugging is to open an irb shell from the program.
This lets you evaluate local variables, etc. See Florian Weber's recent
"breakpoint.rb" announcement.

Nice to see this getting adopted so quickly. :)

Note that in this context even an assert() might be useful. (Something
like assert { termination condition })
Cheers,
Gavin

Regards,
Florian %w{Gross Weber}.any # ;)
 
T

trans. (T. Onoma)

My preferred method of debugging is to open an irb shell from the program.
This lets you evaluate local variables, etc. See Florian Weber's recent
"breakpoint.rb" announcement.

loop do
...
breakpoint if some_condition
...
end

Yes, that seems pretty nice. I plan to use that.
For an infinite loop, I'm guessing printf-debugging would help as well.
Thus: puts/logger/log4r.

Although I did figure it out already, it was tricky b/c the loop was occurring
in someone else's library.
I sincerely doubt it.

Too bad.

Thanks,
T.

--
( o _ カラãƒ
// trans.
/ \ (e-mail address removed)

I don't give a damn for a man that can only spell a word one way.
-Mark Twain
 

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

No members online now.

Forum statistics

Threads
473,781
Messages
2,569,616
Members
45,306
Latest member
TeddyWeath

Latest Threads

Top