debugging - In GDB, how to find out who malloc'ed an address on the heap? -


i have pointer in gdb, how can find out first allocated on heap?

in windbg, can done !heap -p -a <0x12345678> after turning on gflags /i <*exe> +ust

since valgrind can tell me memory allocated (when detects leaks), guess possible?

(this not watchpoint. given situation randomly break in gdb, application, @ pointer , want know "who created piece of memory"?)


using reverse debugging in gdb novel way , correct way solve problem. encountered problem approach gdb 7.1 -- latest stable version. reverse debugging rather new feature in gdb needed check out head (7.2) fix it.

it says matureness of gdb approach think should used when it's more mature. (awesome feature!)

valgrind hijacks memory management calls, that's how heap checkers work. there's no facility in gdb tell given address returned malloc(3). suggest looking mtrace , glibc allocation debugging.


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -