0

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?

4

1 回答 1

0

升级到(尚未发布)3.8.0 SVN 版本的 Valgrind。然后,您将拥有以下 gdbserver 监控命令:

  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")
于 2012-06-22T21:38:00.687 回答