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.
Open args sample project. Set breakpoint at any line before first executable command, i.e. on >>int i line:47 Run Debugger - breakpoint is ignored. If to set breakpoint on line:50 - debugger stops at the breakpoint. gdb 6.6 is used. On Windows this defect is not reproducible.
The bug is also reproducible on solaris. Gdb log from Linux machine is attached.
Created attachment 55771 [details] gdb log
Looking at gdb log it seems that we did "step into" first (at line 50) and after that set a breakpoint at line 47 then perform "continue". This explains why gdb does not stop at non-executable line if it is the first one in the executable file. If we insert any executable line before this line then everything will work fine. For the same reason the bug is not reproducible on Windows where "step into" goes to method definition (before the first line in the code).
Alexander Pepin's analysis is correct. Only breakpoints before the 1st executable line of code will be ignored. Even then, its platform specific (thats why it stops at line 47 on Windows). This problem is fixable, but is it really a P2? Breakpoints set on the 1st executable line of code will work. About the only ones which won't are bps set on comments or uninitialized declarations. Let me know if you agree that this should be a P3. Note: Fixing this would be slightly dangerous. It would involve changing the startup state model. Currently, I set a bp at main, run to it, and set bps at first-stop. To fix this I'd have to either set bps before running, track which ones failed, run to 1st stop, set all failed bps or set the bp in main and analyze which bps are in main but before that 1st bp. In either case, messing with the startup state model is dangerous and I'll only do it if you really think this is likely to affect users.
See previous comment. Closing as WONTFIX.
Per a request from QA, I'm reopening and downgrading. Will consider fixing in NB 7.0.
Per request from Jesse and because this is basically just a platform specific issue (and doesn't happen on Windows), closing as WONTFIX.
I transform it to enhancement.