简体   繁体   中英

Using valgrind to find out how an object is still reachable

I use valgrind for memory leak detection. There was some code I was expecting to produce a memory leak, but valgrind did not detect it. Now I would like to find out in what way this object might still be reachable (this would be a problem in this case). Can valgrind output those references?

Upgrade to the (not yet released) 3.8.0 SVN version of Valgrind. You then have the following gdbserver monitor commands:

  block_list <loss_record_nr> after a leak search, shows the list of blocks of <loss_record_nr> who_points_at <addr> [<len>] shows places pointing inside <len> (default 1) bytes at <addr> (with len 1, only shows "start pointers" pointing exactly to <addr>, with len > 1, will also show "interior pointers") 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM