LoginSignup
4
4

More than 5 years have passed since last update.

LLDBとGDB対比メモ

Posted at

こちらのページ「LLDB 使い方まとめ」、とても参考になりました。

自分が普段gdbで使うコマンドがlldbではどうなってるのかをまとめておくと便利そうな予感がしたのでまとめてみます。次にlldbに触るのが何日後かわからないので…。

相違があるもの

gdb lldb コメント
b A::B::func b func ブレークポイント設定(クラス省略可)
b 1 br del 1 ブレークポイントをdelete
dis 1 br dis 1 ブレークポイントをdisable
en 1 br en 1 ブレークポイントをenable
info b br li ブレークポイント一覧
comm 1 ... br com add 1... ブレークポイントヒット時の実行コマンド
info th th l スレッド一覧
th 1 th se 1 スレッド移動
disas 0x2abbdeadbeef disas -a 0x2abbdeadbeef 逆アセンブル

ブレークポイントヒット時のコマンドについて。

(gdb) b func
(gdb) comm
> print x
> cont
> end

に相当するのが

(lldb) b func
(lldb) br com add
> print x
> cont
> DONE

相違がない(っぽい)もの

コマンド コメント
s ステップ実行
fin 関数を抜ける
c cont
bt バックトレース表示
print x 変数の中身をプリント

gdbにしかない(っぽい)もの

コマンド コメント
printf "[%d] %08x\n", i, x[i] フォーマット付きプリント
shell xxx シェルコマンドを実行

新発見があればまた追記/更新したいと思います。

4
4
0

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
  3. You can use dark theme
What you can do with signing up
4
4