[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ns] Strange gdb execution
Hi,
Even though this does not directly NS related, I was just wondering if
anyone came across this problem. I'm trying to single step thru' the C++
portion of an agent using gdb. Somehow gdb displays a pair of statements
before actually executing them. For eg. if you notice the value of maxx
below, even though gdb indicates that it executes the assignment statement,
the actual value of the variable changes the second time around!
502 maxx = mynode->T_->upperX();
(gdb) watch maxx
Watchpoint 22: this->maxx
(gdb) s
51 double upperX() { return maxX * grid_resolution; }
(gdb) s
503 maxy = mynode->T_->upperY();
(gdb) s
502 maxx = mynode->T_->upperX();
(gdb) s
Watchpoint 22: this->maxx
Old value = 1.7570113996715999e-152
New value = 500
LRPAgent::startlrp (this=0x3ca270) at topography.h:53
53 double upperY() { return maxY * grid_resolution; }
(gdb) s
505 printf("maxx : %f \t maxy : %f\n", maxx, maxy);
(gdb) s
503 maxy = mynode->T_->upperY();
(gdb) s
*Any* feedback will be highly appreciated :)
Thanks,
Sumesh Philip
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp