sun studio 11 for linux
i successfully installed sun studio on a linux machine. i am debugging my first program.
the problem i am having is local variables (stack variables) do not show the correct
values. i can tell by the execution and examining the results that the local variables are
really correct, but what is displayed is garbage. global/static variables display the
correct values. anyone else having such an issue ?
[432 byte] By [
chip.cog] at [2007-11-26 9:50:07]

# 4
Sun Studio debugger has supported gcc/g++ for a while now, so
that feature should definately work. Let us know more information
about the bug, so we can fix it.
If you have time and interest to experiment with pre-release compilers,
you could download the latest "Sun Studio Express" release, and try
out an early access version of the Sun compilers on Linux. But there
are still a few things that don't work right. C should be very robust by now,
but the Sun C++ and Fortran compilers still have some more porting
work to finish before all the compiler features are available on Linux.
http://developers.sun.com/prodtech/cc/downloads/express.jsp
--chris
# 5
system information
Sun Studio 20050910
Red Hat Enterprise 4.0
Kernel Version 2.6.9-34.ELsmp on i386
IDE version IDE/1 spec=3.42.1 impl=20050910
Java 1.5.0_06
VM Java Hot Spot (TM) Client VM 1.5.0_06-b05
Netbeans 3.5V11
compiler options -g -v
using GUI debugger, not command line debugger
example code
when viewing i & j in watch window, i and j display
correctly in main(), but when stepping into debugGUI, their values
are garbage in the local variable window. the values are properly printed.
in debuGUI(), k is garbage in local var window, but prints fine.
static int i=10;
static int j=20;
void debugGUI(int i, int j)
{
int k = 1;
printf("i=%d j=%d k=%d\n",i,j,k);
}
int main(int argc,char *argv[])
{
debugGUI(i,j);
}
If i move the i & j variables into main(), the local variable window have
garbage values for i & j at the function call debugGUI()
int main(int argc, char *argv[])
{
int i=10;
int j=20;
debugGUI(i,j);
}