Date: Tue, 13 Oct 1998 17:53:30 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: djgpp AT delorie DOT com Subject: Re: can't track variables in RHGDB In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com On Thu, 8 Oct 1998, Tal Lavi wrote: > >have GCC 2.8.1 installed, try compiling with -gstubs3 or -gstubs+ instead > >of -g, and see if the problems go away. > > I haven't checked it thouroughly yet, but if I'm not mistaken, putting those > makes no difference, Make sure you use -gstabs+, not gstubs+ as I erroneously wrote. > disabling the optimization(-O2 -ffast-math) does! That's not a solution. Debugging a non-optimized program doesn't help, since the code is very different, so you aren't debugging the same program. There should be no problems debugging an optimized program except that some code rearrangement can take place (i.e., line N might be executed after line N+10 or something), and some automatic variables could be optimized out of existence (i.e., put into registers or discarded altogether). If this is your case, you will have to make special arrangements, like evaluating expressions to find the value of missing variables, to work around this. (But I would still suggest not to go back to debugging an unoptimized program.) Last but not least, don't forget that this could be a bug in GCC and/or GDB, so if you can't solve it, submit a bug report.