debugging - Cannot set watchpoint in GDB -


i doing debugging , wanted check place value of variable changes .for tried setting watch point saying watch 'structure->somefunc.getvalue()' not simple variable (probably portion of bigger structure invoking function ) .when gdb says no symbol 'structure->somefunc..' in current context .when grep in same directory 3-4 instances of same expression.am missing out something?

am missing out something?

yes, appear missing @ least couple of things:

  • the expression structure->somefunc.getvalue() doesn't make sense. meant some_variable->some_field.getvalue()

  • for expression valid, must in context some_variable exists. fact some_variable shows in grep output doesn't mean gdb can currently evaluate it. may able evaluate when stop program in correct context.

  • it makes no sense (and impossible) set watchpoint on return value of getvalue(). watchpoints make sense if can specify memory location want watch. if (as likely) getvalue() returns this->m_value, want set watchpoint on *(&some_variable->some_field.m_value).


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -