This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 108612 - $0 ($PROGRAM_NAME) is not the same when running under debugger
Summary: $0 ($PROGRAM_NAME) is not the same when running under debugger
Status: NEW
Alias: None
Product: ruby
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: issues@ruby
URL: http://rubyforge.org/tracker/index.ph...
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-02 10:52 UTC by michel_demazure
Modified: 2011-01-28 20:10 UTC (History)
0 users

See Also:
Issue Type: TASK
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description michel_demazure 2007-07-02 10:52:08 UTC
My project (uses FXRuby) has no bug.
But debugger freezes. Message when stopped :

 ruby 1.8.6 debugger listens on port 2951
 private method 'chomp!' called for nil:NilClass

But no 'chomp!' in my project.
Comment 1 Martin Krauskopf 2007-07-02 11:54:04 UTC
Hi Michel, I could (and will) try to debug some simple FXRuby project. But I would appreciate more information.

- does it freeze randomly or always when you try to debug your project.
- what debugger are you using. Fast Debugger (ruby-debug-ide) or classic (I suppose Ruby, not JRuby)
- could you run the IDE with debugging flags as described at (very short):

  http://wiki.netbeans.org/wiki/view/RubyDebugging#section-RubyDebugging-HowToFileABug

  that might help.

Thanks for the feedback.
Comment 2 Martin Krauskopf 2007-07-03 09:52:27 UTC
We have found the culprit through emails with Michel. The problem is that $0 ($PROGRAM_NAME) variables is different when
running under debugger then without it.

So the following 'pattern' fails:

if __FILE__ == $0
  ...
end 

I'm still not sure whether to fix it somehow. Probably possible by just adjusting $0 (writable). But there might be some
problem as it is pointed in the discussion:

http://www.ruby-forum.com/topic/113859#new
(thanks for the link Michel)

Leaving open for now.
Comment 3 Jiri Kovalsky 2007-07-03 14:06:48 UTC
Reassigning this issue to newly created 'ruby' component.
Comment 4 Martin Krauskopf 2007-10-26 07:42:41 UTC
Just somebody has filed the same in ruby-debug. I believe this is bug in the backend and get when the debug-commons bug
is fixed (see URL). Probably all we need is ARGV.shift. So actually will be solved by updating to the new version of
ruby-debug-ide gem after the fix is available.
Comment 5 Martin Krauskopf 2008-01-28 15:55:42 UTC
Just a note/reminder for me:
http://rubyforge.org/tracker/index.php?func=detail&aid=16038&group_id=1900&atid=7438