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 151577 - Unable to debug Makefile based projects
Summary: Unable to debug Makefile based projects
Status: VERIFIED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 6.x
Hardware: All Windows XP
: P2 blocker (vote)
Assignee: _ gordonp
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-28 12:09 UTC by Egor Ushakov
Modified: 2009-06-25 10:59 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
gdb log (2.14 KB, text/plain)
2008-10-28 12:10 UTC, Egor Ushakov
Details
gdb log (3.94 KB, text/plain)
2008-11-20 18:04 UTC, Alexander Pepin
Details
gdb log for the latest dev build (3.52 KB, text/plain)
2008-11-21 21:17 UTC, Alexander Pepin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Egor Ushakov 2008-10-28 12:09:30 UTC
Create any makefile based project for cygwin and try to debug.
The result is that executable fails, windows message about app crash appears,
after that IDE hangs for several seconds and message "The process can not be debugged..." appears.
Comment 1 Egor Ushakov 2008-10-28 12:10:46 UTC
Created attachment 72761 [details]
gdb log
Comment 2 Egor Ushakov 2008-10-28 12:13:15 UTC
The problem is that gdb is run without proper environment (i.e. cygwin libs).
In fact it runs with empty environment (second line in the log)
Comment 3 Leonid Lenyashin 2008-10-28 12:28:00 UTC
QA please check for ShowStopper status. To me it sounds very severe.
Comment 4 Alexander Pepin 2008-10-28 13:06:44 UTC
It's impossible to debug makefile using cygwin but debugger works fine with MinGW. It's seems to be a problem with
cygwin gdb. Anyway I confirm that it's a showstopper.
Comment 5 Sergey Grinev 2008-10-28 14:22:12 UTC
After some experiments we found out that Makefile-based projects' debugging doesn't work if there is no cygwin in PATH.
At the same time managed projects' debugging works.

The reason is that env is not set during debugging start for Makefile-based project (as we can see in gdb-logs)



P.S.: I believe this is not a showstopper, because there is a simple workaround: add cygwin to PATH.
Comment 6 _ gordonp 2008-10-28 15:24:04 UTC
Egor said:
> The problem is that gdb is run without proper environment (i.e. cygwin libs).
> In fact it runs with empty environment (second line in the log)

These are 2 different issues. The 1st line is critical (cygwin libs) but the 2nd
line is OK. The empty environment refers to environment variables added at the
project level, not the normal user's environment.

Sergey said:
> P.S.: I believe this is not a showstopper, because there is a simple workaround: add cygwin to PATH

I also agree with this. While I agree that we should add cygwin to the path (in code), its been this way
for 5 or 6 releases so I find it hard to consider this a showstopper.
Comment 7 Alexander Pepin 2008-11-06 20:14:44 UTC
Workaround:
- add path to 'cygwin\bin' to 'Path' environment variable
- restart IDE with a fresh userdir or remove current userdir and restart IDE
Comment 8 Alexander Pepin 2008-11-12 20:19:56 UTC
I believe it should work with both cygwin and MinGW projects.
Comment 9 Alexander Pepin 2008-11-12 20:26:30 UTC
see also issue #153068 
Comment 10 Ann Rice 2008-11-13 21:00:21 UTC
I do not think this is really a bug. Our installation and setup instructions for the tool coolections explicitly tell
users to add the tools they install to their path. So the situation described here will not occur if they follow the
instructions in the documentation. 
Comment 11 _ gordonp 2008-11-13 21:38:41 UTC
> I do not think this is really a bug

Its a bug if for no other reason than Debug behavior is different than Run behavior.
But even though we document that the user needs to have the Cygwin directory in their
path, its still something we can overcome if they don't.

Its much better to proactively fix the user's problem, although in this case it does
break the contract that anything runnable/debuggable in the IDE is r/d from the
command line.
Comment 12 _ gordonp 2008-11-13 21:51:05 UTC
Fixed with http://hg.netbeans.org/main?cmd=changeset;node=746cf88cb89c
Comment 13 Quality Engineering 2008-11-14 05:13:58 UTC
Integrated into 'main-golden', will be available in build *200811140201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/746cf88cb89c
User: Gordon Prieur <gordonp@netbeans.org>
Log: Fixed IZ #151577  Unable to debug Makefile based projects
Comment 14 Alexander Pepin 2008-11-20 18:03:43 UTC
Now cygwin/gdb works but MinGW/gdb does not. Breakpoints get broken if the project uses MinGW tool collection. Please
see attached gdb log
Comment 15 Alexander Pepin 2008-11-20 18:04:35 UTC
Created attachment 73966 [details]
gdb log
Comment 16 Alexander Pepin 2008-11-21 21:17:30 UTC
Created attachment 74029 [details]
gdb log for the latest dev build
Comment 17 pgebauer 2008-11-24 09:31:15 UTC
The issue didn't pass the nomination process by nomination cut-off date. It has been marked as 65fixes2-candidate.
Comment 18 _ gordonp 2008-11-27 00:36:45 UTC
Fixed with http://hg.netbeans.org/main?cmd=changeset;node=4ba7761f4676

I ran your (Alexander's) test_io with gdb.logger.level=WARNING and it immediately showed that the
path comparison failed because one path started with "C:" and the other with "c:". I added some
path magic to equivalent paths should work (on Windows I change all backslashes to forward slash
and all uppercase to lower; on MacOS I change case to lower).

Since your test app let me duplicate the problem, I'm closing as fixed. Please reopen if you still
see the same problem.
Comment 19 Quality Engineering 2008-11-28 17:23:01 UTC
Integrated into 'main-golden', will be available in build *200811281401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/4ba7761f4676
User: Gordon Prieur <gordonp@netbeans.org>
Log: Fixed IZ #151577  Unable to debug Makefile based projects
Comment 20 Alexander Pepin 2008-12-12 16:13:11 UTC
verified in build 200812120201
Comment 21 jinb 2009-01-08 18:39:30 UTC
Hello,
it impossible to apply mentioned changeset(s) to release65_fixes [ref1] branch because a lot of non-this IZ related
changes were made and other changesets pushed into main [ref2] repository between release65_fixes branching time and
mentioned changeset(s) pushing time. Please provide cumulative changeset/ set of changesets applicable to
release65_fixes branch otherwise this fix will be skipped for current NB65 patch.
This problem is common for following IZs: 151761, 151610, 151577, 133134, 155487 
[ref1]: http://hg.netbeans.org/release65_fixes
[ref2]: http://hg.netbeans.org/main
Comment 22 Alexander Pepin 2009-01-14 14:17:17 UTC
verified in NB6.5 with provided jar files
Comment 23 jinb 2009-01-14 17:43:32 UTC
Cumulative backport of fixes of IZ 151481(rebackport), 151577, 151610, 153473, 151640, 151761, 155487, 151631, 133134
provided by developer.
Backported into release65_fixes branch
http://hg.netbeans.org/release65_fixes/rev/84a0c7175a4b
Comment 24 Alexander Pepin 2009-01-19 15:55:21 UTC
verified in patch2