troyl
V2EX  ›  问与答

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

  •  
  •   troyl · Oct 20, 2013 · 3725 views
    This topic created in 4591 days ago, the information mentioned may be changed or developed.
    6 replies    1970-01-01 08:00:00 +08:00
    xatest
        1
    xatest  
       Oct 20, 2013 via iPhone
    Xcode自带的Instruments Leaks
    troyl
        2
    troyl  
    OP
       Oct 20, 2013
    @xatest 单个 cpp 文件应该在 choose target 里选什么呢
    crazybubble
        3
    crazybubble  
       Oct 20, 2013
    valgrind 在mac上能用,但是我用下来发现他永远会显示一些heap use,不报错。就连最简单的hello world也会这样。
    jjgod
        4
    jjgod  
       Oct 20, 2013   ❤️ 1
    @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
        5
    crazybubble  
       Oct 21, 2013
    @jjgod 原来如此。。。我还在用10.7,没有意识到
    troyl
        6
    troyl  
    OP
       Oct 21, 2013
    @jjgod 多谢,我试着研究一下
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2941 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 15:11 · PVG 23:11 · LAX 08:11 · JFK 11:11
    ♥ Do have faith in what you're doing.