Can i set a breakpoint when a member of a C struct is being assigned?

Jim Blandy jimb@codesourcery.com
Mon Jul 30 21:17:00 GMT 2007


"ying lcs" <yinglcs@gmail.com> writes:
> Can i set a breakpoint when a member of a C struct is being assigned?
>
> For example, i have a C struct in my code:
> struct myStruct{
>    int type;
> };

There isn't any way to set a breakpoint on all assignments to a chosen
member of a chosen structure type, regardless of which actual object
of that type is being modified.

You can set a watchpoint on a particular member of a particular
object; see the GDB manual on 'watchpoints'.

You can, of course, set a breakpoint on a particular assignment
statement.



More information about the Gdb mailing list