This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


"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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]