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]

automatic adding of memory access breakpoints


hi.
am programming in C.

i have program that automatically creates blocks in memory
where the debugger shall break once someone accesses the block
both reading or writing.

yes this is a malloc debugger.

the idea:

if you do   void *pt = malloc (1000);
you get:

KILLERBLOCK data KILLERBLOCK
            ^
	    \_ pt

if you do free(pt);
he will check if one of the killerblocks has changed.

but then i cannot say anymore when they were changed.
to quit once they are changed i need debugger help.
how can my program automatically add such blocks into gdb???

or is there some way to do this linux level?
i.e. any mmap tricks ?

all i need is a segfault or buserror or whatsoever
right in the moment someone accesses the KILLERBLOCKs.


thanks & cu
erik


-- 
Name:  Erik Thiele                                       \\\\
Email: erikyyy@erikyyy.de                                o `QQ'_
IRC:   erikyyy                                            /   __8
WWW:   http://www.erikyyy.de/                             '  `

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