X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f Date: Sun, 24 Mar 2002 08:44:30 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: djgpp AT delorie DOT com Subject: Re: Breakpoints crazy? In-Reply-To: <3C9D0617.69890CE3@yahoo.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Sat, 23 Mar 2002, CBFalconer wrote: > Probably because optimization has rearranged the code. Just turn > it off (remove the -On compile flag, for whatever n you are using, > probably 2). Put it back when you are satisfied. It's IMHO a bad idea to turn off optimizations when debugging a program. Compilers these days do such complicated code changes when optimizing that you are effectively debugging a very different program. So you either need to debug the program twice, first without optimizations, then with them (and who has the will power and resources to do that?), or use untested program when you turn on optimizations for production version. Debugging optimized code takes some getting used to, but once you are there, it's not such a hard thing to do, especially with a powerful debugger such as GDB (RHIDE's debugging engine is based on GDB). FWIW, I miss this possibility badly when I work on some systems, such as Solaris, where the native compiler doesn't allow to mix debugging and optimization switches in the same compilation.