www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/06/20/08:45:42

From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: preprpcessor for overiding gcc optimation switch
Date: 20 Jun 2000 12:31:41 GMT
Organization: Aachen University of Technology (RWTH)
Lines: 28
Message-ID: <8ino7d$i9b$1@nets3.rz.RWTH-Aachen.DE>
References: <Pine DOT LNX DOT 4 DOT 21 DOT 0006030531400 DOT 1081-100000 AT roadrunner DOT grendel DOT net> <83zop3o170 DOT fsf AT mercury DOT bitbucket> <25c58271 DOT fc969396 AT usw-ex0104-033 DOT remarq DOT com>
NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de
X-Trace: nets3.rz.RWTH-Aachen.DE 961504301 18731 137.226.32.75 (20 Jun 2000 12:31:41 GMT)
X-Complaints-To: abuse AT rwth-aachen DOT de
NNTP-Posting-Date: 20 Jun 2000 12:31:41 GMT
Originator: broeker@
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

batchex <thedark1NOthSPAM AT phreaker DOT net DOT invalid> wrote:

> The reason I'm asking this cause in one of my project, one (only
> one) of the source file, when compiled with optimation, then try
> to debug a function contained in that file in gdb, it will give
> errorneous results. 

That shouldn't usually happen. Not unless you compile with some of the
explicitly debugging-unfriendly options of gcc active, like
-fomit-frame-pointer. That one may make debugging hard, or even
impossible.

Or was that function an inline assembly one, by any chance? If so,
it's probably just plain buggy if optimization prevents you to run the
debugger over it.

> I forgot if gdb crashed while debugging it or not, but I remember
> peculiar flow of my program.

'Peculiar flow' of control may not mean anything bad, while you're
debugging an optimized program. Instruction scheduling, esp. in newer
compilers, may easily cause things to happen in somewhat unexpected
order, jumping back and forth among several source lines, and similar
'peculiarities'.

-- 
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019