[comp.sys.mac.programmer] LSC Debugger

rob@uokmax.UUCP (Robert K Shull) (12/01/88)

I'm have some problems using the "data" window in the Lightspeed C debugger.
I'm trying to change the value of a floating point number.

Suppose I have the following program:
#include <stdio.h>
main()
{
	float	a;
	int	b;
	
	a = 1;
	for(b=0;b<100;b++)
		a+=1;
	printf("a=%d\n",a);
}

With the program "stepped" to the line "a+=1;", I switch to the data window
and try to change the value of a, which I've been monitoring. I can set
the value of a to 0, but not to anything else.
If I go back to LSC, change the type of a to "int" and re-run the debugger,
I can change the value of a with no problem.

System is: Mac II with 2-meg, System 6.0.2, LSC 3.0p2, MacsBug 5.5

Does anyone have a suggestion?
	Thanks,
	Robert
-- 
Robert K. Shull
att!occrsh!uokmax!rob or sun!texsun!uokmax!rob

jct@geowhiz.UUCP (John C. Terranova) (12/03/88)

In article <2088@uokmax.UUCP> rob@uokmax.UUCP (Robert K Shull) writes:
>Suppose I have the following program:
>#include <stdio.h>
>main()
>{
>	float	a;
>	int	b;
>	
>	a = 1;
>	for(b=0;b<100;b++)
>		a+=1;
>	printf("a=%d\n",a);
>}
>
>With the program "stepped" to the line "a+=1;", I switch to the data window
>and try to change the value of a, which I've been monitoring. I can set
>the value of a to 0, but not to anything else.
>If I go back to LSC, change the type of a to "int" and re-run the debugger,
>I can change the value of a with no problem.

You will notice that 1 is not the same as 1.0.  1 is an integer and
1.0 is a float.  With this in mind, did you try to assign 1.0 to the
float variable or just 1?  The debugger is really not a compiler (I
think) and may not be able to typecast numbers for us.

If you tried 1.0 and it didn't work then it sounds like the debugger
is broken.

------------------------------------------------------------------------------
John Terranova     |  What the hell do I know? | I'm not a Computer Science
   CS, BS to be    |  I come from Waunakee!    | undergraduate, but I play
-------------------+---------------------------+ one at school.
ARPA:   jct%geowhiz.uucp@spool.cs.wisc.edu     +------------------------------
BITNET: jct%geowhiz.uucp%spool.cs.wisc.edu@vms3.macc.wisc.edu
------------------------------------------------------------------------------
I once believed in causes, too.  And had my pointless point of view.
    --Billy Joel, "Angry Young Man"

rob@uokmax.UUCP (Robert K Shull) (12/05/88)

In article <962@geowhiz.UUCP> jct@geowhiz.UUCP (John C. Terranova) writes:
>In article <2088@uokmax.UUCP> rob@uokmax.UUCP (Robert K Shull) writes:
>
> (LSC Debugger problem)
>
>You will notice that 1 is not the same as 1.0.  1 is an integer and
>1.0 is a float.  With this in mind, did you try to assign 1.0 to the

Yes, I tried just about every format I could think of.

	Robert
-- 
Robert K. Shull
att!occrsh!uokmax!rob or sun!texsun!uokmax!rob