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]
# 1
Please tell us:- sample source code- which versions of compiler and debugger- command line debugger or GUI?- which version of linux--chris
ChrisQuenelle at 2007-7-7 1:00:24 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 2
oh yes,and the compiler options used to build the program
ChrisQuenelle at 2007-7-7 1:00:24 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 3
i am using the gnu compiler from red hat (enterprise 4.0) . should i be usingthe work shop compiler instead ?
chipcog at 2007-7-7 1:00:24 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 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

ChrisQuenelle at 2007-7-7 1:00:24 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 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);

}

chipcog at 2007-7-7 1:00:24 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 6
Chris,isn't this the same bug that you identified in this thread? http://forum.sun.com/jive/thread.jspa?threadID=94665&start=14
amduser at 2007-7-7 1:00:24 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 7
yes
chipcog at 2007-7-7 1:00:24 > top of Java-index,Development Tools,Solaris and Linux Development Tools...