diff --git a/commands/FBDebugCommands.py b/commands/FBDebugCommands.py index 763e846..1427e99 100644 --- a/commands/FBDebugCommands.py +++ b/commands/FBDebugCommands.py @@ -149,7 +149,6 @@ def run(self, arguments, options): formattedCategory = category if category else '' breakpointFullName = '{}[{}{} {}]'.format(methodTypeCharacter, breakpointClassName, formattedCategory, selector) - breakpointCondition = None if targetIsClass: breakpointCondition = '(void*)object_getClass({}) == {}'.format(expressionForSelf, targetClass) else: diff --git a/commands/FBDisplayCommands.py b/commands/FBDisplayCommands.py index ac86854..ee4046c 100644 --- a/commands/FBDisplayCommands.py +++ b/commands/FBDisplayCommands.py @@ -8,8 +8,6 @@ # of patent rights can be found in the PATENTS file in the same directory. import lldb -import os -import time import fblldbviewhelpers as viewHelpers import fblldbbase as fb diff --git a/commands/FBFlickerCommands.py b/commands/FBFlickerCommands.py index cdb331e..4a14717 100644 --- a/commands/FBFlickerCommands.py +++ b/commands/FBFlickerCommands.py @@ -8,13 +8,11 @@ # of patent rights can be found in the PATENTS file in the same directory. import os -import time import sys import lldb import fblldbbase as fb import fblldbviewhelpers as viewHelpers -import fblldbinputhelpers as inputHelpers import fblldbobjcruntimehelpers as runtimeHelpers def lldbcommands(): diff --git a/commands/FBInvocationCommands.py b/commands/FBInvocationCommands.py index a7448c6..e34c2f3 100644 --- a/commands/FBInvocationCommands.py +++ b/commands/FBInvocationCommands.py @@ -101,12 +101,6 @@ def findArgAdressAtIndexFromStackFrame(frame, index): def prettyPrintInvocation(frame, invocation): object = fb.evaluateExpression('(id)[(id)' + invocation + ' target]') - selector = fb.evaluateExpressionValue('(char *)sel_getName((SEL)[(id)' + invocation + ' selector])').GetSummary() - selector = re.sub(r'^"|"$', '', selector) - - objectClassValue = fb.evaluateExpressionValue('(id)object_getClass((id)' + object + ')') - objectClass = objectClassValue.GetObjectDescription() - description = fb.evaluateExpressionValue('(id)' + invocation).GetObjectDescription() argDescriptions = description.splitlines(True)[4:] diff --git a/commands/FBVisualizationCommands.py b/commands/FBVisualizationCommands.py index da90fe3..3c0a6a3 100755 --- a/commands/FBVisualizationCommands.py +++ b/commands/FBVisualizationCommands.py @@ -7,9 +7,10 @@ # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. -import lldb import os import time + +import lldb import errno import fblldbbase as fb import fblldbobjecthelpers as objectHelpers diff --git a/fblldb.py b/fblldb.py index 383449b..6795bb9 100644 --- a/fblldb.py +++ b/fblldb.py @@ -12,7 +12,7 @@ import imp import os import shlex -import sys + from optparse import OptionParser import fblldbbase as fb @@ -54,8 +54,6 @@ def loadCommand(module, command, directory, filename, extension): def makeRunCommand(command, filename): def runCommand(debugger, input, result, dict): splitInput = shlex.split(input) - options = None - args = None # OptionParser will throw in the case where you want just one big long argument and no # options and you enter something that starts with '-' in the argument. e.g.: @@ -129,13 +127,12 @@ def helpForCommand(command, filename): help += '\n\nOptions:' for option in command.options(): - optionFlag = '' if option.longName and option.shortName: optionFlag = option.longName + '/' + option.shortName elif option.longName: optionFlag = option.longName else: - optionFlag = optiob.shortName + optionFlag = option.shortName help += '\n ' + optionFlag + ' ' diff --git a/fblldbobjcruntimehelpers.py b/fblldbobjcruntimehelpers.py index a71e949..c1f634e 100644 --- a/fblldbobjcruntimehelpers.py +++ b/fblldbobjcruntimehelpers.py @@ -7,6 +7,8 @@ # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. +import re + import lldb import fblldbbase as fb @@ -58,8 +60,6 @@ def functionPreambleExpressionForSelf(): return expressionForSelf def functionPreambleExpressionForObjectParameterAtIndex(parameterIndex): - import re - arch = currentArch() expresssion = None if arch == 'i386': diff --git a/fblldbviewcontrollerhelpers.py b/fblldbviewcontrollerhelpers.py index b38fa77..9844284 100644 --- a/fblldbviewcontrollerhelpers.py +++ b/fblldbviewcontrollerhelpers.py @@ -8,6 +8,7 @@ # of patent rights can be found in the PATENTS file in the same directory. import lldb + import fblldbbase as fb import fblldbobjcruntimehelpers as runtimeHelpers @@ -36,7 +37,6 @@ def _recursiveViewControllerDescriptionWithPrefixAndChildPrefix(vc, string, pref nextPrefix = childPrefix + ' |' numChildViewControllers = fb.evaluateIntegerExpression('(int)[(id)[%s childViewControllers] count]' % (vc)) - childViewControllers = fb.evaluateExpression('(id)[%s childViewControllers]' % (vc)) for i in range(0, numChildViewControllers): viewController = fb.evaluateExpression('(id)[(id)[%s childViewControllers] objectAtIndex:%d]' % (vc, i)) diff --git a/fblldbviewhelpers.py b/fblldbviewhelpers.py index cf1ef0f..a6534d8 100644 --- a/fblldbviewhelpers.py +++ b/fblldbviewhelpers.py @@ -77,7 +77,7 @@ def upwardsRecursiveDescription(view, maxDepth=0): if viewDescription: recursiveDescription.insert(0, viewDescription) - if len(viewDescription) == 0: + if not len(viewDescription): return None currentPrefix = ""