LoginSignup
5

More than 5 years have passed since last update.

posted at

updated at

macOS High Sierra 10.13 では gdb 8.1 は動かない

mac OS 10.13(High Sierra) で gdb を使う」を参考に High Sierra に gdb を Homebrew からインストールしたらはまったので、そのときのメモ。

環境

  • macOS High Sierra 10.13.4
  • Homebrew 1.6.4

参考にした記事よりも Homebrew のバージョンが上がり、 brew install gdb を実行すると gdb 8.1 がインストールされる。コード署名をして gdb を実行すると、

During startup program terminated with signal SIGTRAP, Trace/breakpoint trap.

のようなエラーが出てしまった。どうやら、gdb 8.1 は macOS 10.13 に対応していないようで、gdb 8.0 をインストールする必要があるようだ。

gdb 8.0 のインストール

Stack Overflow のアンサーを参考にした。

Github 上の gdb 8.0.1 のコードを指定してインストール:

$ brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/9ec9fb27a33698fc7636afce5c1c16787e9ce3f3/Formula/gdb.rb

gdb をアップデートしないようにする:

$ brew pin gdb

SIP (System Integrity Protection) を無効化していない場合は以下のコマンドも実行:

$ echo "set startup-with-shell off" >> ~/.gdbinit

後はコード署名を作成して、 gdb に適応させれば良い。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
What you can do with signing up
5