bug-gdb
[Top][All Lists]
Advanced

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

Gdb and assignment statements


From: Ranga Rao Ravuri
Subject: Gdb and assignment statements
Date: Wed, 13 Dec 2000 19:15:17 +0530

Hi
Here is little problem gdb never does

I have a line in 'c' code like 

        10      int port;
        11      .
        12      .
        13      .
>>>>    14      x = htons(x);
        15      .
        16      .
        17
If I run this part of code on sun sparc with SunOs 5.7 
the htons is defined like 

#define htons(x) (x)

How do I break on line 14 and see what is happening ? It never breaks on
14, rather it does on 15. 
All statements (x) = (x) are ignored by gdb.For each such a case the
break point was set on next source statement. 
Is that gcc which optimizes the expressions like 'x=x' by removing from
the code.

Why so . In above case really I hppened to dig the header file why gdb
is not breaking on line: 14 

Why So ? can any one  explain 
Thanks 
Ranga Rao R



reply via email to

[Prev in Thread] Current Thread [Next in Thread]