troyl
V2EX  ›  问与答

OS X 上有什么类似 valgrind 的工具吗?

  •  
  •   troyl · Oct 20, 2013 · 4128 views
    This topic created in 4766 days ago, the information mentioned may be changed or developed.
    6 replies  •  1970-01-01 08:00:00 +08:00
    xatest
    xatest
    Oct 20, 2013 via iPhone
    1
    Xcode自带的Instruments Leaks
    troyl
    troyl
    OP
    Oct 20, 2013
    2
    @xatest 单个 cpp 文件应该在 choose target 里选什么呢
    crazybubble
    crazybubble
    Oct 20, 2013
    3
    valgrind 在mac上能用,但是我用下来发现他永远会显示一些heap use,不报错。就连最简单的hello world也会这样。
    jjgod
    jjgod
    Oct 20, 2013❤️1
    4
    @troyl: 你要先编译成一个 executable 才能运行。


    @crazybubble: valgrind 从 10.8 开始就没有完全支持了,作者没有时间完成,10.9 支持更是没有开始: https://bugs.kde.org/show_bug.cgi?id=304259

    OS X 下还可以用 clang 的 AddressSanitizer (https://code.google.com/p/address-sanitizer/wiki/AddressSanitizer) 和 LeakSanitizer (http://clang.llvm.org/docs/LeakSanitizer.html)
    crazybubble
    crazybubble
    Oct 21, 2013
    5
    @jjgod 原来如此。。。我还在用10.7,没有意识到
    troyl
    troyl
    OP
    Oct 21, 2013
    6
    @jjgod 多谢,我试着研究一下
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   701 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 19:58 · PVG 03:58 · LAX 11:58 · JFK 14:58
    ♥ Do have faith in what you're doing.