breakpoint for accessing memory location

Erik Leunissen
2006-10-19T20:10:56Z

Hi,

I've got a shared lib that I programmed to store some data on the heap
in order to retrieve them later. The main program which loads the shared
lib appears to overwrite that location in memory, before the next time I
want to use it (which is weird because the main program shouldn't have a
clue about this particular action of the shared lib).

So, in order to find out which part of the main program is being nasty,
I want to set some kind of breakpoint that alerts me whenever that
memory location is being written to.

Is that possible using gdb?

(P.S. In the manual, I found the gdb command [break *address], but from
its behaviour, I think it's meant to do something different from what I
want.)

Thanks for any help,

Erik Leunissen