Xcode 调试工具 Chisel 的安装与使用

Xcode 调试工具 Chisel 的安装与使用

Chisel 是 Facebook 出品的一个功能强大的调试工具。主要用来扩展原有的 LLDB 调试命令。

环境配置

  • 首先您的电脑要安装 homebrew 打开终端窗口, 粘贴以上脚本

      /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    

终端显示

    zqldeMacBook-Pro:~ zql$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    ==> This script will install:
    /usr/local/bin/brew
    /usr/local/Library/...
    /usr/local/share/doc/homebrew
    /usr/local/share/man/man1/brew.1
    /usr/local/share/zsh/site-functions/_brew
    /usr/local/etc/bash_completion.d/brew
    ==> The following directories will be made group writable:
    /usr/local/.
    /usr/local/bin
    /usr/local/sbin
    ==> The following directories will have their owner set to zql:
    /usr/local/.
    /usr/local/bin
    /usr/local/sbin
    ==> The following directories will have their group set to admin:
    /usr/local/.
    /usr/local/bin
    /usr/local/sbin
    
    Press RETURN to continue or any other key to abort
    ==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/. /usr/local/bin /usr/local/sbin
    Password:
    ==> /usr/bin/sudo /usr/sbin/chown zql /usr/local/. /usr/local/bin /usr/local/sbin
    ==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/. /usr/local/bin /usr/local/sbin
    ==> /usr/bin/sudo /bin/mkdir /Library/Caches/Homebrew
    ==> /usr/bin/sudo /bin/chmod g+rwx /Library/Caches/Homebrew
    ==> /usr/bin/sudo /usr/sbin/chown zql /Library/Caches/Homebrew
    ==> Downloading and installing Homebrew...
    remote: Counting objects: 456, done.
    remote: Compressing objects: 100% (413/413), done.
    remote: Total 456 (delta 26), reused 316 (delta 17), pack-reused 0
    Receiving objects: 100% (456/456), 703.58 KiB | 166.00 KiB/s, done.
    Resolving deltas: 100% (26/26), done.
    From https://github.com/Homebrew/brew
     * [new branch]      master     -> origin/master
    HEAD is now at a9c0361 audit: require plist_options when using plist
    ==> Tapping homebrew/core
    Cloning into '/usr/local/Library/Taps/homebrew/homebrew-core'...
    remote: Counting objects: 3657, done.
    remote: Compressing objects: 100% (3540/3540), done.
    remote: Total 3657 (delta 14), reused 1576 (delta 5), pack-reused 0
    Receiving objects: 100% (3657/3657), 2.70 MiB | 222.00 KiB/s, done.
    Resolving deltas: 100% (14/14), done.
    Checking connectivity... done.
    Tapped 3532 formulae (3,683 files, 8.5M)
    ==> Installation successful!
    ==> Next steps
    Run `brew help` to get started
  • 终端输入:brew install chisel

      zqldeMacBook-Pro:~ zql$ brew install chisel
      ==> Downloading https://github.com/facebook/chisel/archive/1.4.0.tar.gz
      ==> Downloading from https://codeload.github.com/facebook/chisel/tar.gz/1.4.0
      ######################################################################## 100.0%
      ==> Caveats
      Add the following line to ~/.lldbinit to load chisel when Xcode launches:
      command script import /usr/local/opt/chisel/libexec/fblldb.py
      ==> Summary
        /usr/local/Cellar/chisel/1.4.0: 22 files, 109.5K, built in 7 seconds
      zqldeMacBook-Pro:~ zql$         
    
  • 从终端中可以看Caveats下面的那两行,意思是把第二行的文字command script import /usr/local/opt/chisel/libexec/fblldb.py添加到.lldbinit文件中,这时执行命令echo command script import /usr/local/opt/chisel/libexec/fblldb.py >> ~/.lldbinit(粗体文字替换为你终端Caveats下面的第二行文字)可免去你去找.lldbinit文件,或者.lldbinit文件不出现的烦恼啊。到此步不出意外已经安装成功。

如图所示

Xcode 调试工具 Chisel 的安装与使用_第1张图片
Snip20160406_14.png

恭喜您已成功安装了!

下面来调试下lldb的强大使用吧

Xcode 调试工具 Chisel 的安装与使用_第2张图片
Snip20160406_3.png

lldb 调试命令

你可能感兴趣的:(Xcode 调试工具 Chisel 的安装与使用)