Re: [Anjuta-list] Debug problem on Anjuta



Have you compiled with -O0 -g ? Looks like the local integer variables
are very likley to get optimized away if you use, say, O2 for example.

> Hi, I just started using Anjuta with gtk. I run into a simple debugging
> problem:in a simple program, the debugger cannot see local variables
> except vars of a char[ ] type.
> 
> See below the sample, in each function, the variables i, k are not in
> Locals window, and if I "Inspect" their values, say k, I get error:
> 
> "No symbol "k" in current context."
> 
> 
> I'm running RH8. Couldn't figure out why.
> 
> Thanks a lot for any help!
> 
> Richard
> 
> ==============================================
> /* Created by Anjuta version 1.0.2 */
> #include <iostream.h>
> int main3()
> {
> int i;
> int k;
> i =9;
> k=45;
> printf("fsgfdss%d", i);
> printf("fsgfdss%d", k);
> char buf[123];
> strcpy(buf, "SSSSSSS");
> printf(buf);
> return 2;
> }
> 
> int main2()
> {
> int i;
> int k;
> i =9;
> k=45;
> printf("fsgfdss%d", i);
> printf("fsgfdss%d", k);
> char buf[123];
> strcpy(buf, "SSSSSSS");
> printf(buf);
> int ret = main3();
> return 2;
> }
> int main()
> 
> {
> int i;
> int k;
> i =9;
> k=45;
> cout << "Hello world\n";
> int ret = main2();
> printf("k= %d", k);
> printf("ret= %d", ret);
> return (0);
> }
> 
> 
> 
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Anjuta-list mailing list
> Anjuta-list lists sourceforge net
> https://lists.sourceforge.net/lists/listinfo/anjuta-list
-- 
Biswa.






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]