Skip to content

Conversation

@KingOfBrian
Copy link

pkp is a command to print out a key path. LLDB has pretty bad . notation resolution, especially through (id) return results, so I've been using [self valueForKeyPath:@"whatever.keypath.failed.inlldb"] to work around this. This helper makes that very easy!

screen shot 2014-11-20 at 4 23 12 pm

@facebook-github-bot
Copy link
Contributor

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks!

@kastiglione kastiglione self-assigned this Nov 21, 2014
@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The use of self here is misleading. To offer a possible wording:

Print out the value of the key path expression using -valueForKeyPath:.

@kastiglione
Copy link
Contributor

@KingOfBrian ❤️ it! Thanks for submitting, I have a few comments.

@KingOfBrian
Copy link
Author

Updated per your comments. I've been waiting for a pkp command for a few months now, but adding a command to lldb directly was a bit intimidating. I was psyched to see chisel and how easy it was to add commands! @adamhrz discovered chisel in a talk at cocoaconf boston.

I'm also eyeing an Accessibility helper command, but again, my python's terrible. Will keep it on my mind tho, I have an ugly accessibility issue that it'd help greatly in.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a previous commit you had it evaluating object as an expression, before evaluating the -valueForKeyPath:. How come you removed that? It seems useful because it could allow:

pkp [someObject methodTaking:1 and:2].foo.bar.whatever

…t 'key', to allow for some slightly more complex behaviors.
@kastiglione
Copy link
Contributor

Cool, and again thank you!

I'll wait a day or two to see if anyone wants to add anything. I'll look at #55 soon too.

@kastiglione
Copy link
Contributor

🚢

kastiglione added a commit that referenced this pull request Nov 25, 2014
pkp: po alternative to lookup via valueForKeyPath:
@kastiglione kastiglione merged commit 708f6e5 into facebook:master Nov 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants