This is the mail archive of the
gdb@sourceware.cygnus.com
mailing list for the GDB project.
Re: Breakpoint on Memory Range?
- To: <riazr at cat dot co dot za>
- Subject: Re: Breakpoint on Memory Range?
- From: jtc at redback dot com (J.T. Conklin)
- Date: 23 May 2000 12:52:34 -0700
- Cc: <gdb at sourceware dot cygnus dot com>
- References: <000001bfc4d2$7424ac80$1923a8c0@cat.co.za>
- Reply-To: jtc at redback dot com
>>>>> "Riaz" == Riaz <riazr@cat.co.za> writes:
Riaz> Does GDB 5.0 (i386 NetBSD) offer the ability to stop execution
Riaz> when there has been a "write" to a memory range?
GDB supports watchpoints, that can be used to see if a memory variable
is changed. The watchpoint command takes an expression, not a memory
range, as its argument; although I suppose that you could construct a
expression that would fit your range. Even if this works, it will be
slow.
Riaz> I specifically need to know whether my code is being overwritten.
I think this is unlikely, unless you are dynamically generating code
on the stack, in the heap or in the data segment. The .text (code)
segment is mapped read only. Any attempt to overwrite your code
should result in a segmentation violation.
--jtc
--
J.T. Conklin
RedBack Networks