Message-ID: <32BE556A.6685@post.comstar.ru> Date: Mon, 23 Dec 1996 12:48:26 +0300 From: Dim Zegebart Reply-To: zager AT post DOT comstar DOT ru Organization: Comstar Ltd. MIME-Version: 1.0 To: "Salvador Eduardo Tropea (SET)" CC: DJGPP Mail List Subject: Re: Debugging in RHIDE References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Salvador Eduardo Tropea (SET) wrote: > > Hi Dim: > > > > I discover the odd problem with DEBUGGING in RHIDE > > (unfortunately i'm too stupid to use GDB :-( ) > I guess that you are lazy not stupid ;-). Yes, thats right :-) >If you use -Ox you'll loose some debug > features. For example: > > if (a>10) > { int b; for (b=1; b<10; b++) a++; } > > b will be optimized in the 90% of the cases and you'll not be able > to watch the b contents because is in a CPU register. > > Or: > switch (a) > { > case 1: a+=2; break; > case 2: b+=2; a+=2; break; > } > > If you step in the case 2 you'll see that the debugger will go to > the case 1!, that very logic because the compiler will reuse the a+=2 > code, or you want 2 copies of the same code? > That's normal, and logic. Ok, loosing of some debugging information is not supprasing for me (i have some knowlege about optimization and related things (i hope so)) > > Info page say: > > "Unlike most other C compilers, GNU CC allows you to use `-g' with > > `-O'. Info page say just that it say. So, i offer add some words into info page about problems shown above : : "Info page say: : Unlike most other C compilers, GNU CC allows you to use `-g' with : `-O' (with some restrictions). Restrictions are : .... Thaks for all. -- Regards, Dim Zegebart, Moscow Russia.