LLDB (Swift): Casting Raw Address into Usable Type

前端 未结 11 802
天涯浪人
天涯浪人 2020-11-27 09:30

Is there an LLDB command that can cast a raw address into a usable Swift class?

For example:

(lldb) po 0x7df67c50 as MKPinAnnotationView
11条回答
  •  感情败类
    2020-11-27 09:57

    For Custom Classes you need to import your project

    expr -l Swift -- import MyTestProject
    expr -l Swift --  let $vc = unsafeBitCast(0x7fad22c066d0, ViewController.self)
    expr -l Swift -- print($vc.view)
    

提交回复
热议问题