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 146691 - MacOSX debug gdb broken
Summary: MacOSX debug gdb broken
Status: RESOLVED DUPLICATE of bug 142454
Alias: None
Product: cnd
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 6.x
Hardware: Macintosh (x86) Mac OS X
: P2 blocker (vote)
Assignee: _ gordonp
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-09 19:35 UTC by jogshy
Modified: 2009-06-25 10:59 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Netbeans 6.1 macosx gdb bug (11.37 KB, application/x-compressed)
2008-09-12 19:59 UTC, jogshy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jogshy 2008-09-09 19:35:53 UTC
I installed NetBeans 6.1 on MacOSX 10.5.2 and I created a "hello world" C++ console application.
Compiled ok. When I try to debug it using the "Run and Debug" the gdb's console says "Launching" debugger... but it does
not debug anything... seems it enters an infinite loop trying to attach gdb but it cannot.
The fact is that I cannot debug the console C++ application.

With other OSs(Ununtu, Windows) I can debug perfectly... but in MacOSX nope.
btw, I have XCode 3.1 installed with GCC 4.0, 4.1 and 4.2.

thx.
Comment 1 _ gordonp 2008-09-10 00:42:32 UTC
Can you Run your application (ie, without the debugger)? 

By default, we run and debug in an xterm. In the current release (and NB 6.5) its the user's
responsibility to start an X server or to change the Console Type property to run/debug in
the Output window.

Please verify this isn't your problem.

To change the Console type, right click the project node and select Properties. In the Project
Properties panel, click on the Run node on the right and you should find Console Type to the
right.
Comment 2 jogshy 2008-09-10 08:03:34 UTC
Yes, the app runs ok without debugging.
I set the xterm... but the problem persists.
Comment 3 _ gordonp 2008-09-10 14:44:06 UTC
The next step is to see if gdb was started and what happened with it if it was. The
gdb module creates a log file with all communications between the IDE and gdb binary.
On Unix systems this file is usually in /tmp or /var/tmp and follows the naming pattern
of gdb-cmds<number>.log.

I'm not sure where this file is created on the Mac, but its the default location where
Java creates temp files. Please look for this file and see if its getting created. If so,
attach it to this issue so I can see whats going on.

Have you tried debugging other programs? Specifically, have you created other sample apps?
Also, is the "hello world" from our sample application or one you wrote? If its one of
our samples, please try another. Our hello sample involves shared libraries and if other
samples worked, that might give me a clue as to whats going wrong.
Comment 4 _ gordonp 2008-09-10 18:57:58 UTC
I just retested on my Mac (10.5.4 with gcc 4.0.1, g++ 4.0.1, and gdb 6.3.5 (apple version gdb-768).
Debugging worked as expected. I used the subproject sample app and breakpoints worked in both the
main project and dlopened shared library.

At this point, both my QA group and I have retested debugging on the Mac and have been unable to
find any problems. The gdb-cmds*.log might give me further information, but its also possible gdb
was never started. In any case, I need input from you or I'll have to close as WORKSFORME.
Comment 5 _ gordonp 2008-09-11 03:35:06 UTC
My expectation is that this will end up being closed as WORKSFORME, but I'm adding WILLFIX because
I expect to get this issue resolved in the next day or 2 (either fix it or WORKSFORME).
Comment 6 jogshy 2008-09-12 16:18:52 UTC
Anybody could tell me where to find the gdb log file so I can post it here, pls?
Comment 7 _ gordonp 2008-09-12 16:33:32 UTC
> Anybody could tell me where to find the gdb log file so I can post it here, pls?

On my Mac its in /tmp. I don't know if thats true of all Macs but /tmp is the default
location on Linux and other Unix derived operating systems (although Solaris puts
it in /var/tmp).
Comment 8 jogshy 2008-09-12 17:14:02 UTC
Ok, got it. The log was on /private/tmp.

I uploaded the NB6.1 project + the gdb log into megaupload:
http://www.megaupload.com/?d=IHOTD282
Comment 9 jogshy 2008-09-12 17:28:59 UTC
Btw I got some extra info:

I'm using gcc/g++ 4.0.1
Make GNU 3.81
gdb 6.3.50- 20050815 ( apple version 960 ).

The gdb log , by the last lines, says gdb was killed. That was because like the debug was not being launched(I waited 2
minutes ), I pressed the stop debugging button.

I installed Xcode 3.1 before Netbeans. Then I installed Netbeans 6.1... and I didn't patch it ( it's the version from
the downloads section.... the ALL one ).
Comment 10 _ gordonp 2008-09-12 17:39:25 UTC
Please attach the log to this issue rather than uploading it to megaupload. I don't
want to install software I'll probably never use again and its also fairly likely
there won't even be a Solaris version for me to download and install.

There is a "Create a new attachment" near the top of the issue. Just press it and
fill in the form.
Comment 11 jogshy 2008-09-12 19:59:41 UTC
Created attachment 69769 [details]
Netbeans 6.1 macosx gdb bug
Comment 12 jogshy 2008-09-12 20:01:05 UTC
Ok, the ZIP file was attached to this issue.
The .log and the NB6.1 project are inside
Comment 13 _ gordonp 2008-09-13 01:56:03 UTC
The problem is in an incompatible change Apple made to their gdb after NetBeans 6.1 was
released. The gdb module communicates with the gdb debugger via a protocol known as gdb/mi
(mi is for machine interface). Apple enabled some timing information which we don't parse.

That also explains why I've had so much trouble duplicating your problem. Its actually a
duplicate issue and the original P1 bug has already been fixed. I'm closing this issue as
a duplicate of IZ 142454 and asking QE to nominate 142454 for NetBeans 6.1 patch 4.

Thanks for sending the log file. Since the problem was fixed in NB 6.5, it took your log
file to be able to tell that its the same problem.

*** This issue has been marked as a duplicate of 142454 ***