-
Notifications
You must be signed in to change notification settings - Fork 791
add ppath command #72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
72145be
ff0d763
e6e9f51
aa3396f
f3119a6
84d60b8
8f16c09
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,6 +29,7 @@ def lldbcommands(): | |
| FBPrintInternals(), | ||
| FBPrintInstanceVariable(), | ||
| FBPrintKeyPath(), | ||
| FBPrintApplicationDocumentsPath(), | ||
| ] | ||
|
|
||
| class FBPrintViewHierarchyCommand(fb.FBCommand): | ||
|
|
@@ -299,3 +300,27 @@ def run(self, arguments, options): | |
| object = fb.evaluateObjectExpression(objectToMessage) | ||
| printCommand = 'po [{} valueForKeyPath:@"{}"]'.format(object, keypath) | ||
| lldb.debugger.HandleCommand(printCommand) | ||
|
|
||
|
|
||
| class FBPrintApplicationDocumentsPath(fb.FBCommand): | ||
| def name(self): | ||
| return 'pdocspath' | ||
|
|
||
| def description(self): | ||
| return "Print application's 'Documents' directory path." | ||
|
|
||
| def options(self): | ||
| return [ | ||
| fb.FBCommandArgument(short='-o', long='--open', arg='open', boolean=True, default=False, help='open in Finder'), | ||
| ] | ||
|
|
||
| def run(self, arguments, options): | ||
| if options.open: | ||
| path = fb.evaluateExpressionValue('(NSString *)[NSSearchPathForDirectoriesInDomains(9, 1, YES) lastObject]') | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you make constants for these numbers?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This could use
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kastiglione hi I tried |
||
| pathString = '{}'.format(path).split('"')[1] | ||
| print pathString | ||
| lldb.debugger.HandleCommand('script os.system("open {}")'.format(pathString)) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This can call |
||
| else: | ||
| lldb.debugger.HandleCommand('po [NSSearchPathForDirectoriesInDomains(9, 1, YES) lastObject]') # NSDocumentDirectory == 9 NSUserDomainMask == 1 | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