Nudger: Example LLDB Python Command
At the 2018 WWDC, the Advanced Debugging with Xcode and LLDB talk demonstrated an lldb command called nudge
. While the talk demonstrates the use of nudge
, it doesn't cover any of its implementation, but the source code for nudge is provided.
Having maintained and written a number of lldb commands, I have thoughts on how to get started writing lldb commands. This repo is not documentation on how to get started, but it provides a few simple and minimal versions, showing how to start a command like nudge
, and then adding some features.
The first version is a small amount of code that does the basics, but supports ObjC only.
The second version adds support for Swift. (diff)
The third version adds the feature that remembers the last nudged view, and applies the nudge to it. For example, nudger 0 -10
moves the last nudged view up by 10 points. (diff)