This is the mail archive of the gdb@sourceware.cygnus.com 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]

Re: Breakpoint on Memory Range?


>>>>> "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

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