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]

How to watch for changes in a location of memory


Hi all,

I would like to check a variable in memory, I don't know in which
function is modified, so I can't do a simple watch on a variable name.

So I wonder if it is possible (gdb 6.8) to watch for a variable using
the location rather than the var name.

I'll try to express it more clearly: for example if I have a struct:
FooCtx* ctx;

containing a field foo, ctx is defined somewhere in the code, and may
be accessed from different contexts, for example:

trash->junk->ctx->foo;
bar->ctx->foo;

etc.

How can I monitor for changes in ctx->foo simply specifying its
location in memory (&ctx->foo), is it currently possible with gdb at
all?

Sorry if I overlooked something obvious.

Thanks in advance, regards.


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