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. meantsome_variable->some_field.getvalue()
for expression valid, must in context
some_variable
exists. factsome_variable
shows ingrep
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()
returnsthis->m_value
, want set watchpoint on*(&some_variable->some_field.m_value)
.
Comments
Post a Comment