Lower -o argument in expression

While rereading the book i’ve mention such line
ex -l swift -o -- unsafeBitCast(0x14bdd9b50, to: NSObject.self)
Here’s lower case -o option in the line. I haven’t found any description about such option in the book neither haven’t find any information in lldb help.
@lolgrep could you please explain what’s the difference between this option and “-O” options in expression cmd?

Technically, that would be a typo, but LLDB will translate a lower case o to --object-description (though I don’t know where in the source from LLDB this occurs https://github.com/llvm-mirror/lldb, also might be in the Swift LLDB repo…) when evaluating the expression.

You can verify by taking an address which points to a valid NSObject and trying with and without the --object-description option while in the Objective-C context and you can see that a lower case o will still produce the description or debugDescription of the memory address

1 Like

This topic was automatically closed after 166 days. New replies are no longer allowed.