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 89876 - gdb-lite is broken for applications compiled by Sun compilers collection
Summary: gdb-lite is broken for applications compiled by Sun compilers collection
Alias: None
Product: cnd
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 5.x
Hardware: All Solaris
: P2 blocker (vote)
Assignee: _ gordonp
: 121776 (view as bug list)
Depends on:
Reported: 2006-11-22 15:46 UTC by alexandrov
Modified: 2009-06-25 10:59 UTC (History)
0 users

See Also:
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description alexandrov 2006-11-22 15:46:14 UTC
There are some samples.
1.Open Quote sample application. Change general property "Compiler Collection"
on Sun Compiler collection. Build application. Set main function breakpoint.
Debug project. External Debugging window immediately closed. From debugger
buttons only "Finish Debugger Session" is enabled.
2. Open IO sample project. Change general property "Compiler Collection" on Sun
Compiler collection. Set breakpoint on 26-th line of string).
Debug project. Debugger stopped at  return statement. Try "Step Over" few times.
Debugger goes somewhere deep(see Call Stack) and after one of step all debugger
controls besides "Finish Debugger Session" and "Pause" became disabled.
3.Create New Project(C\C++ Application). Create file with code
int main(int argc , char** argv){
  int i;
  return i;
Change general property "Compiler Collection" on Sun Compiler collection. Set
main function breakpoint. Run debugger. Open Local Variables view. Try to do few
steps(over ar into). i variable does not change its value in local var view.
Comment 1 Nikolay Molchanov 2006-11-22 19:03:27 UTC
Please, file separate issues for each case, because they look as different 
issues. And make sure you copy-paste debugger log from gdb console - I asked
this many times, and I will repeat this request until each issue will be filed
with debugger log :-)
Also it is important to know which version of Sun Studio compilers was used.
There is a big difference between Sun Studio 11, Sun Studio "Mars" Express 2,
and Sun Studio "Mars" Express 3.
Also it is very important to specify operating system.

Thanks in advance,
Comment 2 _ gordonp 2006-11-22 19:25:51 UTC
Please correct Platform and OS fields. They cannot be "All" because
Sun Compilers don't run on all supported platforms. If the same
problem exists on both Solaris and Linux, then pick one and mention
the other in a comment (or if the problems are different on each
system file a second IZ).
Comment 3 alexandrov 2006-11-23 01:41:14 UTC
Nik, sure these are different issues. I combined it into one to show that Sun
compilers collection is supported by gdb-lite very poor. Each of the examples
could be P1 if it were reproduced for default compiler collection(GNU), but now
I really do not know which priority have these bugs. It depends on decision
about words in release notes. Will be there said about non-supporting Sun
compilers by gdb-lite or no? 
And what do you mean under "debugger log from gdb console"? Where I can find gdb
log in our IDE now?
as for platforms:
1-st and 3-rd problems are common for intel-Solaris(sqao43) and Linux
FC3(sqao35). 2-nd is for intel-solaris.Sun compilers were used from
Comment 4 Nikolay Molchanov 2006-11-23 04:37:47 UTC
Alexander, thank you for additional info! 
First of all, here is how to get back gdb console:
 netbeans -J-Dgdb.console.window=true 
Second, all these issues with Sun Studio compilers are caused by debugging
information, generated by compilers. This information is not correct or gdb 
does not understand it properly. I suggest to file separate P3 issues. 
There is nothink to fix in "gdb-lite" module itself, but we will use these 
issues to file bugs against Sun Studio compilers and to track the bug fixing 

Comment 5 Nikolay Molchanov 2007-01-14 09:18:22 UTC
I changed the priority from P2 to P1 because we plan to support Sun Studio
compilers in release 5.5.1, and right now it is my highest priority task.
Comment 6 Nikolay Molchanov 2007-01-19 09:29:32 UTC
The problem with Quote is also related to the dwarf output.
If Quote is built with Sun Studio compilers, gdb cannot set
a breakpoint in "main" function:

