How to avoid code elimination

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

 



Hi All,

I am new to gcc (used other C compilers before).

I have construct of the like in my C code

.
.
.
if(cond)
{ e=e;
}
.
.

The reasoning here is that I need to stuff a GDB break point on e=e;
cond goes from false to true after some long to wait condition occurs.

Basically my debug session goes like this

set a temp break in this function reach it, then stick a BP on e=e,
then run and wait the BP.

The e=e; comes form the idea that I reuse here whatever int scalar is
in the vincinity.

I tried to compile with -O0 but to no joy gcc always remove my 'NOP'
intruction knowing better than me what I could do with it.

Is there any other idioms I should use, may be an asm("nop") or the
like I guess ?

Thanx in advance
Cheers,
Phi



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux