LLDB swift print object -
LLDB swift print object -
im little dumfounded how utilize lldb inspect object in swift project. in particular case i'm using nsjsonserializer serialize little chunk of json , i'd inspect value. in xcode 5.1 super simple, type "po json" @ lldb prompt , i'd wanted. commands po , print fail me printing out garbage. tried calling description property because works swift types still doesn't work. lastly resort used look println statement , works. certainly there must improve simpler way? here output of lldb:
(lldb) print json (anyobject?) $r4 = (instance_type = builtin.rawpointer = 0x00007ff05c0c49d0 -> 0x0000000107ef32c8 (void *)0x0000000107ef32f0: __nscfdictionary) (lldb) po json (instance_type = builtin.rawpointer = 0x00007ff05c0c49d0 -> 0x0000000107ef32c8 (void *)0x0000000107ef32f0: __nscfdictionary) { instance_type = 0x00007ff05c0c49d0 -> 0x0000000107ef32c8 (void *)0x0000000107ef32f0: __nscfdictionary } (lldb) print json.description? error: <expr>:1:1: error: 'optional<anyobject>' not have fellow member named 'description' json.description? ^ ~~~~~~~~~~~ (lldb) po json.description? error: <expr>:1:1: error: 'optional<anyobject>' not have fellow member named 'description' json.description? ^ ~~~~~~~~~~~ (lldb) look come in expressions, terminate empty line evaluate: 1 println(json) 2 optional({ errors = { "authorizations.provider_user_id" = ( "has been taken" ); }; }) (lldb)
you try
(lldb) expr -o -d run -- json!
the fact "po" not work in same way in objc known limitation. explicitly unwrapping optional, , allowing dynamic type resolution on unwrapped value should work
swift lldb
Comments
Post a Comment