bash-3.00$ gdb --i mi dist/Debug/Sun-Solaris-x86/quote1
~"GNU gdb 6.3.50_2004-11-23-cvs\n"
~"Copyright 2004 Free Software Foundation, Inc.\n"
~"GDB is free software, covered by the GNU General Public License, and you are\n"
~"welcome to change it and/or distribute copies of it under certain conditions.\n"
~"Type \"show copying\" to see the conditions.\n"
~"There is absolutely no warranty for GDB.  Type \"show warranty\" for details.\n"
~"This GDB was configured as \"i386-pc-solaris2.11\"..."
-break-insert main
&"Die: DW_TAG_<unknown> (abbrev = 22, offset = 7100)\n"
&"\thas children: TRUE\n"
&"\t\tDW_AT_name (DW_FORM_string) string: \"basic_ostream\"\n"
&"\t\tDW_AT_<unknown> (DW_FORM_string) string: \"nNbasic_ostream3CTACTB_\"\n"
&"\t\tDW_AT_decl_file (DW_FORM_data1) constant: 8\n"
&"\t\tDW_AT_decl_line (DW_FORM_data1) constant: 73\n"
&"Dwarf Error: Cannot find type of die [in module
^error,msg="Dwarf Error: Cannot find type of die [in module

As a result, "gdb-lite" module cannot start debugging.
Though, there is something strange with this application,
because I don't see such problems with other C++ applications.
Comment 7 Nikolay Molchanov 2007-02-03 09:43:54 UTC
The problem with Quote project seems to be caused by "endl".
I created a small test cases, which can be used to reproduce the problem:
#include <iostream>
using namespace std;

int main(int argc, char* argv[])

	cout<<"Support metric quote program"<<endl<<endl;

        return 0;
If I select this project and do "Step into Project", debugger cannot 
stop in main, and the debugging session exits.
If I comment out "<<endl<<endl" - everything works just fine.
Instead of commenting out "<<endl" I can redefine it, and this also helps:
#define endl "\n"

Comment 8 Nikolay Molchanov 2007-02-08 08:49:10 UTC
On Solaris SPARC we can specify the following compiler options:
1. For Sun Studio C compiler: -Wc,-h_gcc -xO0 -g
2. For Sun Studio C++ compiler: -Qoption cg -h_gcc -xO0 -g
This options do not fix all known problems, but they fix some of them:
a) stop at the beginning of function (now prolog presents in dwarf)
b) local variables are visible and have correct values
These options tell Sun Studio compilers to use "cg" instead of "yabe",
and they also tell "cg" to generate a "more gdb compatible" dwarf output.
But, again, these options are for Solaris SPARC only.
Comment 9 Jesse Grodnik 2007-04-02 22:55:43 UTC
Deferred to NetBeans 6. It is possible that planned changes in the Sun Studio
compilers would allow us to improve behavior sooner, so the plan is to re-test
with each new release of the Sun Studio compilers.
Comment 10 soldatov 2007-04-23 14:36:33 UTC
I cannot debug any C++ program (Welcome, HelloApp and etc.) which was compiled
by Sun C++ compiler on sqao43.

CC:  /set/mars/dist/intel-S2/bin/CC (2007/04/10)
gdb: /set/sqe/tools/gdb/6.4/intel-S2/s10/bin/gdb
Machine: i86pc
System:  SunOS
Release: 5.10
Comment 11 soldatov 2007-04-23 14:50:10 UTC
bash-3.00$ gdb ./dist/Debug/welcome
GNU gdb 6.4
Copyright 2005 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as
"i386-pc-solaris2.10"..."/export/home/tester/Welcome_4/dist/Debug/welcome": not
in executable format: File format not recognized

Comment 12 _ gordonp 2008-11-17 22:56:03 UTC
No sense keeping this open since its a compiler issue, not a debugger one.
Comment 13 _ gordonp 2008-11-17 23:00:01 UTC
*** Issue 121776 has been marked as a duplicate of this issue. ***