Skip to content

Commit

Permalink
Switch commands that used po to pobjc so they work when stopped in a …
Browse files Browse the repository at this point in the history
…Swift frame
  • Loading branch information
Chris Williams committed Oct 15, 2015
1 parent c784f6a commit 598fb71
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion commands/FBAutoLayoutCommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def args(self):
return [ fb.FBCommandArgument(arg='view', type='UIView *', help='The view to print the Auto Layout trace for.', default='(id)[[UIApplication sharedApplication] keyWindow]') ]

def run(self, arguments, options):
lldb.debugger.HandleCommand('po (id)[{} _autolayoutTrace]'.format(arguments[0]))
lldb.debugger.HandleCommand('pobjc (id)[{} _autolayoutTrace]'.format(arguments[0]))


def setBorderOnAmbiguousViewRecursive(view, width, color):
Expand Down
2 changes: 1 addition & 1 deletion commands/FBComponentCommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def run(self, arguments, options):
upwards = 'YES' if options.upwards else 'NO'
showViews = 'YES' if options.showViews == 'YES' else 'NO'

lldb.debugger.HandleCommand('po (id)[CKComponentHierarchyDebugHelper componentHierarchyDescriptionForView:(UIView *)' + arguments[0] + ' searchUpwards:' + upwards + ' showViews:' + showViews + ']')
lldb.debugger.HandleCommand('pobjc (id)[CKComponentHierarchyDebugHelper componentHierarchyDescriptionForView:(UIView *)' + arguments[0] + ' searchUpwards:' + upwards + ' showViews:' + showViews + ']')

class FBComponentsReflowCommand(fb.FBCommand):
def name(self):
Expand Down
2 changes: 1 addition & 1 deletion commands/FBFindCommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,6 @@ def run(self, arguments, options):
@staticmethod
def taplog_callback(frame, bp_loc, internal_dict):
parameterExpr = objc.functionPreambleExpressionForObjectParameterAtIndex(0)
lldb.debugger.HandleCommand('po [[[%s allTouches] anyObject] view]' % (parameterExpr))
lldb.debugger.HandleCommand('pobjc [[[%s allTouches] anyObject] view]' % (parameterExpr))
# We don't want to proceed event (click on button for example), so we just skip it
lldb.debugger.HandleCommand('thread return')
4 changes: 2 additions & 2 deletions commands/FBFlickerCommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def inputCallback(self, input):
if isMac:
recursionName = '_subtreeDescription'

lldb.debugger.HandleCommand('po [(id)' + oldView + ' ' + recusionName + ']')
lldb.debugger.HandleCommand('pobjc [(id)' + oldView + ' ' + recusionName + ']')
else:
print '\nI really have no idea what you meant by \'' + input + '\'... =\\\n'

Expand All @@ -121,7 +121,7 @@ def setCurrentView(self, view, oldView=None):
if oldView:
viewHelpers.unmaskView(oldView)
viewHelpers.maskView(self.currentView, 'red', '0.4')
lldb.debugger.HandleCommand('po (id)' + view)
lldb.debugger.HandleCommand('pobjc (id)' + view)

def superviewOfView(view):
superview = fb.evaluateObjectExpression('[' + view + ' superview]')
Expand Down
8 changes: 4 additions & 4 deletions commands/FBPrintCommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def description(self):
return 'Print layer tree from the perspective of the render server.'

def run(self, arguments, options):
lldb.debugger.HandleCommand('po [NSString stringWithCString:(char *)CARenderServerGetInfo(0, 2, 0)]')
lldb.debugger.HandleCommand('pobjc [NSString stringWithCString:(char *)CARenderServerGetInfo(0, 2, 0)]')


class FBPrintViewControllerHierarchyCommand(fb.FBCommand):
Expand All @@ -111,7 +111,7 @@ def run(self, arguments, options):

if arguments[0] == '__keyWindow_rootVC_dynamic__':
if fb.evaluateBooleanExpression('[UIViewController respondsToSelector:@selector(_printHierarchy)]'):
lldb.debugger.HandleCommand('po [UIViewController _printHierarchy]')
lldb.debugger.HandleCommand('pobjc (NSString *)[UIViewController _printHierarchy]')
return

arguments[0] = '(id)[(id)[[UIApplication sharedApplication] keyWindow] rootViewController]'
Expand Down Expand Up @@ -304,7 +304,7 @@ def run(self, arguments, options):
else:
objectToMessage, keypath = command.split('.', 1)
object = fb.evaluateObjectExpression(objectToMessage)
printCommand = 'po [{} valueForKeyPath:@"{}"]'.format(object, keypath)
printCommand = 'pobjc [{} valueForKeyPath:@"{}"]'.format(object, keypath)
lldb.debugger.HandleCommand(printCommand)


Expand Down Expand Up @@ -401,7 +401,7 @@ def run(self, arguments, option):
elif encoding_text == 'utf32l':
enc = 0x9c000100

print_command = 'po (NSString *)[[NSString alloc] initWithData:{} encoding:{}]'.format(arguments[0], enc)
print_command = 'pobjc (NSString *)[[NSString alloc] initWithData:{} encoding:{}]'.format(arguments[0], enc)
lldb.debugger.HandleCommand(print_command)

class FBPrintTargetActions(fb.FBCommand):
Expand Down
2 changes: 1 addition & 1 deletion commands/FBVisualizationCommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def _visualize(target):
if _dataIsImage(target):
_showImage('(id)[UIImage imageWithData:' + target + ']')
elif _dataIsString(target):
lldb.debugger.HandleCommand('po (NSString*)[[NSString alloc] initWithData:' + target + ' encoding:4]')
lldb.debugger.HandleCommand('pobjc (NSString*)[[NSString alloc] initWithData:' + target + ' encoding:4]')
else:
print 'Data isn\'t an image and isn\'t a string.'
else:
Expand Down

0 comments on commit 598fb71

Please sign in to comment.