potatotips #74 (2021/6/23) GitHub: https://github.com/Scior/LLDBVisualDebug
import lldb class TraceCommand: def trace(self, target, debugger, result): for breakpoint in target.breakpoint_iter(): debugger.HandleCommand("br command add -F lldbutils.show_function_name %d" % breakpoint.id) return None def get_short_help(self): return "Change all breakpoints into trace points." def get_long_help(self): return self.get_short_help() def __init__(self, debugger, unused): return d
lldb cheat sheet Execution Commands start lld (prefix with xcrun on os x) >lldb [program.app] >lldb -- program.app arg1 load program >file program.app run program >process launch [-- args] >run [args] set arguments >settings set target.run-args 1 launch process in new terminal >process launch --tty -- <args> set env variables >settings set target.env-vars DEBUG=1 remove env variables >settings rem
以前も似たような記事書いた気がするんですが、定期的にSwiftのコード上でLLDBを使ってて困ることがあるので定期的に書くことにします。ほとんど https://stackoverflow.com/questions/29441418/lldb-swift-casting-raw-address-into-usable-type からの転載です。 LLDBの言語を指定して実行する標準ではbreakpointを挟んでbreakした行がSwiftであればSwift、Objective-CであればObjective-CでLLDBの言語が選択されるようなのですが、これでは毎回毎回breakした地点に応じてデバッグの仕方が変わって大変で仕方がないので、Swiftに統一してしまうのが良いと思っています。 expr -l swift -- {Swift Command} e -l swift -- {S
Any great software developer must inevitably become a great software debugger. Debugging consists largely of setting breakpoints, then landing on them to examine the state of an app at arbitrary points during its execution. There are roughly two kinds of breakpoints: those you set on your own code, and those you set on other people’s code. Setting a breakpoint on your own code is simple. Just find
Array または Dictionary のインスタンスを JSON 形式で print する LLDB Plugin ほしい と言われたので作ってみました。いざ作ってみるとこれがとても便利!! github.com README に install 方法が書いてあります。 注意点としては Swift モードの時の LLDB でしか意図した挙動はしません。 どうしても使いたい場合は、手元で Objective-C に書き直してもらえればと... LLDB Plugin の作り方は以前に記事を書いたので、そちらが参考になると思います。 dealforest.hatenablog.com タイトルの通りインスタンスを JSON に変換するということなので json コマンドにしました。 DataSource や API のレスポンスなど、特にデータ量が多いもの(でかい class や stru
「iOSDC」「AKIBA.swift×Swift愛好会」「iOSDC Reject Conference days2」で話させていただいたんですが、発表ではなるべく興味を持ってもらえるような内容になっていて、LLDB Plugin の作り方など詳細についてはふれていませんでした。 本来ならブログ書いてあるので見てください。と言いたかったんですが、なかなか手が回らず今になってしまいました。 できることも多いので、回数を分けて書いていければなと思います。 言語選択 LLDB の Plugin は Python で作られています。 ただし、Python が全くわからなくても作れているんで安心してください。 LLDB で実行する際に iOS エンジニアなら2つの言語から、どちらで実行するかを選択する必要があります。 Swift Objective-C 正直どちらを選んでもいいと思っています。 ど
slack.py �� �� �4] �� #!/usr/bin/env python import lldb def slack(debugger, command, result, internal_dict): frame = lldb.debugger.GetSelectedTarget().GetProcess().GetSelectedThread().GetSelectedFrame() path = command lldb.debugger.HandleCommand(""" expr -l swift -- func $sendToSlackForFileUpload(path: String) { let URL = NSURL(fileURLWithPath: NSHomeDirectory()).URLByAppendingPathComponent(path)
現在のXcode 7.2でSwiftを使ったiOSアプリのデバッグをするときのコツみたいなものをまとめました。将来的にはより良くなる可能性はあります。というか良くなってほしいです(´・_・`) ■LLDBはbreakした地点によって挙動が変わるまずハマりどころがこれですが、現在のLLDBはbreakした地点で実行されていたコードがSwiftのコードかC言語系のコードかによってモードが変わります。 // Objective-C mode (lldb) po [someObject property] // Swift mode (lldb) e someObject.property Objective-Cモードの時にSwiftっぽい呼び出しをしたり、その逆をしてもまともにLLDBは動作しません。なので現在自分がどちらのモードのLLDBにいるのかを判断するのがキモになります。 ハマりどころと
With the end of 2015 nearing, we wanted to take a moment to thank each of you for your feedback, enthusiasm and continued support of C++ and Visual Studio. We hope your year was productive and that next year exceeds your expectations.And now, since end-of-year lists are vogue, here are the top posts (by views) for the Visual C++ Team Blog in 2015 (...
We've spoken in the past about teaching Clang to fully support Windows and be compatible with MSVC. Until now, a big missing piece in this story has been debugging the clang-generated executables. Over the past 6 months, we've started working on making LLDB work well on Windows and support debugging both regular Windows programs and those produced by Clang. Why not use an existing debugger such
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く