This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: breakpoint for accessing memory location
- From: Daniel Jacobowitz <drow at false dot org>
- To: Erik Leunissen <e dot leunissen at hccnet dot nl>
- Cc: gdb at sourceware dot org
- Date: Thu, 19 Oct 2006 16:12:14 -0400
- Subject: Re: breakpoint for accessing memory location
- References: <4537DBC6.1030807@hccnet.nl>
On Thu, Oct 19, 2006 at 10:10:46PM +0200, Erik Leunissen wrote:
> 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.)
Take a look at "watchpoints" in the manual. They should be exactly
what you need.
--
Daniel Jacobowitz
CodeSourcery