Mail Archives: djgpp/1998/08/06/11:45:38
Gurunandan R. Bhat <grbhat AT unigoa DOT ernet DOT in> wrote:
> >On Wed, 5 Aug 1998, Eli Zaretskii wrote>
> >> On 5 Aug 1998 mdruiter AT cs DOT vu DOT nl wrote>
> >> > $ br *0x0code-address
> >> > $ watch *0x0data-address
> >> I'm not sure I understand this. Let's say I want to set a watch
> >> point at a certain address. How do I choose the 0x0code-address
> >> where I need to put a breakpoint?
> >I think he means one or the other. Not both.
No, I do mean both. Somehow, I only got watchpoints to work, if some
breakpoint was encountered first. I don't know why, but it worked for
me several times. I may have been lucky, though...
So, set a breakpoint at an address you know will be reached. And set
the watchpoint to the data address you want to follow. Run the
program, and continue after the breakpoint has been reached. If the
value at the location of the watchpoint changes after that, you will
get back to the gdb prompt as wanted.
To be complete: I don't use the stock gdb found on Simtel. I took the
sources plus a newer Readline and recompiled. I changed nothing, so it
really shouldn't matter.
--
Groeten, Michel. http://www.cs.vu.nl/~mdruiter
____________
\ /====\ / "You know, Beavis, you need things that suck,
\/ \/ to have things that are cool", Butt-Head.
- Raw text -