[Lldb-commits] [lldb] r280751 - *** This commit represents a complete reformatting of the LLDB source code

Kate Stone via lldb-commits lldb-commits at lists.llvm.org
Tue Sep 6 13:58:36 PDT 2016


Author: kate
Date: Tue Sep  6 15:57:50 2016
New Revision: 280751

URL: http://llvm.org/viewvc/llvm-project?rev=280751&view=rev
Log:
*** This commit represents a complete reformatting of the LLDB source code
*** to conform to clang-format’s LLVM style.  This kind of mass change has
*** two obvious implications:

Firstly, merging this particular commit into a downstream fork may be a huge
effort.  Alternatively, it may be worth merging all changes up to this commit,
performing the same reformatting operation locally, and then discarding the
merge for this particular commit.  The commands used to accomplish this
reformatting were as follows (with current working directory as the root of
the repository):

    find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} +
    find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ;

The version of clang-format used was 3.9.0, and autopep8 was 1.2.4.

Secondly, “blame” style tools will generally point to this commit instead of
a meaningful prior commit.  There are alternatives available that will attempt
to look through this change and find the appropriate prior commit.  YMMV.


Modified:
    lldb/trunk/examples/customization/bin-utils/binutils.py
    lldb/trunk/examples/customization/import-python/importcmd.py
    lldb/trunk/examples/customization/pwd-cd-and-system/utils.py
    lldb/trunk/examples/darwin/heap_find/heap.py
    lldb/trunk/examples/darwin/heap_find/heap/heap_find.cpp
    lldb/trunk/examples/functions/main.cpp
    lldb/trunk/examples/interposing/darwin/fd_interposing/FDInterposing.cpp
    lldb/trunk/examples/lookup/main.cpp
    lldb/trunk/examples/plugins/commands/fooplugin.cpp
    lldb/trunk/examples/python/cmdtemplate.py
    lldb/trunk/examples/python/crashlog.py
    lldb/trunk/examples/python/delta.py
    lldb/trunk/examples/python/diagnose_nsstring.py
    lldb/trunk/examples/python/diagnose_unwind.py
    lldb/trunk/examples/python/dict_utils.py
    lldb/trunk/examples/python/disasm-stress-test.py
    lldb/trunk/examples/python/disasm.py
    lldb/trunk/examples/python/file_extract.py
    lldb/trunk/examples/python/gdb_disassemble.py
    lldb/trunk/examples/python/gdbremote.py
    lldb/trunk/examples/python/globals.py
    lldb/trunk/examples/python/jump.py
    lldb/trunk/examples/python/lldb_module_utils.py
    lldb/trunk/examples/python/lldbtk.py
    lldb/trunk/examples/python/mach_o.py
    lldb/trunk/examples/python/memory.py
    lldb/trunk/examples/python/operating_system.py
    lldb/trunk/examples/python/performance.py
    lldb/trunk/examples/python/process_events.py
    lldb/trunk/examples/python/pytracer.py
    lldb/trunk/examples/python/sbvalue.py
    lldb/trunk/examples/python/scripted_step.py
    lldb/trunk/examples/python/shadow.py
    lldb/trunk/examples/python/sources.py
    lldb/trunk/examples/python/stacks.py
    lldb/trunk/examples/python/symbolication.py
    lldb/trunk/examples/python/types.py
    lldb/trunk/examples/python/x86_64_linux_target_definition.py
    lldb/trunk/examples/python/x86_64_qemu_target_definition.py
    lldb/trunk/examples/python/x86_64_target_definition.py
    lldb/trunk/examples/scripting/dictionary.c
    lldb/trunk/examples/scripting/tree_utils.py
    lldb/trunk/examples/summaries/cocoa/CFArray.py
    lldb/trunk/examples/summaries/cocoa/CFBag.py
    lldb/trunk/examples/summaries/cocoa/CFBinaryHeap.py
    lldb/trunk/examples/summaries/cocoa/CFBitVector.py
    lldb/trunk/examples/summaries/cocoa/CFDictionary.py
    lldb/trunk/examples/summaries/cocoa/CFString.py
    lldb/trunk/examples/summaries/cocoa/Class.py
    lldb/trunk/examples/summaries/cocoa/Logger.py
    lldb/trunk/examples/summaries/cocoa/NSBundle.py
    lldb/trunk/examples/summaries/cocoa/NSData.py
    lldb/trunk/examples/summaries/cocoa/NSDate.py
    lldb/trunk/examples/summaries/cocoa/NSException.py
    lldb/trunk/examples/summaries/cocoa/NSIndexSet.py
    lldb/trunk/examples/summaries/cocoa/NSMachPort.py
    lldb/trunk/examples/summaries/cocoa/NSNotification.py
    lldb/trunk/examples/summaries/cocoa/NSNumber.py
    lldb/trunk/examples/summaries/cocoa/NSSet.py
    lldb/trunk/examples/summaries/cocoa/NSURL.py
    lldb/trunk/examples/summaries/cocoa/Selector.py
    lldb/trunk/examples/summaries/cocoa/attrib_fromdict.py
    lldb/trunk/examples/summaries/cocoa/cache.py
    lldb/trunk/examples/summaries/cocoa/metrics.py
    lldb/trunk/examples/summaries/cocoa/objc_runtime.py
    lldb/trunk/examples/summaries/objc.py
    lldb/trunk/examples/summaries/pysummary.py
    lldb/trunk/examples/summaries/sp_cp.py
    lldb/trunk/examples/summaries/synth.py
    lldb/trunk/examples/summaries/unicode_strings.py
    lldb/trunk/examples/synthetic/bitfield/example.py
    lldb/trunk/examples/synthetic/bitfield/program.cpp
    lldb/trunk/examples/synthetic/gnu_libstdcpp.py
    lldb/trunk/examples/synthetic/libcxx.py
    lldb/trunk/examples/synthetic/unordered_multi.py
    lldb/trunk/include/lldb/API/LLDB.h
    lldb/trunk/include/lldb/API/SBAddress.h
    lldb/trunk/include/lldb/API/SBAttachInfo.h
    lldb/trunk/include/lldb/API/SBBlock.h
    lldb/trunk/include/lldb/API/SBBreakpoint.h
    lldb/trunk/include/lldb/API/SBBreakpointLocation.h
    lldb/trunk/include/lldb/API/SBBroadcaster.h
    lldb/trunk/include/lldb/API/SBCommandInterpreter.h
    lldb/trunk/include/lldb/API/SBCommandReturnObject.h
    lldb/trunk/include/lldb/API/SBCommunication.h
    lldb/trunk/include/lldb/API/SBCompileUnit.h
    lldb/trunk/include/lldb/API/SBData.h
    lldb/trunk/include/lldb/API/SBDebugger.h
    lldb/trunk/include/lldb/API/SBDeclaration.h
    lldb/trunk/include/lldb/API/SBDefines.h
    lldb/trunk/include/lldb/API/SBError.h
    lldb/trunk/include/lldb/API/SBEvent.h
    lldb/trunk/include/lldb/API/SBExecutionContext.h
    lldb/trunk/include/lldb/API/SBExpressionOptions.h
    lldb/trunk/include/lldb/API/SBFileSpec.h
    lldb/trunk/include/lldb/API/SBFileSpecList.h
    lldb/trunk/include/lldb/API/SBFrame.h
    lldb/trunk/include/lldb/API/SBFunction.h
    lldb/trunk/include/lldb/API/SBHostOS.h
    lldb/trunk/include/lldb/API/SBInstruction.h
    lldb/trunk/include/lldb/API/SBInstructionList.h
    lldb/trunk/include/lldb/API/SBLanguageRuntime.h
    lldb/trunk/include/lldb/API/SBLaunchInfo.h
    lldb/trunk/include/lldb/API/SBLineEntry.h
    lldb/trunk/include/lldb/API/SBListener.h
    lldb/trunk/include/lldb/API/SBMemoryRegionInfo.h
    lldb/trunk/include/lldb/API/SBMemoryRegionInfoList.h
    lldb/trunk/include/lldb/API/SBModule.h
    lldb/trunk/include/lldb/API/SBModuleSpec.h
    lldb/trunk/include/lldb/API/SBPlatform.h
    lldb/trunk/include/lldb/API/SBProcess.h
    lldb/trunk/include/lldb/API/SBQueue.h
    lldb/trunk/include/lldb/API/SBQueueItem.h
    lldb/trunk/include/lldb/API/SBSection.h
    lldb/trunk/include/lldb/API/SBSourceManager.h
    lldb/trunk/include/lldb/API/SBStream.h
    lldb/trunk/include/lldb/API/SBStringList.h
    lldb/trunk/include/lldb/API/SBStructuredData.h
    lldb/trunk/include/lldb/API/SBSymbol.h
    lldb/trunk/include/lldb/API/SBSymbolContext.h
    lldb/trunk/include/lldb/API/SBSymbolContextList.h
    lldb/trunk/include/lldb/API/SBTarget.h
    lldb/trunk/include/lldb/API/SBThread.h
    lldb/trunk/include/lldb/API/SBThreadCollection.h
    lldb/trunk/include/lldb/API/SBThreadPlan.h
    lldb/trunk/include/lldb/API/SBType.h
    lldb/trunk/include/lldb/API/SBTypeCategory.h
    lldb/trunk/include/lldb/API/SBTypeEnumMember.h
    lldb/trunk/include/lldb/API/SBTypeFilter.h
    lldb/trunk/include/lldb/API/SBTypeFormat.h
    lldb/trunk/include/lldb/API/SBTypeNameSpecifier.h
    lldb/trunk/include/lldb/API/SBTypeSummary.h
    lldb/trunk/include/lldb/API/SBTypeSynthetic.h
    lldb/trunk/include/lldb/API/SBUnixSignals.h
    lldb/trunk/include/lldb/API/SBValue.h
    lldb/trunk/include/lldb/API/SBValueList.h
    lldb/trunk/include/lldb/API/SBVariablesOptions.h
    lldb/trunk/include/lldb/API/SBWatchpoint.h
    lldb/trunk/include/lldb/API/SystemInitializerFull.h
    lldb/trunk/include/lldb/Breakpoint/Breakpoint.h
    lldb/trunk/include/lldb/Breakpoint/BreakpointID.h
    lldb/trunk/include/lldb/Breakpoint/BreakpointIDList.h
    lldb/trunk/include/lldb/Breakpoint/BreakpointList.h
    lldb/trunk/include/lldb/Breakpoint/BreakpointLocation.h
    lldb/trunk/include/lldb/Breakpoint/BreakpointLocationCollection.h
    lldb/trunk/include/lldb/Breakpoint/BreakpointLocationList.h
    lldb/trunk/include/lldb/Breakpoint/BreakpointOptions.h
    lldb/trunk/include/lldb/Breakpoint/BreakpointResolver.h
    lldb/trunk/include/lldb/Breakpoint/BreakpointResolverAddress.h
    lldb/trunk/include/lldb/Breakpoint/BreakpointResolverFileLine.h
    lldb/trunk/include/lldb/Breakpoint/BreakpointResolverFileRegex.h
    lldb/trunk/include/lldb/Breakpoint/BreakpointResolverName.h
    lldb/trunk/include/lldb/Breakpoint/BreakpointSite.h
    lldb/trunk/include/lldb/Breakpoint/BreakpointSiteList.h
    lldb/trunk/include/lldb/Breakpoint/Stoppoint.h
    lldb/trunk/include/lldb/Breakpoint/StoppointCallbackContext.h
    lldb/trunk/include/lldb/Breakpoint/StoppointLocation.h
    lldb/trunk/include/lldb/Breakpoint/Watchpoint.h
    lldb/trunk/include/lldb/Breakpoint/WatchpointList.h
    lldb/trunk/include/lldb/Breakpoint/WatchpointOptions.h
    lldb/trunk/include/lldb/Core/Address.h
    lldb/trunk/include/lldb/Core/AddressRange.h
    lldb/trunk/include/lldb/Core/AddressResolver.h
    lldb/trunk/include/lldb/Core/AddressResolverFileLine.h
    lldb/trunk/include/lldb/Core/AddressResolverName.h
    lldb/trunk/include/lldb/Core/ArchSpec.h
    lldb/trunk/include/lldb/Core/Baton.h
    lldb/trunk/include/lldb/Core/Broadcaster.h
    lldb/trunk/include/lldb/Core/ClangForward.h
    lldb/trunk/include/lldb/Core/Communication.h
    lldb/trunk/include/lldb/Core/Connection.h
    lldb/trunk/include/lldb/Core/ConnectionMachPort.h
    lldb/trunk/include/lldb/Core/ConnectionSharedMemory.h
    lldb/trunk/include/lldb/Core/ConstString.h
    lldb/trunk/include/lldb/Core/CxaDemangle.h
    lldb/trunk/include/lldb/Core/DataBuffer.h
    lldb/trunk/include/lldb/Core/DataBufferHeap.h
    lldb/trunk/include/lldb/Core/DataBufferMemoryMap.h
    lldb/trunk/include/lldb/Core/DataEncoder.h
    lldb/trunk/include/lldb/Core/DataExtractor.h
    lldb/trunk/include/lldb/Core/Debugger.h
    lldb/trunk/include/lldb/Core/Disassembler.h
    lldb/trunk/include/lldb/Core/EmulateInstruction.h
    lldb/trunk/include/lldb/Core/Error.h
    lldb/trunk/include/lldb/Core/Event.h
    lldb/trunk/include/lldb/Core/FastDemangle.h
    lldb/trunk/include/lldb/Core/FileLineResolver.h
    lldb/trunk/include/lldb/Core/FileSpecList.h
    lldb/trunk/include/lldb/Core/Flags.h
    lldb/trunk/include/lldb/Core/FormatEntity.h
    lldb/trunk/include/lldb/Core/History.h
    lldb/trunk/include/lldb/Core/IOHandler.h
    lldb/trunk/include/lldb/Core/IOStreamMacros.h
    lldb/trunk/include/lldb/Core/Listener.h
    lldb/trunk/include/lldb/Core/LoadedModuleInfoList.h
    lldb/trunk/include/lldb/Core/Log.h
    lldb/trunk/include/lldb/Core/Logging.h
    lldb/trunk/include/lldb/Core/Mangled.h
    lldb/trunk/include/lldb/Core/MappedHash.h
    lldb/trunk/include/lldb/Core/Module.h
    lldb/trunk/include/lldb/Core/ModuleChild.h
    lldb/trunk/include/lldb/Core/ModuleList.h
    lldb/trunk/include/lldb/Core/ModuleSpec.h
    lldb/trunk/include/lldb/Core/Opcode.h
    lldb/trunk/include/lldb/Core/PluginInterface.h
    lldb/trunk/include/lldb/Core/PluginManager.h
    lldb/trunk/include/lldb/Core/RangeMap.h
    lldb/trunk/include/lldb/Core/RegisterValue.h
    lldb/trunk/include/lldb/Core/RegularExpression.h
    lldb/trunk/include/lldb/Core/STLUtils.h
    lldb/trunk/include/lldb/Core/Scalar.h
    lldb/trunk/include/lldb/Core/SearchFilter.h
    lldb/trunk/include/lldb/Core/Section.h
    lldb/trunk/include/lldb/Core/SourceManager.h
    lldb/trunk/include/lldb/Core/State.h
    lldb/trunk/include/lldb/Core/Stream.h
    lldb/trunk/include/lldb/Core/StreamAsynchronousIO.h
    lldb/trunk/include/lldb/Core/StreamBuffer.h
    lldb/trunk/include/lldb/Core/StreamCallback.h
    lldb/trunk/include/lldb/Core/StreamFile.h
    lldb/trunk/include/lldb/Core/StreamGDBRemote.h
    lldb/trunk/include/lldb/Core/StreamString.h
    lldb/trunk/include/lldb/Core/StreamTee.h
    lldb/trunk/include/lldb/Core/StringList.h
    lldb/trunk/include/lldb/Core/StructuredData.h
    lldb/trunk/include/lldb/Core/ThreadSafeDenseMap.h
    lldb/trunk/include/lldb/Core/ThreadSafeDenseSet.h
    lldb/trunk/include/lldb/Core/ThreadSafeSTLMap.h
    lldb/trunk/include/lldb/Core/ThreadSafeSTLVector.h
    lldb/trunk/include/lldb/Core/ThreadSafeValue.h
    lldb/trunk/include/lldb/Core/Timer.h
    lldb/trunk/include/lldb/Core/UUID.h
    lldb/trunk/include/lldb/Core/UniqueCStringMap.h
    lldb/trunk/include/lldb/Core/UserID.h
    lldb/trunk/include/lldb/Core/UserSettingsController.h
    lldb/trunk/include/lldb/Core/VMRange.h
    lldb/trunk/include/lldb/Core/Value.h
    lldb/trunk/include/lldb/Core/ValueObject.h
    lldb/trunk/include/lldb/Core/ValueObjectCast.h
    lldb/trunk/include/lldb/Core/ValueObjectChild.h
    lldb/trunk/include/lldb/Core/ValueObjectConstResult.h
    lldb/trunk/include/lldb/Core/ValueObjectConstResultCast.h
    lldb/trunk/include/lldb/Core/ValueObjectConstResultChild.h
    lldb/trunk/include/lldb/Core/ValueObjectConstResultImpl.h
    lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h
    lldb/trunk/include/lldb/Core/ValueObjectList.h
    lldb/trunk/include/lldb/Core/ValueObjectMemory.h
    lldb/trunk/include/lldb/Core/ValueObjectRegister.h
    lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h
    lldb/trunk/include/lldb/Core/ValueObjectVariable.h
    lldb/trunk/include/lldb/Core/dwarf.h
    lldb/trunk/include/lldb/DataFormatters/CXXFunctionPointer.h
    lldb/trunk/include/lldb/DataFormatters/DataVisualization.h
    lldb/trunk/include/lldb/DataFormatters/DumpValueObjectOptions.h
    lldb/trunk/include/lldb/DataFormatters/FormatCache.h
    lldb/trunk/include/lldb/DataFormatters/FormatClasses.h
    lldb/trunk/include/lldb/DataFormatters/FormatManager.h
    lldb/trunk/include/lldb/DataFormatters/FormattersContainer.h
    lldb/trunk/include/lldb/DataFormatters/FormattersHelpers.h
    lldb/trunk/include/lldb/DataFormatters/LanguageCategory.h
    lldb/trunk/include/lldb/DataFormatters/StringPrinter.h
    lldb/trunk/include/lldb/DataFormatters/TypeCategory.h
    lldb/trunk/include/lldb/DataFormatters/TypeCategoryMap.h
    lldb/trunk/include/lldb/DataFormatters/TypeFormat.h
    lldb/trunk/include/lldb/DataFormatters/TypeSummary.h
    lldb/trunk/include/lldb/DataFormatters/TypeSynthetic.h
    lldb/trunk/include/lldb/DataFormatters/TypeValidator.h
    lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h
    lldb/trunk/include/lldb/DataFormatters/VectorIterator.h
    lldb/trunk/include/lldb/DataFormatters/VectorType.h
    lldb/trunk/include/lldb/Expression/DWARFExpression.h
    lldb/trunk/include/lldb/Expression/DiagnosticManager.h
    lldb/trunk/include/lldb/Expression/Expression.h
    lldb/trunk/include/lldb/Expression/ExpressionParser.h
    lldb/trunk/include/lldb/Expression/ExpressionSourceCode.h
    lldb/trunk/include/lldb/Expression/ExpressionTypeSystemHelper.h
    lldb/trunk/include/lldb/Expression/ExpressionVariable.h
    lldb/trunk/include/lldb/Expression/FunctionCaller.h
    lldb/trunk/include/lldb/Expression/IRDynamicChecks.h
    lldb/trunk/include/lldb/Expression/IRExecutionUnit.h
    lldb/trunk/include/lldb/Expression/IRInterpreter.h
    lldb/trunk/include/lldb/Expression/IRMemoryMap.h
    lldb/trunk/include/lldb/Expression/LLVMUserExpression.h
    lldb/trunk/include/lldb/Expression/Materializer.h
    lldb/trunk/include/lldb/Expression/REPL.h
    lldb/trunk/include/lldb/Expression/UserExpression.h
    lldb/trunk/include/lldb/Expression/UtilityFunction.h
    lldb/trunk/include/lldb/Host/Config.h
    lldb/trunk/include/lldb/Host/Debug.h
    lldb/trunk/include/lldb/Host/Editline.h
    lldb/trunk/include/lldb/Host/Endian.h
    lldb/trunk/include/lldb/Host/File.h
    lldb/trunk/include/lldb/Host/FileCache.h
    lldb/trunk/include/lldb/Host/FileSpec.h
    lldb/trunk/include/lldb/Host/FileSystem.h
    lldb/trunk/include/lldb/Host/Host.h
    lldb/trunk/include/lldb/Host/HostGetOpt.h
    lldb/trunk/include/lldb/Host/HostInfo.h
    lldb/trunk/include/lldb/Host/HostInfoBase.h
    lldb/trunk/include/lldb/Host/HostNativeProcess.h
    lldb/trunk/include/lldb/Host/HostNativeProcessBase.h
    lldb/trunk/include/lldb/Host/HostNativeThreadBase.h
    lldb/trunk/include/lldb/Host/HostNativeThreadForward.h
    lldb/trunk/include/lldb/Host/HostProcess.h
    lldb/trunk/include/lldb/Host/HostThread.h
    lldb/trunk/include/lldb/Host/IOObject.h
    lldb/trunk/include/lldb/Host/LockFile.h
    lldb/trunk/include/lldb/Host/LockFileBase.h
    lldb/trunk/include/lldb/Host/MainLoop.h
    lldb/trunk/include/lldb/Host/MainLoopBase.h
    lldb/trunk/include/lldb/Host/MonitoringProcessLauncher.h
    lldb/trunk/include/lldb/Host/OptionParser.h
    lldb/trunk/include/lldb/Host/Pipe.h
    lldb/trunk/include/lldb/Host/PipeBase.h
    lldb/trunk/include/lldb/Host/Predicate.h
    lldb/trunk/include/lldb/Host/ProcessLauncher.h
    lldb/trunk/include/lldb/Host/ProcessRunLock.h
    lldb/trunk/include/lldb/Host/Socket.h
    lldb/trunk/include/lldb/Host/SocketAddress.h
    lldb/trunk/include/lldb/Host/StringConvert.h
    lldb/trunk/include/lldb/Host/Symbols.h
    lldb/trunk/include/lldb/Host/Terminal.h
    lldb/trunk/include/lldb/Host/ThisThread.h
    lldb/trunk/include/lldb/Host/ThreadLauncher.h
    lldb/trunk/include/lldb/Host/Time.h
    lldb/trunk/include/lldb/Host/TimeValue.h
    lldb/trunk/include/lldb/Host/XML.h
    lldb/trunk/include/lldb/Host/android/HostInfoAndroid.h
    lldb/trunk/include/lldb/Host/common/GetOptInc.h
    lldb/trunk/include/lldb/Host/common/NativeBreakpoint.h
    lldb/trunk/include/lldb/Host/common/NativeBreakpointList.h
    lldb/trunk/include/lldb/Host/common/NativeProcessProtocol.h
    lldb/trunk/include/lldb/Host/common/NativeRegisterContext.h
    lldb/trunk/include/lldb/Host/common/NativeRegisterContextRegisterInfo.h
    lldb/trunk/include/lldb/Host/common/NativeThreadProtocol.h
    lldb/trunk/include/lldb/Host/common/NativeWatchpointList.h
    lldb/trunk/include/lldb/Host/common/SoftwareBreakpoint.h
    lldb/trunk/include/lldb/Host/common/TCPSocket.h
    lldb/trunk/include/lldb/Host/common/UDPSocket.h
    lldb/trunk/include/lldb/Host/freebsd/Config.h
    lldb/trunk/include/lldb/Host/freebsd/HostInfoFreeBSD.h
    lldb/trunk/include/lldb/Host/freebsd/HostThreadFreeBSD.h
    lldb/trunk/include/lldb/Host/linux/AbstractSocket.h
    lldb/trunk/include/lldb/Host/linux/Config.h
    lldb/trunk/include/lldb/Host/linux/HostInfoLinux.h
    lldb/trunk/include/lldb/Host/linux/HostThreadLinux.h
    lldb/trunk/include/lldb/Host/linux/ProcessLauncherLinux.h
    lldb/trunk/include/lldb/Host/linux/Ptrace.h
    lldb/trunk/include/lldb/Host/linux/Uio.h
    lldb/trunk/include/lldb/Host/macosx/Config.h
    lldb/trunk/include/lldb/Host/macosx/HostInfoMacOSX.h
    lldb/trunk/include/lldb/Host/macosx/HostThreadMacOSX.h
    lldb/trunk/include/lldb/Host/mingw/Config.h
    lldb/trunk/include/lldb/Host/msvc/Config.h
    lldb/trunk/include/lldb/Host/netbsd/HostInfoNetBSD.h
    lldb/trunk/include/lldb/Host/netbsd/HostThreadNetBSD.h
    lldb/trunk/include/lldb/Host/posix/ConnectionFileDescriptorPosix.h
    lldb/trunk/include/lldb/Host/posix/DomainSocket.h
    lldb/trunk/include/lldb/Host/posix/HostInfoPosix.h
    lldb/trunk/include/lldb/Host/posix/HostProcessPosix.h
    lldb/trunk/include/lldb/Host/posix/HostThreadPosix.h
    lldb/trunk/include/lldb/Host/posix/LockFilePosix.h
    lldb/trunk/include/lldb/Host/posix/MainLoopPosix.h
    lldb/trunk/include/lldb/Host/posix/PipePosix.h
    lldb/trunk/include/lldb/Host/posix/ProcessLauncherPosix.h
    lldb/trunk/include/lldb/Host/windows/AutoHandle.h
    lldb/trunk/include/lldb/Host/windows/ConnectionGenericFileWindows.h
    lldb/trunk/include/lldb/Host/windows/HostInfoWindows.h
    lldb/trunk/include/lldb/Host/windows/HostProcessWindows.h
    lldb/trunk/include/lldb/Host/windows/HostThreadWindows.h
    lldb/trunk/include/lldb/Host/windows/LockFileWindows.h
    lldb/trunk/include/lldb/Host/windows/PipeWindows.h
    lldb/trunk/include/lldb/Host/windows/PosixApi.h
    lldb/trunk/include/lldb/Host/windows/ProcessLauncherWindows.h
    lldb/trunk/include/lldb/Host/windows/editlinewin.h
    lldb/trunk/include/lldb/Host/windows/windows.h
    lldb/trunk/include/lldb/Initialization/SystemInitializer.h
    lldb/trunk/include/lldb/Initialization/SystemInitializerCommon.h
    lldb/trunk/include/lldb/Initialization/SystemLifetimeManager.h
    lldb/trunk/include/lldb/Interpreter/Args.h
    lldb/trunk/include/lldb/Interpreter/CommandAlias.h
    lldb/trunk/include/lldb/Interpreter/CommandCompletions.h
    lldb/trunk/include/lldb/Interpreter/CommandHistory.h
    lldb/trunk/include/lldb/Interpreter/CommandInterpreter.h
    lldb/trunk/include/lldb/Interpreter/CommandObject.h
    lldb/trunk/include/lldb/Interpreter/CommandObjectMultiword.h
    lldb/trunk/include/lldb/Interpreter/CommandObjectRegexCommand.h
    lldb/trunk/include/lldb/Interpreter/CommandOptionValidators.h
    lldb/trunk/include/lldb/Interpreter/CommandReturnObject.h
    lldb/trunk/include/lldb/Interpreter/OptionGroupArchitecture.h
    lldb/trunk/include/lldb/Interpreter/OptionGroupBoolean.h
    lldb/trunk/include/lldb/Interpreter/OptionGroupFile.h
    lldb/trunk/include/lldb/Interpreter/OptionGroupFormat.h
    lldb/trunk/include/lldb/Interpreter/OptionGroupOutputFile.h
    lldb/trunk/include/lldb/Interpreter/OptionGroupPlatform.h
    lldb/trunk/include/lldb/Interpreter/OptionGroupString.h
    lldb/trunk/include/lldb/Interpreter/OptionGroupUInt64.h
    lldb/trunk/include/lldb/Interpreter/OptionGroupUUID.h
    lldb/trunk/include/lldb/Interpreter/OptionGroupValueObjectDisplay.h
    lldb/trunk/include/lldb/Interpreter/OptionGroupVariable.h
    lldb/trunk/include/lldb/Interpreter/OptionGroupWatchpoint.h
    lldb/trunk/include/lldb/Interpreter/OptionValue.h
    lldb/trunk/include/lldb/Interpreter/OptionValueArch.h
    lldb/trunk/include/lldb/Interpreter/OptionValueArgs.h
    lldb/trunk/include/lldb/Interpreter/OptionValueArray.h
    lldb/trunk/include/lldb/Interpreter/OptionValueBoolean.h
    lldb/trunk/include/lldb/Interpreter/OptionValueChar.h
    lldb/trunk/include/lldb/Interpreter/OptionValueDictionary.h
    lldb/trunk/include/lldb/Interpreter/OptionValueEnumeration.h
    lldb/trunk/include/lldb/Interpreter/OptionValueFileSpec.h
    lldb/trunk/include/lldb/Interpreter/OptionValueFileSpecList.h
    lldb/trunk/include/lldb/Interpreter/OptionValueFormat.h
    lldb/trunk/include/lldb/Interpreter/OptionValueFormatEntity.h
    lldb/trunk/include/lldb/Interpreter/OptionValueLanguage.h
    lldb/trunk/include/lldb/Interpreter/OptionValuePathMappings.h
    lldb/trunk/include/lldb/Interpreter/OptionValueProperties.h
    lldb/trunk/include/lldb/Interpreter/OptionValueRegex.h
    lldb/trunk/include/lldb/Interpreter/OptionValueSInt64.h
    lldb/trunk/include/lldb/Interpreter/OptionValueString.h
    lldb/trunk/include/lldb/Interpreter/OptionValueUInt64.h
    lldb/trunk/include/lldb/Interpreter/OptionValueUUID.h
    lldb/trunk/include/lldb/Interpreter/OptionValues.h
    lldb/trunk/include/lldb/Interpreter/Options.h
    lldb/trunk/include/lldb/Interpreter/Property.h
    lldb/trunk/include/lldb/Interpreter/ScriptInterpreter.h
    lldb/trunk/include/lldb/Symbol/ArmUnwindInfo.h
    lldb/trunk/include/lldb/Symbol/Block.h
    lldb/trunk/include/lldb/Symbol/ClangASTContext.h
    lldb/trunk/include/lldb/Symbol/ClangASTImporter.h
    lldb/trunk/include/lldb/Symbol/ClangExternalASTSourceCallbacks.h
    lldb/trunk/include/lldb/Symbol/ClangExternalASTSourceCommon.h
    lldb/trunk/include/lldb/Symbol/ClangUtil.h
    lldb/trunk/include/lldb/Symbol/CompactUnwindInfo.h
    lldb/trunk/include/lldb/Symbol/CompileUnit.h
    lldb/trunk/include/lldb/Symbol/CompilerDecl.h
    lldb/trunk/include/lldb/Symbol/CompilerDeclContext.h
    lldb/trunk/include/lldb/Symbol/CompilerType.h
    lldb/trunk/include/lldb/Symbol/DWARFCallFrameInfo.h
    lldb/trunk/include/lldb/Symbol/DebugMacros.h
    lldb/trunk/include/lldb/Symbol/DeclVendor.h
    lldb/trunk/include/lldb/Symbol/Declaration.h
    lldb/trunk/include/lldb/Symbol/FuncUnwinders.h
    lldb/trunk/include/lldb/Symbol/Function.h
    lldb/trunk/include/lldb/Symbol/GoASTContext.h
    lldb/trunk/include/lldb/Symbol/JavaASTContext.h
    lldb/trunk/include/lldb/Symbol/LineEntry.h
    lldb/trunk/include/lldb/Symbol/LineTable.h
    lldb/trunk/include/lldb/Symbol/OCamlASTContext.h
    lldb/trunk/include/lldb/Symbol/ObjectContainer.h
    lldb/trunk/include/lldb/Symbol/ObjectFile.h
    lldb/trunk/include/lldb/Symbol/Symbol.h
    lldb/trunk/include/lldb/Symbol/SymbolContext.h
    lldb/trunk/include/lldb/Symbol/SymbolContextScope.h
    lldb/trunk/include/lldb/Symbol/SymbolFile.h
    lldb/trunk/include/lldb/Symbol/SymbolVendor.h
    lldb/trunk/include/lldb/Symbol/Symtab.h
    lldb/trunk/include/lldb/Symbol/TaggedASTType.h
    lldb/trunk/include/lldb/Symbol/Type.h
    lldb/trunk/include/lldb/Symbol/TypeList.h
    lldb/trunk/include/lldb/Symbol/TypeMap.h
    lldb/trunk/include/lldb/Symbol/TypeSystem.h
    lldb/trunk/include/lldb/Symbol/UnwindPlan.h
    lldb/trunk/include/lldb/Symbol/UnwindTable.h
    lldb/trunk/include/lldb/Symbol/Variable.h
    lldb/trunk/include/lldb/Symbol/VariableList.h
    lldb/trunk/include/lldb/Symbol/VerifyDecl.h
    lldb/trunk/include/lldb/Target/ABI.h
    lldb/trunk/include/lldb/Target/CPPLanguageRuntime.h
    lldb/trunk/include/lldb/Target/DynamicLoader.h
    lldb/trunk/include/lldb/Target/ExecutionContext.h
    lldb/trunk/include/lldb/Target/ExecutionContextScope.h
    lldb/trunk/include/lldb/Target/FileAction.h
    lldb/trunk/include/lldb/Target/InstrumentationRuntime.h
    lldb/trunk/include/lldb/Target/InstrumentationRuntimeStopInfo.h
    lldb/trunk/include/lldb/Target/JITLoader.h
    lldb/trunk/include/lldb/Target/JITLoaderList.h
    lldb/trunk/include/lldb/Target/Language.h
    lldb/trunk/include/lldb/Target/LanguageRuntime.h
    lldb/trunk/include/lldb/Target/Memory.h
    lldb/trunk/include/lldb/Target/MemoryHistory.h
    lldb/trunk/include/lldb/Target/MemoryRegionInfo.h
    lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h
    lldb/trunk/include/lldb/Target/OperatingSystem.h
    lldb/trunk/include/lldb/Target/PathMappingList.h
    lldb/trunk/include/lldb/Target/Platform.h
    lldb/trunk/include/lldb/Target/Process.h
    lldb/trunk/include/lldb/Target/ProcessInfo.h
    lldb/trunk/include/lldb/Target/ProcessLaunchInfo.h
    lldb/trunk/include/lldb/Target/Queue.h
    lldb/trunk/include/lldb/Target/QueueItem.h
    lldb/trunk/include/lldb/Target/QueueList.h
    lldb/trunk/include/lldb/Target/RegisterCheckpoint.h
    lldb/trunk/include/lldb/Target/RegisterContext.h
    lldb/trunk/include/lldb/Target/SectionLoadHistory.h
    lldb/trunk/include/lldb/Target/SectionLoadList.h
    lldb/trunk/include/lldb/Target/StackFrame.h
    lldb/trunk/include/lldb/Target/StackFrameList.h
    lldb/trunk/include/lldb/Target/StackID.h
    lldb/trunk/include/lldb/Target/StopInfo.h
    lldb/trunk/include/lldb/Target/StructuredDataPlugin.h
    lldb/trunk/include/lldb/Target/SystemRuntime.h
    lldb/trunk/include/lldb/Target/Target.h
    lldb/trunk/include/lldb/Target/TargetList.h
    lldb/trunk/include/lldb/Target/Thread.h
    lldb/trunk/include/lldb/Target/ThreadCollection.h
    lldb/trunk/include/lldb/Target/ThreadList.h
    lldb/trunk/include/lldb/Target/ThreadPlan.h
    lldb/trunk/include/lldb/Target/ThreadPlanBase.h
    lldb/trunk/include/lldb/Target/ThreadPlanCallFunction.h
    lldb/trunk/include/lldb/Target/ThreadPlanCallFunctionUsingABI.h
    lldb/trunk/include/lldb/Target/ThreadPlanCallOnFunctionExit.h
    lldb/trunk/include/lldb/Target/ThreadPlanCallUserExpression.h
    lldb/trunk/include/lldb/Target/ThreadPlanPython.h
    lldb/trunk/include/lldb/Target/ThreadPlanRunToAddress.h
    lldb/trunk/include/lldb/Target/ThreadPlanShouldStopHere.h
    lldb/trunk/include/lldb/Target/ThreadPlanStepInRange.h
    lldb/trunk/include/lldb/Target/ThreadPlanStepInstruction.h
    lldb/trunk/include/lldb/Target/ThreadPlanStepOut.h
    lldb/trunk/include/lldb/Target/ThreadPlanStepOverBreakpoint.h
    lldb/trunk/include/lldb/Target/ThreadPlanStepOverRange.h
    lldb/trunk/include/lldb/Target/ThreadPlanStepRange.h
    lldb/trunk/include/lldb/Target/ThreadPlanStepThrough.h
    lldb/trunk/include/lldb/Target/ThreadPlanStepUntil.h
    lldb/trunk/include/lldb/Target/ThreadPlanTracer.h
    lldb/trunk/include/lldb/Target/ThreadSpec.h
    lldb/trunk/include/lldb/Target/UnixSignals.h
    lldb/trunk/include/lldb/Target/Unwind.h
    lldb/trunk/include/lldb/Target/UnwindAssembly.h
    lldb/trunk/include/lldb/Utility/AnsiTerminal.h
    lldb/trunk/include/lldb/Utility/CleanUp.h
    lldb/trunk/include/lldb/Utility/ConvertEnum.h
    lldb/trunk/include/lldb/Utility/Either.h
    lldb/trunk/include/lldb/Utility/Iterable.h
    lldb/trunk/include/lldb/Utility/JSON.h
    lldb/trunk/include/lldb/Utility/LLDBAssert.h
    lldb/trunk/include/lldb/Utility/NameMatches.h
    lldb/trunk/include/lldb/Utility/PriorityPointerPair.h
    lldb/trunk/include/lldb/Utility/ProcessStructReader.h
    lldb/trunk/include/lldb/Utility/PseudoTerminal.h
    lldb/trunk/include/lldb/Utility/Range.h
    lldb/trunk/include/lldb/Utility/RegisterNumber.h
    lldb/trunk/include/lldb/Utility/SafeMachO.h
    lldb/trunk/include/lldb/Utility/SelectHelper.h
    lldb/trunk/include/lldb/Utility/SharedCluster.h
    lldb/trunk/include/lldb/Utility/SharingPtr.h
    lldb/trunk/include/lldb/Utility/StdStringExtractor.h
    lldb/trunk/include/lldb/Utility/StringExtractor.h
    lldb/trunk/include/lldb/Utility/StringLexer.h
    lldb/trunk/include/lldb/Utility/TaskPool.h
    lldb/trunk/include/lldb/lldb-defines.h
    lldb/trunk/include/lldb/lldb-enumerations.h
    lldb/trunk/include/lldb/lldb-forward.h
    lldb/trunk/include/lldb/lldb-private-defines.h
    lldb/trunk/include/lldb/lldb-private-enumerations.h
    lldb/trunk/include/lldb/lldb-private-forward.h
    lldb/trunk/include/lldb/lldb-private-interfaces.h
    lldb/trunk/include/lldb/lldb-private-types.h
    lldb/trunk/include/lldb/lldb-private.h
    lldb/trunk/include/lldb/lldb-public.h
    lldb/trunk/include/lldb/lldb-types.h
    lldb/trunk/include/lldb/lldb-versioning.h
    lldb/trunk/packages/Python/lldbsuite/__init__.py
    lldb/trunk/packages/Python/lldbsuite/support/encoded_file.py
    lldb/trunk/packages/Python/lldbsuite/support/fs.py
    lldb/trunk/packages/Python/lldbsuite/support/funcutils.py
    lldb/trunk/packages/Python/lldbsuite/support/gmodules.py
    lldb/trunk/packages/Python/lldbsuite/support/optional_with.py
    lldb/trunk/packages/Python/lldbsuite/support/seven.py
    lldb/trunk/packages/Python/lldbsuite/support/sockutil.py
    lldb/trunk/packages/Python/lldbsuite/test/android/platform/TestDefaultCacheLineSize.py
    lldb/trunk/packages/Python/lldbsuite/test/api/check_public_api_headers/TestPublicAPIHeaders.py
    lldb/trunk/packages/Python/lldbsuite/test/api/listeners/TestListener.py
    lldb/trunk/packages/Python/lldbsuite/test/api/multiple-debuggers/TestMultipleDebuggers.py
    lldb/trunk/packages/Python/lldbsuite/test/api/multithreaded/TestMultithreaded.py
    lldb/trunk/packages/Python/lldbsuite/test/arm_emulation/TestEmulations.py
    lldb/trunk/packages/Python/lldbsuite/test/attic/tester.py
    lldb/trunk/packages/Python/lldbsuite/test/bench.py
    lldb/trunk/packages/Python/lldbsuite/test/benchmarks/continue/TestBenchmarkContinue.py
    lldb/trunk/packages/Python/lldbsuite/test/benchmarks/disassembly/TestDisassembly.py
    lldb/trunk/packages/Python/lldbsuite/test/benchmarks/disassembly/TestDoAttachThenDisassembly.py
    lldb/trunk/packages/Python/lldbsuite/test/benchmarks/disassembly/TestXcode41Vs42GDBDisassembly.py
    lldb/trunk/packages/Python/lldbsuite/test/benchmarks/expression/TestExpressionCmd.py
    lldb/trunk/packages/Python/lldbsuite/test/benchmarks/expression/TestRepeatedExprs.py
    lldb/trunk/packages/Python/lldbsuite/test/benchmarks/frame_variable/TestFrameVariableResponse.py
    lldb/trunk/packages/Python/lldbsuite/test/benchmarks/libcxxlist/TestBenchmarkLibcxxList.py
    lldb/trunk/packages/Python/lldbsuite/test/benchmarks/libcxxmap/TestBenchmarkLibcxxMap.py
    lldb/trunk/packages/Python/lldbsuite/test/benchmarks/startup/TestStartupDelays.py
    lldb/trunk/packages/Python/lldbsuite/test/benchmarks/stepping/TestSteppingSpeed.py
    lldb/trunk/packages/Python/lldbsuite/test/benchmarks/turnaround/TestCompileRunToBreakpointTurnaround.py
    lldb/trunk/packages/Python/lldbsuite/test/concurrent_base.py
    lldb/trunk/packages/Python/lldbsuite/test/configuration.py
    lldb/trunk/packages/Python/lldbsuite/test/darwin_log.py
    lldb/trunk/packages/Python/lldbsuite/test/decorators.py
    lldb/trunk/packages/Python/lldbsuite/test/dosep.py
    lldb/trunk/packages/Python/lldbsuite/test/dotest.py
    lldb/trunk/packages/Python/lldbsuite/test/dotest_args.py
    lldb/trunk/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py
    lldb/trunk/packages/Python/lldbsuite/test/example/TestSequenceFunctions.py
    lldb/trunk/packages/Python/lldbsuite/test/expression_command/anonymous-struct/TestCallUserAnonTypedef.py
    lldb/trunk/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStdStringFunction.py
    lldb/trunk/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStopAndContinue.py
    lldb/trunk/packages/Python/lldbsuite/test/expression_command/call-function/TestCallUserDefinedFunction.py
    lldb/trunk/packages/Python/lldbsuite/test/expression_command/call-restarts/TestCallThatRestarts.py
    lldb/trunk/packages/Python/lldbsuite/test/expression_command/call-throws/TestCallThatThrows.py
    lldb/trunk/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py
    lldb/trunk/packages/Python/lldbsuite/test/expression_command/expr-in-syscall/TestExpressionInSyscall.py
    lldb/trunk/packages/Python/lldbsuite/test/expression_command/fixits/TestFixIts.py
    lldb/trunk/packages/Python/lldbsuite/test/expression_command/formatters/TestFormatters.py
    lldb/trunk/packages/Python/lldbsuite/test/expression_command/formatters/foosynth.py
    lldb/trunk/packages/Python/lldbsuite/test/expression_command/formatters/formatters.py
    lldb/trunk/packages/Python/lldbsuite/test/expression_command/ir-interpreter-phi-nodes/TestIRInterpreterPHINodes.py
    lldb/trunk/packages/Python/lldbsuite/test/expression_command/ir-interpreter/TestIRInterpreter.py
    lldb/trunk/packages/Python/lldbsuite/test/expression_command/issue_11588/Test11588.py
    lldb/trunk/packages/Python/lldbsuite/test/expression_command/issue_11588/s11588.py
    lldb/trunk/packages/Python/lldbsuite/test/expression_command/macros/TestMacros.py
    lldb/trunk/packages/Python/lldbsuite/test/expression_command/multiline/TestMultilineExpressions.py
    lldb/trunk/packages/Python/lldbsuite/test/expression_command/options/TestExprOptions.py
    lldb/trunk/packages/Python/lldbsuite/test/expression_command/persist_objc_pointeetype/TestPersistObjCPointeeType.py
    lldb/trunk/packages/Python/lldbsuite/test/expression_command/persistent_ptr_update/TestPersistentPtrUpdate.py
    lldb/trunk/packages/Python/lldbsuite/test/expression_command/persistent_types/TestNestedPersistentTypes.py
    lldb/trunk/packages/Python/lldbsuite/test/expression_command/persistent_types/TestPersistentTypes.py
    lldb/trunk/packages/Python/lldbsuite/test/expression_command/persistent_variables/TestPersistentVariables.py
    lldb/trunk/packages/Python/lldbsuite/test/expression_command/po_verbosity/TestPoVerbosity.py
    lldb/trunk/packages/Python/lldbsuite/test/expression_command/radar_8638051/Test8638051.py
    lldb/trunk/packages/Python/lldbsuite/test/expression_command/radar_9531204/TestPrintfAfterUp.py
    lldb/trunk/packages/Python/lldbsuite/test/expression_command/radar_9673664/TestExprHelpExamples.py
    lldb/trunk/packages/Python/lldbsuite/test/expression_command/test/TestExprs.py
    lldb/trunk/packages/Python/lldbsuite/test/expression_command/test/TestExprs2.py
    lldb/trunk/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py
    lldb/trunk/packages/Python/lldbsuite/test/expression_command/top-level/TestTopLevelExprs.py
    lldb/trunk/packages/Python/lldbsuite/test/expression_command/two-files/TestObjCTypeQueryFromOtherCompileUnit.py
    lldb/trunk/packages/Python/lldbsuite/test/expression_command/unwind_expression/TestUnwindExpression.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/abbreviation/TestAbbreviations.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/abbreviation/TestCommonShortSpellings.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/apropos_with_process/TestAproposWithProcess.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/archives/TestBSDArchives.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/asan/TestMemoryHistory.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/asan/TestReportData.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/attach_resume/TestAttachResume.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/avoids-fd-leak/TestFdLeak.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/backticks/TestBackticksWithoutATarget.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestAddressBreakpoints.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestBadAddressBreakpoints.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/TestBreakpointCaseSensitivity.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommandsFromPython.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestRegexpBreakCommand.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/bktptcmd.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_ids/TestBreakpointIDs.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_language/TestBreakpointLanguage.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_options/TestBreakpointOptions.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/consecutive_breakpoints/TestConsecutiveBreakpoints.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp_exception/TestCPPExceptionBreakpoint.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/TestDebugBreak.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/dummy_target_breakpoints/TestBreakpointsWithNoTargets.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/inlined_breakpoints/TestInlinedBreakpoints.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/objc/TestObjCBreakpoints.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/source_regexp/TestSourceRegexBreakpoints.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_history/TestCommandHistory.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_regex/TestCommandRegex.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_script/TestCommandScript.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_script/bug11569.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_script/import/TestImport.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_script/import/bar/bar.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_script/import/bar/barutil.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_script/import/dummymodule.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_script/import/foo/bar/foobar.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_script/import/foo/foo.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_script/import/foo/foo2.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_script/import/rdar-12586188/TestRdar12586188.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_script/import/rdar-12586188/fail12586188.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_script/import/rdar-12586188/fail212586188.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_script/import/thepackage/TPunitA.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_script/import/thepackage/TPunitB.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_script/import/thepackage/__init__.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_script/mysto.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_script/welcome.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_script_alias/TestCommandScriptAlias.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_script_alias/tcsacmd.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/custom_command.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_source/TestCommandSource.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_source/my.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/conditional_break/TestConditionalBreak.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/conditional_break/conditional_break.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/activity-chain/TestDarwinLogFilterMatchActivityChain.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/activity/TestDarwinLogFilterMatchActivity.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/category/TestDarwinLogFilterMatchCategory.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/message/TestDarwinLogFilterMatchMessage.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/subsystem/TestDarwinLogFilterMatchSubsystem.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/activity-chain/TestDarwinLogFilterRegexActivityChain.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/activity/TestDarwinLogFilterRegexActivity.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/category/TestDarwinLogFilterRegexCategory.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/subsystem/TestDarwinLogFilterRegexSubsystem.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/format/TestDarwinLogMessageFormat.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/source/debug/TestDarwinLogSourceDebug.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/darwin_log/source/info/TestDarwinLogSourceInfo.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/boolreference/TestFormattersBoolRefPtr.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/compactvectors/TestCompactVectors.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-disabling/TestDataFormatterDisabling.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-enum-format/TestDataFormatterEnumFormat.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-globals/TestDataFormatterGlobals.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-named-summaries/TestDataFormatterNamedSummaries.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsindexpath/TestDataFormatterNSIndexPath.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-ptr-to-array/TestPtrToArrayFormatting.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/fooSynthProvider.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/ftsp.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-script/TestDataFormatterScript.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/TestLibCxxAtomic.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/function/TestLibCxxFunction.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/TestDataFormatterSynthType.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/myIntSynthProvider.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthval/myIntSynthProvider.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/dump_dynamic/TestDumpDynamic.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/format-propagation/TestFormatPropagation.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/frameformat_smallstruct/TestFrameFormatSmallStruct.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/hexcaps/TestDataFormatterHexCaps.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/language_category_updates/TestDataFormatterLanguageCategoryUpdates.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/nsarraysynth/TestNSArraySynthetic.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/nssetsynth/TestNSSetSynthetic.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/ostypeformatting/TestFormattersOsType.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/parray/TestPrintArray.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/poarray/TestPrintObjectArray.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/ptr_ref_typedef/TestPtrRef2Typedef.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/pyobjsynthprovider/TestPyObjSynthProvider.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/pyobjsynthprovider/provider.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/refpointer-recursion/TestDataFormatterRefPtrRecursion.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/setvaluefromcstring/TestSetValueFromCString.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/stringprinter/TestStringPrinter.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/summary-string-onfail/Test-rdar-9974002.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/fooSynthProvider.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/synthupdate/TestSyntheticFilterRecompute.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_arg/TestTypeSummaryListArg.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/TestTypeSummaryListScript.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/tslsformatters.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/typedef_array/TestTypedefArray.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/user-format-vs-summary/TestUserFormatVsSummary.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/var-in-aggregate-misuse/TestVarInAggregateMisuse.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/varscript_formatting/TestDataFormatterVarScriptFormatting.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/varscript_formatting/helperfunc.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/dead-strip/TestDeadStrip.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/disassembly/TestDisassembleBreakpoint.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/embedded_interpreter/TestConvenienceVariables.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/fat_archives/TestFatArchives.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/format/TestFormats.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-diagnose/array/TestArray.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-diagnose/bad-reference/TestBadReference.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-diagnose/complicated-expression/TestComplicatedExpression.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-argument/TestDiagnoseDereferenceArgument.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-function-return/TestDiagnoseDereferenceFunctionReturn.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-this/TestDiagnoseDereferenceThis.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-diagnose/inheritance/TestDiagnoseInheritance.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-diagnose/local-variable/TestLocalVariable.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/frame-diagnose/virtual-method-call/TestDiagnoseDereferenceVirtualMethodCall.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/inferior-assert/TestInferiorAssert.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/inferior-changed/TestInferiorChanged.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/inferior-crashing/TestInferiorCrashing.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/inline-stepping/TestInlineStepping.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/jitloader_gdb/TestJITLoaderGDB.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/launch_with_shellexpand/TestLaunchWithShellExpand.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/llvm/TestLLVM.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/longjmp/TestLongjmp.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/memory/cache/TestMemoryCache.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/memory/find/TestMemoryFind.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/memory/read/TestMemoryRead.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/multidebugger_commands/TestMultipleDebuggersCommands.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/nested_alias/TestNestedAlias.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/non-overlapping-index-variable-i/TestIndexVariable.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/nosucharch/TestNoSuchArch.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/object-file/TestImageListMultiArchitecture.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/paths/TestPaths.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/platform/TestPlatformCommand.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/plugins/commands/TestPluginCommands.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/plugins/python_os_plugin/TestPythonOSPlugin.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/plugins/python_os_plugin/operating_system.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/plugins/python_os_plugin/operating_system2.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/linux-core/TestLinuxCore.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/wow64_minidump/TestWow64MiniDump.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_attach/TestProcessAttach.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_attach/attach_denied/TestAttachDenied.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_group/TestChangeProcessGroup.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/process_save_core/TestProcessSaveCore.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/ptr_refs/TestPtrRefs.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/recursion/TestValueObjectRecursion.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/TestRegisters.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/rerun/TestRerun.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/set-data/TestSetData.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/signal/TestSendSignal.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/signal/handle-segv/TestHandleSegv.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/signal/raise/TestRaise.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/single-quote-in-filename-to-lldb/TestSingleQuoteInFilename.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/step-avoids-no-debug/TestStepNoDebug.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/stop-hook/TestStopHookCmd.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/stop-hook/TestStopHookMechanism.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/stop-hook/multiple_threads/TestStopHookMultipleThreads.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/target_command/TestTargetCommand.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/TestNumThreads.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/TestBacktraceAll.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/break_after_join/TestBreakAfterJoin.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/breakpoint_delay_breakpoint_one_signal/TestConcurrentBreakpointDelayBreakpointOneSignal.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/breakpoint_one_delay_breakpoint_threads/TestConcurrentBreakpointOneDelayBreakpointThreads.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/breakpoints_delayed_breakpoint_one_watchpoint/TestConcurrentBreakpointsDelayedBreakpointOneWatchpoint.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_break/TestConcurrentCrashWithBreak.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_signal/TestConcurrentCrashWithSignal.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_watchpoint/TestConcurrentCrashWithWatchpoint.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_watchpoint_breakpoint_signal/TestConcurrentCrashWithWatchpointBreakpointSignal.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delay_signal_break/TestConcurrentDelaySignalBreak.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delay_signal_watch/TestConcurrentDelaySignalWatch.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delay_watch_break/TestConcurrentDelayWatchBreak.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delayed_crash_with_breakpoint_signal/TestConcurrentDelayedCrashWithBreakpointSignal.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delayed_crash_with_breakpoint_watchpoint/TestConcurrentDelayedCrashWithBreakpointWatchpoint.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_breakpoints/TestConcurrentManyBreakpoints.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_crash/TestConcurrentManyCrash.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_signals/TestConcurrentManySignals.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_watchpoints/TestConcurrentManyWatchpoints.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/n_watch_n_break/TestConcurrentNWatchNBreak.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_break/TestConcurrentSignalBreak.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_delay_break/TestConcurrentSignalDelayBreak.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_delay_watch/TestConcurrentSignalDelayWatch.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_n_watch_n_break/TestConcurrentSignalNWatchNBreak.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_watch/TestConcurrentSignalWatch.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_watch_break/TestConcurrentSignalWatchBreak.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoint_threads/TestConcurrentTwoBreakpointThreads.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoints_one_delay_signal/TestConcurrentTwoBreakpointsOneDelaySignal.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoints_one_signal/TestConcurrentTwoBreakpointsOneSignal.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoints_one_watchpoint/TestConcurrentTwoBreakpointsOneWatchpoint.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoint_threads/TestConcurrentTwoWatchpointThreads.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoints_one_breakpoint/TestConcurrentTwoWatchpointsOneBreakpoint.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoints_one_delay_breakpoint/TestConcurrentTwoWatchpointsOneDelayBreakpoint.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoints_one_signal/TestConcurrentTwoWatchpointsOneSignal.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watch_break/TestConcurrentWatchBreak.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watch_break_delay/TestConcurrentWatchBreakDelay.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watchpoint_delay_watchpoint_one_breakpoint/TestConcurrentWatchpointDelayWatchpointOneBreakpoint.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watchpoint_with_delay_watchpoint_threads/TestConcurrentWatchpointWithDelayWatchpointThreads.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/create_after_attach/TestCreateAfterAttach.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/create_during_step/TestCreateDuringStep.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/multi_break/TestMultipleBreakpoints.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/step_out/TestThreadStepOut.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/thread_exit/TestThreadExit.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break_plus_condition/TestThreadSpecificBpPlusCondition.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/tsan/basic/TestTsanBasic.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/tsan/cpp_global_location/TestTsanCPPGlobalLocation.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/tsan/global_location/TestTsanGlobalLocation.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/tsan/multiple/TestTsanMultiple.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/tsan/thread_leak/TestTsanThreadLeak.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/tsan/thread_numbers/TestTsanThreadNumbers.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/tty/TestTerminal.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/type_completion/TestTypeCompletion.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/type_lookup/TestTypeLookup.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/unwind/ehframe/TestEhFrameUnwind.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/unwind/noreturn/TestNoreturnUnwind.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/unwind/sigtramp/TestSigtrampUnwind.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/unwind/standard/TestStandardUnwind.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/value_md5_crash/TestValueMD5Crash.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/variable_out_of_scope/TestWatchedVarHitWhenInScope.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandLLDB.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/command/watchpoint_command.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/condition/TestWatchpointConditionCmd.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_on_vectors/TestValueOfVectorVariable.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_size/TestWatchpointSizes.py
    lldb/trunk/packages/Python/lldbsuite/test/help/TestApropos.py
    lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/c/anonymous/TestAnonymous.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/c/array_types/TestArrayTypes.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/c/bitfields/TestBitfields.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/c/blocks/TestBlocks.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/c/const_variables/TestConstVariables.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/c/enum_types/TestEnumTypes.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/c/forward/TestForwardDeclaration.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/c/function_types/TestFunctionTypes.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/c/global_variables/TestGlobalVariables.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/c/inlines/TestRedefinitionsInInlines.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/c/modules/TestCModules.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/c/register_variables/TestRegisterVariables.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/c/set_values/TestSetValues.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/c/shared_lib/TestSharedLib.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/c/shared_lib_stripped_symbols/TestSharedLibStrippedSymbols.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/c/step-target/TestStepTarget.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/c/stepping/TestStepAndBreakpoints.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/c/stepping/TestThreadStepping.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/c/strings/TestCStrings.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/c/struct_types/TestStructTypes.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/c/tls_globals/TestTlsGlobals.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/c/typedef/Testtypedef.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/c/unions/TestUnionMembers.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/auto/TestCPPAuto.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/bool/TestCPPBool.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/breakpoint-commands/TestCPPBreakpointCommands.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/call-function/TestCallCPPFunction.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/chained-calls/TestCppChainedCalls.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/char1632_t/TestChar1632T.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/class_static/TestStaticVariables.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/class_types/TestClassTypes.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/class_types/TestClassTypesDisassembly.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/const_this/TestConstThis.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/diamond/TestDiamond.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/dynamic-value/TestCppValueCast.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/dynamic-value/TestDynamicValue.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/enum_types/TestCPP11EnumTypes.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/exceptions/TestCPPExceptionBreakpoints.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/frame-var-anon-unions/TestFrameVariableAnonymousUnions.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/global_operators/TestCppGlobalOperators.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/gmodules/TestWithModuleDebugging.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/incomplete-types/TestCppIncompleteTypes.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/inlines/TestInlines.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/lambdas/TestLambdas.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/limit-debug-info/TestWithLimitDebugInfo.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/member-and-local-vars-with-same-name/TestMembersAndLocalsWithSameName.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespace.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/TestNamespaceDefinitions.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/nsimport/TestCppNsImport.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/overloaded-functions/TestOverloadedFunctions.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/printf/TestPrintf.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/rvalue-references/TestRvalueReferences.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/scope/TestCppScope.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/signed_types/TestSignedTypes.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/static_members/TestCPPStaticMembers.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/static_methods/TestCPPStaticMethods.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/stl/TestSTL.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/stl/TestStdCXXDisassembly.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/template/TestTemplateArgs.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/this/TestCPPThis.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/unicode-literals/TestUnicodeLiterals.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/unique-types/TestUniqueTypes.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/unsigned_types/TestUnsignedTypes.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/virtual/TestVirtual.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/wchar_t/TestCxxWCharT.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/go/expressions/TestExpressions.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/go/formatters/TestGoFormatters.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/go/goroutines/TestGoroutines.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/go/types/TestGoASTContext.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/mixed/TestMixedLanguages.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/objc/bitfield_ivars/TestBitfieldIvars.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/objc/blocks/TestObjCIvarsInBlocks.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/objc/forward-decl/TestForwardDecl.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/objc/foundation/TestConstStrings.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/objc/foundation/TestFoundationDisassembly.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/objc/foundation/TestObjCMethods.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/objc/foundation/TestObjCMethods2.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/objc/foundation/TestObjectDescriptionAPI.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/objc/foundation/TestRuntimeTypes.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/objc/foundation/TestSymbolTable.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/objc/global_ptrs/TestGlobalObjects.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/objc/hidden-ivars/TestHiddenIvars.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/objc/ivar-IMP/TestObjCiVarIMP.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/objc/modules-auto-import/TestModulesAutoImport.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/objc/modules-incomplete/TestIncompleteModules.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/objc/modules-inline-functions/TestModulesInlineFunctions.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/objc/modules/TestObjCModules.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc++/TestObjCXX.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-baseclass-sbtype/TestObjCBaseClassSBType.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-builtin-types/TestObjCBuiltinTypes.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-checker/TestObjCCheckers.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-class-method/TestObjCClassMethod.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-dyn-sbtype/TestObjCDynamicSBType.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-ivar-protocols/TestIvarProtocols.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-ivar-stripped/TestObjCIvarStripped.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-optimized/TestObjcOptimized.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-property/TestObjCProperty.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-runtime-ivars/TestRuntimeIvars.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-static-method-stripped/TestObjCStaticMethodStripped.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-static-method/TestObjCStaticMethod.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-stepping/TestObjCStepping.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-struct-argument/TestObjCStructArgument.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-struct-return/TestObjCStructReturn.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-super/TestObjCSuper.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/objc/print-obj/TestPrintObj.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/objc/radar-9691614/TestObjCMethodReturningBOOL.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/objc/rdar-10967107/TestRdar10967107.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/objc/rdar-11355592/TestRdar11355592.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/objc/rdar-12408181/TestRdar12408181.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/objc/real-definition/TestRealDefinition.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/objc/self/TestObjCSelf.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/objc/single-entry-dictionary/TestObjCSingleEntryDictionary.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/objc/variadic_methods/TestVariadicMethods.py
    lldb/trunk/packages/Python/lldbsuite/test/lang/objcxx/objcxx-ivar-vector/TestIvarVector.py
    lldb/trunk/packages/Python/lldbsuite/test/linux/builtin_trap/TestBuiltinTrap.py
    lldb/trunk/packages/Python/lldbsuite/test/linux/thread/create_during_instruction_step/TestCreateDuringInstructionStep.py
    lldb/trunk/packages/Python/lldbsuite/test/lldbbench.py
    lldb/trunk/packages/Python/lldbsuite/test/lldbcurses.py
    lldb/trunk/packages/Python/lldbsuite/test/lldbinline.py
    lldb/trunk/packages/Python/lldbsuite/test/lldbpexpect.py
    lldb/trunk/packages/Python/lldbsuite/test/lldbplatform.py
    lldb/trunk/packages/Python/lldbsuite/test/lldbplatformutil.py
    lldb/trunk/packages/Python/lldbsuite/test/lldbtest.py
    lldb/trunk/packages/Python/lldbsuite/test/lldbtest_config.py
    lldb/trunk/packages/Python/lldbsuite/test/lldbutil.py
    lldb/trunk/packages/Python/lldbsuite/test/lock.py
    lldb/trunk/packages/Python/lldbsuite/test/logging/TestLogging.py
    lldb/trunk/packages/Python/lldbsuite/test/macosx/add-dsym/TestAddDsymMidExecutionCommand.py
    lldb/trunk/packages/Python/lldbsuite/test/macosx/debug-info/apple_types/TestAppleTypesIsProduced.py
    lldb/trunk/packages/Python/lldbsuite/test/macosx/indirect_symbol/TestIndirectSymbols.py
    lldb/trunk/packages/Python/lldbsuite/test/macosx/nslog/TestDarwinNSLogOutput.py
    lldb/trunk/packages/Python/lldbsuite/test/macosx/order/TestOrderFile.py
    lldb/trunk/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py
    lldb/trunk/packages/Python/lldbsuite/test/macosx/safe-to-func-call/TestSafeFuncCalls.py
    lldb/trunk/packages/Python/lldbsuite/test/macosx/universal/TestUniversal.py
    lldb/trunk/packages/Python/lldbsuite/test/plugins/builder_base.py
    lldb/trunk/packages/Python/lldbsuite/test/plugins/builder_darwin.py
    lldb/trunk/packages/Python/lldbsuite/test/plugins/builder_freebsd.py
    lldb/trunk/packages/Python/lldbsuite/test/plugins/builder_linux.py
    lldb/trunk/packages/Python/lldbsuite/test/plugins/builder_netbsd.py
    lldb/trunk/packages/Python/lldbsuite/test/plugins/builder_win32.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/breakpoint/TestBreakpointAPI.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/class_members/TestSBTypeClassMembers.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/debugger/TestDebuggerAPI.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/default-constructor/TestDefaultConstructorForAPIObjects.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/default-constructor/sb_address.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/default-constructor/sb_block.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/default-constructor/sb_breakpoint.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/default-constructor/sb_breakpointlocation.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/default-constructor/sb_broadcaster.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/default-constructor/sb_communication.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/default-constructor/sb_compileunit.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/default-constructor/sb_debugger.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/default-constructor/sb_error.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/default-constructor/sb_event.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/default-constructor/sb_filespec.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/default-constructor/sb_frame.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/default-constructor/sb_function.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/default-constructor/sb_instruction.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/default-constructor/sb_instructionlist.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/default-constructor/sb_lineentry.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/default-constructor/sb_listener.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/default-constructor/sb_module.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/default-constructor/sb_process.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/default-constructor/sb_section.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/default-constructor/sb_stringlist.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/default-constructor/sb_symbol.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/default-constructor/sb_symbolcontext.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/default-constructor/sb_target.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/default-constructor/sb_thread.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/default-constructor/sb_type.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/default-constructor/sb_value.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/default-constructor/sb_valuelist.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/default-constructor/sb_watchpoint.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/disassemble-raw-data/TestDisassembleRawData.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/disassemble-raw-data/TestDisassemble_VST1_64.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/event/TestEvents.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/exprpath_synthetic/TestExprPathSynthetic.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/findvalue_duplist/TestSBFrameFindValue.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/formatters/TestFormattersSBAPI.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/formatters/synth.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/frame/TestFrames.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/frame/get-variables/TestGetVariables.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/frame/inlines/TestInlinedFrame.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/function_symbol/TestDisasmAPI.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/function_symbol/TestSymbolAPI.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/interpreter/TestCommandInterpreterAPI.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/lldbutil/frame/TestFrameUtils.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/lldbutil/iter/TestLLDBIterator.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/lldbutil/iter/TestRegistersIterator.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/lldbutil/process/TestPrintStackTraces.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/module_section/TestModuleAndSection.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/objc_type/TestObjCType.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/process/TestProcessAPI.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/process/io/TestProcessIO.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/rdar-12481949/Test-rdar-12481949.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/sbdata/TestSBData.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/sbtype_typeclass/TestSBTypeTypeClass.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/sbvalue_persist/TestSBValuePersist.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/section/TestSectionAPI.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/signals/TestSignalsAPI.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/symbol-context/TestSymbolContext.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/symbol-context/two-files/TestSymbolContextTwoFiles.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/target/TestTargetAPI.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/thread/TestThreadAPI.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/type/TestTypeList.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/value/TestValueAPI.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/value/change_values/TestChangeValueAPI.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/value/linked_list/TestValueAPILinkedList.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/value_var_update/TestValueVarUpdate.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/watchpoint/TestSetWatchpoint.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/watchpoint/TestWatchpointIgnoreCount.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/watchpoint/TestWatchpointIter.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/watchpoint/condition/TestWatchpointConditionAPI.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py
    lldb/trunk/packages/Python/lldbsuite/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py
    lldb/trunk/packages/Python/lldbsuite/test/redo.py
    lldb/trunk/packages/Python/lldbsuite/test/settings/TestSettings.py
    lldb/trunk/packages/Python/lldbsuite/test/settings/quoting/TestQuoting.py
    lldb/trunk/packages/Python/lldbsuite/test/source-manager/TestSourceManager.py
    lldb/trunk/packages/Python/lldbsuite/test/terminal/TestSTTYBeforeAndAfter.py
    lldb/trunk/packages/Python/lldbsuite/test/test_categories.py
    lldb/trunk/packages/Python/lldbsuite/test/test_result.py
    lldb/trunk/packages/Python/lldbsuite/test/test_runner/process_control.py
    lldb/trunk/packages/Python/lldbsuite/test/test_runner/test/test_process_control.py
    lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiExit.py
    lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiFile.py
    lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiGdbSetShow.py
    lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiLibraryLoaded.py
    lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiPrompt.py
    lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py
    lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/control/TestMiExec.py
    lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py
    lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/interpreter/TestMiCliSupport.py
    lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py
    lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py
    lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/signal/TestMiSignal.py
    lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/stack/TestMiStack.py
    lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py
    lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py
    lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/syntax/TestMiSyntax.py
    lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/target/TestMiTarget.py
    lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/threadinfo/TestMiThreadInfo.py
    lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiGdbSetShowPrint.py
    lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiVar.py
    lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteAttach.py
    lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteAuxvSupport.py
    lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteExpeditedRegisters.py
    lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteKill.py
    lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteProcessInfo.py
    lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteRegisterState.py
    lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteSingleStep.py
    lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteThreadsInStopReply.py
    lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemote_qThreadStopInfo.py
    lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemote_vCont.py
    lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py
    lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/commandline/TestStubReverseConnect.py
    lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/commandline/TestStubSetSID.py
    lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
    lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/inferior-crash/TestGdbRemoteAbort.py
    lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/inferior-crash/TestGdbRemoteSegFault.py
    lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py
    lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/platform-process-connect/TestPlatformProcessConnect.py
    lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/socket_packet_pump.py
    lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/test/test_lldbgdbserverutils.py
    lldb/trunk/packages/Python/lldbsuite/test/types/AbstractBase.py
    lldb/trunk/packages/Python/lldbsuite/test/types/HideTestFailures.py
    lldb/trunk/packages/Python/lldbsuite/test/types/TestFloatTypes.py
    lldb/trunk/packages/Python/lldbsuite/test/types/TestFloatTypesExpr.py
    lldb/trunk/packages/Python/lldbsuite/test/types/TestIntegerTypes.py
    lldb/trunk/packages/Python/lldbsuite/test/types/TestIntegerTypesExpr.py
    lldb/trunk/packages/Python/lldbsuite/test/types/TestRecursiveTypes.py
    lldb/trunk/packages/Python/lldbsuite/test/warnings/uuid/TestAddDsymCommand.py
    lldb/trunk/packages/Python/lldbsuite/test_event/build_exception.py
    lldb/trunk/packages/Python/lldbsuite/test_event/dotest_channels.py
    lldb/trunk/packages/Python/lldbsuite/test_event/event_builder.py
    lldb/trunk/packages/Python/lldbsuite/test_event/formatter/__init__.py
    lldb/trunk/packages/Python/lldbsuite/test_event/formatter/curses.py
    lldb/trunk/packages/Python/lldbsuite/test_event/formatter/pickled.py
    lldb/trunk/packages/Python/lldbsuite/test_event/formatter/results_formatter.py
    lldb/trunk/packages/Python/lldbsuite/test_event/formatter/xunit.py
    lldb/trunk/packages/Python/lldbsuite/test_event/test/src/TestCatchInvalidDecorator.py
    lldb/trunk/packages/Python/lldbsuite/test_event/test/src/event_collector.py
    lldb/trunk/scripts/Python/android/host_art_bt.py
    lldb/trunk/scripts/Python/finishSwigPythonLLDB.py
    lldb/trunk/scripts/Python/modify-python-lldb.py
    lldb/trunk/scripts/Python/modules/readline/readline.cpp
    lldb/trunk/scripts/Python/prepare_binding_Python.py
    lldb/trunk/scripts/Python/remote-build.py
    lldb/trunk/scripts/Python/use_lldb_suite.py
    lldb/trunk/scripts/Xcode/build-llvm.py
    lldb/trunk/scripts/Xcode/lldbbuild.py
    lldb/trunk/scripts/Xcode/package-clang-headers.py
    lldb/trunk/scripts/buildbot.py
    lldb/trunk/scripts/finishSwigWrapperClasses.py
    lldb/trunk/scripts/install_custom_python.py
    lldb/trunk/scripts/swig_bot.py
    lldb/trunk/scripts/swig_bot_lib/client.py
    lldb/trunk/scripts/swig_bot_lib/local.py
    lldb/trunk/scripts/swig_bot_lib/remote.py
    lldb/trunk/scripts/swig_bot_lib/server.py
    lldb/trunk/scripts/use_lldb_suite.py
    lldb/trunk/scripts/utilsArgsParse.py
    lldb/trunk/scripts/utilsDebug.py
    lldb/trunk/scripts/utilsOsType.py
    lldb/trunk/scripts/verify_api.py
    lldb/trunk/source/API/SBAddress.cpp
    lldb/trunk/source/API/SBAttachInfo.cpp
    lldb/trunk/source/API/SBBlock.cpp
    lldb/trunk/source/API/SBBreakpoint.cpp
    lldb/trunk/source/API/SBBreakpointLocation.cpp
    lldb/trunk/source/API/SBBroadcaster.cpp
    lldb/trunk/source/API/SBCommandInterpreter.cpp
    lldb/trunk/source/API/SBCommandReturnObject.cpp
    lldb/trunk/source/API/SBCommunication.cpp
    lldb/trunk/source/API/SBCompileUnit.cpp
    lldb/trunk/source/API/SBData.cpp
    lldb/trunk/source/API/SBDebugger.cpp
    lldb/trunk/source/API/SBDeclaration.cpp
    lldb/trunk/source/API/SBError.cpp
    lldb/trunk/source/API/SBEvent.cpp
    lldb/trunk/source/API/SBExecutionContext.cpp
    lldb/trunk/source/API/SBExpressionOptions.cpp
    lldb/trunk/source/API/SBFileSpec.cpp
    lldb/trunk/source/API/SBFileSpecList.cpp
    lldb/trunk/source/API/SBFrame.cpp
    lldb/trunk/source/API/SBFunction.cpp
    lldb/trunk/source/API/SBHostOS.cpp
    lldb/trunk/source/API/SBInstruction.cpp
    lldb/trunk/source/API/SBInstructionList.cpp
    lldb/trunk/source/API/SBLanguageRuntime.cpp
    lldb/trunk/source/API/SBLaunchInfo.cpp
    lldb/trunk/source/API/SBLineEntry.cpp
    lldb/trunk/source/API/SBListener.cpp
    lldb/trunk/source/API/SBMemoryRegionInfo.cpp
    lldb/trunk/source/API/SBMemoryRegionInfoList.cpp
    lldb/trunk/source/API/SBModule.cpp
    lldb/trunk/source/API/SBModuleSpec.cpp
    lldb/trunk/source/API/SBPlatform.cpp
    lldb/trunk/source/API/SBProcess.cpp
    lldb/trunk/source/API/SBQueue.cpp
    lldb/trunk/source/API/SBQueueItem.cpp
    lldb/trunk/source/API/SBSection.cpp
    lldb/trunk/source/API/SBSourceManager.cpp
    lldb/trunk/source/API/SBStream.cpp
    lldb/trunk/source/API/SBStringList.cpp
    lldb/trunk/source/API/SBStructuredData.cpp
    lldb/trunk/source/API/SBSymbol.cpp
    lldb/trunk/source/API/SBSymbolContext.cpp
    lldb/trunk/source/API/SBSymbolContextList.cpp
    lldb/trunk/source/API/SBTarget.cpp
    lldb/trunk/source/API/SBThread.cpp
    lldb/trunk/source/API/SBThreadCollection.cpp
    lldb/trunk/source/API/SBThreadPlan.cpp
    lldb/trunk/source/API/SBType.cpp
    lldb/trunk/source/API/SBTypeCategory.cpp
    lldb/trunk/source/API/SBTypeEnumMember.cpp
    lldb/trunk/source/API/SBTypeFilter.cpp
    lldb/trunk/source/API/SBTypeFormat.cpp
    lldb/trunk/source/API/SBTypeNameSpecifier.cpp
    lldb/trunk/source/API/SBTypeSummary.cpp
    lldb/trunk/source/API/SBTypeSynthetic.cpp
    lldb/trunk/source/API/SBUnixSignals.cpp
    lldb/trunk/source/API/SBValue.cpp
    lldb/trunk/source/API/SBValueList.cpp
    lldb/trunk/source/API/SBVariablesOptions.cpp
    lldb/trunk/source/API/SBWatchpoint.cpp
    lldb/trunk/source/API/SystemInitializerFull.cpp
    lldb/trunk/source/Breakpoint/Breakpoint.cpp
    lldb/trunk/source/Breakpoint/BreakpointID.cpp
    lldb/trunk/source/Breakpoint/BreakpointIDList.cpp
    lldb/trunk/source/Breakpoint/BreakpointList.cpp
    lldb/trunk/source/Breakpoint/BreakpointLocation.cpp
    lldb/trunk/source/Breakpoint/BreakpointLocationCollection.cpp
    lldb/trunk/source/Breakpoint/BreakpointLocationList.cpp
    lldb/trunk/source/Breakpoint/BreakpointOptions.cpp
    lldb/trunk/source/Breakpoint/BreakpointResolver.cpp
    lldb/trunk/source/Breakpoint/BreakpointResolverAddress.cpp
    lldb/trunk/source/Breakpoint/BreakpointResolverFileLine.cpp
    lldb/trunk/source/Breakpoint/BreakpointResolverFileRegex.cpp
    lldb/trunk/source/Breakpoint/BreakpointResolverName.cpp
    lldb/trunk/source/Breakpoint/BreakpointSite.cpp
    lldb/trunk/source/Breakpoint/BreakpointSiteList.cpp
    lldb/trunk/source/Breakpoint/Stoppoint.cpp
    lldb/trunk/source/Breakpoint/StoppointCallbackContext.cpp
    lldb/trunk/source/Breakpoint/StoppointLocation.cpp
    lldb/trunk/source/Breakpoint/Watchpoint.cpp
    lldb/trunk/source/Breakpoint/WatchpointList.cpp
    lldb/trunk/source/Breakpoint/WatchpointOptions.cpp
    lldb/trunk/source/Commands/CommandCompletions.cpp
    lldb/trunk/source/Commands/CommandObjectApropos.cpp
    lldb/trunk/source/Commands/CommandObjectApropos.h
    lldb/trunk/source/Commands/CommandObjectArgs.cpp
    lldb/trunk/source/Commands/CommandObjectArgs.h
    lldb/trunk/source/Commands/CommandObjectBreakpoint.cpp
    lldb/trunk/source/Commands/CommandObjectBreakpoint.h
    lldb/trunk/source/Commands/CommandObjectBreakpointCommand.cpp
    lldb/trunk/source/Commands/CommandObjectBreakpointCommand.h
    lldb/trunk/source/Commands/CommandObjectBugreport.cpp
    lldb/trunk/source/Commands/CommandObjectBugreport.h
    lldb/trunk/source/Commands/CommandObjectCommands.cpp
    lldb/trunk/source/Commands/CommandObjectCommands.h
    lldb/trunk/source/Commands/CommandObjectDisassemble.cpp
    lldb/trunk/source/Commands/CommandObjectDisassemble.h
    lldb/trunk/source/Commands/CommandObjectExpression.cpp
    lldb/trunk/source/Commands/CommandObjectExpression.h
    lldb/trunk/source/Commands/CommandObjectFrame.cpp
    lldb/trunk/source/Commands/CommandObjectFrame.h
    lldb/trunk/source/Commands/CommandObjectGUI.cpp
    lldb/trunk/source/Commands/CommandObjectGUI.h
    lldb/trunk/source/Commands/CommandObjectHelp.cpp
    lldb/trunk/source/Commands/CommandObjectHelp.h
    lldb/trunk/source/Commands/CommandObjectLanguage.cpp
    lldb/trunk/source/Commands/CommandObjectLanguage.h
    lldb/trunk/source/Commands/CommandObjectLog.cpp
    lldb/trunk/source/Commands/CommandObjectLog.h
    lldb/trunk/source/Commands/CommandObjectMemory.cpp
    lldb/trunk/source/Commands/CommandObjectMemory.h
    lldb/trunk/source/Commands/CommandObjectMultiword.cpp
    lldb/trunk/source/Commands/CommandObjectPlatform.cpp
    lldb/trunk/source/Commands/CommandObjectPlatform.h
    lldb/trunk/source/Commands/CommandObjectPlugin.cpp
    lldb/trunk/source/Commands/CommandObjectPlugin.h
    lldb/trunk/source/Commands/CommandObjectProcess.cpp
    lldb/trunk/source/Commands/CommandObjectProcess.h
    lldb/trunk/source/Commands/CommandObjectQuit.cpp
    lldb/trunk/source/Commands/CommandObjectQuit.h
    lldb/trunk/source/Commands/CommandObjectRegister.cpp
    lldb/trunk/source/Commands/CommandObjectRegister.h
    lldb/trunk/source/Commands/CommandObjectSettings.cpp
    lldb/trunk/source/Commands/CommandObjectSettings.h
    lldb/trunk/source/Commands/CommandObjectSource.cpp
    lldb/trunk/source/Commands/CommandObjectSource.h
    lldb/trunk/source/Commands/CommandObjectSyntax.cpp
    lldb/trunk/source/Commands/CommandObjectSyntax.h
    lldb/trunk/source/Commands/CommandObjectTarget.cpp
    lldb/trunk/source/Commands/CommandObjectTarget.h
    lldb/trunk/source/Commands/CommandObjectThread.cpp
    lldb/trunk/source/Commands/CommandObjectThread.h
    lldb/trunk/source/Commands/CommandObjectType.cpp
    lldb/trunk/source/Commands/CommandObjectType.h
    lldb/trunk/source/Commands/CommandObjectVersion.cpp
    lldb/trunk/source/Commands/CommandObjectVersion.h
    lldb/trunk/source/Commands/CommandObjectWatchpoint.cpp
    lldb/trunk/source/Commands/CommandObjectWatchpoint.h
    lldb/trunk/source/Commands/CommandObjectWatchpointCommand.cpp
    lldb/trunk/source/Commands/CommandObjectWatchpointCommand.h
    lldb/trunk/source/Core/Address.cpp
    lldb/trunk/source/Core/AddressRange.cpp
    lldb/trunk/source/Core/AddressResolver.cpp
    lldb/trunk/source/Core/AddressResolverFileLine.cpp
    lldb/trunk/source/Core/AddressResolverName.cpp
    lldb/trunk/source/Core/ArchSpec.cpp
    lldb/trunk/source/Core/Baton.cpp
    lldb/trunk/source/Core/Broadcaster.cpp
    lldb/trunk/source/Core/Communication.cpp
    lldb/trunk/source/Core/Connection.cpp
    lldb/trunk/source/Core/ConnectionMachPort.cpp
    lldb/trunk/source/Core/ConnectionSharedMemory.cpp
    lldb/trunk/source/Core/ConstString.cpp
    lldb/trunk/source/Core/CxaDemangle.cpp
    lldb/trunk/source/Core/DataBufferHeap.cpp
    lldb/trunk/source/Core/DataBufferMemoryMap.cpp
    lldb/trunk/source/Core/DataEncoder.cpp
    lldb/trunk/source/Core/DataExtractor.cpp
    lldb/trunk/source/Core/Debugger.cpp
    lldb/trunk/source/Core/Disassembler.cpp
    lldb/trunk/source/Core/DynamicLoader.cpp
    lldb/trunk/source/Core/EmulateInstruction.cpp
    lldb/trunk/source/Core/Error.cpp
    lldb/trunk/source/Core/Event.cpp
    lldb/trunk/source/Core/FastDemangle.cpp
    lldb/trunk/source/Core/FileLineResolver.cpp
    lldb/trunk/source/Core/FileSpecList.cpp
    lldb/trunk/source/Core/FormatEntity.cpp
    lldb/trunk/source/Core/History.cpp
    lldb/trunk/source/Core/IOHandler.cpp
    lldb/trunk/source/Core/Listener.cpp
    lldb/trunk/source/Core/Log.cpp
    lldb/trunk/source/Core/Logging.cpp
    lldb/trunk/source/Core/Mangled.cpp
    lldb/trunk/source/Core/Module.cpp
    lldb/trunk/source/Core/ModuleChild.cpp
    lldb/trunk/source/Core/ModuleList.cpp
    lldb/trunk/source/Core/Opcode.cpp
    lldb/trunk/source/Core/PluginManager.cpp
    lldb/trunk/source/Core/RegisterValue.cpp
    lldb/trunk/source/Core/RegularExpression.cpp
    lldb/trunk/source/Core/Scalar.cpp
    lldb/trunk/source/Core/SearchFilter.cpp
    lldb/trunk/source/Core/Section.cpp
    lldb/trunk/source/Core/SourceManager.cpp
    lldb/trunk/source/Core/State.cpp
    lldb/trunk/source/Core/Stream.cpp
    lldb/trunk/source/Core/StreamAsynchronousIO.cpp
    lldb/trunk/source/Core/StreamCallback.cpp
    lldb/trunk/source/Core/StreamFile.cpp
    lldb/trunk/source/Core/StreamGDBRemote.cpp
    lldb/trunk/source/Core/StreamString.cpp
    lldb/trunk/source/Core/StringList.cpp
    lldb/trunk/source/Core/StructuredData.cpp
    lldb/trunk/source/Core/Timer.cpp
    lldb/trunk/source/Core/UUID.cpp
    lldb/trunk/source/Core/UserID.cpp
    lldb/trunk/source/Core/UserSettingsController.cpp
    lldb/trunk/source/Core/VMRange.cpp
    lldb/trunk/source/Core/Value.cpp
    lldb/trunk/source/Core/ValueObject.cpp
    lldb/trunk/source/Core/ValueObjectCast.cpp
    lldb/trunk/source/Core/ValueObjectChild.cpp
    lldb/trunk/source/Core/ValueObjectConstResult.cpp
    lldb/trunk/source/Core/ValueObjectConstResultCast.cpp
    lldb/trunk/source/Core/ValueObjectConstResultChild.cpp
    lldb/trunk/source/Core/ValueObjectConstResultImpl.cpp
    lldb/trunk/source/Core/ValueObjectDynamicValue.cpp
    lldb/trunk/source/Core/ValueObjectList.cpp
    lldb/trunk/source/Core/ValueObjectMemory.cpp
    lldb/trunk/source/Core/ValueObjectRegister.cpp
    lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp
    lldb/trunk/source/Core/ValueObjectVariable.cpp
    lldb/trunk/source/DataFormatters/CXXFunctionPointer.cpp
    lldb/trunk/source/DataFormatters/DataVisualization.cpp
    lldb/trunk/source/DataFormatters/DumpValueObjectOptions.cpp
    lldb/trunk/source/DataFormatters/FormatCache.cpp
    lldb/trunk/source/DataFormatters/FormatClasses.cpp
    lldb/trunk/source/DataFormatters/FormatManager.cpp
    lldb/trunk/source/DataFormatters/FormattersHelpers.cpp
    lldb/trunk/source/DataFormatters/LanguageCategory.cpp
    lldb/trunk/source/DataFormatters/StringPrinter.cpp
    lldb/trunk/source/DataFormatters/TypeCategory.cpp
    lldb/trunk/source/DataFormatters/TypeCategoryMap.cpp
    lldb/trunk/source/DataFormatters/TypeFormat.cpp
    lldb/trunk/source/DataFormatters/TypeSummary.cpp
    lldb/trunk/source/DataFormatters/TypeSynthetic.cpp
    lldb/trunk/source/DataFormatters/TypeValidator.cpp
    lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp
    lldb/trunk/source/DataFormatters/VectorType.cpp
    lldb/trunk/source/Expression/DWARFExpression.cpp
    lldb/trunk/source/Expression/DiagnosticManager.cpp
    lldb/trunk/source/Expression/Expression.cpp
    lldb/trunk/source/Expression/ExpressionSourceCode.cpp
    lldb/trunk/source/Expression/ExpressionVariable.cpp
    lldb/trunk/source/Expression/FunctionCaller.cpp
    lldb/trunk/source/Expression/IRDynamicChecks.cpp
    lldb/trunk/source/Expression/IRExecutionUnit.cpp
    lldb/trunk/source/Expression/IRInterpreter.cpp
    lldb/trunk/source/Expression/IRMemoryMap.cpp
    lldb/trunk/source/Expression/LLVMUserExpression.cpp
    lldb/trunk/source/Expression/Materializer.cpp
    lldb/trunk/source/Expression/REPL.cpp
    lldb/trunk/source/Expression/UserExpression.cpp
    lldb/trunk/source/Expression/UtilityFunction.cpp
    lldb/trunk/source/Host/android/HostInfoAndroid.cpp
    lldb/trunk/source/Host/android/LibcGlue.cpp
    lldb/trunk/source/Host/common/Editline.cpp
    lldb/trunk/source/Host/common/File.cpp
    lldb/trunk/source/Host/common/FileCache.cpp
    lldb/trunk/source/Host/common/FileSpec.cpp
    lldb/trunk/source/Host/common/FileSystem.cpp
    lldb/trunk/source/Host/common/GetOptInc.cpp
    lldb/trunk/source/Host/common/Host.cpp
    lldb/trunk/source/Host/common/HostInfoBase.cpp
    lldb/trunk/source/Host/common/HostNativeThreadBase.cpp
    lldb/trunk/source/Host/common/HostProcess.cpp
    lldb/trunk/source/Host/common/HostThread.cpp
    lldb/trunk/source/Host/common/LockFileBase.cpp
    lldb/trunk/source/Host/common/MonitoringProcessLauncher.cpp
    lldb/trunk/source/Host/common/NativeBreakpoint.cpp
    lldb/trunk/source/Host/common/NativeBreakpointList.cpp
    lldb/trunk/source/Host/common/NativeProcessProtocol.cpp
    lldb/trunk/source/Host/common/NativeRegisterContext.cpp
    lldb/trunk/source/Host/common/NativeRegisterContextRegisterInfo.cpp
    lldb/trunk/source/Host/common/NativeThreadProtocol.cpp
    lldb/trunk/source/Host/common/NativeWatchpointList.cpp
    lldb/trunk/source/Host/common/OptionParser.cpp
    lldb/trunk/source/Host/common/PipeBase.cpp
    lldb/trunk/source/Host/common/ProcessRunLock.cpp
    lldb/trunk/source/Host/common/Socket.cpp
    lldb/trunk/source/Host/common/SocketAddress.cpp
    lldb/trunk/source/Host/common/SoftwareBreakpoint.cpp
    lldb/trunk/source/Host/common/StringConvert.cpp
    lldb/trunk/source/Host/common/Symbols.cpp
    lldb/trunk/source/Host/common/TCPSocket.cpp
    lldb/trunk/source/Host/common/Terminal.cpp
    lldb/trunk/source/Host/common/ThisThread.cpp
    lldb/trunk/source/Host/common/ThreadLauncher.cpp
    lldb/trunk/source/Host/common/TimeValue.cpp
    lldb/trunk/source/Host/common/UDPSocket.cpp
    lldb/trunk/source/Host/common/XML.cpp
    lldb/trunk/source/Host/freebsd/Host.cpp
    lldb/trunk/source/Host/freebsd/HostInfoFreeBSD.cpp
    lldb/trunk/source/Host/freebsd/HostThreadFreeBSD.cpp
    lldb/trunk/source/Host/freebsd/ThisThread.cpp
    lldb/trunk/source/Host/linux/AbstractSocket.cpp
    lldb/trunk/source/Host/linux/Host.cpp
    lldb/trunk/source/Host/linux/HostInfoLinux.cpp
    lldb/trunk/source/Host/linux/HostThreadLinux.cpp
    lldb/trunk/source/Host/linux/LibcGlue.cpp
    lldb/trunk/source/Host/linux/ProcessLauncherLinux.cpp
    lldb/trunk/source/Host/linux/ThisThread.cpp
    lldb/trunk/source/Host/macosx/Host.mm
    lldb/trunk/source/Host/macosx/HostInfoMacOSX.mm
    lldb/trunk/source/Host/macosx/HostThreadMacOSX.mm
    lldb/trunk/source/Host/macosx/Symbols.cpp
    lldb/trunk/source/Host/macosx/ThisThread.cpp
    lldb/trunk/source/Host/macosx/cfcpp/CFCBundle.cpp
    lldb/trunk/source/Host/macosx/cfcpp/CFCBundle.h
    lldb/trunk/source/Host/macosx/cfcpp/CFCData.cpp
    lldb/trunk/source/Host/macosx/cfcpp/CFCData.h
    lldb/trunk/source/Host/macosx/cfcpp/CFCMutableArray.cpp
    lldb/trunk/source/Host/macosx/cfcpp/CFCMutableArray.h
    lldb/trunk/source/Host/macosx/cfcpp/CFCMutableDictionary.cpp
    lldb/trunk/source/Host/macosx/cfcpp/CFCMutableDictionary.h
    lldb/trunk/source/Host/macosx/cfcpp/CFCMutableSet.cpp
    lldb/trunk/source/Host/macosx/cfcpp/CFCMutableSet.h
    lldb/trunk/source/Host/macosx/cfcpp/CFCReleaser.h
    lldb/trunk/source/Host/macosx/cfcpp/CFCString.cpp
    lldb/trunk/source/Host/macosx/cfcpp/CFCString.h
    lldb/trunk/source/Host/macosx/cfcpp/CoreFoundationCPP.h
    lldb/trunk/source/Host/netbsd/Host.cpp
    lldb/trunk/source/Host/netbsd/HostInfoNetBSD.cpp
    lldb/trunk/source/Host/netbsd/HostThreadNetBSD.cpp
    lldb/trunk/source/Host/netbsd/ThisThread.cpp
    lldb/trunk/source/Host/posix/ConnectionFileDescriptorPosix.cpp
    lldb/trunk/source/Host/posix/DomainSocket.cpp
    lldb/trunk/source/Host/posix/FileSystem.cpp
    lldb/trunk/source/Host/posix/HostInfoPosix.cpp
    lldb/trunk/source/Host/posix/HostProcessPosix.cpp
    lldb/trunk/source/Host/posix/HostThreadPosix.cpp
    lldb/trunk/source/Host/posix/LockFilePosix.cpp
    lldb/trunk/source/Host/posix/MainLoopPosix.cpp
    lldb/trunk/source/Host/posix/PipePosix.cpp
    lldb/trunk/source/Host/posix/ProcessLauncherPosix.cpp
    lldb/trunk/source/Host/windows/ConnectionGenericFileWindows.cpp
    lldb/trunk/source/Host/windows/EditLineWin.cpp
    lldb/trunk/source/Host/windows/FileSystem.cpp
    lldb/trunk/source/Host/windows/Host.cpp
    lldb/trunk/source/Host/windows/HostInfoWindows.cpp
    lldb/trunk/source/Host/windows/HostProcessWindows.cpp
    lldb/trunk/source/Host/windows/HostThreadWindows.cpp
    lldb/trunk/source/Host/windows/LockFileWindows.cpp
    lldb/trunk/source/Host/windows/PipeWindows.cpp
    lldb/trunk/source/Host/windows/ProcessLauncherWindows.cpp
    lldb/trunk/source/Host/windows/ProcessRunLock.cpp
    lldb/trunk/source/Host/windows/ThisThread.cpp
    lldb/trunk/source/Host/windows/Windows.cpp
    lldb/trunk/source/Initialization/SystemInitializer.cpp
    lldb/trunk/source/Initialization/SystemInitializerCommon.cpp
    lldb/trunk/source/Initialization/SystemLifetimeManager.cpp
    lldb/trunk/source/Interpreter/Args.cpp
    lldb/trunk/source/Interpreter/CommandAlias.cpp
    lldb/trunk/source/Interpreter/CommandHistory.cpp
    lldb/trunk/source/Interpreter/CommandInterpreter.cpp
    lldb/trunk/source/Interpreter/CommandObject.cpp
    lldb/trunk/source/Interpreter/CommandObjectRegexCommand.cpp
    lldb/trunk/source/Interpreter/CommandObjectScript.cpp
    lldb/trunk/source/Interpreter/CommandObjectScript.h
    lldb/trunk/source/Interpreter/CommandOptionValidators.cpp
    lldb/trunk/source/Interpreter/CommandReturnObject.cpp
    lldb/trunk/source/Interpreter/OptionGroupArchitecture.cpp
    lldb/trunk/source/Interpreter/OptionGroupBoolean.cpp
    lldb/trunk/source/Interpreter/OptionGroupFile.cpp
    lldb/trunk/source/Interpreter/OptionGroupFormat.cpp
    lldb/trunk/source/Interpreter/OptionGroupOutputFile.cpp
    lldb/trunk/source/Interpreter/OptionGroupPlatform.cpp
    lldb/trunk/source/Interpreter/OptionGroupString.cpp
    lldb/trunk/source/Interpreter/OptionGroupUInt64.cpp
    lldb/trunk/source/Interpreter/OptionGroupUUID.cpp
    lldb/trunk/source/Interpreter/OptionGroupValueObjectDisplay.cpp
    lldb/trunk/source/Interpreter/OptionGroupVariable.cpp
    lldb/trunk/source/Interpreter/OptionGroupWatchpoint.cpp
    lldb/trunk/source/Interpreter/OptionValue.cpp
    lldb/trunk/source/Interpreter/OptionValueArch.cpp
    lldb/trunk/source/Interpreter/OptionValueArgs.cpp
    lldb/trunk/source/Interpreter/OptionValueArray.cpp
    lldb/trunk/source/Interpreter/OptionValueBoolean.cpp
    lldb/trunk/source/Interpreter/OptionValueChar.cpp
    lldb/trunk/source/Interpreter/OptionValueDictionary.cpp
    lldb/trunk/source/Interpreter/OptionValueEnumeration.cpp
    lldb/trunk/source/Interpreter/OptionValueFileSpec.cpp
    lldb/trunk/source/Interpreter/OptionValueFileSpecLIst.cpp
    lldb/trunk/source/Interpreter/OptionValueFormat.cpp
    lldb/trunk/source/Interpreter/OptionValueFormatEntity.cpp
    lldb/trunk/source/Interpreter/OptionValueLanguage.cpp
    lldb/trunk/source/Interpreter/OptionValuePathMappings.cpp
    lldb/trunk/source/Interpreter/OptionValueProperties.cpp
    lldb/trunk/source/Interpreter/OptionValueRegex.cpp
    lldb/trunk/source/Interpreter/OptionValueSInt64.cpp
    lldb/trunk/source/Interpreter/OptionValueString.cpp
    lldb/trunk/source/Interpreter/OptionValueUInt64.cpp
    lldb/trunk/source/Interpreter/OptionValueUUID.cpp
    lldb/trunk/source/Interpreter/Options.cpp
    lldb/trunk/source/Interpreter/Property.cpp
    lldb/trunk/source/Interpreter/ScriptInterpreter.cpp
    lldb/trunk/source/Interpreter/embedded_interpreter.py
    lldb/trunk/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp
    lldb/trunk/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.h
    lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp
    lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.h
    lldb/trunk/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp
    lldb/trunk/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.h
    lldb/trunk/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp
    lldb/trunk/source/Plugins/ABI/SysV-arm/ABISysV_arm.h
    lldb/trunk/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp
    lldb/trunk/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.h
    lldb/trunk/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp
    lldb/trunk/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.h
    lldb/trunk/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp
    lldb/trunk/source/Plugins/ABI/SysV-i386/ABISysV_i386.h
    lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp
    lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.h
    lldb/trunk/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp
    lldb/trunk/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.h
    lldb/trunk/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp
    lldb/trunk/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.h
    lldb/trunk/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp
    lldb/trunk/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.h
    lldb/trunk/source/Plugins/ABI/SysV-s390x/ABISysV_s390x.cpp
    lldb/trunk/source/Plugins/ABI/SysV-s390x/ABISysV_s390x.h
    lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp
    lldb/trunk/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.h
    lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
    lldb/trunk/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h
    lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
    lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h
    lldb/trunk/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp
    lldb/trunk/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.h
    lldb/trunk/source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.cpp
    lldb/trunk/source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.h
    lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
    lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.h
    lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp
    lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.h
    lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
    lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h
    lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.cpp
    lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.h
    lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
    lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.h
    lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
    lldb/trunk/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h
    lldb/trunk/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp
    lldb/trunk/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.h
    lldb/trunk/source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.cpp
    lldb/trunk/source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.h
    lldb/trunk/source/Plugins/ExpressionParser/Clang/ASTDumper.cpp
    lldb/trunk/source/Plugins/ExpressionParser/Clang/ASTDumper.h
    lldb/trunk/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp
    lldb/trunk/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.h
    lldb/trunk/source/Plugins/ExpressionParser/Clang/ASTStructExtractor.cpp
    lldb/trunk/source/Plugins/ExpressionParser/Clang/ASTStructExtractor.h
    lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
    lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangASTSource.h
    lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangDiagnostic.h
    lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
    lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h
    lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionHelper.h
    lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
    lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h
    lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.cpp
    lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.h
    lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.cpp
    lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.h
    lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp
    lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.h
    lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp
    lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h
    lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
    lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h
    lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp
    lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.h
    lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp
    lldb/trunk/source/Plugins/ExpressionParser/Clang/IRForTarget.h
    lldb/trunk/source/Plugins/ExpressionParser/Go/GoAST.h
    lldb/trunk/source/Plugins/ExpressionParser/Go/GoLexer.cpp
    lldb/trunk/source/Plugins/ExpressionParser/Go/GoLexer.h
    lldb/trunk/source/Plugins/ExpressionParser/Go/GoParser.cpp
    lldb/trunk/source/Plugins/ExpressionParser/Go/GoParser.h
    lldb/trunk/source/Plugins/ExpressionParser/Go/GoUserExpression.cpp
    lldb/trunk/source/Plugins/ExpressionParser/Go/GoUserExpression.h
    lldb/trunk/source/Plugins/ExpressionParser/Go/gen_go_ast.py
    lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
    lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.h
    lldb/trunk/source/Plugins/Instruction/ARM/EmulationStateARM.cpp
    lldb/trunk/source/Plugins/Instruction/ARM/EmulationStateARM.h
    lldb/trunk/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp
    lldb/trunk/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.h
    lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp
    lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h
    lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp
    lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h
    lldb/trunk/source/Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.cpp
    lldb/trunk/source/Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.h
    lldb/trunk/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp
    lldb/trunk/source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.h
    lldb/trunk/source/Plugins/JITLoader/GDB/JITLoaderGDB.cpp
    lldb/trunk/source/Plugins/JITLoader/GDB/JITLoaderGDB.h
    lldb/trunk/source/Plugins/Language/CPlusPlus/BlockPointer.cpp
    lldb/trunk/source/Plugins/Language/CPlusPlus/BlockPointer.h
    lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
    lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h
    lldb/trunk/source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp
    lldb/trunk/source/Plugins/Language/CPlusPlus/CxxStringTypes.h
    lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxx.cpp
    lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxx.h
    lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxAtomic.cpp
    lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxAtomic.h
    lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxInitializerList.cpp
    lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxList.cpp
    lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp
    lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxUnorderedMap.cpp
    lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxVector.cpp
    lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcpp.cpp
    lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcpp.h
    lldb/trunk/source/Plugins/Language/Go/GoFormatterFunctions.cpp
    lldb/trunk/source/Plugins/Language/Go/GoFormatterFunctions.h
    lldb/trunk/source/Plugins/Language/Go/GoLanguage.cpp
    lldb/trunk/source/Plugins/Language/Go/GoLanguage.h
    lldb/trunk/source/Plugins/Language/Java/JavaFormatterFunctions.cpp
    lldb/trunk/source/Plugins/Language/Java/JavaFormatterFunctions.h
    lldb/trunk/source/Plugins/Language/Java/JavaLanguage.cpp
    lldb/trunk/source/Plugins/Language/Java/JavaLanguage.h
    lldb/trunk/source/Plugins/Language/OCaml/OCamlLanguage.cpp
    lldb/trunk/source/Plugins/Language/OCaml/OCamlLanguage.h
    lldb/trunk/source/Plugins/Language/ObjC/CF.cpp
    lldb/trunk/source/Plugins/Language/ObjC/CF.h
    lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp
    lldb/trunk/source/Plugins/Language/ObjC/Cocoa.h
    lldb/trunk/source/Plugins/Language/ObjC/CoreMedia.cpp
    lldb/trunk/source/Plugins/Language/ObjC/CoreMedia.h
    lldb/trunk/source/Plugins/Language/ObjC/NSArray.cpp
    lldb/trunk/source/Plugins/Language/ObjC/NSDictionary.cpp
    lldb/trunk/source/Plugins/Language/ObjC/NSDictionary.h
    lldb/trunk/source/Plugins/Language/ObjC/NSError.cpp
    lldb/trunk/source/Plugins/Language/ObjC/NSException.cpp
    lldb/trunk/source/Plugins/Language/ObjC/NSIndexPath.cpp
    lldb/trunk/source/Plugins/Language/ObjC/NSSet.cpp
    lldb/trunk/source/Plugins/Language/ObjC/NSSet.h
    lldb/trunk/source/Plugins/Language/ObjC/NSString.cpp
    lldb/trunk/source/Plugins/Language/ObjC/NSString.h
    lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.cpp
    lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.h
    lldb/trunk/source/Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.cpp
    lldb/trunk/source/Plugins/Language/ObjCPlusPlus/ObjCPlusPlusLanguage.h
    lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
    lldb/trunk/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h
    lldb/trunk/source/Plugins/LanguageRuntime/Go/GoLanguageRuntime.cpp
    lldb/trunk/source/Plugins/LanguageRuntime/Go/GoLanguageRuntime.h
    lldb/trunk/source/Plugins/LanguageRuntime/Java/JavaLanguageRuntime.cpp
    lldb/trunk/source/Plugins/LanguageRuntime/Java/JavaLanguageRuntime.h
    lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp
    lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.h
    lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp
    lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.h
    lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
    lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h
    lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp
    lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h
    lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
    lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h
    lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
    lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.h
    lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp
    lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.h
    lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp
    lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.h
    lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp
    lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.h
    lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
    lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h
    lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp
    lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.h
    lldb/trunk/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp
    lldb/trunk/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.h
    lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
    lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h
    lldb/trunk/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp
    lldb/trunk/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.h
    lldb/trunk/source/Plugins/ObjectFile/ELF/ELFHeader.cpp
    lldb/trunk/source/Plugins/ObjectFile/ELF/ELFHeader.h
    lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
    lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
    lldb/trunk/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp
    lldb/trunk/source/Plugins/ObjectFile/JIT/ObjectFileJIT.h
    lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
    lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h
    lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
    lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h
    lldb/trunk/source/Plugins/ObjectFile/PECOFF/WindowsMiniDump.cpp
    lldb/trunk/source/Plugins/ObjectFile/PECOFF/WindowsMiniDump.h
    lldb/trunk/source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp
    lldb/trunk/source/Plugins/OperatingSystem/Go/OperatingSystemGo.h
    lldb/trunk/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp
    lldb/trunk/source/Plugins/OperatingSystem/Python/OperatingSystemPython.h
    lldb/trunk/source/Plugins/Platform/Android/AdbClient.cpp
    lldb/trunk/source/Plugins/Platform/Android/AdbClient.h
    lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.cpp
    lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.h
    lldb/trunk/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp
    lldb/trunk/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.h
    lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
    lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.h
    lldb/trunk/source/Plugins/Platform/Kalimba/PlatformKalimba.cpp
    lldb/trunk/source/Plugins/Platform/Kalimba/PlatformKalimba.h
    lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp
    lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.h
    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.cpp
    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.h
    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp
    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.h
    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp
    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.h
    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.h
    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h
    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.h
    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.cpp
    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.h
    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp
    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.h
    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp
    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.h
    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp
    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.h
    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformiOSSimulatorCoreSimulatorSupport.h
    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformiOSSimulatorCoreSimulatorSupport.mm
    lldb/trunk/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp
    lldb/trunk/source/Plugins/Platform/NetBSD/PlatformNetBSD.h
    lldb/trunk/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
    lldb/trunk/source/Plugins/Platform/POSIX/PlatformPOSIX.h
    lldb/trunk/source/Plugins/Platform/Windows/PlatformWindows.cpp
    lldb/trunk/source/Plugins/Platform/Windows/PlatformWindows.h
    lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
    lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h
    lldb/trunk/source/Plugins/Process/Darwin/CFBundle.cpp
    lldb/trunk/source/Plugins/Process/Darwin/CFBundle.h
    lldb/trunk/source/Plugins/Process/Darwin/CFString.cpp
    lldb/trunk/source/Plugins/Process/Darwin/CFString.h
    lldb/trunk/source/Plugins/Process/Darwin/CFUtils.h
    lldb/trunk/source/Plugins/Process/Darwin/DarwinProcessLauncher.cpp
    lldb/trunk/source/Plugins/Process/Darwin/DarwinProcessLauncher.h
    lldb/trunk/source/Plugins/Process/Darwin/LaunchFlavor.h
    lldb/trunk/source/Plugins/Process/Darwin/MachException.cpp
    lldb/trunk/source/Plugins/Process/Darwin/MachException.h
    lldb/trunk/source/Plugins/Process/Darwin/NativeProcessDarwin.cpp
    lldb/trunk/source/Plugins/Process/Darwin/NativeProcessDarwin.h
    lldb/trunk/source/Plugins/Process/Darwin/NativeThreadDarwin.cpp
    lldb/trunk/source/Plugins/Process/Darwin/NativeThreadDarwin.h
    lldb/trunk/source/Plugins/Process/Darwin/NativeThreadListDarwin.cpp
    lldb/trunk/source/Plugins/Process/Darwin/NativeThreadListDarwin.h
    lldb/trunk/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp
    lldb/trunk/source/Plugins/Process/FreeBSD/FreeBSDThread.h
    lldb/trunk/source/Plugins/Process/FreeBSD/POSIXStopInfo.cpp
    lldb/trunk/source/Plugins/Process/FreeBSD/POSIXStopInfo.h
    lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
    lldb/trunk/source/Plugins/Process/FreeBSD/ProcessFreeBSD.h
    lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp
    lldb/trunk/source/Plugins/Process/FreeBSD/ProcessMonitor.h
    lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIX.h
    lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm.cpp
    lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm.h
    lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm64.cpp
    lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm64.h
    lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_mips64.cpp
    lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_mips64.h
    lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_powerpc.cpp
    lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_powerpc.h
    lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.cpp
    lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.h
    lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
    lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.h
    lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux.cpp
    lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux.h
    lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp
    lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h
    lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
    lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h
    lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp
    lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.h
    lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp
    lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.h
    lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
    lldb/trunk/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.h
    lldb/trunk/source/Plugins/Process/Linux/NativeThreadLinux.cpp
    lldb/trunk/source/Plugins/Process/Linux/NativeThreadLinux.h
    lldb/trunk/source/Plugins/Process/Linux/ProcFileReader.cpp
    lldb/trunk/source/Plugins/Process/Linux/ProcFileReader.h
    lldb/trunk/source/Plugins/Process/Linux/Procfs.h
    lldb/trunk/source/Plugins/Process/Linux/SingleStepCheck.cpp
    lldb/trunk/source/Plugins/Process/Linux/SingleStepCheck.h
    lldb/trunk/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp
    lldb/trunk/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.h
    lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
    lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h
    lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDPLog.cpp
    lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDPLog.h
    lldb/trunk/source/Plugins/Process/MacOSX-Kernel/RegisterContextKDP_arm.cpp
    lldb/trunk/source/Plugins/Process/MacOSX-Kernel/RegisterContextKDP_arm.h
    lldb/trunk/source/Plugins/Process/MacOSX-Kernel/RegisterContextKDP_arm64.cpp
    lldb/trunk/source/Plugins/Process/MacOSX-Kernel/RegisterContextKDP_arm64.h
    lldb/trunk/source/Plugins/Process/MacOSX-Kernel/RegisterContextKDP_i386.cpp
    lldb/trunk/source/Plugins/Process/MacOSX-Kernel/RegisterContextKDP_i386.h
    lldb/trunk/source/Plugins/Process/MacOSX-Kernel/RegisterContextKDP_x86_64.cpp
    lldb/trunk/source/Plugins/Process/MacOSX-Kernel/RegisterContextKDP_x86_64.h
    lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp
    lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.h
    lldb/trunk/source/Plugins/Process/POSIX/CrashReason.cpp
    lldb/trunk/source/Plugins/Process/POSIX/CrashReason.h
    lldb/trunk/source/Plugins/Process/POSIX/ProcessMessage.cpp
    lldb/trunk/source/Plugins/Process/POSIX/ProcessMessage.h
    lldb/trunk/source/Plugins/Process/POSIX/ProcessPOSIXLog.cpp
    lldb/trunk/source/Plugins/Process/POSIX/ProcessPOSIXLog.h
    lldb/trunk/source/Plugins/Process/Utility/ARMDefines.h
    lldb/trunk/source/Plugins/Process/Utility/ARMUtils.h
    lldb/trunk/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
    lldb/trunk/source/Plugins/Process/Utility/DynamicRegisterInfo.h
    lldb/trunk/source/Plugins/Process/Utility/FreeBSDSignals.cpp
    lldb/trunk/source/Plugins/Process/Utility/FreeBSDSignals.h
    lldb/trunk/source/Plugins/Process/Utility/GDBRemoteSignals.cpp
    lldb/trunk/source/Plugins/Process/Utility/GDBRemoteSignals.h
    lldb/trunk/source/Plugins/Process/Utility/HistoryThread.cpp
    lldb/trunk/source/Plugins/Process/Utility/HistoryThread.h
    lldb/trunk/source/Plugins/Process/Utility/HistoryUnwind.cpp
    lldb/trunk/source/Plugins/Process/Utility/HistoryUnwind.h
    lldb/trunk/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp
    lldb/trunk/source/Plugins/Process/Utility/InferiorCallPOSIX.h
    lldb/trunk/source/Plugins/Process/Utility/InstructionUtils.h
    lldb/trunk/source/Plugins/Process/Utility/LinuxSignals.cpp
    lldb/trunk/source/Plugins/Process/Utility/LinuxSignals.h
    lldb/trunk/source/Plugins/Process/Utility/MipsLinuxSignals.cpp
    lldb/trunk/source/Plugins/Process/Utility/MipsLinuxSignals.h
    lldb/trunk/source/Plugins/Process/Utility/NetBSDSignals.cpp
    lldb/trunk/source/Plugins/Process/Utility/NetBSDSignals.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_i386.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextDummy.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextDummy.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextFreeBSD_arm.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextFreeBSD_arm.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextFreeBSD_arm64.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextFreeBSD_arm64.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextFreeBSD_i386.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextFreeBSD_i386.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextFreeBSD_mips64.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextFreeBSD_mips64.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextFreeBSD_powerpc.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextFreeBSD_powerpc.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextFreeBSD_x86_64.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextHistory.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextHistory.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextLLDB.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_arm.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_arm.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_arm64.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_arm64.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_i386.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_mips.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_mips.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_mips64.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_mips64.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_s390x.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_s390x.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_x86_64.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextLinux_x86_64.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_arm.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_arm.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_i386.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_i386.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_x86_64.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_x86_64.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextMemory.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextMemory.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextNetBSD_x86_64.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_arm.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_arm.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_arm64.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_arm64.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_mips64.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_mips64.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_s390x.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_s390x.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextThreadMemory.cpp
    lldb/trunk/source/Plugins/Process/Utility/RegisterContextThreadMemory.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterContext_mips.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterContext_powerpc.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterContext_s390x.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterContext_x86.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterInfoInterface.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterInfos_arm.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterInfos_arm64.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterInfos_i386.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterInfos_mips.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterInfos_mips64.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterInfos_powerpc.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterInfos_s390x.h
    lldb/trunk/source/Plugins/Process/Utility/RegisterInfos_x86_64.h
    lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.cpp
    lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.h
    lldb/trunk/source/Plugins/Process/Utility/ThreadMemory.cpp
    lldb/trunk/source/Plugins/Process/Utility/ThreadMemory.h
    lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.cpp
    lldb/trunk/source/Plugins/Process/Utility/UnwindLLDB.h
    lldb/trunk/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.cpp
    lldb/trunk/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.h
    lldb/trunk/source/Plugins/Process/Utility/lldb-arm-register-enums.h
    lldb/trunk/source/Plugins/Process/Utility/lldb-arm64-register-enums.h
    lldb/trunk/source/Plugins/Process/Utility/lldb-mips-freebsd-register-enums.h
    lldb/trunk/source/Plugins/Process/Utility/lldb-mips-linux-register-enums.h
    lldb/trunk/source/Plugins/Process/Utility/lldb-s390x-register-enums.h
    lldb/trunk/source/Plugins/Process/Utility/lldb-x86-register-enums.h
    lldb/trunk/source/Plugins/Process/Windows/Common/ExceptionRecord.h
    lldb/trunk/source/Plugins/Process/Windows/Common/NtStructures.h
    lldb/trunk/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
    lldb/trunk/source/Plugins/Process/Windows/Common/ProcessWindows.h
    lldb/trunk/source/Plugins/Process/Windows/Common/ProcessWindowsLog.cpp
    lldb/trunk/source/Plugins/Process/Windows/Common/ProcessWindowsLog.h
    lldb/trunk/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp
    lldb/trunk/source/Plugins/Process/Windows/Common/RegisterContextWindows.h
    lldb/trunk/source/Plugins/Process/Windows/Common/TargetThreadWindows.cpp
    lldb/trunk/source/Plugins/Process/Windows/Common/TargetThreadWindows.h
    lldb/trunk/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp
    lldb/trunk/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.h
    lldb/trunk/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.cpp
    lldb/trunk/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.h
    lldb/trunk/source/Plugins/Process/Windows/Live/DebuggerThread.cpp
    lldb/trunk/source/Plugins/Process/Windows/Live/DebuggerThread.h
    lldb/trunk/source/Plugins/Process/Windows/Live/ForwardDecl.h
    lldb/trunk/source/Plugins/Process/Windows/Live/IDebugDelegate.h
    lldb/trunk/source/Plugins/Process/Windows/Live/LocalDebugDelegate.cpp
    lldb/trunk/source/Plugins/Process/Windows/Live/LocalDebugDelegate.h
    lldb/trunk/source/Plugins/Process/Windows/Live/ProcessWindowsLive.cpp
    lldb/trunk/source/Plugins/Process/Windows/Live/ProcessWindowsLive.h
    lldb/trunk/source/Plugins/Process/Windows/Live/TargetThreadWindowsLive.cpp
    lldb/trunk/source/Plugins/Process/Windows/Live/TargetThreadWindowsLive.h
    lldb/trunk/source/Plugins/Process/Windows/Live/x64/RegisterContextWindowsLive_x64.cpp
    lldb/trunk/source/Plugins/Process/Windows/Live/x64/RegisterContextWindowsLive_x64.h
    lldb/trunk/source/Plugins/Process/Windows/Live/x86/RegisterContextWindowsLive_x86.cpp
    lldb/trunk/source/Plugins/Process/Windows/Live/x86/RegisterContextWindowsLive_x86.h
    lldb/trunk/source/Plugins/Process/Windows/MiniDump/ProcessWinMiniDump.cpp
    lldb/trunk/source/Plugins/Process/Windows/MiniDump/ProcessWinMiniDump.h
    lldb/trunk/source/Plugins/Process/Windows/MiniDump/ThreadWinMiniDump.cpp
    lldb/trunk/source/Plugins/Process/Windows/MiniDump/ThreadWinMiniDump.h
    lldb/trunk/source/Plugins/Process/Windows/MiniDump/x64/RegisterContextWindowsMiniDump_x64.cpp
    lldb/trunk/source/Plugins/Process/Windows/MiniDump/x64/RegisterContextWindowsMiniDump_x64.h
    lldb/trunk/source/Plugins/Process/Windows/MiniDump/x86/RegisterContextWindowsMiniDump_x86.cpp
    lldb/trunk/source/Plugins/Process/Windows/MiniDump/x86/RegisterContextWindowsMiniDump_x86.h
    lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.cpp
    lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.h
    lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm.cpp
    lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm.h
    lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm64.cpp
    lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_arm64.h
    lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_mips64.cpp
    lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_mips64.h
    lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_powerpc.cpp
    lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_powerpc.h
    lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_s390x.cpp
    lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_s390x.h
    lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_x86_64.cpp
    lldb/trunk/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_x86_64.h
    lldb/trunk/source/Plugins/Process/elf-core/ThreadElfCore.cpp
    lldb/trunk/source/Plugins/Process/elf-core/ThreadElfCore.h
    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp
    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.h
    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h
    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h
    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h
    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.h
    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h
    lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
    lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
    lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp
    lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.h
    lldb/trunk/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp
    lldb/trunk/source/Plugins/Process/gdb-remote/ThreadGDBRemote.h
    lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp
    lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.h
    lldb/trunk/source/Plugins/Process/mach-core/ThreadMachCore.cpp
    lldb/trunk/source/Plugins/Process/mach-core/ThreadMachCore.h
    lldb/trunk/source/Plugins/Process/minidump/MinidumpParser.cpp
    lldb/trunk/source/Plugins/Process/minidump/MinidumpParser.h
    lldb/trunk/source/Plugins/Process/minidump/MinidumpTypes.cpp
    lldb/trunk/source/Plugins/Process/minidump/MinidumpTypes.h
    lldb/trunk/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp
    lldb/trunk/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.h
    lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
    lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
    lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonExceptionState.cpp
    lldb/trunk/source/Plugins/ScriptInterpreter/Python/PythonExceptionState.h
    lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
    lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h
    lldb/trunk/source/Plugins/ScriptInterpreter/Python/lldb-python.h
    lldb/trunk/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp
    lldb/trunk/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DIERef.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DIERef.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParser.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserGo.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserGo.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserJava.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserJava.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserOCaml.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserOCaml.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFAttribute.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFAttribute.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIECollection.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIECollection.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfo.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfo.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugMacinfoEntry.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugMacro.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugMacro.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDefines.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDefines.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/LogChannelDWARF.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/LogChannelDWARF.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/NameToDIE.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
    lldb/trunk/source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.h
    lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
    lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.h
    lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
    lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h
    lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp
    lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h
    lldb/trunk/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
    lldb/trunk/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.h
    lldb/trunk/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp
    lldb/trunk/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.h
    lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp
    lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.h
    lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp
    lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.h
    lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp
    lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.h
    lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp
    lldb/trunk/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.h
    lldb/trunk/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp
    lldb/trunk/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.h
    lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
    lldb/trunk/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h
    lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp
    lldb/trunk/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.h
    lldb/trunk/source/Symbol/ArmUnwindInfo.cpp
    lldb/trunk/source/Symbol/Block.cpp
    lldb/trunk/source/Symbol/ClangASTContext.cpp
    lldb/trunk/source/Symbol/ClangASTImporter.cpp
    lldb/trunk/source/Symbol/ClangExternalASTSourceCallbacks.cpp
    lldb/trunk/source/Symbol/ClangExternalASTSourceCommon.cpp
    lldb/trunk/source/Symbol/ClangUtil.cpp
    lldb/trunk/source/Symbol/CompactUnwindInfo.cpp
    lldb/trunk/source/Symbol/CompileUnit.cpp
    lldb/trunk/source/Symbol/CompilerDecl.cpp
    lldb/trunk/source/Symbol/CompilerDeclContext.cpp
    lldb/trunk/source/Symbol/CompilerType.cpp
    lldb/trunk/source/Symbol/DWARFCallFrameInfo.cpp
    lldb/trunk/source/Symbol/DebugMacros.cpp
    lldb/trunk/source/Symbol/Declaration.cpp
    lldb/trunk/source/Symbol/FuncUnwinders.cpp
    lldb/trunk/source/Symbol/Function.cpp
    lldb/trunk/source/Symbol/GoASTContext.cpp
    lldb/trunk/source/Symbol/JavaASTContext.cpp
    lldb/trunk/source/Symbol/LineEntry.cpp
    lldb/trunk/source/Symbol/LineTable.cpp
    lldb/trunk/source/Symbol/OCamlASTContext.cpp
    lldb/trunk/source/Symbol/ObjectFile.cpp
    lldb/trunk/source/Symbol/Symbol.cpp
    lldb/trunk/source/Symbol/SymbolContext.cpp
    lldb/trunk/source/Symbol/SymbolFile.cpp
    lldb/trunk/source/Symbol/SymbolVendor.cpp
    lldb/trunk/source/Symbol/Symtab.cpp
    lldb/trunk/source/Symbol/Type.cpp
    lldb/trunk/source/Symbol/TypeList.cpp
    lldb/trunk/source/Symbol/TypeMap.cpp
    lldb/trunk/source/Symbol/TypeSystem.cpp
    lldb/trunk/source/Symbol/UnwindPlan.cpp
    lldb/trunk/source/Symbol/UnwindTable.cpp
    lldb/trunk/source/Symbol/Variable.cpp
    lldb/trunk/source/Symbol/VariableList.cpp
    lldb/trunk/source/Symbol/VerifyDecl.cpp
    lldb/trunk/source/Target/ABI.cpp
    lldb/trunk/source/Target/CPPLanguageRuntime.cpp
    lldb/trunk/source/Target/ExecutionContext.cpp
    lldb/trunk/source/Target/FileAction.cpp
    lldb/trunk/source/Target/InstrumentationRuntime.cpp
    lldb/trunk/source/Target/InstrumentationRuntimeStopInfo.cpp
    lldb/trunk/source/Target/JITLoader.cpp
    lldb/trunk/source/Target/JITLoaderList.cpp
    lldb/trunk/source/Target/Language.cpp
    lldb/trunk/source/Target/LanguageRuntime.cpp
    lldb/trunk/source/Target/Memory.cpp
    lldb/trunk/source/Target/MemoryHistory.cpp
    lldb/trunk/source/Target/ObjCLanguageRuntime.cpp
    lldb/trunk/source/Target/OperatingSystem.cpp
    lldb/trunk/source/Target/PathMappingList.cpp
    lldb/trunk/source/Target/Platform.cpp
    lldb/trunk/source/Target/Process.cpp
    lldb/trunk/source/Target/ProcessInfo.cpp
    lldb/trunk/source/Target/ProcessLaunchInfo.cpp
    lldb/trunk/source/Target/Queue.cpp
    lldb/trunk/source/Target/QueueItem.cpp
    lldb/trunk/source/Target/QueueList.cpp
    lldb/trunk/source/Target/RegisterContext.cpp
    lldb/trunk/source/Target/SectionLoadHistory.cpp
    lldb/trunk/source/Target/SectionLoadList.cpp
    lldb/trunk/source/Target/StackFrame.cpp
    lldb/trunk/source/Target/StackFrameList.cpp
    lldb/trunk/source/Target/StackID.cpp
    lldb/trunk/source/Target/StopInfo.cpp
    lldb/trunk/source/Target/StructuredDataPlugin.cpp
    lldb/trunk/source/Target/SystemRuntime.cpp
    lldb/trunk/source/Target/Target.cpp
    lldb/trunk/source/Target/TargetList.cpp
    lldb/trunk/source/Target/Thread.cpp
    lldb/trunk/source/Target/ThreadCollection.cpp
    lldb/trunk/source/Target/ThreadList.cpp
    lldb/trunk/source/Target/ThreadPlan.cpp
    lldb/trunk/source/Target/ThreadPlanBase.cpp
    lldb/trunk/source/Target/ThreadPlanCallFunction.cpp
    lldb/trunk/source/Target/ThreadPlanCallFunctionUsingABI.cpp
    lldb/trunk/source/Target/ThreadPlanCallOnFunctionExit.cpp
    lldb/trunk/source/Target/ThreadPlanCallUserExpression.cpp
    lldb/trunk/source/Target/ThreadPlanPython.cpp
    lldb/trunk/source/Target/ThreadPlanRunToAddress.cpp
    lldb/trunk/source/Target/ThreadPlanShouldStopHere.cpp
    lldb/trunk/source/Target/ThreadPlanStepInRange.cpp
    lldb/trunk/source/Target/ThreadPlanStepInstruction.cpp
    lldb/trunk/source/Target/ThreadPlanStepOut.cpp
    lldb/trunk/source/Target/ThreadPlanStepOverBreakpoint.cpp
    lldb/trunk/source/Target/ThreadPlanStepOverRange.cpp
    lldb/trunk/source/Target/ThreadPlanStepRange.cpp
    lldb/trunk/source/Target/ThreadPlanStepThrough.cpp
    lldb/trunk/source/Target/ThreadPlanStepUntil.cpp
    lldb/trunk/source/Target/ThreadPlanTracer.cpp
    lldb/trunk/source/Target/ThreadSpec.cpp
    lldb/trunk/source/Target/UnixSignals.cpp
    lldb/trunk/source/Target/UnwindAssembly.cpp
    lldb/trunk/source/Utility/ARM64_DWARF_Registers.cpp
    lldb/trunk/source/Utility/ARM64_DWARF_Registers.h
    lldb/trunk/source/Utility/ARM64_ehframe_Registers.h
    lldb/trunk/source/Utility/ARM_DWARF_Registers.cpp
    lldb/trunk/source/Utility/ARM_DWARF_Registers.h
    lldb/trunk/source/Utility/ARM_ehframe_Registers.h
    lldb/trunk/source/Utility/ConvertEnum.cpp
    lldb/trunk/source/Utility/JSON.cpp
    lldb/trunk/source/Utility/KQueue.cpp
    lldb/trunk/source/Utility/KQueue.h
    lldb/trunk/source/Utility/LLDBAssert.cpp
    lldb/trunk/source/Utility/ModuleCache.cpp
    lldb/trunk/source/Utility/ModuleCache.h
    lldb/trunk/source/Utility/NameMatches.cpp
    lldb/trunk/source/Utility/PseudoTerminal.cpp
    lldb/trunk/source/Utility/Range.cpp
    lldb/trunk/source/Utility/RegisterNumber.cpp
    lldb/trunk/source/Utility/SelectHelper.cpp
    lldb/trunk/source/Utility/SharingPtr.cpp
    lldb/trunk/source/Utility/StdStringExtractor.cpp
    lldb/trunk/source/Utility/StringExtractor.cpp
    lldb/trunk/source/Utility/StringExtractorGDBRemote.cpp
    lldb/trunk/source/Utility/StringExtractorGDBRemote.h
    lldb/trunk/source/Utility/StringLexer.cpp
    lldb/trunk/source/Utility/TaskPool.cpp
    lldb/trunk/source/Utility/TimeSpecTimeout.cpp
    lldb/trunk/source/Utility/TimeSpecTimeout.h
    lldb/trunk/source/Utility/UriParser.cpp
    lldb/trunk/source/Utility/UriParser.h
    lldb/trunk/source/lldb.cpp
    lldb/trunk/test/use_lldb_suite.py
    lldb/trunk/third_party/Python/module/pexpect-2.4/ANSI.py
    lldb/trunk/third_party/Python/module/pexpect-2.4/FSM.py
    lldb/trunk/third_party/Python/module/pexpect-2.4/examples/astat.py
    lldb/trunk/third_party/Python/module/pexpect-2.4/examples/bd_client.py
    lldb/trunk/third_party/Python/module/pexpect-2.4/examples/bd_serv.py
    lldb/trunk/third_party/Python/module/pexpect-2.4/examples/chess.py
    lldb/trunk/third_party/Python/module/pexpect-2.4/examples/chess2.py
    lldb/trunk/third_party/Python/module/pexpect-2.4/examples/chess3.py
    lldb/trunk/third_party/Python/module/pexpect-2.4/examples/df.py
    lldb/trunk/third_party/Python/module/pexpect-2.4/examples/fix_cvs_files.py
    lldb/trunk/third_party/Python/module/pexpect-2.4/examples/ftp.py
    lldb/trunk/third_party/Python/module/pexpect-2.4/examples/hive.py
    lldb/trunk/third_party/Python/module/pexpect-2.4/examples/monitor.py
    lldb/trunk/third_party/Python/module/pexpect-2.4/examples/passmass.py
    lldb/trunk/third_party/Python/module/pexpect-2.4/examples/python.py
    lldb/trunk/third_party/Python/module/pexpect-2.4/examples/rippy.py
    lldb/trunk/third_party/Python/module/pexpect-2.4/examples/script.py
    lldb/trunk/third_party/Python/module/pexpect-2.4/examples/ssh_session.py
    lldb/trunk/third_party/Python/module/pexpect-2.4/examples/ssh_tunnel.py
    lldb/trunk/third_party/Python/module/pexpect-2.4/examples/sshls.py
    lldb/trunk/third_party/Python/module/pexpect-2.4/examples/topip.py
    lldb/trunk/third_party/Python/module/pexpect-2.4/examples/uptime.py
    lldb/trunk/third_party/Python/module/pexpect-2.4/fdpexpect.py
    lldb/trunk/third_party/Python/module/pexpect-2.4/pexpect.py
    lldb/trunk/third_party/Python/module/pexpect-2.4/pxssh.py
    lldb/trunk/third_party/Python/module/pexpect-2.4/screen.py
    lldb/trunk/third_party/Python/module/pexpect-2.4/setup.py
    lldb/trunk/third_party/Python/module/progress/progress.py
    lldb/trunk/third_party/Python/module/six/six.py
    lldb/trunk/third_party/Python/module/unittest2/unittest2/__init__.py
    lldb/trunk/third_party/Python/module/unittest2/unittest2/case.py
    lldb/trunk/third_party/Python/module/unittest2/unittest2/collector.py
    lldb/trunk/third_party/Python/module/unittest2/unittest2/compatibility.py
    lldb/trunk/third_party/Python/module/unittest2/unittest2/loader.py
    lldb/trunk/third_party/Python/module/unittest2/unittest2/main.py
    lldb/trunk/third_party/Python/module/unittest2/unittest2/result.py
    lldb/trunk/third_party/Python/module/unittest2/unittest2/runner.py
    lldb/trunk/third_party/Python/module/unittest2/unittest2/signals.py
    lldb/trunk/third_party/Python/module/unittest2/unittest2/suite.py
    lldb/trunk/third_party/Python/module/unittest2/unittest2/test/__init__.py
    lldb/trunk/third_party/Python/module/unittest2/unittest2/test/support.py
    lldb/trunk/third_party/Python/module/unittest2/unittest2/test/test_assertions.py
    lldb/trunk/third_party/Python/module/unittest2/unittest2/test/test_break.py
    lldb/trunk/third_party/Python/module/unittest2/unittest2/test/test_case.py
    lldb/trunk/third_party/Python/module/unittest2/unittest2/test/test_discovery.py
    lldb/trunk/third_party/Python/module/unittest2/unittest2/test/test_functiontestcase.py
    lldb/trunk/third_party/Python/module/unittest2/unittest2/test/test_loader.py
    lldb/trunk/third_party/Python/module/unittest2/unittest2/test/test_new_tests.py
    lldb/trunk/third_party/Python/module/unittest2/unittest2/test/test_program.py
    lldb/trunk/third_party/Python/module/unittest2/unittest2/test/test_result.py
    lldb/trunk/third_party/Python/module/unittest2/unittest2/test/test_runner.py
    lldb/trunk/third_party/Python/module/unittest2/unittest2/test/test_setups.py
    lldb/trunk/third_party/Python/module/unittest2/unittest2/test/test_skipping.py
    lldb/trunk/third_party/Python/module/unittest2/unittest2/test/test_suite.py
    lldb/trunk/third_party/Python/module/unittest2/unittest2/test/test_unittest2_with.py
    lldb/trunk/third_party/Python/module/unittest2/unittest2/util.py
    lldb/trunk/tools/argdumper/argdumper.cpp
    lldb/trunk/tools/compact-unwind/compact-unwind-dumper.c
    lldb/trunk/tools/darwin-debug/darwin-debug.cpp
    lldb/trunk/tools/darwin-threads/examine-threads.c
    lldb/trunk/tools/debugserver/source/ARM_DWARF_Registers.h
    lldb/trunk/tools/debugserver/source/ARM_ehframe_Registers.h
    lldb/trunk/tools/debugserver/source/DNB.cpp
    lldb/trunk/tools/debugserver/source/DNB.h
    lldb/trunk/tools/debugserver/source/DNBArch.cpp
    lldb/trunk/tools/debugserver/source/DNBArch.h
    lldb/trunk/tools/debugserver/source/DNBBreakpoint.cpp
    lldb/trunk/tools/debugserver/source/DNBBreakpoint.h
    lldb/trunk/tools/debugserver/source/DNBDataRef.cpp
    lldb/trunk/tools/debugserver/source/DNBDataRef.h
    lldb/trunk/tools/debugserver/source/DNBDefs.h
    lldb/trunk/tools/debugserver/source/DNBError.cpp
    lldb/trunk/tools/debugserver/source/DNBError.h
    lldb/trunk/tools/debugserver/source/DNBLog.cpp
    lldb/trunk/tools/debugserver/source/DNBLog.h
    lldb/trunk/tools/debugserver/source/DNBRegisterInfo.cpp
    lldb/trunk/tools/debugserver/source/DNBRegisterInfo.h
    lldb/trunk/tools/debugserver/source/DNBRuntimeAction.h
    lldb/trunk/tools/debugserver/source/DNBThreadResumeActions.cpp
    lldb/trunk/tools/debugserver/source/DNBThreadResumeActions.h
    lldb/trunk/tools/debugserver/source/DNBTimer.h
    lldb/trunk/tools/debugserver/source/JSON.cpp
    lldb/trunk/tools/debugserver/source/JSON.h
    lldb/trunk/tools/debugserver/source/JSONGenerator.h
    lldb/trunk/tools/debugserver/source/MacOSX/CFBundle.cpp
    lldb/trunk/tools/debugserver/source/MacOSX/CFBundle.h
    lldb/trunk/tools/debugserver/source/MacOSX/CFString.cpp
    lldb/trunk/tools/debugserver/source/MacOSX/CFString.h
    lldb/trunk/tools/debugserver/source/MacOSX/CFUtils.h
    lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/ActivityStore.cpp
    lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/ActivityStore.h
    lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/ActivityStreamSPI.h
    lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/DarwinLogCollector.cpp
    lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/DarwinLogCollector.h
    lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/DarwinLogTypes.h
    lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/LogFilter.cpp
    lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/LogFilter.h
    lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/LogFilterChain.cpp
    lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/LogFilterChain.h
    lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/LogFilterExactMatch.cpp
    lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/LogFilterExactMatch.h
    lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/LogFilterRegex.cpp
    lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/LogFilterRegex.h
    lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/LogMessage.cpp
    lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/LogMessage.h
    lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/LogMessageOsLog.cpp
    lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/LogMessageOsLog.h
    lldb/trunk/tools/debugserver/source/MacOSX/Genealogy.cpp
    lldb/trunk/tools/debugserver/source/MacOSX/Genealogy.h
    lldb/trunk/tools/debugserver/source/MacOSX/GenealogySPI.h
    lldb/trunk/tools/debugserver/source/MacOSX/HasAVX.h
    lldb/trunk/tools/debugserver/source/MacOSX/MachException.cpp
    lldb/trunk/tools/debugserver/source/MacOSX/MachException.h
    lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.h
    lldb/trunk/tools/debugserver/source/MacOSX/MachProcess.mm
    lldb/trunk/tools/debugserver/source/MacOSX/MachTask.h
    lldb/trunk/tools/debugserver/source/MacOSX/MachTask.mm
    lldb/trunk/tools/debugserver/source/MacOSX/MachThread.cpp
    lldb/trunk/tools/debugserver/source/MacOSX/MachThread.h
    lldb/trunk/tools/debugserver/source/MacOSX/MachThreadList.cpp
    lldb/trunk/tools/debugserver/source/MacOSX/MachThreadList.h
    lldb/trunk/tools/debugserver/source/MacOSX/MachVMMemory.cpp
    lldb/trunk/tools/debugserver/source/MacOSX/MachVMMemory.h
    lldb/trunk/tools/debugserver/source/MacOSX/MachVMRegion.cpp
    lldb/trunk/tools/debugserver/source/MacOSX/MachVMRegion.h
    lldb/trunk/tools/debugserver/source/MacOSX/OsLogger.cpp
    lldb/trunk/tools/debugserver/source/MacOSX/OsLogger.h
    lldb/trunk/tools/debugserver/source/MacOSX/ThreadInfo.h
    lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp
    lldb/trunk/tools/debugserver/source/MacOSX/arm/DNBArchImpl.h
    lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp
    lldb/trunk/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.h
    lldb/trunk/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp
    lldb/trunk/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.h
    lldb/trunk/tools/debugserver/source/MacOSX/i386/MachRegisterStatesI386.h
    lldb/trunk/tools/debugserver/source/MacOSX/ppc/DNBArchImpl.cpp
    lldb/trunk/tools/debugserver/source/MacOSX/ppc/DNBArchImpl.h
    lldb/trunk/tools/debugserver/source/MacOSX/stack_logging.h
    lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp
    lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.h
    lldb/trunk/tools/debugserver/source/MacOSX/x86_64/MachRegisterStatesX86_64.h
    lldb/trunk/tools/debugserver/source/PThreadCondition.h
    lldb/trunk/tools/debugserver/source/PThreadEvent.cpp
    lldb/trunk/tools/debugserver/source/PThreadEvent.h
    lldb/trunk/tools/debugserver/source/PThreadMutex.cpp
    lldb/trunk/tools/debugserver/source/PThreadMutex.h
    lldb/trunk/tools/debugserver/source/PseudoTerminal.cpp
    lldb/trunk/tools/debugserver/source/PseudoTerminal.h
    lldb/trunk/tools/debugserver/source/RNBContext.cpp
    lldb/trunk/tools/debugserver/source/RNBContext.h
    lldb/trunk/tools/debugserver/source/RNBDefs.h
    lldb/trunk/tools/debugserver/source/RNBRemote.cpp
    lldb/trunk/tools/debugserver/source/RNBRemote.h
    lldb/trunk/tools/debugserver/source/RNBServices.cpp
    lldb/trunk/tools/debugserver/source/RNBServices.h
    lldb/trunk/tools/debugserver/source/RNBSocket.cpp
    lldb/trunk/tools/debugserver/source/RNBSocket.h
    lldb/trunk/tools/debugserver/source/SysSignal.cpp
    lldb/trunk/tools/debugserver/source/SysSignal.h
    lldb/trunk/tools/debugserver/source/TTYState.cpp
    lldb/trunk/tools/debugserver/source/TTYState.h
    lldb/trunk/tools/debugserver/source/debugserver.cpp
    lldb/trunk/tools/debugserver/source/libdebugserver.cpp
    lldb/trunk/tools/driver/Driver.cpp
    lldb/trunk/tools/driver/Driver.h
    lldb/trunk/tools/driver/Platform.cpp
    lldb/trunk/tools/driver/Platform.h
    lldb/trunk/tools/lldb-mi/MICmdArgContext.cpp
    lldb/trunk/tools/lldb-mi/MICmdArgContext.h
    lldb/trunk/tools/lldb-mi/MICmdArgSet.cpp
    lldb/trunk/tools/lldb-mi/MICmdArgSet.h
    lldb/trunk/tools/lldb-mi/MICmdArgValBase.cpp
    lldb/trunk/tools/lldb-mi/MICmdArgValBase.h
    lldb/trunk/tools/lldb-mi/MICmdArgValConsume.cpp
    lldb/trunk/tools/lldb-mi/MICmdArgValConsume.h
    lldb/trunk/tools/lldb-mi/MICmdArgValFile.cpp
    lldb/trunk/tools/lldb-mi/MICmdArgValFile.h
    lldb/trunk/tools/lldb-mi/MICmdArgValListBase.cpp
    lldb/trunk/tools/lldb-mi/MICmdArgValListBase.h
    lldb/trunk/tools/lldb-mi/MICmdArgValListOfN.cpp
    lldb/trunk/tools/lldb-mi/MICmdArgValListOfN.h
    lldb/trunk/tools/lldb-mi/MICmdArgValNumber.cpp
    lldb/trunk/tools/lldb-mi/MICmdArgValNumber.h
    lldb/trunk/tools/lldb-mi/MICmdArgValOptionLong.cpp
    lldb/trunk/tools/lldb-mi/MICmdArgValOptionLong.h
    lldb/trunk/tools/lldb-mi/MICmdArgValOptionShort.cpp
    lldb/trunk/tools/lldb-mi/MICmdArgValOptionShort.h
    lldb/trunk/tools/lldb-mi/MICmdArgValPrintValues.cpp
    lldb/trunk/tools/lldb-mi/MICmdArgValPrintValues.h
    lldb/trunk/tools/lldb-mi/MICmdArgValString.cpp
    lldb/trunk/tools/lldb-mi/MICmdArgValString.h
    lldb/trunk/tools/lldb-mi/MICmdArgValThreadGrp.cpp
    lldb/trunk/tools/lldb-mi/MICmdArgValThreadGrp.h
    lldb/trunk/tools/lldb-mi/MICmdBase.cpp
    lldb/trunk/tools/lldb-mi/MICmdBase.h
    lldb/trunk/tools/lldb-mi/MICmdCmd.cpp
    lldb/trunk/tools/lldb-mi/MICmdCmd.h
    lldb/trunk/tools/lldb-mi/MICmdCmdBreak.cpp
    lldb/trunk/tools/lldb-mi/MICmdCmdBreak.h
    lldb/trunk/tools/lldb-mi/MICmdCmdData.cpp
    lldb/trunk/tools/lldb-mi/MICmdCmdData.h
    lldb/trunk/tools/lldb-mi/MICmdCmdEnviro.cpp
    lldb/trunk/tools/lldb-mi/MICmdCmdEnviro.h
    lldb/trunk/tools/lldb-mi/MICmdCmdExec.cpp
    lldb/trunk/tools/lldb-mi/MICmdCmdExec.h
    lldb/trunk/tools/lldb-mi/MICmdCmdFile.cpp
    lldb/trunk/tools/lldb-mi/MICmdCmdFile.h
    lldb/trunk/tools/lldb-mi/MICmdCmdGdbInfo.cpp
    lldb/trunk/tools/lldb-mi/MICmdCmdGdbInfo.h
    lldb/trunk/tools/lldb-mi/MICmdCmdGdbSet.cpp
    lldb/trunk/tools/lldb-mi/MICmdCmdGdbSet.h
    lldb/trunk/tools/lldb-mi/MICmdCmdGdbShow.cpp
    lldb/trunk/tools/lldb-mi/MICmdCmdGdbShow.h
    lldb/trunk/tools/lldb-mi/MICmdCmdGdbThread.cpp
    lldb/trunk/tools/lldb-mi/MICmdCmdGdbThread.h
    lldb/trunk/tools/lldb-mi/MICmdCmdMiscellanous.cpp
    lldb/trunk/tools/lldb-mi/MICmdCmdMiscellanous.h
    lldb/trunk/tools/lldb-mi/MICmdCmdStack.cpp
    lldb/trunk/tools/lldb-mi/MICmdCmdStack.h
    lldb/trunk/tools/lldb-mi/MICmdCmdSupportInfo.cpp
    lldb/trunk/tools/lldb-mi/MICmdCmdSupportInfo.h
    lldb/trunk/tools/lldb-mi/MICmdCmdSupportList.cpp
    lldb/trunk/tools/lldb-mi/MICmdCmdSupportList.h
    lldb/trunk/tools/lldb-mi/MICmdCmdSymbol.cpp
    lldb/trunk/tools/lldb-mi/MICmdCmdSymbol.h
    lldb/trunk/tools/lldb-mi/MICmdCmdTarget.cpp
    lldb/trunk/tools/lldb-mi/MICmdCmdTarget.h
    lldb/trunk/tools/lldb-mi/MICmdCmdThread.cpp
    lldb/trunk/tools/lldb-mi/MICmdCmdThread.h
    lldb/trunk/tools/lldb-mi/MICmdCmdTrace.cpp
    lldb/trunk/tools/lldb-mi/MICmdCmdTrace.h
    lldb/trunk/tools/lldb-mi/MICmdCmdVar.cpp
    lldb/trunk/tools/lldb-mi/MICmdCmdVar.h
    lldb/trunk/tools/lldb-mi/MICmdCommands.cpp
    lldb/trunk/tools/lldb-mi/MICmdCommands.h
    lldb/trunk/tools/lldb-mi/MICmdData.h
    lldb/trunk/tools/lldb-mi/MICmdFactory.cpp
    lldb/trunk/tools/lldb-mi/MICmdFactory.h
    lldb/trunk/tools/lldb-mi/MICmdInterpreter.cpp
    lldb/trunk/tools/lldb-mi/MICmdInterpreter.h
    lldb/trunk/tools/lldb-mi/MICmdInvoker.cpp
    lldb/trunk/tools/lldb-mi/MICmdInvoker.h
    lldb/trunk/tools/lldb-mi/MICmdMgr.cpp
    lldb/trunk/tools/lldb-mi/MICmdMgr.h
    lldb/trunk/tools/lldb-mi/MICmdMgrSetCmdDeleteCallback.cpp
    lldb/trunk/tools/lldb-mi/MICmdMgrSetCmdDeleteCallback.h
    lldb/trunk/tools/lldb-mi/MICmnBase.cpp
    lldb/trunk/tools/lldb-mi/MICmnBase.h
    lldb/trunk/tools/lldb-mi/MICmnConfig.h
    lldb/trunk/tools/lldb-mi/MICmnLLDBBroadcaster.cpp
    lldb/trunk/tools/lldb-mi/MICmnLLDBBroadcaster.h
    lldb/trunk/tools/lldb-mi/MICmnLLDBDebugSessionInfo.cpp
    lldb/trunk/tools/lldb-mi/MICmnLLDBDebugSessionInfo.h
    lldb/trunk/tools/lldb-mi/MICmnLLDBDebugSessionInfoVarObj.cpp
    lldb/trunk/tools/lldb-mi/MICmnLLDBDebugSessionInfoVarObj.h
    lldb/trunk/tools/lldb-mi/MICmnLLDBDebugger.cpp
    lldb/trunk/tools/lldb-mi/MICmnLLDBDebugger.h
    lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp
    lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.h
    lldb/trunk/tools/lldb-mi/MICmnLLDBProxySBValue.cpp
    lldb/trunk/tools/lldb-mi/MICmnLLDBProxySBValue.h
    lldb/trunk/tools/lldb-mi/MICmnLLDBUtilSBValue.cpp
    lldb/trunk/tools/lldb-mi/MICmnLLDBUtilSBValue.h
    lldb/trunk/tools/lldb-mi/MICmnLog.cpp
    lldb/trunk/tools/lldb-mi/MICmnLog.h
    lldb/trunk/tools/lldb-mi/MICmnLogMediumFile.cpp
    lldb/trunk/tools/lldb-mi/MICmnLogMediumFile.h
    lldb/trunk/tools/lldb-mi/MICmnMIOutOfBandRecord.cpp
    lldb/trunk/tools/lldb-mi/MICmnMIOutOfBandRecord.h
    lldb/trunk/tools/lldb-mi/MICmnMIResultRecord.cpp
    lldb/trunk/tools/lldb-mi/MICmnMIResultRecord.h
    lldb/trunk/tools/lldb-mi/MICmnMIValue.cpp
    lldb/trunk/tools/lldb-mi/MICmnMIValue.h
    lldb/trunk/tools/lldb-mi/MICmnMIValueConst.cpp
    lldb/trunk/tools/lldb-mi/MICmnMIValueConst.h
    lldb/trunk/tools/lldb-mi/MICmnMIValueList.cpp
    lldb/trunk/tools/lldb-mi/MICmnMIValueList.h
    lldb/trunk/tools/lldb-mi/MICmnMIValueResult.cpp
    lldb/trunk/tools/lldb-mi/MICmnMIValueResult.h
    lldb/trunk/tools/lldb-mi/MICmnMIValueTuple.cpp
    lldb/trunk/tools/lldb-mi/MICmnMIValueTuple.h
    lldb/trunk/tools/lldb-mi/MICmnResources.cpp
    lldb/trunk/tools/lldb-mi/MICmnResources.h
    lldb/trunk/tools/lldb-mi/MICmnStreamStderr.cpp
    lldb/trunk/tools/lldb-mi/MICmnStreamStderr.h
    lldb/trunk/tools/lldb-mi/MICmnStreamStdin.cpp
    lldb/trunk/tools/lldb-mi/MICmnStreamStdin.h
    lldb/trunk/tools/lldb-mi/MICmnStreamStdout.cpp
    lldb/trunk/tools/lldb-mi/MICmnStreamStdout.h
    lldb/trunk/tools/lldb-mi/MICmnThreadMgrStd.cpp
    lldb/trunk/tools/lldb-mi/MICmnThreadMgrStd.h
    lldb/trunk/tools/lldb-mi/MIDataTypes.h
    lldb/trunk/tools/lldb-mi/MIDriver.cpp
    lldb/trunk/tools/lldb-mi/MIDriver.h
    lldb/trunk/tools/lldb-mi/MIDriverBase.cpp
    lldb/trunk/tools/lldb-mi/MIDriverBase.h
    lldb/trunk/tools/lldb-mi/MIDriverMain.cpp
    lldb/trunk/tools/lldb-mi/MIDriverMgr.cpp
    lldb/trunk/tools/lldb-mi/MIDriverMgr.h
    lldb/trunk/tools/lldb-mi/MIUtilDateTimeStd.cpp
    lldb/trunk/tools/lldb-mi/MIUtilDateTimeStd.h
    lldb/trunk/tools/lldb-mi/MIUtilDebug.cpp
    lldb/trunk/tools/lldb-mi/MIUtilDebug.h
    lldb/trunk/tools/lldb-mi/MIUtilFileStd.cpp
    lldb/trunk/tools/lldb-mi/MIUtilFileStd.h
    lldb/trunk/tools/lldb-mi/MIUtilMapIdToVariant.cpp
    lldb/trunk/tools/lldb-mi/MIUtilMapIdToVariant.h
    lldb/trunk/tools/lldb-mi/MIUtilParse.cpp
    lldb/trunk/tools/lldb-mi/MIUtilParse.h
    lldb/trunk/tools/lldb-mi/MIUtilSingletonBase.h
    lldb/trunk/tools/lldb-mi/MIUtilSingletonHelper.h
    lldb/trunk/tools/lldb-mi/MIUtilString.cpp
    lldb/trunk/tools/lldb-mi/MIUtilString.h
    lldb/trunk/tools/lldb-mi/MIUtilThreadBaseStd.cpp
    lldb/trunk/tools/lldb-mi/MIUtilThreadBaseStd.h
    lldb/trunk/tools/lldb-mi/MIUtilVariant.cpp
    lldb/trunk/tools/lldb-mi/MIUtilVariant.h
    lldb/trunk/tools/lldb-mi/Platform.h
    lldb/trunk/tools/lldb-perf/common/clang/lldb_perf_clang.cpp
    lldb/trunk/tools/lldb-perf/common/clang/main.cpp
    lldb/trunk/tools/lldb-perf/common/stepping/lldb-perf-stepping.cpp
    lldb/trunk/tools/lldb-perf/common/stepping/stepping-testcase.cpp
    lldb/trunk/tools/lldb-perf/darwin/formatters/fmts_tester.mm
    lldb/trunk/tools/lldb-perf/darwin/formatters/formatters.cpp
    lldb/trunk/tools/lldb-perf/darwin/sketch/sketch.cpp
    lldb/trunk/tools/lldb-perf/lib/Gauge.cpp
    lldb/trunk/tools/lldb-perf/lib/Gauge.h
    lldb/trunk/tools/lldb-perf/lib/Measurement.h
    lldb/trunk/tools/lldb-perf/lib/MemoryGauge.cpp
    lldb/trunk/tools/lldb-perf/lib/MemoryGauge.h
    lldb/trunk/tools/lldb-perf/lib/Metric.cpp
    lldb/trunk/tools/lldb-perf/lib/Metric.h
    lldb/trunk/tools/lldb-perf/lib/Results.cpp
    lldb/trunk/tools/lldb-perf/lib/Results.h
    lldb/trunk/tools/lldb-perf/lib/TestCase.cpp
    lldb/trunk/tools/lldb-perf/lib/TestCase.h
    lldb/trunk/tools/lldb-perf/lib/Timer.cpp
    lldb/trunk/tools/lldb-perf/lib/Timer.h
    lldb/trunk/tools/lldb-perf/lib/Xcode.cpp
    lldb/trunk/tools/lldb-perf/lib/Xcode.h
    lldb/trunk/tools/lldb-server/Acceptor.cpp
    lldb/trunk/tools/lldb-server/Acceptor.h
    lldb/trunk/tools/lldb-server/LLDBServerUtilities.cpp
    lldb/trunk/tools/lldb-server/LLDBServerUtilities.h
    lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp
    lldb/trunk/tools/lldb-server/lldb-platform.cpp
    lldb/trunk/tools/lldb-server/lldb-server.cpp
    lldb/trunk/unittests/Core/BroadcasterTest.cpp
    lldb/trunk/unittests/Core/DataExtractorTest.cpp
    lldb/trunk/unittests/Core/ScalarTest.cpp
    lldb/trunk/unittests/Editline/EditlineTest.cpp
    lldb/trunk/unittests/Expression/GoParserTest.cpp
    lldb/trunk/unittests/Host/FileSpecTest.cpp
    lldb/trunk/unittests/Host/SocketAddressTest.cpp
    lldb/trunk/unittests/Host/SocketTest.cpp
    lldb/trunk/unittests/Host/SymbolsTest.cpp
    lldb/trunk/unittests/Interpreter/TestArgs.cpp
    lldb/trunk/unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp
    lldb/trunk/unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp
    lldb/trunk/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
    lldb/trunk/unittests/Process/gdb-remote/GDBRemoteTestUtils.cpp
    lldb/trunk/unittests/Process/gdb-remote/GDBRemoteTestUtils.h
    lldb/trunk/unittests/Process/minidump/Inputs/linux-x86_64.cpp
    lldb/trunk/unittests/Process/minidump/MinidumpParserTest.cpp
    lldb/trunk/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp
    lldb/trunk/unittests/ScriptInterpreter/Python/PythonExceptionStateTests.cpp
    lldb/trunk/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp
    lldb/trunk/unittests/ScriptInterpreter/Python/PythonTestSuite.h
    lldb/trunk/unittests/Symbol/TestClangASTContext.cpp
    lldb/trunk/unittests/SymbolFile/PDB/Inputs/test-dwarf.cpp
    lldb/trunk/unittests/SymbolFile/PDB/Inputs/test-pdb-alt.cpp
    lldb/trunk/unittests/SymbolFile/PDB/Inputs/test-pdb-nested.h
    lldb/trunk/unittests/SymbolFile/PDB/Inputs/test-pdb-types.cpp
    lldb/trunk/unittests/SymbolFile/PDB/Inputs/test-pdb.cpp
    lldb/trunk/unittests/SymbolFile/PDB/Inputs/test-pdb.h
    lldb/trunk/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp
    lldb/trunk/unittests/Utility/Inputs/TestModule.c
    lldb/trunk/unittests/Utility/ModuleCacheTest.cpp
    lldb/trunk/unittests/Utility/StringExtractorTest.cpp
    lldb/trunk/unittests/Utility/TaskPoolTest.cpp
    lldb/trunk/unittests/Utility/UriParserTest.cpp
    lldb/trunk/unittests/gtest_common.h
    lldb/trunk/use_lldb_suite_root.py
    lldb/trunk/utils/git-svn/convert.py
    lldb/trunk/utils/lui/breakwin.py
    lldb/trunk/utils/lui/commandwin.py
    lldb/trunk/utils/lui/cui.py
    lldb/trunk/utils/lui/debuggerdriver.py
    lldb/trunk/utils/lui/eventwin.py
    lldb/trunk/utils/lui/lldbutil.py
    lldb/trunk/utils/lui/lui.py
    lldb/trunk/utils/lui/sandbox.py
    lldb/trunk/utils/lui/sourcewin.py
    lldb/trunk/utils/lui/statuswin.py
    lldb/trunk/utils/misc/grep-svn-log.py
    lldb/trunk/utils/sync-source/lib/transfer/protocol.py
    lldb/trunk/utils/sync-source/lib/transfer/rsync.py
    lldb/trunk/utils/sync-source/lib/transfer/transfer_spec.py
    lldb/trunk/utils/sync-source/syncsource.py
    lldb/trunk/utils/test/disasm.py
    lldb/trunk/utils/test/lldb-disasm.py
    lldb/trunk/utils/test/llvm-mc-shell.py
    lldb/trunk/utils/test/main.c
    lldb/trunk/utils/test/ras.py
    lldb/trunk/utils/test/run-dis.py
    lldb/trunk/utils/test/run-until-faulted.py
    lldb/trunk/utils/vim-lldb/python-vim-lldb/import_lldb.py
    lldb/trunk/utils/vim-lldb/python-vim-lldb/lldb_controller.py
    lldb/trunk/utils/vim-lldb/python-vim-lldb/plugin.py
    lldb/trunk/utils/vim-lldb/python-vim-lldb/vim_panes.py
    lldb/trunk/utils/vim-lldb/python-vim-lldb/vim_signs.py
    lldb/trunk/utils/vim-lldb/python-vim-lldb/vim_ui.py

Modified: lldb/trunk/examples/customization/bin-utils/binutils.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/customization/bin-utils/binutils.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/examples/customization/bin-utils/binutils.py (original)
+++ lldb/trunk/examples/customization/bin-utils/binutils.py Tue Sep  6 15:57:50 2016
@@ -2,6 +2,7 @@
 
 import StringIO
 
+
 def binary(n, width=None):
     """
     Return a list of (0|1)'s for the binary representation of n where n >= 0.
@@ -12,7 +13,7 @@ def binary(n, width=None):
     if width and width <= 0:
         width = None
     while n > 0:
-        l.append(1 if n&1 else 0)
+        l.append(1 if n & 1 else 0)
         n = n >> 1
 
     if width:
@@ -22,14 +23,15 @@ def binary(n, width=None):
     l.reverse()
     return l
 
+
 def twos_complement(n, width):
     """
     Return a list of (0|1)'s for the binary representation of a width-bit two's
     complement numeral system of an integer n which may be negative.
     """
-    val = 2**(width-1)
+    val = 2**(width - 1)
     if n >= 0:
-        if n > (val-1):
+        if n > (val - 1):
             return None
         # It is safe to represent n with width-bits.
         return binary(n, width)
@@ -38,7 +40,7 @@ def twos_complement(n, width):
         if abs(n) > val:
             return None
         # It is safe to represent n (a negative int) with width-bits.
-        return binary(val*2 - abs(n))
+        return binary(val * 2 - abs(n))
 
 # print binary(0xABCD)
 # [1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1]
@@ -53,12 +55,13 @@ def twos_complement(n, width):
 # print twos_complement(-5, 64)
 # [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1]
 
+
 def positions(width):
     """Helper function returning a list describing the bit positions.
     Bit positions greater than 99 are truncated to 2 digits, for example,
     100 -> 00 and 127 -> 27."""
     return ['{0:2}'.format(i)[-2:] for i in reversed(range(width))]
-    
+
 
 def utob(debugger, command_line, result, dict):
     """Convert the unsigned integer to print its binary representation.
@@ -88,9 +91,10 @@ def utob(debugger, command_line, result,
         return
     if verbose and width > 0:
         pos = positions(width)
-        print ' '+' '.join(pos)
+        print ' ' + ' '.join(pos)
     print ' %s' % str(bits)
 
+
 def itob(debugger, command_line, result, dict):
     """Convert the integer to print its two's complement representation.
     args[0] (mandatory) is the integer to be converted
@@ -117,6 +121,5 @@ def itob(debugger, command_line, result,
         return
     if verbose and width > 0:
         pos = positions(width)
-        print ' '+' '.join(pos)
+        print ' ' + ' '.join(pos)
     print ' %s' % str(bits)
-

Modified: lldb/trunk/examples/customization/import-python/importcmd.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/customization/import-python/importcmd.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/examples/customization/import-python/importcmd.py (original)
+++ lldb/trunk/examples/customization/import-python/importcmd.py Tue Sep  6 15:57:50 2016
@@ -1,31 +1,38 @@
-import sys,os,lldb
+import sys
+import os
+import lldb
+
+
 def check_has_dir_in_path(dirname):
-	return sys.path.__contains__(dirname);
+    return sys.path.__contains__(dirname)
+
 
 def ensure_has_dir_in_path(dirname):
-	dirname = os.path.abspath(dirname)
-	if not (check_has_dir_in_path(dirname)):
-		sys.path.append(dirname);	
-
-def do_import(debugger,modname):
-	if (len(modname) > 4 and modname[-4:] == '.pyc'):
-		modname = modname[:-4]
-	if (len(modname) > 3 and modname[-3:] == '.py'):
-		modname = modname[:-3]
-	debugger.HandleCommand("script import " + modname)
+    dirname = os.path.abspath(dirname)
+    if not (check_has_dir_in_path(dirname)):
+        sys.path.append(dirname)
+
+
+def do_import(debugger, modname):
+    if (len(modname) > 4 and modname[-4:] == '.pyc'):
+        modname = modname[:-4]
+    if (len(modname) > 3 and modname[-3:] == '.py'):
+        modname = modname[:-3]
+    debugger.HandleCommand("script import " + modname)
+
 
 def pyimport_cmd(debugger, args, result, dict):
-	"""Import a Python module given its full path"""
-	print 'WARNING: obsolete feature - use native command "command script import"'
-	if args == "":
-		return "no module path given";
-	if not (os.sep in args):
-		modname = args
-		ensure_has_dir_in_path('.')
-	else:
-		endofdir = args.rfind(os.sep)
-		modname = args[endofdir+1:]
-		args = args[0:endofdir]
-		ensure_has_dir_in_path(args)
-	do_import(debugger,modname)
-	return None
+    """Import a Python module given its full path"""
+    print 'WARNING: obsolete feature - use native command "command script import"'
+    if args == "":
+        return "no module path given"
+    if not (os.sep in args):
+        modname = args
+        ensure_has_dir_in_path('.')
+    else:
+        endofdir = args.rfind(os.sep)
+        modname = args[endofdir + 1:]
+        args = args[0:endofdir]
+        ensure_has_dir_in_path(args)
+    do_import(debugger, modname)
+    return None

Modified: lldb/trunk/examples/customization/pwd-cd-and-system/utils.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/customization/pwd-cd-and-system/utils.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/examples/customization/pwd-cd-and-system/utils.py (original)
+++ lldb/trunk/examples/customization/pwd-cd-and-system/utils.py Tue Sep  6 15:57:50 2016
@@ -1,8 +1,12 @@
 """Utility for changing directories and execution of commands in a subshell."""
 
-import os, shlex, subprocess
+import os
+import shlex
+import subprocess
 
 # Store the previous working directory for the 'cd -' command.
+
+
 class Holder:
     """Holds the _prev_dir_ class attribute for chdir() function."""
     _prev_dir_ = None
@@ -15,6 +19,7 @@ class Holder:
     def swap(cls, dir):
         cls._prev_dir_ = dir
 
+
 def chdir(debugger, args, result, dict):
     """Change the working directory, or cd to ${HOME}.
     You can also issue 'cd -' to change to the previous working directory."""
@@ -33,10 +38,14 @@ def chdir(debugger, args, result, dict):
     os.chdir(new_dir)
     print "Current working directory: %s" % os.getcwd()
 
+
 def system(debugger, command_line, result, dict):
     """Execute the command (a string) in a subshell."""
     args = shlex.split(command_line)
-    process = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+    process = subprocess.Popen(
+        args,
+        stdout=subprocess.PIPE,
+        stderr=subprocess.PIPE)
     output, error = process.communicate()
     retcode = process.poll()
     if output and error:

Modified: lldb/trunk/examples/darwin/heap_find/heap.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/darwin/heap_find/heap.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/examples/darwin/heap_find/heap.py (original)
+++ lldb/trunk/examples/darwin/heap_find/heap.py Tue Sep  6 15:57:50 2016
@@ -23,7 +23,12 @@ import lldb.utils.symbolication
 g_libheap_dylib_dir = None
 g_libheap_dylib_dict = dict()
 
-def get_iterate_memory_expr(options, process, user_init_code, user_return_code):
+
+def get_iterate_memory_expr(
+        options,
+        process,
+        user_init_code,
+        user_return_code):
     expr = '''
 typedef unsigned natural_t;
 typedef uintptr_t vm_size_t;
@@ -32,7 +37,7 @@ typedef natural_t task_t;
 typedef int kern_return_t;
 #define KERN_SUCCESS 0
 typedef void (*range_callback_t)(task_t task, void *baton, unsigned type, uintptr_t ptr_addr, uintptr_t ptr_size);
-''';
+'''
     if options.search_vm_regions:
         expr += '''
 typedef int vm_prot_t;
@@ -65,11 +70,11 @@ typedef struct vm_region_submap_short_in
     boolean_t is_submap;	// submap vs obj
     vm_behavior_t behavior;	// access behavior hint
     vm32_object_id_t object_id;	// obj/map name, not a handle
-    unsigned short user_wired_count; 
+    unsigned short user_wired_count;
 } vm_region_submap_short_info_data_64_t;
-#define VM_REGION_SUBMAP_SHORT_INFO_COUNT_64 ((mach_msg_type_number_t)(sizeof(vm_region_submap_short_info_data_64_t)/sizeof(int)))''';
+#define VM_REGION_SUBMAP_SHORT_INFO_COUNT_64 ((mach_msg_type_number_t)(sizeof(vm_region_submap_short_info_data_64_t)/sizeof(int)))'''
         if user_init_code:
-            expr += user_init_code;
+            expr += user_init_code
         expr += '''
 task_t task = (task_t)mach_task_self();
 mach_vm_address_t vm_region_base_addr;
@@ -88,24 +93,24 @@ for (vm_region_base_addr = 0, vm_region_
                                                  &vm_region_info_size);
     if (err)
         break;
-    // Check all read + write regions. This will cover the thread stacks 
+    // Check all read + write regions. This will cover the thread stacks
     // and any regions of memory like __DATA segments, that might contain
     // data we are looking for
-    if (vm_region_info.protection & VM_PROT_WRITE && 
+    if (vm_region_info.protection & VM_PROT_WRITE &&
         vm_region_info.protection & VM_PROT_READ)
     {
-        baton.callback (task, 
-                        &baton, 
-                        64, 
-                        vm_region_base_addr, 
+        baton.callback (task,
+                        &baton,
+                        64,
+                        vm_region_base_addr,
                         vm_region_size);
     }
 }'''
     else:
         if options.search_stack:
-            expr += get_thread_stack_ranges_struct (process)
+            expr += get_thread_stack_ranges_struct(process)
         if options.search_segments:
-            expr += get_sections_ranges_struct (process)
+            expr += get_sections_ranges_struct(process)
         if user_init_code:
             expr += user_init_code
         if options.search_heap:
@@ -137,11 +142,11 @@ if (KERN_SUCCESS == err)
     {
         const malloc_zone_t *zone = (const malloc_zone_t *)zones[i];
         if (zone && zone->introspect)
-            zone->introspect->enumerator (task, 
-                                          &baton, 
-                                          MALLOC_PTR_IN_USE_RANGE_TYPE, 
-                                          (vm_address_t)zone, 
-                                          task_peek, 
+            zone->introspect->enumerator (task,
+                                          &baton,
+                                          MALLOC_PTR_IN_USE_RANGE_TYPE,
+                                          (vm_address_t)zone,
+                                          task_peek,
                                           [] (task_t task, void *baton, unsigned type, vm_range_t *ranges, unsigned size) -> void
                                           {
                                               range_callback_t callback = ((callback_baton_t *)baton)->callback;
@@ -149,7 +154,7 @@ if (KERN_SUCCESS == err)
                                               {
                                                   callback (task, baton, type, ranges[i].address, ranges[i].size);
                                               }
-                                          });    
+                                          });
     }
 }'''
 
@@ -164,7 +169,7 @@ for (uint32_t i=0; i<NUM_STACKS; ++i) {
     }
 }
 #endif'''
-    
+
         if options.search_segments:
             expr += '''
 #ifdef NUM_SEGMENTS
@@ -175,70 +180,184 @@ for (uint32_t i=0; i<NUM_SEGMENTS; ++i)
 
     if user_return_code:
         expr += "\n%s" % (user_return_code,)
-    
+
     return expr
 
+
 def get_member_types_for_offset(value_type, offset, member_list):
     member = value_type.GetFieldAtIndex(0)
     search_bases = False
     if member:
         if member.GetOffsetInBytes() <= offset:
-            for field_idx in range (value_type.GetNumberOfFields()):
+            for field_idx in range(value_type.GetNumberOfFields()):
                 member = value_type.GetFieldAtIndex(field_idx)
                 member_byte_offset = member.GetOffsetInBytes()
                 member_end_byte_offset = member_byte_offset + member.type.size
                 if member_byte_offset <= offset and offset < member_end_byte_offset:
                     member_list.append(member)
-                    get_member_types_for_offset (member.type, offset - member_byte_offset, member_list)
+                    get_member_types_for_offset(
+                        member.type, offset - member_byte_offset, member_list)
                     return
         else:
             search_bases = True
     else:
         search_bases = True
     if search_bases:
-        for field_idx in range (value_type.GetNumberOfDirectBaseClasses()):
+        for field_idx in range(value_type.GetNumberOfDirectBaseClasses()):
             member = value_type.GetDirectBaseClassAtIndex(field_idx)
             member_byte_offset = member.GetOffsetInBytes()
             member_end_byte_offset = member_byte_offset + member.type.size
             if member_byte_offset <= offset and offset < member_end_byte_offset:
                 member_list.append(member)
-                get_member_types_for_offset (member.type, offset - member_byte_offset, member_list)
+                get_member_types_for_offset(
+                    member.type, offset - member_byte_offset, member_list)
                 return
-        for field_idx in range (value_type.GetNumberOfVirtualBaseClasses()):
+        for field_idx in range(value_type.GetNumberOfVirtualBaseClasses()):
             member = value_type.GetVirtualBaseClassAtIndex(field_idx)
             member_byte_offset = member.GetOffsetInBytes()
             member_end_byte_offset = member_byte_offset + member.type.size
             if member_byte_offset <= offset and offset < member_end_byte_offset:
                 member_list.append(member)
-                get_member_types_for_offset (member.type, offset - member_byte_offset, member_list)
+                get_member_types_for_offset(
+                    member.type, offset - member_byte_offset, member_list)
                 return
 
+
 def append_regex_callback(option, opt, value, parser):
     try:
         ivar_regex = re.compile(value)
         parser.values.ivar_regex_blacklist.append(ivar_regex)
     except:
         print 'error: an exception was thrown when compiling the ivar regular expression for "%s"' % value
-    
+
+
 def add_common_options(parser):
-    parser.add_option('-v', '--verbose', action='store_true', dest='verbose', help='display verbose debug info', default=False)
-    parser.add_option('-t', '--type', action='store_true', dest='print_type', help='print the full value of the type for each matching malloc block', default=False)
-    parser.add_option('-o', '--po', action='store_true', dest='print_object_description', help='print the object descriptions for any matches', default=False)
-    parser.add_option('-z', '--size', action='store_true', dest='show_size', help='print the allocation size in bytes', default=False)
-    parser.add_option('-r', '--range', action='store_true', dest='show_range', help='print the allocation address range instead of just the allocation base address', default=False)
-    parser.add_option('-m', '--memory', action='store_true', dest='memory', help='dump the memory for each matching block', default=False)
-    parser.add_option('-f', '--format', type='string', dest='format', help='the format to use when dumping memory if --memory is specified', default=None)
-    parser.add_option('-I', '--omit-ivar-regex', type='string', action='callback', callback=append_regex_callback, dest='ivar_regex_blacklist', default=[], help='specify one or more regular expressions used to backlist any matches that are in ivars')
-    parser.add_option('-s', '--stack', action='store_true', dest='stack', help='gets the stack that allocated each malloc block if MallocStackLogging is enabled', default=False)
-    parser.add_option('-S', '--stack-history', action='store_true', dest='stack_history', help='gets the stack history for all allocations whose start address matches each malloc block if MallocStackLogging is enabled', default=False)
-    parser.add_option('-F', '--max-frames', type='int', dest='max_frames', help='the maximum number of stack frames to print when using the --stack or --stack-history options (default=128)', default=128)
-    parser.add_option('-H', '--max-history', type='int', dest='max_history', help='the maximum number of stack history backtraces to print for each allocation when using the --stack-history option (default=16)', default=16)
-    parser.add_option('-M', '--max-matches', type='int', dest='max_matches', help='the maximum number of matches to print', default=32)
-    parser.add_option('-O', '--offset', type='int', dest='offset', help='the matching data must be at this offset', default=-1)
-    parser.add_option('--ignore-stack', action='store_false', dest='search_stack', help="Don't search the stack when enumerating memory", default=True)
-    parser.add_option('--ignore-heap', action='store_false', dest='search_heap', help="Don't search the heap allocations when enumerating memory", default=True)
-    parser.add_option('--ignore-segments', action='store_false', dest='search_segments', help="Don't search readable executable segments enumerating memory", default=True)
-    parser.add_option('-V', '--vm-regions', action='store_true', dest='search_vm_regions', help='Check all VM regions instead of searching the heap, stack and segments', default=False)
+    parser.add_option(
+        '-v',
+        '--verbose',
+        action='store_true',
+        dest='verbose',
+        help='display verbose debug info',
+        default=False)
+    parser.add_option(
+        '-t',
+        '--type',
+        action='store_true',
+        dest='print_type',
+        help='print the full value of the type for each matching malloc block',
+        default=False)
+    parser.add_option(
+        '-o',
+        '--po',
+        action='store_true',
+        dest='print_object_description',
+        help='print the object descriptions for any matches',
+        default=False)
+    parser.add_option(
+        '-z',
+        '--size',
+        action='store_true',
+        dest='show_size',
+        help='print the allocation size in bytes',
+        default=False)
+    parser.add_option(
+        '-r',
+        '--range',
+        action='store_true',
+        dest='show_range',
+        help='print the allocation address range instead of just the allocation base address',
+        default=False)
+    parser.add_option(
+        '-m',
+        '--memory',
+        action='store_true',
+        dest='memory',
+        help='dump the memory for each matching block',
+        default=False)
+    parser.add_option(
+        '-f',
+        '--format',
+        type='string',
+        dest='format',
+        help='the format to use when dumping memory if --memory is specified',
+        default=None)
+    parser.add_option(
+        '-I',
+        '--omit-ivar-regex',
+        type='string',
+        action='callback',
+        callback=append_regex_callback,
+        dest='ivar_regex_blacklist',
+        default=[],
+        help='specify one or more regular expressions used to backlist any matches that are in ivars')
+    parser.add_option(
+        '-s',
+        '--stack',
+        action='store_true',
+        dest='stack',
+        help='gets the stack that allocated each malloc block if MallocStackLogging is enabled',
+        default=False)
+    parser.add_option(
+        '-S',
+        '--stack-history',
+        action='store_true',
+        dest='stack_history',
+        help='gets the stack history for all allocations whose start address matches each malloc block if MallocStackLogging is enabled',
+        default=False)
+    parser.add_option(
+        '-F',
+        '--max-frames',
+        type='int',
+        dest='max_frames',
+        help='the maximum number of stack frames to print when using the --stack or --stack-history options (default=128)',
+        default=128)
+    parser.add_option(
+        '-H',
+        '--max-history',
+        type='int',
+        dest='max_history',
+        help='the maximum number of stack history backtraces to print for each allocation when using the --stack-history option (default=16)',
+        default=16)
+    parser.add_option(
+        '-M',
+        '--max-matches',
+        type='int',
+        dest='max_matches',
+        help='the maximum number of matches to print',
+        default=32)
+    parser.add_option(
+        '-O',
+        '--offset',
+        type='int',
+        dest='offset',
+        help='the matching data must be at this offset',
+        default=-1)
+    parser.add_option(
+        '--ignore-stack',
+        action='store_false',
+        dest='search_stack',
+        help="Don't search the stack when enumerating memory",
+        default=True)
+    parser.add_option(
+        '--ignore-heap',
+        action='store_false',
+        dest='search_heap',
+        help="Don't search the heap allocations when enumerating memory",
+        default=True)
+    parser.add_option(
+        '--ignore-segments',
+        action='store_false',
+        dest='search_segments',
+        help="Don't search readable executable segments enumerating memory",
+        default=True)
+    parser.add_option(
+        '-V',
+        '--vm-regions',
+        action='store_true',
+        dest='search_vm_regions',
+        help='Check all VM regions instead of searching the heap, stack and segments',
+        default=False)
+
 
 def type_flags_to_string(type_flags):
     if type_flags == 0:
@@ -261,8 +380,9 @@ def type_flags_to_string(type_flags):
         type_str = hex(type_flags)
     return type_str
 
+
 def find_variable_containing_address(verbose, frame, match_addr):
-    variables = frame.GetVariables(True,True,True,True)
+    variables = frame.GetVariables(True, True, True, True)
     matching_var = None
     for var in variables:
         var_addr = var.GetLoadAddress()
@@ -275,33 +395,42 @@ def find_variable_containing_address(ver
                     print 'match'
                 return var
             else:
-                if byte_size > 0 and var_addr <= match_addr and match_addr < (var_addr + byte_size):
+                if byte_size > 0 and var_addr <= match_addr and match_addr < (
+                        var_addr + byte_size):
                     if verbose:
                         print 'match'
                     return var
     return None
-    
+
+
 def find_frame_for_stack_address(process, addr):
-    closest_delta = sys.maxint
+    closest_delta = sys.maxsize
     closest_frame = None
-    #print 'find_frame_for_stack_address(%#x)' % (addr)
+    # print 'find_frame_for_stack_address(%#x)' % (addr)
     for thread in process:
         prev_sp = lldb.LLDB_INVALID_ADDRESS
         for frame in thread:
             cfa = frame.GetCFA()
-            #print 'frame #%u: cfa = %#x' % (frame.GetFrameID(), cfa)
+            # print 'frame #%u: cfa = %#x' % (frame.GetFrameID(), cfa)
             if addr < cfa:
                 delta = cfa - addr
-                #print '%#x < %#x, delta = %i' % (addr, cfa, delta)
+                # print '%#x < %#x, delta = %i' % (addr, cfa, delta)
                 if delta < closest_delta:
-                    #print 'closest'
+                    # print 'closest'
                     closest_delta = delta
                     closest_frame = frame
                 # else:
                 #     print 'delta >= closest_delta'
     return closest_frame
-            
-def type_flags_to_description(process, type_flags, ptr_addr, ptr_size, offset, match_addr):
+
+
+def type_flags_to_description(
+        process,
+        type_flags,
+        ptr_addr,
+        ptr_size,
+        offset,
+        match_addr):
     show_offset = False
     if type_flags == 0 or type_flags & 4:
         type_str = 'free(%#x)' % (ptr_addr,)
@@ -312,38 +441,45 @@ def type_flags_to_description(process, t
         type_str = 'stack'
         frame = find_frame_for_stack_address(process, match_addr)
         if frame:
-            type_str += ' in frame #%u of thread #%u: tid %#x' % (frame.GetFrameID(), frame.GetThread().GetIndexID(), frame.GetThread().GetThreadID())
-        variables = frame.GetVariables(True,True,True,True)
+            type_str += ' in frame #%u of thread #%u: tid %#x' % (frame.GetFrameID(
+            ), frame.GetThread().GetIndexID(), frame.GetThread().GetThreadID())
+        variables = frame.GetVariables(True, True, True, True)
         matching_var = None
         for var in variables:
             var_addr = var.GetLoadAddress()
             if var_addr != lldb.LLDB_INVALID_ADDRESS:
-                #print 'variable "%s" @ %#x (%#x)' % (var.name, var.load_addr, match_addr)
+                # print 'variable "%s" @ %#x (%#x)' % (var.name, var.load_addr,
+                # match_addr)
                 if var_addr == match_addr:
                     matching_var = var
                     break
                 else:
                     byte_size = var.GetType().GetByteSize()
-                    if byte_size > 0 and var_addr <= match_addr and match_addr < (var_addr + byte_size):
+                    if byte_size > 0 and var_addr <= match_addr and match_addr < (
+                            var_addr + byte_size):
                         matching_var = var
                         break
         if matching_var:
-            type_str += ' in variable at %#x:\n    %s' % (matching_var.GetLoadAddress(), matching_var)
+            type_str += ' in variable at %#x:\n    %s' % (
+                matching_var.GetLoadAddress(), matching_var)
     elif type_flags & 16:
         type_str = 'stack (red zone)'
     elif type_flags & 32:
         sb_addr = process.GetTarget().ResolveLoadAddress(ptr_addr + offset)
-        type_str = 'segment [%#x - %#x), %s + %u, %s' % (ptr_addr, ptr_addr + ptr_size, sb_addr.section.name, sb_addr.offset, sb_addr)
+        type_str = 'segment [%#x - %#x), %s + %u, %s' % (
+            ptr_addr, ptr_addr + ptr_size, sb_addr.section.name, sb_addr.offset, sb_addr)
     elif type_flags & 64:
         sb_addr = process.GetTarget().ResolveLoadAddress(ptr_addr + offset)
-        type_str = 'vm_region [%#x - %#x), %s + %u, %s' % (ptr_addr, ptr_addr + ptr_size, sb_addr.section.name, sb_addr.offset, sb_addr)
+        type_str = 'vm_region [%#x - %#x), %s + %u, %s' % (
+            ptr_addr, ptr_addr + ptr_size, sb_addr.section.name, sb_addr.offset, sb_addr)
     else:
         type_str = '%#x' % (ptr_addr,)
         show_offset = True
     if show_offset and offset != 0:
         type_str += ' + %-6u' % (offset,)
     return type_str
-    
+
+
 def dump_stack_history_entry(options, result, stack_history_entry, idx):
     address = int(stack_history_entry.address)
     if address:
@@ -351,7 +487,9 @@ def dump_stack_history_entry(options, re
         symbolicator = lldb.utils.symbolication.Symbolicator()
         symbolicator.target = lldb.debugger.GetSelectedTarget()
         type_str = type_flags_to_string(type_flags)
-        result.AppendMessage('stack[%u]: addr = 0x%x, type=%s, frames:' % (idx, address, type_str))
+        result.AppendMessage(
+            'stack[%u]: addr = 0x%x, type=%s, frames:' %
+            (idx, address, type_str))
         frame_idx = 0
         idx = 0
         pc = int(stack_history_entry.frames[idx])
@@ -360,7 +498,9 @@ def dump_stack_history_entry(options, re
                 frames = symbolicator.symbolicate(pc)
                 if frames:
                     for frame in frames:
-                        result.AppendMessage('     [%u] %s' % (frame_idx, frame))
+                        result.AppendMessage(
+                            '     [%u] %s' %
+                            (frame_idx, frame))
                         frame_idx += 1
                 else:
                     result.AppendMessage('     [%u] 0x%x' % (frame_idx, pc))
@@ -370,10 +510,13 @@ def dump_stack_history_entry(options, re
             else:
                 pc = 0
         if idx >= options.max_frames:
-            result.AppendMessage('warning: the max number of stack frames (%u) was reached, use the "--max-frames=<COUNT>" option to see more frames' % (options.max_frames))
-            
+            result.AppendMessage(
+                'warning: the max number of stack frames (%u) was reached, use the "--max-frames=<COUNT>" option to see more frames' %
+                (options.max_frames))
+
         result.AppendMessage('')
-            
+
+
 def dump_stack_history_entries(options, result, addr, history):
     # malloc_stack_entry *get_stack_history_for_address (const void * addr)
     expr_prefix = '''
@@ -397,16 +540,16 @@ stack.num_frames = 0;
 stack.frames[0] = 0;
 uint32_t max_stack_frames = MAX_FRAMES;
 stack.err = (kern_return_t)__mach_stack_logging_get_frames (
-    (task_t)mach_task_self(), 
-    stack.address, 
-    &stack.frames[0], 
-    max_stack_frames, 
+    (task_t)mach_task_self(),
+    stack.address,
+    &stack.frames[0],
+    max_stack_frames,
     &stack.num_frames);
 if (stack.num_frames < MAX_FRAMES)
     stack.frames[stack.num_frames] = 0;
 else
     stack.frames[MAX_FRAMES-1] = 0;
-stack''' % (options.max_frames, addr);
+stack''' % (options.max_frames, addr)
 
     history_expr = '''
 typedef int kern_return_t;
@@ -426,7 +569,7 @@ typedef struct malloc_stack_entry {
     uint32_t type_flags;
     uint32_t num_frames;
     uint64_t frames[MAX_FRAMES];
-    kern_return_t frames_err;    
+    kern_return_t frames_err;
 } malloc_stack_entry;
 typedef struct $malloc_stack_history {
     task_t task;
@@ -445,32 +588,33 @@ enumerate_callback_t callback = [] (mach
         stack_entry->num_frames = 0;
         stack_entry->frames[0] = 0;
         stack_entry->frames_err = (kern_return_t)__mach_stack_logging_frames_for_uniqued_stack (
-            info->task, 
+            info->task,
             stack_record.stack_identifier,
             stack_entry->frames,
             (uint32_t)MAX_FRAMES,
             &stack_entry->num_frames);
         // Terminate the frames with zero if there is room
         if (stack_entry->num_frames < MAX_FRAMES)
-            stack_entry->frames[stack_entry->num_frames] = 0; 
+            stack_entry->frames[stack_entry->num_frames] = 0;
     }
     ++info->idx;
 };
 (kern_return_t)__mach_stack_logging_enumerate_records (info.task, (uint64_t)0x%x, callback, &info);
-info''' % (options.max_frames, options.max_history, addr);
+info''' % (options.max_frames, options.max_history, addr)
 
-    frame = lldb.debugger.GetSelectedTarget().GetProcess().GetSelectedThread().GetSelectedFrame()
+    frame = lldb.debugger.GetSelectedTarget().GetProcess(
+    ).GetSelectedThread().GetSelectedFrame()
     if history:
         expr = history_expr
     else:
         expr = single_expr
     expr_options = lldb.SBExpressionOptions()
-    expr_options.SetIgnoreBreakpoints(True);
-    expr_options.SetTimeoutInMicroSeconds (5*1000*1000) # 5 second timeout
-    expr_options.SetTryAllThreads (True)
+    expr_options.SetIgnoreBreakpoints(True)
+    expr_options.SetTimeoutInMicroSeconds(5 * 1000 * 1000)  # 5 second timeout
+    expr_options.SetTryAllThreads(True)
     expr_options.SetLanguage(lldb.eLanguageTypeObjC_plus_plus)
     expr_options.SetPrefix(expr_prefix)
-    expr_sbvalue = frame.EvaluateExpression (expr, expr_options)
+    expr_sbvalue = frame.EvaluateExpression(expr, expr_options)
     if options.verbose:
         print "expression:"
         print expr
@@ -486,55 +630,72 @@ info''' % (options.max_frames, options.m
                 i_max = options.max_history
             for i in range(i_max):
                 stack_history_entry = malloc_stack_history.entries[i]
-                dump_stack_history_entry(options, result, stack_history_entry, i)
+                dump_stack_history_entry(
+                    options, result, stack_history_entry, i)
             if num_stacks > options.max_history:
-                result.AppendMessage('warning: the max number of stacks (%u) was reached, use the "--max-history=%u" option to see all of the stacks' % (options.max_history, num_stacks))
+                result.AppendMessage(
+                    'warning: the max number of stacks (%u) was reached, use the "--max-history=%u" option to see all of the stacks' %
+                    (options.max_history, num_stacks))
         else:
             stack_history_entry = lldb.value(expr_sbvalue)
             dump_stack_history_entry(options, result, stack_history_entry, 0)
-            
+
     else:
-        result.AppendMessage('error: expression failed "%s" => %s' % (expr, expr_sbvalue.error))
+        result.AppendMessage(
+            'error: expression failed "%s" => %s' %
+            (expr, expr_sbvalue.error))
 
 
-def display_match_results (process, result, options, arg_str_description, expr, print_no_matches, expr_prefix = None):
-    frame = lldb.debugger.GetSelectedTarget().GetProcess().GetSelectedThread().GetSelectedFrame()
+def display_match_results(
+        process,
+        result,
+        options,
+        arg_str_description,
+        expr,
+        print_no_matches,
+        expr_prefix=None):
+    frame = lldb.debugger.GetSelectedTarget().GetProcess(
+    ).GetSelectedThread().GetSelectedFrame()
     if not frame:
         result.AppendMessage('error: invalid frame')
         return 0
     expr_options = lldb.SBExpressionOptions()
-    expr_options.SetIgnoreBreakpoints(True);
-    expr_options.SetFetchDynamicValue(lldb.eNoDynamicValues);
-    expr_options.SetTimeoutInMicroSeconds (30*1000*1000) # 30 second timeout
-    expr_options.SetTryAllThreads (False)
-    expr_options.SetLanguage (lldb.eLanguageTypeObjC_plus_plus)
+    expr_options.SetIgnoreBreakpoints(True)
+    expr_options.SetFetchDynamicValue(lldb.eNoDynamicValues)
+    expr_options.SetTimeoutInMicroSeconds(
+        30 * 1000 * 1000)  # 30 second timeout
+    expr_options.SetTryAllThreads(False)
+    expr_options.SetLanguage(lldb.eLanguageTypeObjC_plus_plus)
     if expr_prefix:
-        expr_options.SetPrefix (expr_prefix)
-    expr_sbvalue = frame.EvaluateExpression (expr, expr_options)
+        expr_options.SetPrefix(expr_prefix)
+    expr_sbvalue = frame.EvaluateExpression(expr, expr_options)
     if options.verbose:
         print "expression:"
         print expr
         print "expression result:"
         print expr_sbvalue
     if expr_sbvalue.error.Success():
-        match_value = lldb.value(expr_sbvalue)  
+        match_value = lldb.value(expr_sbvalue)
         i = 0
         match_idx = 0
-        while 1:
+        while True:
             print_entry = True
-            match_entry = match_value[i]; i += 1
+            match_entry = match_value[i]
+            i += 1
             if i > options.max_matches:
-                result.AppendMessage('warning: the max number of matches (%u) was reached, use the --max-matches option to get more results' % (options.max_matches))
+                result.AppendMessage(
+                    'warning: the max number of matches (%u) was reached, use the --max-matches option to get more results' %
+                    (options.max_matches))
                 break
             malloc_addr = match_entry.addr.sbvalue.unsigned
             if malloc_addr == 0:
                 break
             malloc_size = int(match_entry.size)
             offset = int(match_entry.offset)
-            
+
             if options.offset >= 0 and options.offset != offset:
                 print_entry = False
-            else:                    
+            else:
                 match_addr = malloc_addr + offset
                 type_flags = int(match_entry.type)
                 #result.AppendMessage (hex(malloc_addr + offset))
@@ -547,29 +708,36 @@ def display_match_results (process, resu
                     options.search_segments = True
                     options.search_heap = True
                     options.search_vm_regions = False
-                    if malloc_info_impl (lldb.debugger, result, options, [hex(malloc_addr + offset)]):
+                    if malloc_info_impl(lldb.debugger, result, options, [
+                                        hex(malloc_addr + offset)]):
                         print_entry = False
                     options.search_stack = search_stack_old
                     options.search_segments = search_segments_old
                     options.search_heap = search_heap_old
                     options.search_vm_regions = search_vm_regions
                 if print_entry:
-                    description = '%#16.16x: %s' % (match_addr, type_flags_to_description(process, type_flags, malloc_addr, malloc_size, offset, match_addr))
+                    description = '%#16.16x: %s' % (match_addr, type_flags_to_description(
+                        process, type_flags, malloc_addr, malloc_size, offset, match_addr))
                     if options.show_size:
                         description += ' <%5u>' % (malloc_size)
                     if options.show_range:
-                        description += ' [%#x - %#x)' % (malloc_addr, malloc_addr + malloc_size)
+                        description += ' [%#x - %#x)' % (
+                            malloc_addr, malloc_addr + malloc_size)
                     derefed_dynamic_value = None
-                    dynamic_value = match_entry.addr.sbvalue.GetDynamicValue(lldb.eDynamicCanRunTarget)
+                    dynamic_value = match_entry.addr.sbvalue.GetDynamicValue(
+                        lldb.eDynamicCanRunTarget)
                     if dynamic_value.type.name == 'void *':
                         if options.type == 'pointer' and malloc_size == 4096:
                             error = lldb.SBError()
                             process = expr_sbvalue.GetProcess()
                             target = expr_sbvalue.GetTarget()
-                            data = bytearray(process.ReadMemory(malloc_addr, 16, error))
+                            data = bytearray(
+                                process.ReadMemory(
+                                    malloc_addr, 16, error))
                             if data == '\xa1\xa1\xa1\xa1AUTORELEASE!':
                                 ptr_size = target.addr_size
-                                thread = process.ReadUnsignedFromMemory (malloc_addr + 16 + ptr_size, ptr_size, error)
+                                thread = process.ReadUnsignedFromMemory(
+                                    malloc_addr + 16 + ptr_size, ptr_size, error)
                                 #   4 bytes  0xa1a1a1a1
                                 #  12 bytes  'AUTORELEASE!'
                                 # ptr bytes  autorelease insertion point
@@ -578,40 +746,45 @@ def display_match_results (process, resu
                                 # ptr bytes  next hotter page
                                 #   4 bytes  this page's depth in the list
                                 #   4 bytes  high-water mark
-                                description += ' AUTORELEASE! for pthread_t %#x' % (thread)
+                                description += ' AUTORELEASE! for pthread_t %#x' % (
+                                    thread)
                         #     else:
                         #         description += 'malloc(%u)' % (malloc_size)
                         # else:
                         #     description += 'malloc(%u)' % (malloc_size)
                     else:
                         derefed_dynamic_value = dynamic_value.deref
-                        if derefed_dynamic_value:                        
+                        if derefed_dynamic_value:
                             derefed_dynamic_type = derefed_dynamic_value.type
                             derefed_dynamic_type_size = derefed_dynamic_type.size
                             derefed_dynamic_type_name = derefed_dynamic_type.name
                             description += ' '
                             description += derefed_dynamic_type_name
                             if offset < derefed_dynamic_type_size:
-                                member_list = list();
-                                get_member_types_for_offset (derefed_dynamic_type, offset, member_list)
+                                member_list = list()
+                                get_member_types_for_offset(
+                                    derefed_dynamic_type, offset, member_list)
                                 if member_list:
                                     member_path = ''
                                     for member in member_list:
                                         member_name = member.name
-                                        if member_name: 
+                                        if member_name:
                                             if member_path:
                                                 member_path += '.'
                                             member_path += member_name
                                     if member_path:
                                         if options.ivar_regex_blacklist:
                                             for ivar_regex in options.ivar_regex_blacklist:
-                                                if ivar_regex.match(member_path):
+                                                if ivar_regex.match(
+                                                        member_path):
                                                     print_entry = False
                                         description += '.%s' % (member_path)
                             else:
-                                description += '%u bytes after %s' % (offset - derefed_dynamic_type_size, derefed_dynamic_type_name)
+                                description += '%u bytes after %s' % (
+                                    offset - derefed_dynamic_type_size, derefed_dynamic_type_name)
                         else:
-                            # strip the "*" from the end of the name since we were unable to dereference this
+                            # strip the "*" from the end of the name since we
+                            # were unable to dereference this
                             description += dynamic_value.type.name[0:-1]
             if print_entry:
                 match_idx += 1
@@ -628,10 +801,12 @@ def display_match_results (process, resu
                     result.AppendMessage(result_output)
                 if options.memory:
                     cmd_result = lldb.SBCommandReturnObject()
-                    if options.format == None:
-                        memory_command = "memory read --force 0x%x 0x%x" % (malloc_addr, malloc_addr + malloc_size)
+                    if options.format is None:
+                        memory_command = "memory read --force 0x%x 0x%x" % (
+                            malloc_addr, malloc_addr + malloc_size)
                     else:
-                        memory_command = "memory read --force -f %s 0x%x 0x%x" % (options.format, malloc_addr, malloc_addr + malloc_size)
+                        memory_command = "memory read --force -f %s 0x%x 0x%x" % (
+                            options.format, malloc_addr, malloc_addr + malloc_size)
                     if options.verbose:
                         result.AppendMessage(memory_command)
                     lldb.debugger.GetCommandInterpreter().HandleCommand(memory_command, cmd_result)
@@ -644,48 +819,64 @@ def display_match_results (process, resu
     else:
         result.AppendMessage(str(expr_sbvalue.error))
     return 0
-    
-def get_ptr_refs_options ():
+
+
+def get_ptr_refs_options():
     usage = "usage: %prog [options] <EXPR> [EXPR ...]"
-    description='''Searches all allocations on the heap for pointer values on 
-darwin user space programs. Any matches that were found will dump the malloc 
-blocks that contain the pointers and might be able to print what kind of 
+    description = '''Searches all allocations on the heap for pointer values on
+darwin user space programs. Any matches that were found will dump the malloc
+blocks that contain the pointers and might be able to print what kind of
 objects the pointers are contained in using dynamic type information in the
 program.'''
-    parser = optparse.OptionParser(description=description, prog='ptr_refs',usage=usage)
+    parser = optparse.OptionParser(
+        description=description,
+        prog='ptr_refs',
+        usage=usage)
     add_common_options(parser)
     return parser
-    
+
+
 def find_variable(debugger, command, result, dict):
     usage = "usage: %prog [options] <ADDR> [ADDR ...]"
-    description='''Searches for a local variable in all frames that contains a hex ADDR.'''
+    description = '''Searches for a local variable in all frames that contains a hex ADDR.'''
     command_args = shlex.split(command)
-    parser = optparse.OptionParser(description=description, prog='find_variable',usage=usage)
-    parser.add_option('-v', '--verbose', action='store_true', dest='verbose', help='display verbose debug info', default=False)
+    parser = optparse.OptionParser(
+        description=description,
+        prog='find_variable',
+        usage=usage)
+    parser.add_option(
+        '-v',
+        '--verbose',
+        action='store_true',
+        dest='verbose',
+        help='display verbose debug info',
+        default=False)
     try:
         (options, args) = parser.parse_args(command_args)
     except:
         return
-    
+
     process = debugger.GetSelectedTarget().GetProcess()
     if not process:
         result.AppendMessage('error: invalid process')
         return
-    
+
     for arg in args:
         var_addr = int(arg, 16)
         print >>result, "Finding a variable with address %#x..." % (var_addr)
         done = False
         for thread in process:
             for frame in thread:
-                var = find_variable_containing_address(options.verbose, frame, var_addr)
+                var = find_variable_containing_address(
+                    options.verbose, frame, var_addr)
                 if var:
                     print var
                     done = True
                     break
             if done:
                 break
-                
+
+
 def ptr_refs(debugger, command, result, dict):
     command_args = shlex.split(command)
     parser = get_ptr_refs_options()
@@ -704,13 +895,13 @@ def ptr_refs(debugger, command, result,
         return
 
     options.type = 'pointer'
-    if options.format == None: 
-        options.format = "A" # 'A' is "address" format
+    if options.format is None:
+        options.format = "A"  # 'A' is "address" format
 
     if args:
         # When we initialize the expression, we must define any types that
         # we will need when looking at every allocation. We must also define
-        # a type named callback_baton_t and make an instance named "baton" 
+        # a type named callback_baton_t and make an instance named "baton"
         # and initialize it how ever we want to. The address of "baton" will
         # be passed into our range callback. callback_baton_t must contain
         # a member named "callback" whose type is "range_callback_t". This
@@ -723,7 +914,7 @@ struct $malloc_match {
     uintptr_t offset;
     uintptr_t type;
 };
-'''        
+'''
         user_init_code_format = '''
 #define MAX_MATCHES %u
 typedef struct callback_baton_t {
@@ -737,7 +928,7 @@ range_callback_t range_callback = [](tas
     typedef void* T;
     const unsigned size = sizeof(T);
     T *array = (T*)ptr_addr;
-    for (unsigned idx = 0; ((idx + 1) * sizeof(T)) <= ptr_size; ++idx) {  
+    for (unsigned idx = 0; ((idx + 1) * sizeof(T)) <= ptr_size; ++idx) {
         if (array[idx] == info->ptr) {
             if (info->num_matches < MAX_MATCHES) {
                 info->matches[info->num_matches].addr = (void*)ptr_addr;
@@ -759,29 +950,44 @@ callback_baton_t baton = { range_callbac
         user_return_code = '''if (baton.num_matches < MAX_MATCHES)
     baton.matches[baton.num_matches].addr = 0; // Terminate the matches array
 baton.matches'''
-        # Iterate through all of our pointer expressions and display the results
+        # Iterate through all of our pointer expressions and display the
+        # results
         for ptr_expr in args:
-            user_init_code = user_init_code_format % (options.max_matches, ptr_expr)
-            expr = get_iterate_memory_expr(options, process, user_init_code, user_return_code)          
+            user_init_code = user_init_code_format % (
+                options.max_matches, ptr_expr)
+            expr = get_iterate_memory_expr(
+                options, process, user_init_code, user_return_code)
             arg_str_description = 'malloc block containing pointer %s' % ptr_expr
-            display_match_results (process, result, options, arg_str_description, expr, True, expr_prefix)
+            display_match_results(
+                process,
+                result,
+                options,
+                arg_str_description,
+                expr,
+                True,
+                expr_prefix)
     else:
         result.AppendMessage('error: no pointer arguments were given')
 
+
 def get_cstr_refs_options():
     usage = "usage: %prog [options] <CSTR> [CSTR ...]"
-    description='''Searches all allocations on the heap for C string values on
+    description = '''Searches all allocations on the heap for C string values on
 darwin user space programs. Any matches that were found will dump the malloc
 blocks that contain the C strings and might be able to print what kind of
 objects the pointers are contained in using dynamic type information in the
 program.'''
-    parser = optparse.OptionParser(description=description, prog='cstr_refs',usage=usage)
+    parser = optparse.OptionParser(
+        description=description,
+        prog='cstr_refs',
+        usage=usage)
     add_common_options(parser)
     return parser
 
+
 def cstr_refs(debugger, command, result, dict):
     command_args = shlex.split(command)
-    parser = get_cstr_refs_options();
+    parser = get_cstr_refs_options()
     try:
         (options, args) = parser.parse_args(command_args)
     except:
@@ -796,15 +1002,14 @@ def cstr_refs(debugger, command, result,
         result.AppendMessage('error: invalid frame')
         return
 
-
     options.type = 'cstr'
-    if options.format == None: 
-        options.format = "Y" # 'Y' is "bytes with ASCII" format
+    if options.format is None:
+        options.format = "Y"  # 'Y' is "bytes with ASCII" format
 
     if args:
         # When we initialize the expression, we must define any types that
         # we will need when looking at every allocation. We must also define
-        # a type named callback_baton_t and make an instance named "baton" 
+        # a type named callback_baton_t and make an instance named "baton"
         # and initialize it how ever we want to. The address of "baton" will
         # be passed into our range callback. callback_baton_t must contain
         # a member named "callback" whose type is "range_callback_t". This
@@ -817,7 +1022,7 @@ struct $malloc_match {
     uintptr_t offset;
     uintptr_t type;
 };
-'''        
+'''
         user_init_code_format = '''
 #define MAX_MATCHES %u
 typedef struct callback_baton_t {
@@ -855,27 +1060,42 @@ callback_baton_t baton = { range_callbac
         user_return_code = '''if (baton.num_matches < MAX_MATCHES)
     baton.matches[baton.num_matches].addr = 0; // Terminate the matches array
 baton.matches'''
-        # Iterate through all of our pointer expressions and display the results
+        # Iterate through all of our pointer expressions and display the
+        # results
         for cstr in args:
-            user_init_code = user_init_code_format % (options.max_matches, cstr)
-            expr = get_iterate_memory_expr(options, process, user_init_code, user_return_code)          
-            arg_str_description = 'malloc block containing "%s"' % cstr            
-            display_match_results (process, result, options, arg_str_description, expr, True, expr_prefix)
+            user_init_code = user_init_code_format % (
+                options.max_matches, cstr)
+            expr = get_iterate_memory_expr(
+                options, process, user_init_code, user_return_code)
+            arg_str_description = 'malloc block containing "%s"' % cstr
+            display_match_results(
+                process,
+                result,
+                options,
+                arg_str_description,
+                expr,
+                True,
+                expr_prefix)
     else:
-        result.AppendMessage('error: command takes one or more C string arguments')
+        result.AppendMessage(
+            'error: command takes one or more C string arguments')
 
 
 def get_malloc_info_options():
     usage = "usage: %prog [options] <EXPR> [EXPR ...]"
-    description='''Searches the heap a malloc block that contains the addresses
+    description = '''Searches the heap a malloc block that contains the addresses
 specified as one or more address expressions. Any matches that were found will
 dump the malloc blocks that match or contain the specified address. The matching
 blocks might be able to show what kind of objects they are using dynamic type
 information in the program.'''
-    parser = optparse.OptionParser(description=description, prog='malloc_info',usage=usage)
+    parser = optparse.OptionParser(
+        description=description,
+        prog='malloc_info',
+        usage=usage)
     add_common_options(parser)
     return parser
 
+
 def malloc_info(debugger, command, result, dict):
     command_args = shlex.split(command)
     parser = get_malloc_info_options()
@@ -883,9 +1103,10 @@ def malloc_info(debugger, command, resul
         (options, args) = parser.parse_args(command_args)
     except:
         return
-    malloc_info_impl (debugger, result, options, args)
+    malloc_info_impl(debugger, result, options, args)
 
-def malloc_info_impl (debugger, result, options, args):
+
+def malloc_info_impl(debugger, result, options, args):
     # We are specifically looking for something on the heap only
     options.type = 'malloc_info'
 
@@ -904,8 +1125,8 @@ struct $malloc_match {
     uintptr_t offset;
     uintptr_t type;
 };
-'''        
-    
+'''
+
     user_init_code_format = '''
 typedef struct callback_baton_t {
     range_callback_t callback;
@@ -935,30 +1156,37 @@ baton.matches[1].addr = 0;'''
         total_matches = 0
         for ptr_expr in args:
             user_init_code = user_init_code_format % (ptr_expr)
-            expr = get_iterate_memory_expr(options, process, user_init_code, 'baton.matches')          
+            expr = get_iterate_memory_expr(
+                options, process, user_init_code, 'baton.matches')
             arg_str_description = 'malloc block that contains %s' % ptr_expr
-            total_matches += display_match_results (process, result, options, arg_str_description, expr, True, expr_prefix)
+            total_matches += display_match_results(
+                process, result, options, arg_str_description, expr, True, expr_prefix)
         return total_matches
     else:
-        result.AppendMessage('error: command takes one or more pointer expressions')
+        result.AppendMessage(
+            'error: command takes one or more pointer expressions')
         return 0
 
-def get_thread_stack_ranges_struct (process):
+
+def get_thread_stack_ranges_struct(process):
     '''Create code that defines a structure that represents threads stack bounds
     for all  threads. It returns a static sized array initialized with all of
     the tid, base, size structs for all the threads.'''
     stack_dicts = list()
     if process:
-        i = 0;
+        i = 0
         for thread in process:
             min_sp = thread.frame[0].sp
             max_sp = min_sp
             for frame in thread.frames:
                 sp = frame.sp
-                if sp < min_sp: min_sp = sp
-                if sp > max_sp: max_sp = sp
+                if sp < min_sp:
+                    min_sp = sp
+                if sp > max_sp:
+                    max_sp = sp
             if min_sp < max_sp:
-                stack_dicts.append ({ 'tid' : thread.GetThreadID(), 'base' : min_sp  , 'size' : max_sp-min_sp, 'index' : i })
+                stack_dicts.append({'tid': thread.GetThreadID(
+                ), 'base': min_sp, 'size': max_sp - min_sp, 'index': i})
                 i += 1
     stack_dicts_len = len(stack_dicts)
     if stack_dicts_len > 0:
@@ -976,9 +1204,10 @@ stacks[%(index)u].size = 0x%(size)x;'''
     else:
         return ''
 
-def get_sections_ranges_struct (process):
+
+def get_sections_ranges_struct(process):
     '''Create code that defines a structure that represents all segments that
-    can contain data for all images in "target". It returns a static sized 
+    can contain data for all images in "target". It returns a static sized
     array initialized with all of base, size structs for all the threads.'''
     target = process.target
     segment_dicts = list()
@@ -992,7 +1221,7 @@ def get_sections_ranges_struct (process)
                 base = section.GetLoadAddress(target)
                 size = section.GetByteSize()
                 if base != lldb.LLDB_INVALID_ADDRESS and size > 0:
-                    segment_dicts.append ({ 'base' : base, 'size' : size })
+                    segment_dicts.append({'base': base, 'size': size})
     segment_dicts_len = len(segment_dicts)
     if segment_dicts_len > 0:
         result = '''
@@ -1008,13 +1237,23 @@ segments[%(index)u].size = 0x%(size)x;''
     else:
         return ''
 
+
 def section_ptr_refs(debugger, command, result, dict):
     command_args = shlex.split(command)
     usage = "usage: %prog [options] <EXPR> [EXPR ...]"
-    description='''Searches section contents for pointer values in darwin user space programs.'''
-    parser = optparse.OptionParser(description=description, prog='section_ptr_refs',usage=usage)
+    description = '''Searches section contents for pointer values in darwin user space programs.'''
+    parser = optparse.OptionParser(
+        description=description,
+        prog='section_ptr_refs',
+        usage=usage)
     add_common_options(parser)
-    parser.add_option('--section', action='append', type='string', dest='section_names', help='section name to search', default=list())
+    parser.add_option(
+        '--section',
+        action='append',
+        type='string',
+        dest='section_names',
+        help='section name to search',
+        default=list())
     try:
         (options, args) = parser.parse_args(command_args)
     except:
@@ -1025,7 +1264,8 @@ def section_ptr_refs(debugger, command,
     sections = list()
     section_modules = list()
     if not options.section_names:
-        result.AppendMessage('error: at least one section must be specified with the --section option')
+        result.AppendMessage(
+            'error: at least one section must be specified with the --section option')
         return
 
     target = debugger.GetSelectedTarget()
@@ -1033,8 +1273,8 @@ def section_ptr_refs(debugger, command,
         for section_name in options.section_names:
             section = module.section[section_name]
             if section:
-                sections.append (section)
-                section_modules.append (module)
+                sections.append(section)
+                section_modules.append(module)
     if sections:
         dylid_load_err = load_dylib()
         if dylid_load_err:
@@ -1043,9 +1283,12 @@ def section_ptr_refs(debugger, command,
         frame = target.GetProcess().GetSelectedThread().GetSelectedFrame()
         for expr_str in args:
             for (idx, section) in enumerate(sections):
-                expr = 'find_pointer_in_memory(0x%xllu, %ullu, (void *)%s)' % (section.addr.load_addr, section.size, expr_str)
-                arg_str_description = 'section %s.%s containing "%s"' % (section_modules[idx].file.fullpath, section.name, expr_str)
-                num_matches = display_match_results (target.GetProcess(), result, options, arg_str_description, expr, False)
+                expr = 'find_pointer_in_memory(0x%xllu, %ullu, (void *)%s)' % (
+                    section.addr.load_addr, section.size, expr_str)
+                arg_str_description = 'section %s.%s containing "%s"' % (
+                    section_modules[idx].file.fullpath, section.name, expr_str)
+                num_matches = display_match_results(
+                    target.GetProcess(), result, options, arg_str_description, expr, False)
                 if num_matches:
                     if num_matches < options.max_matches:
                         options.max_matches = options.max_matches - num_matches
@@ -1054,20 +1297,28 @@ def section_ptr_refs(debugger, command,
                 if options.max_matches == 0:
                     return
     else:
-        result.AppendMessage('error: no sections were found that match any of %s' % (', '.join(options.section_names)))
+        result.AppendMessage(
+            'error: no sections were found that match any of %s' %
+            (', '.join(
+                options.section_names)))
+
 
 def get_objc_refs_options():
     usage = "usage: %prog [options] <CLASS> [CLASS ...]"
-    description='''Searches all allocations on the heap for instances of 
+    description = '''Searches all allocations on the heap for instances of
 objective C classes, or any classes that inherit from the specified classes
 in darwin user space programs. Any matches that were found will dump the malloc
 blocks that contain the C strings and might be able to print what kind of
 objects the pointers are contained in using dynamic type information in the
 program.'''
-    parser = optparse.OptionParser(description=description, prog='objc_refs',usage=usage)
+    parser = optparse.OptionParser(
+        description=description,
+        prog='objc_refs',
+        usage=usage)
     add_common_options(parser)
     return parser
 
+
 def objc_refs(debugger, command, result, dict):
     command_args = shlex.split(command)
     parser = get_objc_refs_options()
@@ -1086,28 +1337,31 @@ def objc_refs(debugger, command, result,
         return
 
     options.type = 'isa'
-    if options.format == None: 
-        options.format = "A" # 'A' is "address" format
+    if options.format is None:
+        options.format = "A"  # 'A' is "address" format
 
     expr_options = lldb.SBExpressionOptions()
-    expr_options.SetIgnoreBreakpoints(True);
-    expr_options.SetTimeoutInMicroSeconds (3*1000*1000) # 3 second infinite timeout
-    expr_options.SetTryAllThreads (True)
+    expr_options.SetIgnoreBreakpoints(True)
+    expr_options.SetTimeoutInMicroSeconds(
+        3 * 1000 * 1000)  # 3 second infinite timeout
+    expr_options.SetTryAllThreads(True)
     expr_options.SetLanguage(lldb.eLanguageTypeObjC_plus_plus)
-    num_objc_classes_value = frame.EvaluateExpression("(int)objc_getClassList((void *)0, (int)0)", expr_options)
+    num_objc_classes_value = frame.EvaluateExpression(
+        "(int)objc_getClassList((void *)0, (int)0)", expr_options)
     if not num_objc_classes_value.error.Success():
-        result.AppendMessage('error: %s' % num_objc_classes_value.error.GetCString())
+        result.AppendMessage('error: %s' %
+                             num_objc_classes_value.error.GetCString())
         return
-    
+
     num_objc_classes = num_objc_classes_value.GetValueAsUnsigned()
     if num_objc_classes == 0:
         result.AppendMessage('error: no objective C classes in program')
         return
-        
+
     if args:
         # When we initialize the expression, we must define any types that
         # we will need when looking at every allocation. We must also define
-        # a type named callback_baton_t and make an instance named "baton" 
+        # a type named callback_baton_t and make an instance named "baton"
         # and initialize it how ever we want to. The address of "baton" will
         # be passed into our range callback. callback_baton_t must contain
         # a member named "callback" whose type is "range_callback_t". This
@@ -1120,7 +1374,7 @@ struct $malloc_match {
     uintptr_t offset;
     uintptr_t type;
 };
-'''        
+'''
 
         user_init_code_format = '''
 #define MAX_MATCHES %u
@@ -1146,10 +1400,10 @@ range_callback_t range_callback = [](tas
     callback_baton_t *info = (callback_baton_t *)baton;
     if (sizeof(Class) <= ptr_size) {
         Class *curr_class_ptr = (Class *)ptr_addr;
-        Class *matching_class_ptr = (Class *)bsearch (curr_class_ptr, 
-                                                      (const void *)info->classes, 
-                                                      sizeof(info->classes)/sizeof(Class), 
-                                                      sizeof(Class), 
+        Class *matching_class_ptr = (Class *)bsearch (curr_class_ptr,
+                                                      (const void *)info->classes,
+                                                      sizeof(info->classes)/sizeof(Class),
+                                                      sizeof(Class),
                                                       info->compare_callback);
         if (matching_class_ptr) {
             bool match = false;
@@ -1197,31 +1451,49 @@ int nc = (int)objc_getClassList(baton.cl
         for class_name in args:
             addr_expr_str = "(void *)[%s class]" % class_name
             expr_options = lldb.SBExpressionOptions()
-            expr_options.SetIgnoreBreakpoints(True);
-            expr_options.SetTimeoutInMicroSeconds (1*1000*1000) # 1 second timeout
-            expr_options.SetTryAllThreads (True)
+            expr_options.SetIgnoreBreakpoints(True)
+            expr_options.SetTimeoutInMicroSeconds(
+                1 * 1000 * 1000)  # 1 second timeout
+            expr_options.SetTryAllThreads(True)
             expr_options.SetLanguage(lldb.eLanguageTypeObjC_plus_plus)
-            expr_sbvalue = frame.EvaluateExpression (addr_expr_str, expr_options)
+            expr_sbvalue = frame.EvaluateExpression(
+                addr_expr_str, expr_options)
             if expr_sbvalue.error.Success():
                 isa = expr_sbvalue.unsigned
                 if isa:
                     options.type = 'isa'
-                    result.AppendMessage('Searching for all instances of classes or subclasses of "%s" (isa=0x%x)' % (class_name, isa))
-                    user_init_code = user_init_code_format % (options.max_matches, num_objc_classes, isa)
-                    expr = get_iterate_memory_expr(options, process, user_init_code, user_return_code)          
+                    result.AppendMessage(
+                        'Searching for all instances of classes or subclasses of "%s" (isa=0x%x)' %
+                        (class_name, isa))
+                    user_init_code = user_init_code_format % (
+                        options.max_matches, num_objc_classes, isa)
+                    expr = get_iterate_memory_expr(
+                        options, process, user_init_code, user_return_code)
                     arg_str_description = 'objective C classes with isa 0x%x' % isa
-                    display_match_results (process, result, options, arg_str_description, expr, True, expr_prefix)
+                    display_match_results(
+                        process,
+                        result,
+                        options,
+                        arg_str_description,
+                        expr,
+                        True,
+                        expr_prefix)
                 else:
-                    result.AppendMessage('error: Can\'t find isa for an ObjC class named "%s"' % (class_name))
+                    result.AppendMessage(
+                        'error: Can\'t find isa for an ObjC class named "%s"' %
+                        (class_name))
             else:
-                result.AppendMessage('error: expression error for "%s": %s' % (addr_expr_str, expr_sbvalue.error))
+                result.AppendMessage(
+                    'error: expression error for "%s": %s' %
+                    (addr_expr_str, expr_sbvalue.error))
     else:
-        result.AppendMessage('error: command takes one or more C string arguments');
+        result.AppendMessage(
+            'error: command takes one or more C string arguments')
 
 if __name__ == '__main__':
     lldb.debugger = lldb.SBDebugger.Create()
 
-# Make the options so we can generate the help text for the new LLDB 
+# Make the options so we can generate the help text for the new LLDB
 # command line command prior to registering it with LLDB below. This way
 # if clients in LLDB type "help malloc_info", they will see the exact same
 # output as typing "malloc_info --help".
@@ -1229,16 +1501,22 @@ ptr_refs.__doc__ = get_ptr_refs_options(
 cstr_refs.__doc__ = get_cstr_refs_options().format_help()
 malloc_info.__doc__ = get_malloc_info_options().format_help()
 objc_refs.__doc__ = get_objc_refs_options().format_help()
-lldb.debugger.HandleCommand('command script add -f %s.ptr_refs ptr_refs' % __name__)
-lldb.debugger.HandleCommand('command script add -f %s.cstr_refs cstr_refs' % __name__)
-lldb.debugger.HandleCommand('command script add -f %s.malloc_info malloc_info' % __name__)
-lldb.debugger.HandleCommand('command script add -f %s.find_variable find_variable' % __name__)
+lldb.debugger.HandleCommand(
+    'command script add -f %s.ptr_refs ptr_refs' %
+    __name__)
+lldb.debugger.HandleCommand(
+    'command script add -f %s.cstr_refs cstr_refs' %
+    __name__)
+lldb.debugger.HandleCommand(
+    'command script add -f %s.malloc_info malloc_info' %
+    __name__)
+lldb.debugger.HandleCommand(
+    'command script add -f %s.find_variable find_variable' %
+    __name__)
 # lldb.debugger.HandleCommand('command script add -f %s.heap heap' % package_name)
 # lldb.debugger.HandleCommand('command script add -f %s.section_ptr_refs section_ptr_refs' % package_name)
 # lldb.debugger.HandleCommand('command script add -f %s.stack_ptr_refs stack_ptr_refs' % package_name)
-lldb.debugger.HandleCommand('command script add -f %s.objc_refs objc_refs' % __name__)
+lldb.debugger.HandleCommand(
+    'command script add -f %s.objc_refs objc_refs' %
+    __name__)
 print '"malloc_info", "ptr_refs", "cstr_refs", "find_variable", and "objc_refs" commands have been installed, use the "--help" options on these commands for detailed help.'
-
-
-
-

Modified: lldb/trunk/examples/darwin/heap_find/heap/heap_find.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/darwin/heap_find/heap/heap_find.cpp?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/examples/darwin/heap_find/heap/heap_find.cpp (original)
+++ lldb/trunk/examples/darwin/heap_find/heap/heap_find.cpp Tue Sep  6 15:57:50 2016
@@ -13,39 +13,41 @@
 //
 // (lldb) process load /path/to/libheap.dylib
 //
-// Now you can use the "find_pointer_in_heap" and "find_cstring_in_heap" 
+// Now you can use the "find_pointer_in_heap" and "find_cstring_in_heap"
 // functions in the expression parser.
 //
-// This will grep everything in all active allocation blocks and print and 
+// This will grep everything in all active allocation blocks and print and
 // malloc blocks that contain the pointer 0x112233000000:
 //
 // (lldb) expression find_pointer_in_heap (0x112233000000)
 //
-// This will grep everything in all active allocation blocks and print and 
+// This will grep everything in all active allocation blocks and print and
 // malloc blocks that contain the C string "hello" (as a substring, no
 // NULL termination included):
 //
 // (lldb) expression find_cstring_in_heap ("hello")
 //
-// The results will be printed to the STDOUT of the inferior program. The 
-// return value of the "find_pointer_in_heap" function is the number of 
+// The results will be printed to the STDOUT of the inferior program. The
+// return value of the "find_pointer_in_heap" function is the number of
 // pointer references that were found. A quick example shows
 //
 // (lldb) expr find_pointer_in_heap(0x0000000104000410)
 // (uint32_t) $5 = 0x00000002
-// 0x104000740: 0x0000000104000410 found in malloc block 0x104000730 + 16 (malloc_size = 48)
-// 0x100820060: 0x0000000104000410 found in malloc block 0x100820000 + 96 (malloc_size = 4096)
+// 0x104000740: 0x0000000104000410 found in malloc block 0x104000730 + 16
+// (malloc_size = 48)
+// 0x100820060: 0x0000000104000410 found in malloc block 0x100820000 + 96
+// (malloc_size = 4096)
 //
 // From the above output we see that 0x104000410 was found in the malloc block
 // at 0x104000730 and 0x100820000. If we want to see what these blocks are, we
-// can display the memory for this block using the "address" ("A" for short) 
+// can display the memory for this block using the "address" ("A" for short)
 // format. The address format shows pointers, and if those pointers point to
 // objects that have symbols or know data contents, it will display information
 // about the pointers:
 //
-// (lldb) memory read --format address --count 1 0x104000730 
+// (lldb) memory read --format address --count 1 0x104000730
 // 0x104000730: 0x0000000100002460 (void *)0x0000000100002488: MyString
-// 
+//
 // We can see that the first block is a "MyString" object that contains our
 // pointer value at offset 16.
 //
@@ -53,9 +55,9 @@
 // (lldb) memory read -fA 0x100820000 -c1
 // 0x100820000: 0x4f545541a1a1a1a1
 // (lldb) memory read 0x100820000
-// 0x100820000: a1 a1 a1 a1 41 55 54 4f 52 45 4c 45 41 53 45 21  ....AUTORELEASE!
-// 0x100820010: 78 00 82 00 01 00 00 00 60 f9 e8 75 ff 7f 00 00  x.......`..u....
-// 
+// 0x100820000: a1 a1 a1 a1 41 55 54 4f 52 45 4c 45 41 53 45 21 ....AUTORELEASE!
+// 0x100820010: 78 00 82 00 01 00 00 00 60 f9 e8 75 ff 7f 00 00 x.......`..u....
+//
 // This is an objective C auto release pool object that contains our pointer.
 // C++ classes will show up if they are virtual as something like:
 // (lldb) memory read --format address --count 1 0x104008000
@@ -82,66 +84,47 @@
 // Redefine private types from "/usr/local/include/stack_logging.h"
 //----------------------------------------------------------------------
 typedef struct {
-	uint32_t		type_flags;
-	uint64_t		stack_identifier;
-	uint64_t		argument;
-	mach_vm_address_t	address;
+  uint32_t type_flags;
+  uint64_t stack_identifier;
+  uint64_t argument;
+  mach_vm_address_t address;
 } mach_stack_logging_record_t;
 
 //----------------------------------------------------------------------
 // Redefine private defines from "/usr/local/include/stack_logging.h"
 //----------------------------------------------------------------------
-#define stack_logging_type_free		0
-#define stack_logging_type_generic	1
-#define stack_logging_type_alloc	2
-#define stack_logging_type_dealloc	4
+#define stack_logging_type_free 0
+#define stack_logging_type_generic 1
+#define stack_logging_type_alloc 2
+#define stack_logging_type_dealloc 4
 // This bit is made up by this code
-#define stack_logging_type_vm_region 8 
+#define stack_logging_type_vm_region 8
 
 //----------------------------------------------------------------------
-// Redefine private function prototypes from 
+// Redefine private function prototypes from
 // "/usr/local/include/stack_logging.h"
 //----------------------------------------------------------------------
-extern "C" kern_return_t 
-__mach_stack_logging_set_file_path (
-    task_t task, 
-    char* file_path
-);
-
-extern "C" kern_return_t 
-__mach_stack_logging_get_frames (
-    task_t task, 
-    mach_vm_address_t address, 
-    mach_vm_address_t *stack_frames_buffer, 
-    uint32_t max_stack_frames, 
-    uint32_t *count
-);
-
-extern "C" kern_return_t
-__mach_stack_logging_enumerate_records (
-    task_t task,
-    mach_vm_address_t address, 
-    void enumerator(mach_stack_logging_record_t, void *), 
-    void *context
-);
+extern "C" kern_return_t __mach_stack_logging_set_file_path(task_t task,
+                                                            char *file_path);
 
 extern "C" kern_return_t
-__mach_stack_logging_frames_for_uniqued_stack (
-    task_t task, 
-    uint64_t stack_identifier, 
-    mach_vm_address_t *stack_frames_buffer, 
-    uint32_t max_stack_frames, 
-    uint32_t *count
-);
+__mach_stack_logging_get_frames(task_t task, mach_vm_address_t address,
+                                mach_vm_address_t *stack_frames_buffer,
+                                uint32_t max_stack_frames, uint32_t *count);
+
+extern "C" kern_return_t __mach_stack_logging_enumerate_records(
+    task_t task, mach_vm_address_t address,
+    void enumerator(mach_stack_logging_record_t, void *), void *context);
+
+extern "C" kern_return_t __mach_stack_logging_frames_for_uniqued_stack(
+    task_t task, uint64_t stack_identifier,
+    mach_vm_address_t *stack_frames_buffer, uint32_t max_stack_frames,
+    uint32_t *count);
 
-extern "C" void *gdb_class_getClass (void *objc_class);
+extern "C" void *gdb_class_getClass(void *objc_class);
 
-static void
-range_info_callback (task_t task, 
-                     void *baton, 
-                     unsigned type, 
-                     uint64_t ptr_addr, 
-                     uint64_t ptr_size);
+static void range_info_callback(task_t task, void *baton, unsigned type,
+                                uint64_t ptr_addr, uint64_t ptr_size);
 
 //----------------------------------------------------------------------
 // Redefine private global variables prototypes from
@@ -158,289 +141,221 @@ extern "C" int stack_logging_enable_logg
 //----------------------------------------------------------------------
 // Local Typedefs and Types
 //----------------------------------------------------------------------
-typedef void range_callback_t (task_t task, void *baton, unsigned type, uint64_t ptr_addr, uint64_t ptr_size);
-typedef void zone_callback_t (void *info, const malloc_zone_t *zone);
+typedef void range_callback_t(task_t task, void *baton, unsigned type,
+                              uint64_t ptr_addr, uint64_t ptr_size);
+typedef void zone_callback_t(void *info, const malloc_zone_t *zone);
 typedef int (*comare_function_t)(const void *, const void *);
-struct range_callback_info_t
-{
-    zone_callback_t *zone_callback;
-    range_callback_t *range_callback;
-    void *baton;
-    int check_vm_regions;
-};
-
-enum data_type_t
-{
-    eDataTypeAddress,
-    eDataTypeContainsData,
-    eDataTypeObjC,
-    eDataTypeHeapInfo
-};
-
-struct aligned_data_t
-{
-    const uint8_t *buffer;
-    uint32_t size;
-    uint32_t align;
-};
-
-struct objc_data_t
-{
-    void *match_isa; // Set to NULL for all objective C objects
-    bool match_superclasses;
-};
-
-struct range_contains_data_callback_info_t
-{
-    data_type_t type;
-    const void *lookup_addr;
-    union
-    {
-        uintptr_t addr;
-        aligned_data_t data;
-        objc_data_t objc;
-    };
-    uint32_t match_count;
-    bool done;
-    bool unique;    
-};
-
-struct malloc_match
-{
-    void *addr;
-    intptr_t size;
-    intptr_t offset;
-    uintptr_t type;
-};
-
-struct malloc_stack_entry
-{
-    const void *address;
-    uint64_t argument;
-    uint32_t type_flags;
-    uint32_t num_frames;
-    mach_vm_address_t frames[MAX_FRAMES];
-};
-
-struct malloc_block_contents
-{
-    union {
-        Class isa;
-        void *pointers[2];
-    };
-};
-
-static int 
-compare_void_ptr (const void *a, const void *b)
-{
-    Class a_ptr = *(Class *)a;
-    Class b_ptr = *(Class *)b;
-    if (a_ptr < b_ptr) return -1;
-    if (a_ptr > b_ptr) return +1;
-    return 0;
+struct range_callback_info_t {
+  zone_callback_t *zone_callback;
+  range_callback_t *range_callback;
+  void *baton;
+  int check_vm_regions;
+};
+
+enum data_type_t {
+  eDataTypeAddress,
+  eDataTypeContainsData,
+  eDataTypeObjC,
+  eDataTypeHeapInfo
+};
+
+struct aligned_data_t {
+  const uint8_t *buffer;
+  uint32_t size;
+  uint32_t align;
+};
+
+struct objc_data_t {
+  void *match_isa; // Set to NULL for all objective C objects
+  bool match_superclasses;
+};
+
+struct range_contains_data_callback_info_t {
+  data_type_t type;
+  const void *lookup_addr;
+  union {
+    uintptr_t addr;
+    aligned_data_t data;
+    objc_data_t objc;
+  };
+  uint32_t match_count;
+  bool done;
+  bool unique;
+};
+
+struct malloc_match {
+  void *addr;
+  intptr_t size;
+  intptr_t offset;
+  uintptr_t type;
+};
+
+struct malloc_stack_entry {
+  const void *address;
+  uint64_t argument;
+  uint32_t type_flags;
+  uint32_t num_frames;
+  mach_vm_address_t frames[MAX_FRAMES];
+};
+
+struct malloc_block_contents {
+  union {
+    Class isa;
+    void *pointers[2];
+  };
+};
+
+static int compare_void_ptr(const void *a, const void *b) {
+  Class a_ptr = *(Class *)a;
+  Class b_ptr = *(Class *)b;
+  if (a_ptr < b_ptr)
+    return -1;
+  if (a_ptr > b_ptr)
+    return +1;
+  return 0;
 }
 
-class MatchResults
-{
-    enum { 
-        k_max_entries = 8 * 1024
-    };
-public:
-    MatchResults () :
-        m_size(0)
-    {
-    }
-    
-    void
-    clear()
-    {
-        m_size = 0;
-        bzero (&m_entries, sizeof(m_entries));
-    }
-    
-    bool
-    empty() const
-    {
-        return m_size == 0;
-    }
+class MatchResults {
+  enum { k_max_entries = 8 * 1024 };
 
-    void
-    push_back (const malloc_match& m, bool unique = false)
-    {
-        if (unique)
-        {
-            // Don't add the entry if there is already a match for this address
-            for (uint32_t i=0; i<m_size; ++i)
-            {
-                if (((uint8_t *)m_entries[i].addr + m_entries[i].offset) == ((uint8_t *)m.addr + m.offset))
-                    return; // Duplicate entry
-            }
-        }
-        if (m_size < k_max_entries - 1)
-        {
-            m_entries[m_size] = m;
-            m_size++;
-        }
-    }
+public:
+  MatchResults() : m_size(0) {}
 
-    malloc_match *
-    data ()
-    {
-        // If empty, return NULL
-        if (empty())
-            return NULL;
-        // In not empty, terminate and return the result
-        malloc_match terminator_entry = { NULL, 0, 0, 0 };
-        // We always leave room for an empty entry at the end
-        m_entries[m_size] = terminator_entry;
-        return m_entries;
-    }
+  void clear() {
+    m_size = 0;
+    bzero(&m_entries, sizeof(m_entries));
+  }
+
+  bool empty() const { return m_size == 0; }
+
+  void push_back(const malloc_match &m, bool unique = false) {
+    if (unique) {
+      // Don't add the entry if there is already a match for this address
+      for (uint32_t i = 0; i < m_size; ++i) {
+        if (((uint8_t *)m_entries[i].addr + m_entries[i].offset) ==
+            ((uint8_t *)m.addr + m.offset))
+          return; // Duplicate entry
+      }
+    }
+    if (m_size < k_max_entries - 1) {
+      m_entries[m_size] = m;
+      m_size++;
+    }
+  }
+
+  malloc_match *data() {
+    // If empty, return NULL
+    if (empty())
+      return NULL;
+    // In not empty, terminate and return the result
+    malloc_match terminator_entry = {NULL, 0, 0, 0};
+    // We always leave room for an empty entry at the end
+    m_entries[m_size] = terminator_entry;
+    return m_entries;
+  }
 
 protected:
-    malloc_match m_entries[k_max_entries];
-    uint32_t m_size;
+  malloc_match m_entries[k_max_entries];
+  uint32_t m_size;
 };
 
-class MallocStackLoggingEntries
-{
-    enum {  k_max_entries = 128 };
-public:
-    MallocStackLoggingEntries () :
-        m_size(0)
-    {
-    }
+class MallocStackLoggingEntries {
+  enum { k_max_entries = 128 };
 
-    void
-    clear()
-    {
-        m_size = 0;
-    }
-
-    bool
-    empty() const
-    {
-        return m_size == 0;
-    }
+public:
+  MallocStackLoggingEntries() : m_size(0) {}
 
+  void clear() { m_size = 0; }
 
-    malloc_stack_entry *
-    next ()
-    {
-        if (m_size < k_max_entries - 1)
-        {
-            malloc_stack_entry * result = m_entries + m_size;
-            ++m_size;
-            return result;
-        }
-        return NULL; // Out of entries...
-    }
+  bool empty() const { return m_size == 0; }
 
-    malloc_stack_entry *
-    data ()
-    {
-        // If empty, return NULL
-        if (empty())
-            return NULL;
-        // In not empty, terminate and return the result
-        m_entries[m_size].address = NULL;
-        m_entries[m_size].argument = 0;
-        m_entries[m_size].type_flags = 0;
-        m_entries[m_size].num_frames = 0;
-        return m_entries;
-    }
+  malloc_stack_entry *next() {
+    if (m_size < k_max_entries - 1) {
+      malloc_stack_entry *result = m_entries + m_size;
+      ++m_size;
+      return result;
+    }
+    return NULL; // Out of entries...
+  }
+
+  malloc_stack_entry *data() {
+    // If empty, return NULL
+    if (empty())
+      return NULL;
+    // In not empty, terminate and return the result
+    m_entries[m_size].address = NULL;
+    m_entries[m_size].argument = 0;
+    m_entries[m_size].type_flags = 0;
+    m_entries[m_size].num_frames = 0;
+    return m_entries;
+  }
 
-protected:  
-    malloc_stack_entry m_entries[k_max_entries];
-    uint32_t m_size;
+protected:
+  malloc_stack_entry m_entries[k_max_entries];
+  uint32_t m_size;
 };
 
 //----------------------------------------------------------------------
 // A safe way to allocate memory and keep it from interfering with the
 // malloc enumerators.
 //----------------------------------------------------------------------
-void *
-safe_malloc(size_t n_bytes)
-{
-    if (n_bytes > 0)
-    {
-        const int k_page_size = getpagesize();
-        const mach_vm_size_t vm_size = ((n_bytes + k_page_size - 1)/k_page_size) * k_page_size;
-        vm_address_t address = 0;
-        kern_return_t kerr = vm_allocate (mach_task_self(), &address, vm_size, true);
-        if (kerr == KERN_SUCCESS)
-            return (void *)address;
-    }
-    return NULL;
+void *safe_malloc(size_t n_bytes) {
+  if (n_bytes > 0) {
+    const int k_page_size = getpagesize();
+    const mach_vm_size_t vm_size =
+        ((n_bytes + k_page_size - 1) / k_page_size) * k_page_size;
+    vm_address_t address = 0;
+    kern_return_t kerr = vm_allocate(mach_task_self(), &address, vm_size, true);
+    if (kerr == KERN_SUCCESS)
+      return (void *)address;
+  }
+  return NULL;
 }
 
-
 //----------------------------------------------------------------------
 // ObjCClasses
 //----------------------------------------------------------------------
-class ObjCClasses
-{
+class ObjCClasses {
 public:
-    ObjCClasses() :
-        m_objc_class_ptrs (NULL),
-        m_size (0)
-    {
-    }
+  ObjCClasses() : m_objc_class_ptrs(NULL), m_size(0) {}
 
-    bool
-    Update()
-    {
-        // TODO: find out if class list has changed and update if needed
-        if (m_objc_class_ptrs == NULL)
-        {
-            m_size = objc_getClassList(NULL, 0);
-            if (m_size > 0)
-            {
-                // Allocate the class pointers
-                m_objc_class_ptrs = (Class *)safe_malloc (m_size * sizeof(Class));
-                m_size = objc_getClassList(m_objc_class_ptrs, m_size);
-                // Sort Class pointers for quick lookup
-                ::qsort (m_objc_class_ptrs, m_size, sizeof(Class), compare_void_ptr);
-            }
-            else
-                return false;
-        }
-        return true;
-    }
-    
-    uint32_t
-    FindClassIndex (Class isa)
-    {
-        Class *matching_class = (Class *)bsearch (&isa, 
-                                                  m_objc_class_ptrs, 
-                                                  m_size, 
-                                                  sizeof(Class), 
-                                                  compare_void_ptr);
-        if (matching_class)
-        {
-            uint32_t idx = matching_class - m_objc_class_ptrs;
-            return idx;
-        }        
-        return UINT32_MAX;
-    }
-    
-    Class
-    GetClassAtIndex (uint32_t idx) const
-    {
-        if (idx < m_size)
-            return m_objc_class_ptrs[idx];
-        return NULL;
-    }
-    uint32_t
-    GetSize() const
-    {
-        return m_size;
+  bool Update() {
+    // TODO: find out if class list has changed and update if needed
+    if (m_objc_class_ptrs == NULL) {
+      m_size = objc_getClassList(NULL, 0);
+      if (m_size > 0) {
+        // Allocate the class pointers
+        m_objc_class_ptrs = (Class *)safe_malloc(m_size * sizeof(Class));
+        m_size = objc_getClassList(m_objc_class_ptrs, m_size);
+        // Sort Class pointers for quick lookup
+        ::qsort(m_objc_class_ptrs, m_size, sizeof(Class), compare_void_ptr);
+      } else
+        return false;
     }
-private:
-    Class *m_objc_class_ptrs;
-    uint32_t m_size;    
-};
+    return true;
+  }
 
+  uint32_t FindClassIndex(Class isa) {
+    Class *matching_class = (Class *)bsearch(&isa, m_objc_class_ptrs, m_size,
+                                             sizeof(Class), compare_void_ptr);
+    if (matching_class) {
+      uint32_t idx = matching_class - m_objc_class_ptrs;
+      return idx;
+    }
+    return UINT32_MAX;
+  }
+
+  Class GetClassAtIndex(uint32_t idx) const {
+    if (idx < m_size)
+      return m_objc_class_ptrs[idx];
+    return NULL;
+  }
+  uint32_t GetSize() const { return m_size; }
 
+private:
+  Class *m_objc_class_ptrs;
+  uint32_t m_size;
+};
 
 //----------------------------------------------------------------------
 // Local global variables
@@ -453,127 +368,104 @@ ObjCClasses g_objc_classes;
 // ObjCClassInfo
 //----------------------------------------------------------------------
 
-enum HeapInfoSortType
-{
-    eSortTypeNone,
-    eSortTypeBytes,
-    eSortTypeCount
-};
+enum HeapInfoSortType { eSortTypeNone, eSortTypeBytes, eSortTypeCount };
 
-class ObjCClassInfo
-{
+class ObjCClassInfo {
 public:
-    ObjCClassInfo() :
-        m_entries (NULL),
-        m_size (0),
-        m_sort_type (eSortTypeNone)
-    {
-    }
-    
-    void
-    Update (const ObjCClasses &objc_classes)
-    {
-        m_size = objc_classes.GetSize();
-        m_entries = (Entry *)safe_malloc (m_size * sizeof(Entry));
-        m_sort_type = eSortTypeNone;
-        Reset ();
-    }
-    
-    bool
-    AddInstance (uint32_t idx, uint64_t ptr_size)
-    {
-        if (m_size == 0)
-            Update (g_objc_classes);
-        // Update the totals for the classes
-        if (idx < m_size)
-        {
-            m_entries[idx].bytes += ptr_size;
-            ++m_entries[idx].count;
-            return true;
-        }
-        return false;
-    }
-    
-    void
-    Reset ()
-    {
-        m_sort_type = eSortTypeNone;
-        for (uint32_t i=0; i<m_size; ++i)
-        {
-             // In case we sort the entries after gathering the data, we will
-             // want to know the index into the m_objc_class_ptrs[] array.
-            m_entries[i].idx = i;
-            m_entries[i].bytes = 0;
-            m_entries[i].count = 0;
-        }
-    }
-    void
-    SortByTotalBytes (const ObjCClasses &objc_classes, bool print)
-    {
-        if (m_sort_type != eSortTypeBytes && m_size > 0)
-        {
-            ::qsort (m_entries, m_size, sizeof(Entry), (comare_function_t)compare_bytes);            
-            m_sort_type = eSortTypeBytes;
-        }
-        if (print && m_size > 0)
-        {
-            puts("Objective C objects by total bytes:");
-            puts("Total Bytes Class Name");
-            puts("----------- -----------------------------------------------------------------");
-            for (uint32_t i=0; i<m_size && m_entries[i].bytes > 0; ++i)
-            {
-                printf ("%11llu %s\n", m_entries[i].bytes, class_getName (objc_classes.GetClassAtIndex(m_entries[i].idx)));
-            }            
-        }
-    }
-    void
-    SortByTotalCount (const ObjCClasses &objc_classes, bool print)
-    {
-        if (m_sort_type != eSortTypeCount && m_size > 0)
-        {
-            ::qsort (m_entries, m_size, sizeof(Entry), (comare_function_t)compare_count);            
-            m_sort_type = eSortTypeCount;
-        }
-        if (print && m_size > 0)
-        {
-            puts("Objective C objects by total count:");
-            puts("Count    Class Name");
-            puts("-------- -----------------------------------------------------------------");
-            for (uint32_t i=0; i<m_size && m_entries[i].count > 0; ++i)
-            {
-                printf ("%8u %s\n", m_entries[i].count, class_getName (objc_classes.GetClassAtIndex(m_entries[i].idx)));
-            }            
-        }
+  ObjCClassInfo() : m_entries(NULL), m_size(0), m_sort_type(eSortTypeNone) {}
+
+  void Update(const ObjCClasses &objc_classes) {
+    m_size = objc_classes.GetSize();
+    m_entries = (Entry *)safe_malloc(m_size * sizeof(Entry));
+    m_sort_type = eSortTypeNone;
+    Reset();
+  }
+
+  bool AddInstance(uint32_t idx, uint64_t ptr_size) {
+    if (m_size == 0)
+      Update(g_objc_classes);
+    // Update the totals for the classes
+    if (idx < m_size) {
+      m_entries[idx].bytes += ptr_size;
+      ++m_entries[idx].count;
+      return true;
+    }
+    return false;
+  }
+
+  void Reset() {
+    m_sort_type = eSortTypeNone;
+    for (uint32_t i = 0; i < m_size; ++i) {
+      // In case we sort the entries after gathering the data, we will
+      // want to know the index into the m_objc_class_ptrs[] array.
+      m_entries[i].idx = i;
+      m_entries[i].bytes = 0;
+      m_entries[i].count = 0;
+    }
+  }
+  void SortByTotalBytes(const ObjCClasses &objc_classes, bool print) {
+    if (m_sort_type != eSortTypeBytes && m_size > 0) {
+      ::qsort(m_entries, m_size, sizeof(Entry),
+              (comare_function_t)compare_bytes);
+      m_sort_type = eSortTypeBytes;
+    }
+    if (print && m_size > 0) {
+      puts("Objective C objects by total bytes:");
+      puts("Total Bytes Class Name");
+      puts("----------- "
+           "-----------------------------------------------------------------");
+      for (uint32_t i = 0; i < m_size && m_entries[i].bytes > 0; ++i) {
+        printf("%11llu %s\n", m_entries[i].bytes,
+               class_getName(objc_classes.GetClassAtIndex(m_entries[i].idx)));
+      }
+    }
+  }
+  void SortByTotalCount(const ObjCClasses &objc_classes, bool print) {
+    if (m_sort_type != eSortTypeCount && m_size > 0) {
+      ::qsort(m_entries, m_size, sizeof(Entry),
+              (comare_function_t)compare_count);
+      m_sort_type = eSortTypeCount;
+    }
+    if (print && m_size > 0) {
+      puts("Objective C objects by total count:");
+      puts("Count    Class Name");
+      puts("-------- "
+           "-----------------------------------------------------------------");
+      for (uint32_t i = 0; i < m_size && m_entries[i].count > 0; ++i) {
+        printf("%8u %s\n", m_entries[i].count,
+               class_getName(objc_classes.GetClassAtIndex(m_entries[i].idx)));
+      }
     }
+  }
+
 private:
-    struct Entry
-    {
-        uint32_t idx;   // Index into the m_objc_class_ptrs[] array
-        uint32_t count; // Number of object instances that were found
-        uint64_t bytes; // Total number of bytes for each objc class
-    };
-    
-    static int
-    compare_bytes (const Entry *a, const Entry *b)
-    {
-        // Reverse the comparison to most bytes entries end up at top of list
-        if (a->bytes > b->bytes) return -1;
-        if (a->bytes < b->bytes) return +1;
-        return 0;
-    }
+  struct Entry {
+    uint32_t idx;   // Index into the m_objc_class_ptrs[] array
+    uint32_t count; // Number of object instances that were found
+    uint64_t bytes; // Total number of bytes for each objc class
+  };
+
+  static int compare_bytes(const Entry *a, const Entry *b) {
+    // Reverse the comparison to most bytes entries end up at top of list
+    if (a->bytes > b->bytes)
+      return -1;
+    if (a->bytes < b->bytes)
+      return +1;
+    return 0;
+  }
 
-    static int
-    compare_count (const Entry *a, const Entry *b)
-    {
-        // Reverse the comparison to most count entries end up at top of list
-        if (a->count > b->count) return -1;
-        if (a->count < b->count) return +1;
-        return 0;
-    }
+  static int compare_count(const Entry *a, const Entry *b) {
+    // Reverse the comparison to most count entries end up at top of list
+    if (a->count > b->count)
+      return -1;
+    if (a->count < b->count)
+      return +1;
+    return 0;
+  }
 
-    Entry *m_entries;
-    uint32_t m_size;    
-    HeapInfoSortType m_sort_type;
+  Entry *m_entries;
+  uint32_t m_size;
+  HeapInfoSortType m_sort_type;
 };
 
 ObjCClassInfo g_objc_class_snapshot;
@@ -585,74 +477,62 @@ ObjCClassInfo g_objc_class_snapshot;
 // by the code that iterates through all of the malloc blocks to read
 // the memory in this process.
 //----------------------------------------------------------------------
-static kern_return_t
-task_peek (task_t task, vm_address_t remote_address, vm_size_t size, void **local_memory)
-{
-    *local_memory = (void*) remote_address;
-    return KERN_SUCCESS;
-}
-
-
-static const void
-foreach_zone_in_this_process (range_callback_info_t *info)
-{
-    if (info == NULL || info->zone_callback == NULL)
-        return;
-
-    vm_address_t *zones = NULL;
-    unsigned int num_zones = 0;
-        
-    kern_return_t err = malloc_get_all_zones (0, task_peek, &zones, &num_zones);
-    if (KERN_SUCCESS == err)
-    {
-        for (unsigned int i=0; i<num_zones; ++i)
-        {
-            info->zone_callback (info, (const malloc_zone_t *)zones[i]);
-        }
-    }
-    
-    if (info->check_vm_regions)
-    {
-#if defined (VM_REGION_SUBMAP_SHORT_INFO_COUNT_64)
-        typedef vm_region_submap_short_info_data_64_t RegionInfo;
-        enum { kRegionInfoSize = VM_REGION_SUBMAP_SHORT_INFO_COUNT_64 };
+static kern_return_t task_peek(task_t task, vm_address_t remote_address,
+                               vm_size_t size, void **local_memory) {
+  *local_memory = (void *)remote_address;
+  return KERN_SUCCESS;
+}
+
+static const void foreach_zone_in_this_process(range_callback_info_t *info) {
+  if (info == NULL || info->zone_callback == NULL)
+    return;
+
+  vm_address_t *zones = NULL;
+  unsigned int num_zones = 0;
+
+  kern_return_t err = malloc_get_all_zones(0, task_peek, &zones, &num_zones);
+  if (KERN_SUCCESS == err) {
+    for (unsigned int i = 0; i < num_zones; ++i) {
+      info->zone_callback(info, (const malloc_zone_t *)zones[i]);
+    }
+  }
+
+  if (info->check_vm_regions) {
+#if defined(VM_REGION_SUBMAP_SHORT_INFO_COUNT_64)
+    typedef vm_region_submap_short_info_data_64_t RegionInfo;
+    enum { kRegionInfoSize = VM_REGION_SUBMAP_SHORT_INFO_COUNT_64 };
 #else
-        typedef vm_region_submap_info_data_64_t RegionInfo;
-        enum { kRegionInfoSize = VM_REGION_SUBMAP_INFO_COUNT_64 };
+    typedef vm_region_submap_info_data_64_t RegionInfo;
+    enum { kRegionInfoSize = VM_REGION_SUBMAP_INFO_COUNT_64 };
 #endif
-        task_t task = mach_task_self();
-    	mach_vm_address_t vm_region_base_addr;
-    	mach_vm_size_t vm_region_size;
-    	natural_t vm_region_depth;
-    	RegionInfo vm_region_info;
-
-        ((range_contains_data_callback_info_t *)info->baton)->unique = true;
-
-        for (vm_region_base_addr = 0, vm_region_size = 1; vm_region_size != 0; vm_region_base_addr += vm_region_size)
-        {
-            mach_msg_type_number_t vm_region_info_size = kRegionInfoSize;
-            const kern_return_t err = mach_vm_region_recurse (task,
-                                                              &vm_region_base_addr,
-                                                              &vm_region_size,
-                                                              &vm_region_depth,
-                                                              (vm_region_recurse_info_t)&vm_region_info,
-                                                              &vm_region_info_size);
-            if (err)
-                break;
-            // Check all read + write regions. This will cover the thread stacks 
-            // and any regions of memory that aren't covered by the heap
-            if (vm_region_info.protection & VM_PROT_WRITE && 
-                vm_region_info.protection & VM_PROT_READ)
-            {
-                //printf ("checking vm_region: [0x%16.16llx - 0x%16.16llx)\n", (uint64_t)vm_region_base_addr, (uint64_t)vm_region_base_addr + vm_region_size);
-                range_info_callback (task, 
-                                     info->baton, 
-                                     stack_logging_type_vm_region, 
-                                     vm_region_base_addr, 
-                                     vm_region_size);
-            }
-        }
+    task_t task = mach_task_self();
+    mach_vm_address_t vm_region_base_addr;
+    mach_vm_size_t vm_region_size;
+    natural_t vm_region_depth;
+    RegionInfo vm_region_info;
+
+    ((range_contains_data_callback_info_t *)info->baton)->unique = true;
+
+    for (vm_region_base_addr = 0, vm_region_size = 1; vm_region_size != 0;
+         vm_region_base_addr += vm_region_size) {
+      mach_msg_type_number_t vm_region_info_size = kRegionInfoSize;
+      const kern_return_t err = mach_vm_region_recurse(
+          task, &vm_region_base_addr, &vm_region_size, &vm_region_depth,
+          (vm_region_recurse_info_t)&vm_region_info, &vm_region_info_size);
+      if (err)
+        break;
+      // Check all read + write regions. This will cover the thread stacks
+      // and any regions of memory that aren't covered by the heap
+      if (vm_region_info.protection & VM_PROT_WRITE &&
+          vm_region_info.protection & VM_PROT_READ) {
+        // printf ("checking vm_region: [0x%16.16llx - 0x%16.16llx)\n",
+        // (uint64_t)vm_region_base_addr, (uint64_t)vm_region_base_addr +
+        // vm_region_size);
+        range_info_callback(task, info->baton, stack_logging_type_vm_region,
+                            vm_region_base_addr, vm_region_size);
+      }
     }
+  }
 }
 
 //----------------------------------------------------------------------
@@ -661,235 +541,203 @@ foreach_zone_in_this_process (range_call
 // A simple callback that will dump each malloc block and all available
 // info from the enumeration callback perspective.
 //----------------------------------------------------------------------
-static void
-dump_malloc_block_callback (task_t task, void *baton, unsigned type, uint64_t ptr_addr, uint64_t ptr_size)
-{
-    printf ("task = 0x%4.4x: baton = %p, type = %u, ptr_addr = 0x%llx + 0x%llu\n", task, baton, type, ptr_addr, ptr_size);
-}
-
-static void 
-ranges_callback (task_t task, void *baton, unsigned type, vm_range_t *ptrs, unsigned count) 
-{
-    range_callback_info_t *info = (range_callback_info_t *)baton;
-    while(count--) {
-        info->range_callback (task, info->baton, type, ptrs->address, ptrs->size);
-        ptrs++;
-    }
-}
-
-static void
-enumerate_range_in_zone (void *baton, const malloc_zone_t *zone)
-{
-    range_callback_info_t *info = (range_callback_info_t *)baton;
-
-    if (zone && zone->introspect)
-        zone->introspect->enumerator (mach_task_self(), 
-                                      info, 
-                                      MALLOC_PTR_IN_USE_RANGE_TYPE, 
-                                      (vm_address_t)zone, 
-                                      task_peek, 
-                                      ranges_callback);    
-}
-
-static void
-range_info_callback (task_t task, void *baton, unsigned type, uint64_t ptr_addr, uint64_t ptr_size)
-{
-    const uint64_t end_addr = ptr_addr + ptr_size;
-    
-    range_contains_data_callback_info_t *info = (range_contains_data_callback_info_t *)baton;
-    switch (info->type)
-    {
-    case eDataTypeAddress:
-        // Check if the current malloc block contains an address specified by "info->addr"
-        if (ptr_addr <= info->addr && info->addr < end_addr)
-        {
-            ++info->match_count;
-            malloc_match match = { (void *)ptr_addr, ptr_size, info->addr - ptr_addr, type };
-            g_matches.push_back(match, info->unique);
-        }
-        break;
-    
-    case eDataTypeContainsData:
-        // Check if the current malloc block contains data specified in "info->data"
-        {
-            const uint32_t size = info->data.size;
-            if (size < ptr_size) // Make sure this block can contain this data
-            {
-                uint8_t *ptr_data = NULL;
-                if (task_peek (task, ptr_addr, ptr_size, (void **)&ptr_data) == KERN_SUCCESS)
-                {
-                    const void *buffer = info->data.buffer;
-                    assert (ptr_data);
-                    const uint32_t align = info->data.align;
-                    for (uint64_t addr = ptr_addr; 
-                         addr < end_addr && ((end_addr - addr) >= size);
-                         addr += align, ptr_data += align)
-                    {
-                        if (memcmp (buffer, ptr_data, size) == 0)
-                        {
-                            ++info->match_count;
-                            malloc_match match = { (void *)ptr_addr, ptr_size, addr - ptr_addr, type };
-                            g_matches.push_back(match, info->unique);
-                        }
-                    }
-                }
-                else
-                {
-                    printf ("0x%llx: error: couldn't read %llu bytes\n", ptr_addr, ptr_size);
-                }   
+static void dump_malloc_block_callback(task_t task, void *baton, unsigned type,
+                                       uint64_t ptr_addr, uint64_t ptr_size) {
+  printf("task = 0x%4.4x: baton = %p, type = %u, ptr_addr = 0x%llx + 0x%llu\n",
+         task, baton, type, ptr_addr, ptr_size);
+}
+
+static void ranges_callback(task_t task, void *baton, unsigned type,
+                            vm_range_t *ptrs, unsigned count) {
+  range_callback_info_t *info = (range_callback_info_t *)baton;
+  while (count--) {
+    info->range_callback(task, info->baton, type, ptrs->address, ptrs->size);
+    ptrs++;
+  }
+}
+
+static void enumerate_range_in_zone(void *baton, const malloc_zone_t *zone) {
+  range_callback_info_t *info = (range_callback_info_t *)baton;
+
+  if (zone && zone->introspect)
+    zone->introspect->enumerator(
+        mach_task_self(), info, MALLOC_PTR_IN_USE_RANGE_TYPE,
+        (vm_address_t)zone, task_peek, ranges_callback);
+}
+
+static void range_info_callback(task_t task, void *baton, unsigned type,
+                                uint64_t ptr_addr, uint64_t ptr_size) {
+  const uint64_t end_addr = ptr_addr + ptr_size;
+
+  range_contains_data_callback_info_t *info =
+      (range_contains_data_callback_info_t *)baton;
+  switch (info->type) {
+  case eDataTypeAddress:
+    // Check if the current malloc block contains an address specified by
+    // "info->addr"
+    if (ptr_addr <= info->addr && info->addr < end_addr) {
+      ++info->match_count;
+      malloc_match match = {(void *)ptr_addr, ptr_size, info->addr - ptr_addr,
+                            type};
+      g_matches.push_back(match, info->unique);
+    }
+    break;
+
+  case eDataTypeContainsData:
+    // Check if the current malloc block contains data specified in "info->data"
+    {
+      const uint32_t size = info->data.size;
+      if (size < ptr_size) // Make sure this block can contain this data
+      {
+        uint8_t *ptr_data = NULL;
+        if (task_peek(task, ptr_addr, ptr_size, (void **)&ptr_data) ==
+            KERN_SUCCESS) {
+          const void *buffer = info->data.buffer;
+          assert(ptr_data);
+          const uint32_t align = info->data.align;
+          for (uint64_t addr = ptr_addr;
+               addr < end_addr && ((end_addr - addr) >= size);
+               addr += align, ptr_data += align) {
+            if (memcmp(buffer, ptr_data, size) == 0) {
+              ++info->match_count;
+              malloc_match match = {(void *)ptr_addr, ptr_size, addr - ptr_addr,
+                                    type};
+              g_matches.push_back(match, info->unique);
             }
-        }
-        break;
-    
-    case eDataTypeObjC:
-        // Check if the current malloc block contains an objective C object
-        // of any sort where the first pointer in the object is an OBJC class
-        // pointer (an isa)
-        {
-            malloc_block_contents *block_contents = NULL;
-            if (task_peek (task, ptr_addr, sizeof(void *), (void **)&block_contents) == KERN_SUCCESS)
-            {
-                // We assume that g_objc_classes is up to date
-                // that the class list was verified to have some classes in it
-                // before calling this function
-                const uint32_t objc_class_idx = g_objc_classes.FindClassIndex (block_contents->isa);
-                if (objc_class_idx != UINT32_MAX)
-                {
-                    bool match = false;
-                    if (info->objc.match_isa == 0)
-                    {
-                        // Match any objective C object
-                        match = true;
-                    }
-                    else 
-                    {
-                        // Only match exact isa values in the current class or
-                        // optionally in the super classes
-                        if (info->objc.match_isa == block_contents->isa)
-                            match = true;
-                        else if (info->objc.match_superclasses)
-                        {
-                            Class super = class_getSuperclass(block_contents->isa);
-                            while (super)
-                            {
-                                match = super == info->objc.match_isa;
-                                if (match)
-                                    break;
-                                super = class_getSuperclass(super);
-                            }
-                        }
-                    }
-                    if (match)
-                    {
-                        //printf (" success\n");
-                        ++info->match_count;
-                        malloc_match match = { (void *)ptr_addr, ptr_size, 0, type };
-                        g_matches.push_back(match, info->unique);
-                    }
-                    else
-                    {
-                        //printf (" error: wrong class: %s\n", dl_info.dli_sname);                        
-                    }
-                }
-                else
-                {
-                    //printf ("\terror: symbol not objc class: %s\n", dl_info.dli_sname);
-                    return;
-                }
-            }
-        }
-        break;
-
-    case eDataTypeHeapInfo:
-        // Check if the current malloc block contains an objective C object
-        // of any sort where the first pointer in the object is an OBJC class
-        // pointer (an isa)
-        {
-            malloc_block_contents *block_contents = NULL;
-            if (task_peek (task, ptr_addr, sizeof(void *), (void **)&block_contents) == KERN_SUCCESS)
-            {
-                // We assume that g_objc_classes is up to date
-                // that the class list was verified to have some classes in it
-                // before calling this function
-                const uint32_t objc_class_idx = g_objc_classes.FindClassIndex (block_contents->isa);
-                if (objc_class_idx != UINT32_MAX)
-                {
-                    // This is an objective C object
-                    g_objc_class_snapshot.AddInstance (objc_class_idx, ptr_size);
-                }
-                else
-                {
-                    // Classify other heap info
-                }
+          }
+        } else {
+          printf("0x%llx: error: couldn't read %llu bytes\n", ptr_addr,
+                 ptr_size);
+        }
+      }
+    }
+    break;
+
+  case eDataTypeObjC:
+    // Check if the current malloc block contains an objective C object
+    // of any sort where the first pointer in the object is an OBJC class
+    // pointer (an isa)
+    {
+      malloc_block_contents *block_contents = NULL;
+      if (task_peek(task, ptr_addr, sizeof(void *), (void **)&block_contents) ==
+          KERN_SUCCESS) {
+        // We assume that g_objc_classes is up to date
+        // that the class list was verified to have some classes in it
+        // before calling this function
+        const uint32_t objc_class_idx =
+            g_objc_classes.FindClassIndex(block_contents->isa);
+        if (objc_class_idx != UINT32_MAX) {
+          bool match = false;
+          if (info->objc.match_isa == 0) {
+            // Match any objective C object
+            match = true;
+          } else {
+            // Only match exact isa values in the current class or
+            // optionally in the super classes
+            if (info->objc.match_isa == block_contents->isa)
+              match = true;
+            else if (info->objc.match_superclasses) {
+              Class super = class_getSuperclass(block_contents->isa);
+              while (super) {
+                match = super == info->objc.match_isa;
+                if (match)
+                  break;
+                super = class_getSuperclass(super);
+              }
             }
+          }
+          if (match) {
+            // printf (" success\n");
+            ++info->match_count;
+            malloc_match match = {(void *)ptr_addr, ptr_size, 0, type};
+            g_matches.push_back(match, info->unique);
+          } else {
+            // printf (" error: wrong class: %s\n", dl_info.dli_sname);
+          }
+        } else {
+          // printf ("\terror: symbol not objc class: %s\n", dl_info.dli_sname);
+          return;
+        }
+      }
+    }
+    break;
+
+  case eDataTypeHeapInfo:
+    // Check if the current malloc block contains an objective C object
+    // of any sort where the first pointer in the object is an OBJC class
+    // pointer (an isa)
+    {
+      malloc_block_contents *block_contents = NULL;
+      if (task_peek(task, ptr_addr, sizeof(void *), (void **)&block_contents) ==
+          KERN_SUCCESS) {
+        // We assume that g_objc_classes is up to date
+        // that the class list was verified to have some classes in it
+        // before calling this function
+        const uint32_t objc_class_idx =
+            g_objc_classes.FindClassIndex(block_contents->isa);
+        if (objc_class_idx != UINT32_MAX) {
+          // This is an objective C object
+          g_objc_class_snapshot.AddInstance(objc_class_idx, ptr_size);
+        } else {
+          // Classify other heap info
         }
-        break;
-
+      }
     }
+    break;
+  }
 }
 
-static void 
-get_stack_for_address_enumerator(mach_stack_logging_record_t stack_record, void *task_ptr)
-{
+static void
+get_stack_for_address_enumerator(mach_stack_logging_record_t stack_record,
+                                 void *task_ptr) {
+  malloc_stack_entry *stack_entry = g_malloc_stack_history.next();
+  if (stack_entry) {
+    stack_entry->address = (void *)stack_record.address;
+    stack_entry->type_flags = stack_record.type_flags;
+    stack_entry->argument = stack_record.argument;
+    stack_entry->num_frames = 0;
+    stack_entry->frames[0] = 0;
+    kern_return_t err = __mach_stack_logging_frames_for_uniqued_stack(
+        *(task_t *)task_ptr, stack_record.stack_identifier, stack_entry->frames,
+        MAX_FRAMES, &stack_entry->num_frames);
+    // Terminate the frames with zero if there is room
+    if (stack_entry->num_frames < MAX_FRAMES)
+      stack_entry->frames[stack_entry->num_frames] = 0;
+  }
+}
+
+malloc_stack_entry *get_stack_history_for_address(const void *addr,
+                                                  int history) {
+  if (!stack_logging_enable_logging)
+    return NULL;
+  g_malloc_stack_history.clear();
+  kern_return_t err;
+  task_t task = mach_task_self();
+  if (history) {
+    err = __mach_stack_logging_enumerate_records(
+        task, (mach_vm_address_t)addr, get_stack_for_address_enumerator, &task);
+  } else {
     malloc_stack_entry *stack_entry = g_malloc_stack_history.next();
-    if (stack_entry)
-    {
-        stack_entry->address = (void *)stack_record.address;
-        stack_entry->type_flags = stack_record.type_flags;
-        stack_entry->argument = stack_record.argument;
-        stack_entry->num_frames = 0;
-        stack_entry->frames[0] = 0;
-        kern_return_t err = __mach_stack_logging_frames_for_uniqued_stack (*(task_t *)task_ptr, 
-                                                                           stack_record.stack_identifier,
-                                                                           stack_entry->frames,
-                                                                           MAX_FRAMES,
-                                                                           &stack_entry->num_frames);    
+    if (stack_entry) {
+      stack_entry->address = addr;
+      stack_entry->type_flags = stack_logging_type_alloc;
+      stack_entry->argument = 0;
+      stack_entry->num_frames = 0;
+      stack_entry->frames[0] = 0;
+      err = __mach_stack_logging_get_frames(task, (mach_vm_address_t)addr,
+                                            stack_entry->frames, MAX_FRAMES,
+                                            &stack_entry->num_frames);
+      if (err == 0 && stack_entry->num_frames > 0) {
         // Terminate the frames with zero if there is room
         if (stack_entry->num_frames < MAX_FRAMES)
-            stack_entry->frames[stack_entry->num_frames] = 0; 
-    }
-}
-
-malloc_stack_entry *
-get_stack_history_for_address (const void * addr, int history)
-{
-    if (!stack_logging_enable_logging)
-        return NULL;
-    g_malloc_stack_history.clear();
-    kern_return_t err;
-    task_t task = mach_task_self();
-    if (history)
-    {
-        err = __mach_stack_logging_enumerate_records (task,
-                                                      (mach_vm_address_t)addr, 
-                                                      get_stack_for_address_enumerator,
-                                                      &task);
-    }
-    else
-    {
-        malloc_stack_entry *stack_entry = g_malloc_stack_history.next();
-        if (stack_entry)
-        {
-            stack_entry->address = addr;
-            stack_entry->type_flags = stack_logging_type_alloc;
-            stack_entry->argument = 0;
-            stack_entry->num_frames = 0;
-            stack_entry->frames[0] = 0;
-            err = __mach_stack_logging_get_frames(task, (mach_vm_address_t)addr, stack_entry->frames, MAX_FRAMES, &stack_entry->num_frames);
-            if (err == 0 && stack_entry->num_frames > 0)
-            {
-                // Terminate the frames with zero if there is room
-                if (stack_entry->num_frames < MAX_FRAMES)
-                    stack_entry->frames[stack_entry->num_frames] = 0;
-            }
-            else
-            {
-                g_malloc_stack_history.clear();                
-            }
-        }
-    }
-    // Return data if there is any
-    return g_malloc_stack_history.data();
+          stack_entry->frames[stack_entry->num_frames] = 0;
+      } else {
+        g_malloc_stack_history.clear();
+      }
+    }
+  }
+  // Return data if there is any
+  return g_malloc_stack_history.data();
 }
 
 //----------------------------------------------------------------------
@@ -898,28 +746,26 @@ get_stack_history_for_address (const voi
 // Finds a pointer value inside one or more currently valid malloc
 // blocks.
 //----------------------------------------------------------------------
-malloc_match *
-find_pointer_in_heap (const void * addr, int check_vm_regions)
-{
-    g_matches.clear();
-    // Setup "info" to look for a malloc block that contains data
-    // that is the pointer
-    if (addr)
-    {
-        range_contains_data_callback_info_t data_info;
-        data_info.type = eDataTypeContainsData;      // Check each block for data
-        data_info.data.buffer = (uint8_t *)&addr;    // What data? The pointer value passed in
-        data_info.data.size = sizeof(addr);          // How many bytes? The byte size of a pointer
-        data_info.data.align = sizeof(addr);         // Align to a pointer byte size
-        data_info.match_count = 0;                   // Initialize the match count to zero
-        data_info.done = false;                      // Set done to false so searching doesn't stop
-        data_info.unique = false;                    // Set to true when iterating on the vm_regions
-        range_callback_info_t info = { enumerate_range_in_zone, range_info_callback, &data_info, check_vm_regions };
-        foreach_zone_in_this_process (&info);
-        
-        
-    }
-    return g_matches.data();
+malloc_match *find_pointer_in_heap(const void *addr, int check_vm_regions) {
+  g_matches.clear();
+  // Setup "info" to look for a malloc block that contains data
+  // that is the pointer
+  if (addr) {
+    range_contains_data_callback_info_t data_info;
+    data_info.type = eDataTypeContainsData; // Check each block for data
+    data_info.data.buffer =
+        (uint8_t *)&addr; // What data? The pointer value passed in
+    data_info.data.size =
+        sizeof(addr); // How many bytes? The byte size of a pointer
+    data_info.data.align = sizeof(addr); // Align to a pointer byte size
+    data_info.match_count = 0;           // Initialize the match count to zero
+    data_info.done = false;   // Set done to false so searching doesn't stop
+    data_info.unique = false; // Set to true when iterating on the vm_regions
+    range_callback_info_t info = {enumerate_range_in_zone, range_info_callback,
+                                  &data_info, check_vm_regions};
+    foreach_zone_in_this_process(&info);
+  }
+  return g_matches.data();
 }
 
 //----------------------------------------------------------------------
@@ -928,95 +774,90 @@ find_pointer_in_heap (const void * addr,
 // Finds a pointer value inside one or more currently valid malloc
 // blocks.
 //----------------------------------------------------------------------
-malloc_match *
-find_pointer_in_memory (uint64_t memory_addr, uint64_t memory_size, const void * addr)
-{
-    g_matches.clear();
-    // Setup "info" to look for a malloc block that contains data
-    // that is the pointer
-    range_contains_data_callback_info_t data_info;
-    data_info.type = eDataTypeContainsData;      // Check each block for data
-    data_info.data.buffer = (uint8_t *)&addr;    // What data? The pointer value passed in
-    data_info.data.size = sizeof(addr);          // How many bytes? The byte size of a pointer
-    data_info.data.align = sizeof(addr);         // Align to a pointer byte size
-    data_info.match_count = 0;                   // Initialize the match count to zero
-    data_info.done = false;                      // Set done to false so searching doesn't stop
-    data_info.unique = false;                    // Set to true when iterating on the vm_regions
-    range_info_callback (mach_task_self(), &data_info, stack_logging_type_generic, memory_addr, memory_size);
-    return g_matches.data();
+malloc_match *find_pointer_in_memory(uint64_t memory_addr, uint64_t memory_size,
+                                     const void *addr) {
+  g_matches.clear();
+  // Setup "info" to look for a malloc block that contains data
+  // that is the pointer
+  range_contains_data_callback_info_t data_info;
+  data_info.type = eDataTypeContainsData; // Check each block for data
+  data_info.data.buffer =
+      (uint8_t *)&addr; // What data? The pointer value passed in
+  data_info.data.size =
+      sizeof(addr); // How many bytes? The byte size of a pointer
+  data_info.data.align = sizeof(addr); // Align to a pointer byte size
+  data_info.match_count = 0;           // Initialize the match count to zero
+  data_info.done = false;   // Set done to false so searching doesn't stop
+  data_info.unique = false; // Set to true when iterating on the vm_regions
+  range_info_callback(mach_task_self(), &data_info, stack_logging_type_generic,
+                      memory_addr, memory_size);
+  return g_matches.data();
 }
 
 //----------------------------------------------------------------------
 // find_objc_objects_in_memory
 //
 // Find all instances of ObjC classes 'c', or all ObjC classes if 'c' is
-// NULL. If 'c' is non NULL, then also check objects to see if they 
+// NULL. If 'c' is non NULL, then also check objects to see if they
 // inherit from 'c'
 //----------------------------------------------------------------------
-malloc_match *
-find_objc_objects_in_memory (void *isa, int check_vm_regions)
-{
-    g_matches.clear();
-    if (g_objc_classes.Update())
-    {
-        // Setup "info" to look for a malloc block that contains data
-        // that is the pointer
-        range_contains_data_callback_info_t data_info;
-        data_info.type = eDataTypeObjC;      // Check each block for data
-        data_info.objc.match_isa = isa;
-        data_info.objc.match_superclasses = true;
-        data_info.match_count = 0;                   // Initialize the match count to zero
-        data_info.done = false;                      // Set done to false so searching doesn't stop
-        data_info.unique = false;                    // Set to true when iterating on the vm_regions
-        range_callback_info_t info = { enumerate_range_in_zone, range_info_callback, &data_info, check_vm_regions };
-        foreach_zone_in_this_process (&info);
-    }
-    return g_matches.data();
+malloc_match *find_objc_objects_in_memory(void *isa, int check_vm_regions) {
+  g_matches.clear();
+  if (g_objc_classes.Update()) {
+    // Setup "info" to look for a malloc block that contains data
+    // that is the pointer
+    range_contains_data_callback_info_t data_info;
+    data_info.type = eDataTypeObjC; // Check each block for data
+    data_info.objc.match_isa = isa;
+    data_info.objc.match_superclasses = true;
+    data_info.match_count = 0; // Initialize the match count to zero
+    data_info.done = false;    // Set done to false so searching doesn't stop
+    data_info.unique = false;  // Set to true when iterating on the vm_regions
+    range_callback_info_t info = {enumerate_range_in_zone, range_info_callback,
+                                  &data_info, check_vm_regions};
+    foreach_zone_in_this_process(&info);
+  }
+  return g_matches.data();
 }
 
 //----------------------------------------------------------------------
 // get_heap_info
 //
-// Gather information for all allocations on the heap and report 
+// Gather information for all allocations on the heap and report
 // statistics.
 //----------------------------------------------------------------------
 
-void
-get_heap_info (int sort_type)
-{
-    if (g_objc_classes.Update())
-    {
-        // Reset all stats
-        g_objc_class_snapshot.Reset ();
-        // Setup "info" to look for a malloc block that contains data
-        // that is the pointer
-        range_contains_data_callback_info_t data_info;
-        data_info.type = eDataTypeHeapInfo; // Check each block for data
-        data_info.match_count = 0;          // Initialize the match count to zero
-        data_info.done = false;             // Set done to false so searching doesn't stop
-        data_info.unique = false;           // Set to true when iterating on the vm_regions
-        const int check_vm_regions = false;
-        range_callback_info_t info = { enumerate_range_in_zone, range_info_callback, &data_info, check_vm_regions };
-        foreach_zone_in_this_process (&info);
-        
-        // Sort and print byte total bytes
-        switch (sort_type)
-        {
-        case eSortTypeNone:
-        default:
-        case eSortTypeBytes:
-            g_objc_class_snapshot.SortByTotalBytes(g_objc_classes, true);
-            break;
-            
-        case eSortTypeCount:
-            g_objc_class_snapshot.SortByTotalCount(g_objc_classes, true);
-            break;
-        }
-    }
-    else
-    {
-        printf ("error: no objective C classes\n");
-    }
+void get_heap_info(int sort_type) {
+  if (g_objc_classes.Update()) {
+    // Reset all stats
+    g_objc_class_snapshot.Reset();
+    // Setup "info" to look for a malloc block that contains data
+    // that is the pointer
+    range_contains_data_callback_info_t data_info;
+    data_info.type = eDataTypeHeapInfo; // Check each block for data
+    data_info.match_count = 0;          // Initialize the match count to zero
+    data_info.done = false;   // Set done to false so searching doesn't stop
+    data_info.unique = false; // Set to true when iterating on the vm_regions
+    const int check_vm_regions = false;
+    range_callback_info_t info = {enumerate_range_in_zone, range_info_callback,
+                                  &data_info, check_vm_regions};
+    foreach_zone_in_this_process(&info);
+
+    // Sort and print byte total bytes
+    switch (sort_type) {
+    case eSortTypeNone:
+    default:
+    case eSortTypeBytes:
+      g_objc_class_snapshot.SortByTotalBytes(g_objc_classes, true);
+      break;
+
+    case eSortTypeCount:
+      g_objc_class_snapshot.SortByTotalCount(g_objc_classes, true);
+      break;
+    }
+  } else {
+    printf("error: no objective C classes\n");
+  }
 }
 
 //----------------------------------------------------------------------
@@ -1024,28 +865,27 @@ get_heap_info (int sort_type)
 //
 // Finds a C string inside one or more currently valid malloc blocks.
 //----------------------------------------------------------------------
-malloc_match *
-find_cstring_in_heap (const char *s, int check_vm_regions)
-{
-    g_matches.clear();
-    if (s == NULL || s[0] == '\0')
-    {
-        printf ("error: invalid argument (empty cstring)\n");
-        return NULL;
-    }
-    // Setup "info" to look for a malloc block that contains data
-    // that is the C string passed in aligned on a 1 byte boundary
-    range_contains_data_callback_info_t data_info;
-    data_info.type = eDataTypeContainsData;  // Check each block for data
-    data_info.data.buffer = (uint8_t *)s;    // What data? The C string passed in
-    data_info.data.size = strlen(s);         // How many bytes? The length of the C string
-    data_info.data.align = 1;                // Data doesn't need to be aligned, so set the alignment to 1
-    data_info.match_count = 0;               // Initialize the match count to zero
-    data_info.done = false;                  // Set done to false so searching doesn't stop
-    data_info.unique = false;                // Set to true when iterating on the vm_regions
-    range_callback_info_t info = { enumerate_range_in_zone, range_info_callback, &data_info, check_vm_regions };
-    foreach_zone_in_this_process (&info);
-    return g_matches.data();
+malloc_match *find_cstring_in_heap(const char *s, int check_vm_regions) {
+  g_matches.clear();
+  if (s == NULL || s[0] == '\0') {
+    printf("error: invalid argument (empty cstring)\n");
+    return NULL;
+  }
+  // Setup "info" to look for a malloc block that contains data
+  // that is the C string passed in aligned on a 1 byte boundary
+  range_contains_data_callback_info_t data_info;
+  data_info.type = eDataTypeContainsData; // Check each block for data
+  data_info.data.buffer = (uint8_t *)s;   // What data? The C string passed in
+  data_info.data.size = strlen(s); // How many bytes? The length of the C string
+  data_info.data.align =
+      1; // Data doesn't need to be aligned, so set the alignment to 1
+  data_info.match_count = 0; // Initialize the match count to zero
+  data_info.done = false;    // Set done to false so searching doesn't stop
+  data_info.unique = false;  // Set to true when iterating on the vm_regions
+  range_callback_info_t info = {enumerate_range_in_zone, range_info_callback,
+                                &data_info, check_vm_regions};
+  foreach_zone_in_this_process(&info);
+  return g_matches.data();
 }
 
 //----------------------------------------------------------------------
@@ -1053,19 +893,19 @@ find_cstring_in_heap (const char *s, int
 //
 // Find the malloc block that whose address range contains "addr".
 //----------------------------------------------------------------------
-malloc_match *
-find_block_for_address (const void *addr, int check_vm_regions)
-{
-    g_matches.clear();
-    // Setup "info" to look for a malloc block that contains data
-    // that is the C string passed in aligned on a 1 byte boundary
-    range_contains_data_callback_info_t data_info;
-    data_info.type = eDataTypeAddress;  // Check each block to see if the block contains the address passed in
-    data_info.addr = (uintptr_t)addr;   // What data? The C string passed in
-    data_info.match_count = 0;          // Initialize the match count to zero
-    data_info.done = false;             // Set done to false so searching doesn't stop
-    data_info.unique = false;           // Set to true when iterating on the vm_regions
-    range_callback_info_t info = { enumerate_range_in_zone, range_info_callback, &data_info, check_vm_regions };
-    foreach_zone_in_this_process (&info);
-    return g_matches.data();
+malloc_match *find_block_for_address(const void *addr, int check_vm_regions) {
+  g_matches.clear();
+  // Setup "info" to look for a malloc block that contains data
+  // that is the C string passed in aligned on a 1 byte boundary
+  range_contains_data_callback_info_t data_info;
+  data_info.type = eDataTypeAddress; // Check each block to see if the block
+                                     // contains the address passed in
+  data_info.addr = (uintptr_t)addr;  // What data? The C string passed in
+  data_info.match_count = 0;         // Initialize the match count to zero
+  data_info.done = false;   // Set done to false so searching doesn't stop
+  data_info.unique = false; // Set to true when iterating on the vm_regions
+  range_callback_info_t info = {enumerate_range_in_zone, range_info_callback,
+                                &data_info, check_vm_regions};
+  foreach_zone_in_this_process(&info);
+  return g_matches.data();
 }

Modified: lldb/trunk/examples/functions/main.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/functions/main.cpp?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/examples/functions/main.cpp (original)
+++ lldb/trunk/examples/functions/main.cpp Tue Sep  6 15:57:50 2016
@@ -19,11 +19,11 @@
 #include "LLDB/SBDebugger.h"
 #include "LLDB/SBFunction.h"
 #include "LLDB/SBModule.h"
+#include "LLDB/SBProcess.h"
 #include "LLDB/SBStream.h"
 #include "LLDB/SBSymbol.h"
 #include "LLDB/SBTarget.h"
 #include "LLDB/SBThread.h"
-#include "LLDB/SBProcess.h"
 #endif
 
 #include <string>
@@ -34,9 +34,9 @@ using namespace lldb;
 // This quick sample code shows how to create a debugger instance and
 // create an executable target without adding dependent shared
 // libraries. It will then set a regular expression breakpoint to get
-// breakpoint locations for all functions in the module, and use the 
-// locations to extract the symbol context for each location. Then it 
-// dumps all // information about the function: its name, file address 
+// breakpoint locations for all functions in the module, and use the
+// locations to extract the symbol context for each location. Then it
+// dumps all // information about the function: its name, file address
 // range, the return type (if any), and all argument types.
 //
 // To build the program, type (while in this directory):
@@ -46,319 +46,301 @@ using namespace lldb;
 // then to run this on MacOSX, specify the path to your LLDB.framework
 // library using the DYLD_FRAMEWORK_PATH option and run the executable
 //
-//    $ DYLD_FRAMEWORK_PATH=/Volumes/data/lldb/tot/build/Debug ./a.out executable_path1 [executable_path2 ...] 
+//    $ DYLD_FRAMEWORK_PATH=/Volumes/data/lldb/tot/build/Debug ./a.out
+//    executable_path1 [executable_path2 ...]
 //----------------------------------------------------------------------
-class LLDBSentry
-{
+class LLDBSentry {
 public:
-    LLDBSentry() {
-        // Initialize LLDB
-        SBDebugger::Initialize();
-    }
-    ~LLDBSentry() {
-        // Terminate LLDB
-        SBDebugger::Terminate();
-    }
+  LLDBSentry() {
+    // Initialize LLDB
+    SBDebugger::Initialize();
+  }
+  ~LLDBSentry() {
+    // Terminate LLDB
+    SBDebugger::Terminate();
+  }
 };
 
-static struct option g_long_options[] = 
-{
-	{ "arch",		required_argument,	NULL, 'a' },
-	{ "canonical",  no_argument,	    NULL, 'c' },
-	{ "extern",     no_argument,	    NULL, 'x' },
-    { "help",       no_argument,        NULL, 'h' },
-	{ "platform",   required_argument,	NULL, 'p' },
-    { "verbose",    no_argument,        NULL, 'v' },
-	{ NULL,			0,					NULL,  0  }
-};
+static struct option g_long_options[] = {
+    {"arch", required_argument, NULL, 'a'},
+    {"canonical", no_argument, NULL, 'c'},
+    {"extern", no_argument, NULL, 'x'},
+    {"help", no_argument, NULL, 'h'},
+    {"platform", required_argument, NULL, 'p'},
+    {"verbose", no_argument, NULL, 'v'},
+    {NULL, 0, NULL, 0}};
 
 #define PROGRAM_NAME "lldb-functions"
-void
-usage ()
-{
-    puts (
-    "NAME\n"
-    "    " PROGRAM_NAME " -- extract all function signatures from one or more binaries.\n"
-    "\n"
-    "SYNOPSIS\n"
-    "    " PROGRAM_NAME " [[--arch=<ARCH>] [--platform=<PLATFORM>] [--verbose] [--help] [--canonical] --] <PATH> [<PATH>....]\n"
-    "\n"
-    "DESCRIPTION\n"
-    "    Loads the executable pointed to by <PATH> and dumps complete signatures for all functions that have debug information.\n"
-    "\n"
-    "EXAMPLE\n"
-    "   " PROGRAM_NAME " --arch=x86_64 /usr/lib/dyld\n"
-    );
-    exit(0);
+void usage() {
+  puts("NAME\n"
+       "    " PROGRAM_NAME
+       " -- extract all function signatures from one or more binaries.\n"
+       "\n"
+       "SYNOPSIS\n"
+       "    " PROGRAM_NAME " [[--arch=<ARCH>] [--platform=<PLATFORM>] "
+                           "[--verbose] [--help] [--canonical] --] <PATH> "
+                           "[<PATH>....]\n"
+       "\n"
+       "DESCRIPTION\n"
+       "    Loads the executable pointed to by <PATH> and dumps complete "
+       "signatures for all functions that have debug information.\n"
+       "\n"
+       "EXAMPLE\n"
+       "   " PROGRAM_NAME " --arch=x86_64 /usr/lib/dyld\n");
+  exit(0);
 }
-int
-main (int argc, char const *argv[])
-{
-    // Use a sentry object to properly initialize/terminate LLDB.
-    LLDBSentry sentry;
-    
-    SBDebugger debugger (SBDebugger::Create());
-    
-    // Create a debugger instance so we can create a target
-    if (!debugger.IsValid())
-        fprintf (stderr, "error: failed to create a debugger object\n");
-    
-    bool show_usage = false;
-    bool verbose = false;
-    bool canonical = false;
-    bool external_only = false;
-    const char *arch = NULL;
-    const char *platform = NULL;
-    std::string short_options("h?");
-    for (const struct option *opt = g_long_options; opt->name; ++opt)
-    {
-        if (isprint(opt->val))
-        {
-            short_options.append(1, (char)opt->val);
-            switch (opt->has_arg)
-            {
-            case no_argument:
-                break;
-            case required_argument:
-                short_options.append(1, ':'); 
-                break;
-            case optional_argument:
-                short_options.append(2, ':'); 
-                break;
-            }   
-        }        
+int main(int argc, char const *argv[]) {
+  // Use a sentry object to properly initialize/terminate LLDB.
+  LLDBSentry sentry;
+
+  SBDebugger debugger(SBDebugger::Create());
+
+  // Create a debugger instance so we can create a target
+  if (!debugger.IsValid())
+    fprintf(stderr, "error: failed to create a debugger object\n");
+
+  bool show_usage = false;
+  bool verbose = false;
+  bool canonical = false;
+  bool external_only = false;
+  const char *arch = NULL;
+  const char *platform = NULL;
+  std::string short_options("h?");
+  for (const struct option *opt = g_long_options; opt->name; ++opt) {
+    if (isprint(opt->val)) {
+      short_options.append(1, (char)opt->val);
+      switch (opt->has_arg) {
+      case no_argument:
+        break;
+      case required_argument:
+        short_options.append(1, ':');
+        break;
+      case optional_argument:
+        short_options.append(2, ':');
+        break;
+      }
     }
+  }
 #ifdef __GLIBC__
-    optind = 0;
+  optind = 0;
 #else
-    optreset = 1;
-    optind = 1;
+  optreset = 1;
+  optind = 1;
 #endif
-    char ch;
-	while ((ch = getopt_long_only(argc, (char * const *)argv, short_options.c_str(), g_long_options, 0)) != -1)
-	{
-		switch (ch) 
-		{
-        case 0:
-            break;
-
-		case 'a':
-		    if (arch != NULL)
-		    {
-                fprintf (stderr, "error: the --arch option can only be specified once\n");
-                exit(1);
-		    }
-            arch = optarg;
-			break;
-
-        case 'c':
-            canonical = true;
-            break;
-
-        case 'x':
-            external_only = true;
-            break;
-    
-        case 'p':
-            platform = optarg;
-            break;            
-        
-        case 'v':
-            verbose = true;
-            break;
-
-		case 'h':
-		case '?':
-		default:
-			show_usage = true;
-			break;
-		}
-	}
-	argc -= optind;
-	argv += optind;
-    
-    const bool add_dependent_libs = false;
-    SBError error;
-    for (int arg_idx = 0; arg_idx < argc; ++arg_idx)
-    {
-        // The first argument is the file path we want to look something up in
-        const char *exe_file_path = argv[arg_idx];
-        
-        // Create a target using the executable.
-        SBTarget target = debugger.CreateTarget (exe_file_path,
-                                                 arch,
-                                                 platform,
-                                                 add_dependent_libs,
-                                                 error);
-        
-        if (error.Success())
-        {
-            if (target.IsValid())
-            {
-                SBFileSpec exe_file_spec (exe_file_path, true);
-                SBModule module (target.FindModule (exe_file_spec));
-                SBFileSpecList comp_unit_list;
-
-                if (module.IsValid())
-                {
-                    char command[1024];
-                    lldb::SBCommandReturnObject command_result;
-                    snprintf (command, sizeof(command), "add-dsym --uuid %s", module.GetUUIDString());
-                    debugger.GetCommandInterpreter().HandleCommand (command, command_result);
-                    if (!command_result.Succeeded())
-                    {
-                        fprintf (stderr, "error: couldn't locate debug symbols for '%s'\n", exe_file_path);
-                        exit(1);
-                    }
+  char ch;
+  while ((ch = getopt_long_only(argc, (char *const *)argv,
+                                short_options.c_str(), g_long_options, 0)) !=
+         -1) {
+    switch (ch) {
+    case 0:
+      break;
+
+    case 'a':
+      if (arch != NULL) {
+        fprintf(stderr,
+                "error: the --arch option can only be specified once\n");
+        exit(1);
+      }
+      arch = optarg;
+      break;
+
+    case 'c':
+      canonical = true;
+      break;
+
+    case 'x':
+      external_only = true;
+      break;
+
+    case 'p':
+      platform = optarg;
+      break;
+
+    case 'v':
+      verbose = true;
+      break;
+
+    case 'h':
+    case '?':
+    default:
+      show_usage = true;
+      break;
+    }
+  }
+  argc -= optind;
+  argv += optind;
+
+  const bool add_dependent_libs = false;
+  SBError error;
+  for (int arg_idx = 0; arg_idx < argc; ++arg_idx) {
+    // The first argument is the file path we want to look something up in
+    const char *exe_file_path = argv[arg_idx];
+
+    // Create a target using the executable.
+    SBTarget target = debugger.CreateTarget(exe_file_path, arch, platform,
+                                            add_dependent_libs, error);
+
+    if (error.Success()) {
+      if (target.IsValid()) {
+        SBFileSpec exe_file_spec(exe_file_path, true);
+        SBModule module(target.FindModule(exe_file_spec));
+        SBFileSpecList comp_unit_list;
+
+        if (module.IsValid()) {
+          char command[1024];
+          lldb::SBCommandReturnObject command_result;
+          snprintf(command, sizeof(command), "add-dsym --uuid %s",
+                   module.GetUUIDString());
+          debugger.GetCommandInterpreter().HandleCommand(command,
+                                                         command_result);
+          if (!command_result.Succeeded()) {
+            fprintf(stderr, "error: couldn't locate debug symbols for '%s'\n",
+                    exe_file_path);
+            exit(1);
+          }
 
-                    SBFileSpecList module_list;
-                    module_list.Append(exe_file_spec);
-                    SBBreakpoint bp = target.BreakpointCreateByRegex (".", module_list, comp_unit_list);
-                    
-                    const size_t num_locations = bp.GetNumLocations();
-                    for (uint32_t bp_loc_idx=0; bp_loc_idx<num_locations; ++bp_loc_idx)
-                    {
-                        SBBreakpointLocation bp_loc = bp.GetLocationAtIndex(bp_loc_idx);
-                        SBSymbolContext sc (bp_loc.GetAddress().GetSymbolContext(eSymbolContextEverything));
-                        if (sc.IsValid())
-                        {
-                            if (sc.GetBlock().GetContainingInlinedBlock().IsValid())
-                            {
-                                // Skip inlined functions
-                                continue;
-                            }
-                            SBFunction function (sc.GetFunction());
-                            if (function.IsValid())
-                            {
-                                addr_t lo_pc = function.GetStartAddress().GetFileAddress();
-                                if (lo_pc == LLDB_INVALID_ADDRESS)
-                                {
-                                    // Skip functions that don't have concrete instances in the binary
-                                    continue;
-                                }
-                                addr_t hi_pc = function.GetEndAddress().GetFileAddress();
-                                const char *func_demangled_name = function.GetName();
-                                const char *func_mangled_name = function.GetMangledName();
-                                
-                                bool dump = true;
-                                const bool is_objc_method = ((func_demangled_name[0] == '-') || (func_demangled_name[0] == '+')) && (func_demangled_name[1] == '[');
-                                if (external_only)
-                                {
-                                    // Dump all objective C methods, or external symbols
-                                    dump = is_objc_method;
-                                    if (!dump)
-                                        dump = sc.GetSymbol().IsExternal();
-                                }
-
-                                if (dump)
-                                {
-                                    if (verbose)
-                                    {
-                                        printf ("\n   name: %s\n", func_demangled_name);
-                                        if (func_mangled_name)
-                                            printf ("mangled: %s\n", func_mangled_name);
-                                        printf ("  range: [0x%16.16llx - 0x%16.16llx)\n   type: ", lo_pc, hi_pc);
-                                    }
-                                    else
-                                    {
-                                        printf ("[0x%16.16llx - 0x%16.16llx) ", lo_pc, hi_pc);
-                                    }
-                                    SBType function_type = function.GetType();
-                                    SBType return_type = function_type.GetFunctionReturnType();
-                                
-                                    if (canonical)
-                                        return_type = return_type.GetCanonicalType();
-
-                                    if (func_mangled_name && 
-                                        func_mangled_name[0] == '_' &&
-                                        func_mangled_name[1] == 'Z')
-                                    {
-                                        printf ("%s %s\n", return_type.GetName(), func_demangled_name);
-                                    }
-                                    else 
-                                    {
-                                        SBTypeList function_args = function_type.GetFunctionArgumentTypes();
-                                        const size_t num_function_args = function_args.GetSize();
-                                    
-                                        if (is_objc_method)
-                                        {
-                                            const char *class_name_start = func_demangled_name + 2;
-                                        
-                                            if (num_function_args == 0)
-                                            {
-                                                printf("%c(%s)[%s\n", func_demangled_name[0], return_type.GetName(), class_name_start);
-                                            }
-                                            else
-                                            {
-                                                const char *class_name_end = strchr(class_name_start,' ');
-                                                const int class_name_len = class_name_end - class_name_start;
-                                                printf ("%c(%s)[%*.*s", func_demangled_name[0], return_type.GetName(), class_name_len, class_name_len, class_name_start);
-                                        
-                                                const char *selector_pos = class_name_end + 1;
-                                                for (uint32_t function_arg_idx = 0; function_arg_idx < num_function_args; ++function_arg_idx)
-                                                {
-                                                    const char *selector_end = strchr(selector_pos, ':') + 1;
-                                                    const int selector_len = selector_end - selector_pos; 
-                                                    SBType function_arg_type = function_args.GetTypeAtIndex(function_arg_idx);
-
-                                                    if (canonical)
-                                                        function_arg_type = function_arg_type.GetCanonicalType();
-
-                                                    printf (" %*.*s", selector_len, selector_len, selector_pos);
-                                                    if (function_arg_type.IsValid())
-                                                    {
-                                                        printf ("(%s)", function_arg_type.GetName());
-                                                    }
-                                                    else
-                                                    {
-                                                        printf ("(?)");
-                                                    }
-                                                    selector_pos = selector_end;
-                                                }
-                                                printf ("]\n");
-                                            }
-                                        }
-                                        else
-                                        {
-                                            printf ("%s ", return_type.GetName());
-                                            if (strchr (func_demangled_name, '('))
-                                                printf ("(*)(");
-                                            else
-                                                printf ("%s(", func_demangled_name);
-                                
-                                            for (uint32_t function_arg_idx = 0; function_arg_idx < num_function_args; ++function_arg_idx)
-                                            {
-                                                SBType function_arg_type = function_args.GetTypeAtIndex(function_arg_idx);
-
-                                                if (canonical)
-                                                    function_arg_type = function_arg_type.GetCanonicalType();
-                                            
-                                                if (function_arg_type.IsValid())
-                                                {
-                                                    printf ("%s%s", function_arg_idx > 0 ? ", " : "", function_arg_type.GetName());
-                                                }
-                                                else
-                                                {
-                                                    printf ("%s???", function_arg_idx > 0 ? ", " : "");
-                                                }
-                                            }
-                                            printf (")\n");                            
-                                        }    
-                                    }
-                                }
-                            }
+          SBFileSpecList module_list;
+          module_list.Append(exe_file_spec);
+          SBBreakpoint bp =
+              target.BreakpointCreateByRegex(".", module_list, comp_unit_list);
+
+          const size_t num_locations = bp.GetNumLocations();
+          for (uint32_t bp_loc_idx = 0; bp_loc_idx < num_locations;
+               ++bp_loc_idx) {
+            SBBreakpointLocation bp_loc = bp.GetLocationAtIndex(bp_loc_idx);
+            SBSymbolContext sc(
+                bp_loc.GetAddress().GetSymbolContext(eSymbolContextEverything));
+            if (sc.IsValid()) {
+              if (sc.GetBlock().GetContainingInlinedBlock().IsValid()) {
+                // Skip inlined functions
+                continue;
+              }
+              SBFunction function(sc.GetFunction());
+              if (function.IsValid()) {
+                addr_t lo_pc = function.GetStartAddress().GetFileAddress();
+                if (lo_pc == LLDB_INVALID_ADDRESS) {
+                  // Skip functions that don't have concrete instances in the
+                  // binary
+                  continue;
+                }
+                addr_t hi_pc = function.GetEndAddress().GetFileAddress();
+                const char *func_demangled_name = function.GetName();
+                const char *func_mangled_name = function.GetMangledName();
+
+                bool dump = true;
+                const bool is_objc_method = ((func_demangled_name[0] == '-') ||
+                                             (func_demangled_name[0] == '+')) &&
+                                            (func_demangled_name[1] == '[');
+                if (external_only) {
+                  // Dump all objective C methods, or external symbols
+                  dump = is_objc_method;
+                  if (!dump)
+                    dump = sc.GetSymbol().IsExternal();
+                }
+
+                if (dump) {
+                  if (verbose) {
+                    printf("\n   name: %s\n", func_demangled_name);
+                    if (func_mangled_name)
+                      printf("mangled: %s\n", func_mangled_name);
+                    printf("  range: [0x%16.16llx - 0x%16.16llx)\n   type: ",
+                           lo_pc, hi_pc);
+                  } else {
+                    printf("[0x%16.16llx - 0x%16.16llx) ", lo_pc, hi_pc);
+                  }
+                  SBType function_type = function.GetType();
+                  SBType return_type = function_type.GetFunctionReturnType();
+
+                  if (canonical)
+                    return_type = return_type.GetCanonicalType();
+
+                  if (func_mangled_name && func_mangled_name[0] == '_' &&
+                      func_mangled_name[1] == 'Z') {
+                    printf("%s %s\n", return_type.GetName(),
+                           func_demangled_name);
+                  } else {
+                    SBTypeList function_args =
+                        function_type.GetFunctionArgumentTypes();
+                    const size_t num_function_args = function_args.GetSize();
+
+                    if (is_objc_method) {
+                      const char *class_name_start = func_demangled_name + 2;
+
+                      if (num_function_args == 0) {
+                        printf("%c(%s)[%s\n", func_demangled_name[0],
+                               return_type.GetName(), class_name_start);
+                      } else {
+                        const char *class_name_end =
+                            strchr(class_name_start, ' ');
+                        const int class_name_len =
+                            class_name_end - class_name_start;
+                        printf("%c(%s)[%*.*s", func_demangled_name[0],
+                               return_type.GetName(), class_name_len,
+                               class_name_len, class_name_start);
+
+                        const char *selector_pos = class_name_end + 1;
+                        for (uint32_t function_arg_idx = 0;
+                             function_arg_idx < num_function_args;
+                             ++function_arg_idx) {
+                          const char *selector_end =
+                              strchr(selector_pos, ':') + 1;
+                          const int selector_len = selector_end - selector_pos;
+                          SBType function_arg_type =
+                              function_args.GetTypeAtIndex(function_arg_idx);
+
+                          if (canonical)
+                            function_arg_type =
+                                function_arg_type.GetCanonicalType();
+
+                          printf(" %*.*s", selector_len, selector_len,
+                                 selector_pos);
+                          if (function_arg_type.IsValid()) {
+                            printf("(%s)", function_arg_type.GetName());
+                          } else {
+                            printf("(?)");
+                          }
+                          selector_pos = selector_end;
+                        }
+                        printf("]\n");
+                      }
+                    } else {
+                      printf("%s ", return_type.GetName());
+                      if (strchr(func_demangled_name, '('))
+                        printf("(*)(");
+                      else
+                        printf("%s(", func_demangled_name);
+
+                      for (uint32_t function_arg_idx = 0;
+                           function_arg_idx < num_function_args;
+                           ++function_arg_idx) {
+                        SBType function_arg_type =
+                            function_args.GetTypeAtIndex(function_arg_idx);
+
+                        if (canonical)
+                          function_arg_type =
+                              function_arg_type.GetCanonicalType();
+
+                        if (function_arg_type.IsValid()) {
+                          printf("%s%s", function_arg_idx > 0 ? ", " : "",
+                                 function_arg_type.GetName());
+                        } else {
+                          printf("%s???", function_arg_idx > 0 ? ", " : "");
                         }
+                      }
+                      printf(")\n");
                     }
+                  }
                 }
+              }
             }
+          }
         }
-        else
-        {
-            fprintf (stderr, "error: %s\n", error.GetCString());
-            exit(1);
-        }
+      }
+    } else {
+      fprintf(stderr, "error: %s\n", error.GetCString());
+      exit(1);
     }
-    
-    return 0;
-}
+  }
 
+  return 0;
+}

Modified: lldb/trunk/examples/interposing/darwin/fd_interposing/FDInterposing.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/interposing/darwin/fd_interposing/FDInterposing.cpp?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/examples/interposing/darwin/fd_interposing/FDInterposing.cpp (original)
+++ lldb/trunk/examples/interposing/darwin/fd_interposing/FDInterposing.cpp Tue Sep  6 15:57:50 2016
@@ -7,8 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// This file helps with catching double close calls on unix integer file 
-// descriptors by interposing functions for all file descriptor create and 
+// This file helps with catching double close calls on unix integer file
+// descriptors by interposing functions for all file descriptor create and
 // close operations. A stack backtrace for every create and close function is
 // maintained, and every create and close operation is logged. When a double
 // file descriptor close is encountered, it will be logged.
@@ -18,20 +18,21 @@
 // For sh:
 //  DYLD_INSERT_LIBRARIES=/path/to/FDInterposing.dylib /path/to/executable
 // For tcsh:
-//  (setenv DYLD_INSERT_LIBRARIES=/path/to/FDInterposing.dylib ; /path/to/executable)
+//  (setenv DYLD_INSERT_LIBRARIES=/path/to/FDInterposing.dylib ;
+//  /path/to/executable)
 //
 // Other environment variables that can alter the default actions of this
 // interposing shared library include:
 //
 // "FileDescriptorStackLoggingNoCompact"
 //
-//      With this environment variable set, all file descriptor create and 
-//      delete operations will be permanantly maintained in the event map. 
+//      With this environment variable set, all file descriptor create and
+//      delete operations will be permanantly maintained in the event map.
 //      The default action is to compact the create/delete events by removing
-//      any previous file descriptor create events that are matched with a 
+//      any previous file descriptor create events that are matched with a
 //      corresponding file descriptor delete event when the next valid file
 //      descriptor create event is detected.
-// 
+//
 // "FileDescriptorMinimalLogging"
 //
 //      By default every file descriptor create and delete operation is logged
@@ -49,39 +50,40 @@
 #include <assert.h>
 #include <dirent.h>
 #include <errno.h>
-#include <fcntl.h>
 #include <execinfo.h>
+#include <fcntl.h>
 #include <libgen.h>
-#include <mach-o/dyld.h>
 #include <mach-o/dyld-interposing.h>
-#include <stdlib.h>
+#include <mach-o/dyld.h>
+#include <map>
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
+#include <string>
 #include <sys/event.h>
 #include <sys/mman.h>
 #include <sys/socket.h>
-#include <sys/types.h>
 #include <sys/time.h>
+#include <sys/types.h>
 #include <tr1/memory> // for std::tr1::shared_ptr
 #include <unistd.h>
-#include <string>
 #include <vector>
-#include <map>
 
 //----------------------------------------------------------------------
 /// @def DISALLOW_COPY_AND_ASSIGN(TypeName)
 ///     Macro definition for easily disallowing copy constructor and
 ///     assignment operators in C++ classes.
 //----------------------------------------------------------------------
-#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
-TypeName(const TypeName&); \
-const TypeName& operator=(const TypeName&)
+#define DISALLOW_COPY_AND_ASSIGN(TypeName)                                     \
+  TypeName(const TypeName &);                                                  \
+  const TypeName &operator=(const TypeName &)
 
 extern "C" {
-    int accept$NOCANCEL (int, struct sockaddr * __restrict, socklen_t * __restrict);
-    int close$NOCANCEL(int);
-    int open$NOCANCEL(const char *, int, ...);
-    int __open_extended(const char *, int, uid_t, gid_t, int, struct kauth_filesec *);
+int accept$NOCANCEL(int, struct sockaddr *__restrict, socklen_t *__restrict);
+int close$NOCANCEL(int);
+int open$NOCANCEL(const char *, int, ...);
+int __open_extended(const char *, int, uid_t, gid_t, int,
+                    struct kauth_filesec *);
 }
 
 namespace fd_interposing {
@@ -90,76 +92,55 @@ namespace fd_interposing {
 // String class so we can get formatted strings without having to worry
 // about the memory storage since it will allocate the memory it needs.
 //----------------------------------------------------------------------
-class String
-{
+class String {
 public:
-    String () : 
-        m_str (NULL) 
-    {}
-
-    String (const char *format, ...) : 
-        m_str (NULL)
-    {
-        va_list args;
-        va_start (args, format);
-        vprintf (format, args);
-        va_end (args);
-    }
-    
-    ~String()
-    {
-        reset();
-    }
-    
-    void
-    reset (char *s = NULL)
-    {
-        if (m_str)
-            ::free (m_str);
-        m_str = s;
-    }
-    
-    const char *
-    c_str () const
-    {
-        return m_str;
-    }
+  String() : m_str(NULL) {}
 
-    void
-    printf (const char *format, ...)
-    {
-        va_list args;
-        va_start (args, format);
-        vprintf (format, args);
-        va_end (args);        
-    }
-    void
-    vprintf (const char *format, va_list args)
-    {
-        reset();
-        ::vasprintf (&m_str, format, args);
+  String(const char *format, ...) : m_str(NULL) {
+    va_list args;
+    va_start(args, format);
+    vprintf(format, args);
+    va_end(args);
+  }
+
+  ~String() { reset(); }
+
+  void reset(char *s = NULL) {
+    if (m_str)
+      ::free(m_str);
+    m_str = s;
+  }
+
+  const char *c_str() const { return m_str; }
+
+  void printf(const char *format, ...) {
+    va_list args;
+    va_start(args, format);
+    vprintf(format, args);
+    va_end(args);
+  }
+  void vprintf(const char *format, va_list args) {
+    reset();
+    ::vasprintf(&m_str, format, args);
+  }
+
+  void log(int log_fd) {
+    if (m_str && log_fd >= 0) {
+      const int len = strlen(m_str);
+      if (len > 0) {
+        write(log_fd, m_str, len);
+        const char last_char = m_str[len - 1];
+        if (!(last_char == '\n' || last_char == '\r'))
+          write(log_fd, "\n", 1);
+      }
     }
+  }
 
-    void
-    log (int log_fd)
-    {
-        if (m_str && log_fd >= 0)
-        {
-            const int len = strlen(m_str);
-            if (len > 0)
-            {
-                write (log_fd, m_str, len);
-                const char last_char = m_str[len-1];
-                if (!(last_char == '\n' || last_char == '\r'))
-                    write (log_fd, "\n", 1);
-            }
-        }
-    }
 protected:
-    char *m_str;
-    
+  char *m_str;
+
 private:
-    DISALLOW_COPY_AND_ASSIGN (String);
+  DISALLOW_COPY_AND_ASSIGN(String);
 };
 
 //----------------------------------------------------------------------
@@ -171,7 +152,6 @@ typedef std::vector<void *> Frames;
 typedef std::tr1::shared_ptr<FDEvent> FDEventSP;
 typedef std::tr1::shared_ptr<String> StringSP;
 
-
 //----------------------------------------------------------------------
 // FDEvent
 //
@@ -180,115 +160,75 @@ typedef std::tr1::shared_ptr<String> Str
 // File descriptor events fall into one of two categories: create events
 // and delete events.
 //----------------------------------------------------------------------
-class FDEvent
-{
+class FDEvent {
 public:
-    FDEvent (int fd, int err, const StringSP &string_sp, bool is_create, const Frames& frames) :
-        m_string_sp (string_sp),
-        m_frames (frames.begin(), frames.end()),
-        m_fd (fd),
-        m_err (err),
-        m_is_create (is_create)
-    {}
-    
-    ~FDEvent () {}
-    
-    bool
-    IsCreateEvent() const
-    {
-        return m_is_create;
-    }
+  FDEvent(int fd, int err, const StringSP &string_sp, bool is_create,
+          const Frames &frames)
+      : m_string_sp(string_sp), m_frames(frames.begin(), frames.end()),
+        m_fd(fd), m_err(err), m_is_create(is_create) {}
 
-    bool
-    IsDeleteEvent() const
-    {
-        return !m_is_create;
-    }
+  ~FDEvent() {}
 
-    Frames &
-    GetFrames ()
-    {
-        return m_frames;
-    }
+  bool IsCreateEvent() const { return m_is_create; }
 
-    const Frames &
-    GetFrames () const
-    {
-        return m_frames;
-    }
-    
-    int
-    GetFD () const
-    {
-        return m_fd;
-    }
+  bool IsDeleteEvent() const { return !m_is_create; }
 
-    int
-    GetError () const
-    {
-        return m_err;
-    }
-    
-    void
-    Dump (int log_fd) const;
-
-    void
-    SetCreateEvent (FDEventSP &create_event_sp)
-    {
-        m_create_event_sp = create_event_sp;
-    }
+  Frames &GetFrames() { return m_frames; }
+
+  const Frames &GetFrames() const { return m_frames; }
+
+  int GetFD() const { return m_fd; }
+
+  int GetError() const { return m_err; }
+
+  void Dump(int log_fd) const;
+
+  void SetCreateEvent(FDEventSP &create_event_sp) {
+    m_create_event_sp = create_event_sp;
+  }
 
 private:
-    // A shared pointer to a String that describes this event in 
-    // detail (all args and return and error values)
-    StringSP m_string_sp;
-    // The frames for the stack backtrace for this event
-    Frames m_frames;
-    // If this is a file descriptor delete event, this might contain 
-    // the correspoding file descriptor create event
-    FDEventSP m_create_event_sp;    
-    // The file descriptor for this event
-    int m_fd;
-    // The error code (if any) for this event
-    int m_err;
-    // True if this event is a file descriptor create event, false 
-    // if it is a file descriptor delete event
-    bool m_is_create;
+  // A shared pointer to a String that describes this event in
+  // detail (all args and return and error values)
+  StringSP m_string_sp;
+  // The frames for the stack backtrace for this event
+  Frames m_frames;
+  // If this is a file descriptor delete event, this might contain
+  // the correspoding file descriptor create event
+  FDEventSP m_create_event_sp;
+  // The file descriptor for this event
+  int m_fd;
+  // The error code (if any) for this event
+  int m_err;
+  // True if this event is a file descriptor create event, false
+  // if it is a file descriptor delete event
+  bool m_is_create;
 };
 
 //----------------------------------------------------------------------
-// Templatized class that will save errno only if the "value" it is 
-// constructed with is equal to INVALID. When the class goes out of 
+// Templatized class that will save errno only if the "value" it is
+// constructed with is equal to INVALID. When the class goes out of
 // scope, it will restore errno if it was saved.
 //----------------------------------------------------------------------
-template <int INVALID>
-class Errno
-{
+template <int INVALID> class Errno {
 public:
-    // Save errno only if we are supposed to
-    Errno (int value) :
-        m_saved_errno ((value == INVALID) ? errno : 0),
-        m_restore (value == INVALID)
-    {
-    }
-    
-    // Restore errno only if we are supposed to
-    ~Errno()
-    {
-        if (m_restore)
-            errno = m_saved_errno;
-    }
+  // Save errno only if we are supposed to
+  Errno(int value)
+      : m_saved_errno((value == INVALID) ? errno : 0),
+        m_restore(value == INVALID) {}
+
+  // Restore errno only if we are supposed to
+  ~Errno() {
+    if (m_restore)
+      errno = m_saved_errno;
+  }
 
-    // Accessor for the saved value of errno
-    int
-    get_errno() const
-    {
-        return m_saved_errno;
-    }
+  // Accessor for the saved value of errno
+  int get_errno() const { return m_saved_errno; }
 
 protected:
-    const int m_saved_errno;
-    const bool m_restore;
+  const int m_saved_errno;
+  const bool m_restore;
 };
 
 typedef Errno<-1> InvalidFDErrno;
@@ -303,12 +243,13 @@ typedef std::map<int, FDEventArray> FDEv
 // descriptor create and close events come in, they will get filled
 // into this map (protected by g_mutex). When a file descriptor close
 // event is detected, the open event will be removed and placed into
-// the close event so if something tries to double close a file 
-// descriptor we can show the previous close event and the file 
+// the close event so if something tries to double close a file
+// descriptor we can show the previous close event and the file
 // desctiptor event that created it. When a new file descriptor create
-// event comes in, we will remove the previous one for that file 
-// desctiptor unless the environment variable "FileDescriptorStackLoggingNoCompact"
-// is set. The file desctiptor history can be accessed using the 
+// event comes in, we will remove the previous one for that file
+// desctiptor unless the environment variable
+// "FileDescriptorStackLoggingNoCompact"
+// is set. The file desctiptor history can be accessed using the
 // get_fd_history() function.
 static FDEventMap g_fd_event_map;
 // A mutex to protect access to our data structures in g_fd_event_map
@@ -328,760 +269,662 @@ static bool g_enabled = true;
 // Mutex class that will lock a mutex when it is constructed, and unlock
 // it when is goes out of scope
 //----------------------------------------------------------------------
-class Locker
-{
+class Locker {
 public:
-    Locker (pthread_mutex_t *mutex_ptr) :
-        m_mutex_ptr(mutex_ptr)
-    {
-        ::pthread_mutex_lock (m_mutex_ptr);
-    }
+  Locker(pthread_mutex_t *mutex_ptr) : m_mutex_ptr(mutex_ptr) {
+    ::pthread_mutex_lock(m_mutex_ptr);
+  }
+
+  // This allows clients to test try and acquire the mutex...
+  Locker(pthread_mutex_t *mutex_ptr, bool &lock_acquired) : m_mutex_ptr(NULL) {
+    lock_acquired = ::pthread_mutex_trylock(mutex_ptr) == 0;
+    if (lock_acquired)
+      m_mutex_ptr = mutex_ptr;
+  }
+
+  ~Locker() {
+    if (m_mutex_ptr)
+      ::pthread_mutex_unlock(m_mutex_ptr);
+  }
 
-    // This allows clients to test try and acquire the mutex...
-    Locker (pthread_mutex_t *mutex_ptr, bool &lock_acquired) :
-        m_mutex_ptr(NULL)
-    {
-        lock_acquired = ::pthread_mutex_trylock(mutex_ptr) == 0;
-        if (lock_acquired)
-            m_mutex_ptr = mutex_ptr;
-    }
-
-    ~Locker ()
-    {
-        if (m_mutex_ptr)
-            ::pthread_mutex_unlock (m_mutex_ptr);
-    }
 protected:
-    pthread_mutex_t *m_mutex_ptr;
+  pthread_mutex_t *m_mutex_ptr;
 };
 
-static void
-log (const char *format, ...) __attribute__ ((format (printf, 1, 2)));
+static void log(const char *format, ...) __attribute__((format(printf, 1, 2)));
 
-static void
-log (int log_fd, const FDEvent *event, const char *format, ...) __attribute__ ((format (printf, 3, 4)));
+static void log(int log_fd, const FDEvent *event, const char *format, ...)
+    __attribute__((format(printf, 3, 4)));
 
-static void
-backtrace_log (const char *format, ...) __attribute__ ((format (printf, 1, 2)));
+static void backtrace_log(const char *format, ...)
+    __attribute__((format(printf, 1, 2)));
 
-static void
-backtrace_error (const char *format, ...) __attribute__ ((format (printf, 1, 2)));
-
-static void
-log_to_fd (int log_fd, const char *format, ...) __attribute__ ((format (printf, 2, 3)));
-
-static inline size_t
-get_backtrace (Frames &frame_buffer, size_t frames_to_remove)
-{
-    void *frames[2048];
-    int count = ::backtrace (&frames[0], sizeof(frames)/sizeof(void*));
-    if (count > frames_to_remove)
-        frame_buffer.assign (&frames[frames_to_remove], &frames[count]);
-    else
-        frame_buffer.assign (&frames[0], &frames[count]);
-    while (frame_buffer.back() < (void *)1024)
-        frame_buffer.pop_back();
-    return frame_buffer.size();
+static void backtrace_error(const char *format, ...)
+    __attribute__((format(printf, 1, 2)));
+
+static void log_to_fd(int log_fd, const char *format, ...)
+    __attribute__((format(printf, 2, 3)));
+
+static inline size_t get_backtrace(Frames &frame_buffer,
+                                   size_t frames_to_remove) {
+  void *frames[2048];
+  int count = ::backtrace(&frames[0], sizeof(frames) / sizeof(void *));
+  if (count > frames_to_remove)
+    frame_buffer.assign(&frames[frames_to_remove], &frames[count]);
+  else
+    frame_buffer.assign(&frames[0], &frames[count]);
+  while (frame_buffer.back() < (void *)1024)
+    frame_buffer.pop_back();
+  return frame_buffer.size();
 }
 
 static int g_log_fd = STDOUT_FILENO;
 static int g_initialized = 0;
 
-const char *
-get_process_fullpath (bool force = false)
-{
-    static char g_process_fullpath[PATH_MAX] = {0};
-    if (force || g_process_fullpath[0] == '\0')
-    {
-        // If DST is NULL, then return the number of bytes needed.
-        uint32_t len = sizeof(g_process_fullpath);
-        if (_NSGetExecutablePath (g_process_fullpath, &len) != 0)
-            strncpy (g_process_fullpath, "<error>", sizeof(g_process_fullpath));
-    }
-    return g_process_fullpath;
+const char *get_process_fullpath(bool force = false) {
+  static char g_process_fullpath[PATH_MAX] = {0};
+  if (force || g_process_fullpath[0] == '\0') {
+    // If DST is NULL, then return the number of bytes needed.
+    uint32_t len = sizeof(g_process_fullpath);
+    if (_NSGetExecutablePath(g_process_fullpath, &len) != 0)
+      strncpy(g_process_fullpath, "<error>", sizeof(g_process_fullpath));
+  }
+  return g_process_fullpath;
 }
 
 // Returns the current process ID, or -1 if inserposing not enabled for
 // this process
-static int
-get_interposed_pid()
-{
-    if (!g_enabled)
-        return -1;
-
-    const pid_t pid = getpid();
-    if (g_pid != pid)
-    {
-        if (g_pid == -1)
-        {
-            g_pid = pid;
-            log ("Interposing file descriptor create and delete functions for %s (pid=%i)\n", get_process_fullpath (true), pid);
-        }
-        else
-        {
-            log ("pid=%i: disabling interposing file descriptor create and delete functions for child process %s (pid=%i)\n", g_pid, get_process_fullpath (true), pid);
-            g_enabled = false;
-            return -1;
-        }
-        // Log when our process changes
-    }
-    return g_pid;
-}
-
-static int
-get_logging_fd ()
-{
-    if (!g_enabled)
-        return -1;
-    
-    if (!g_initialized) 
-    {
-        g_initialized = 1;
-
-        const pid_t pid = get_interposed_pid();
-
-        if (g_enabled)
-        {
-            // Keep all stack info around for all fd create and delete calls.
-            // Otherwise we will remove the fd create call when a corresponding
-            // fd delete call is received
-            if (getenv("FileDescriptorStackLoggingNoCompact"))
-                g_compact = 0;
-
-            if (getenv("FileDescriptorMinimalLogging"))
-                g_log_all_calls = 0;
-
-            const char *log_path = getenv ("FileDescriptorLogFile");
-            if (log_path)
-                g_log_fd = ::creat (log_path, 0660);
-            else
-                g_log_fd = STDOUT_FILENO;
-
-            // Only let this interposing happen on the first time this matches
-            // and stop this from happening so any child processes don't also
-            // log their file descriptors
-            ::unsetenv ("DYLD_INSERT_LIBRARIES");
-        }
-        else
-        {
-            log ("pid=%i: logging disabled\n", getpid());
-        }
-    }
-    return g_log_fd;
-}
-
-void
-log_to_fd (int log_fd, const char *format, va_list args)
-{
-    if (format && format[0] && log_fd >= 0)
-    {
-        char buffer[PATH_MAX];
-        const int count = ::vsnprintf (buffer, sizeof(buffer), format, args);
-        if (count > 0)
-            write (log_fd, buffer, count);
+static int get_interposed_pid() {
+  if (!g_enabled)
+    return -1;
+
+  const pid_t pid = getpid();
+  if (g_pid != pid) {
+    if (g_pid == -1) {
+      g_pid = pid;
+      log("Interposing file descriptor create and delete functions for %s "
+          "(pid=%i)\n",
+          get_process_fullpath(true), pid);
+    } else {
+      log("pid=%i: disabling interposing file descriptor create and delete "
+          "functions for child process %s (pid=%i)\n",
+          g_pid, get_process_fullpath(true), pid);
+      g_enabled = false;
+      return -1;
+    }
+    // Log when our process changes
+  }
+  return g_pid;
+}
+
+static int get_logging_fd() {
+  if (!g_enabled)
+    return -1;
+
+  if (!g_initialized) {
+    g_initialized = 1;
+
+    const pid_t pid = get_interposed_pid();
+
+    if (g_enabled) {
+      // Keep all stack info around for all fd create and delete calls.
+      // Otherwise we will remove the fd create call when a corresponding
+      // fd delete call is received
+      if (getenv("FileDescriptorStackLoggingNoCompact"))
+        g_compact = 0;
+
+      if (getenv("FileDescriptorMinimalLogging"))
+        g_log_all_calls = 0;
+
+      const char *log_path = getenv("FileDescriptorLogFile");
+      if (log_path)
+        g_log_fd = ::creat(log_path, 0660);
+      else
+        g_log_fd = STDOUT_FILENO;
+
+      // Only let this interposing happen on the first time this matches
+      // and stop this from happening so any child processes don't also
+      // log their file descriptors
+      ::unsetenv("DYLD_INSERT_LIBRARIES");
+    } else {
+      log("pid=%i: logging disabled\n", getpid());
+    }
+  }
+  return g_log_fd;
+}
+
+void log_to_fd(int log_fd, const char *format, va_list args) {
+  if (format && format[0] && log_fd >= 0) {
+    char buffer[PATH_MAX];
+    const int count = ::vsnprintf(buffer, sizeof(buffer), format, args);
+    if (count > 0)
+      write(log_fd, buffer, count);
+  }
+}
+
+void log_to_fd(int log_fd, const char *format, ...) {
+  if (format && format[0]) {
+    va_list args;
+    va_start(args, format);
+    log_to_fd(log_fd, format, args);
+    va_end(args);
+  }
+}
+
+void log(const char *format, va_list args) {
+  log_to_fd(get_logging_fd(), format, args);
+}
+
+void log(const char *format, ...) {
+  if (format && format[0]) {
+    va_list args;
+    va_start(args, format);
+    log(format, args);
+    va_end(args);
+  }
+}
+
+void log(int log_fd, const FDEvent *event, const char *format, ...) {
+  if (format && format[0]) {
+    va_list args;
+    va_start(args, format);
+    log_to_fd(log_fd, format, args);
+    va_end(args);
+  }
+  if (event)
+    event->Dump(log_fd);
+}
+
+void FDEvent::Dump(int log_fd) const {
+  if (log_fd >= 0) {
+    log_to_fd(log_fd, "%s\n", m_string_sp->c_str());
+    if (!m_frames.empty())
+      ::backtrace_symbols_fd(m_frames.data(), m_frames.size(), log_fd);
+
+    if (m_create_event_sp) {
+      log_to_fd(log_fd, "\nfd=%i was created with this event:\n", m_fd);
+      m_create_event_sp->Dump(log_fd);
+      log_to_fd(log_fd, "\n");
+    }
+  }
+}
+
+void backtrace_log(const char *format, ...) {
+  const int log_fd = get_logging_fd();
+  if (log_fd >= 0) {
+    if (format && format[0]) {
+      va_list args;
+      va_start(args, format);
+      log(format, args);
+      va_end(args);
     }
-}
 
-void
-log_to_fd (int log_fd, const char *format, ...)
-{
-    if (format && format[0])
-    {
-        va_list args;
-        va_start (args, format);
-        log_to_fd (log_fd, format, args);
-        va_end (args);
-    }
-}
-
-void
-log (const char *format, va_list args)
-{
-    log_to_fd (get_logging_fd (), format, args);
+    Frames frames;
+    if (get_backtrace(frames, 2))
+      ::backtrace_symbols_fd(frames.data(), frames.size(), log_fd);
+  }
 }
 
-void
-log (const char *format, ...)
-{
-    if (format && format[0])
-    {
-        va_list args;
-        va_start (args, format);
-        log (format, args);
-        va_end (args);
-    }
-}
+void backtrace_error(const char *format, ...) {
+  const int pid = get_interposed_pid();
+  if (pid >= 0) {
+    const int log_fd = get_logging_fd();
+    if (log_fd >= 0) {
+      log("\nerror: %s (pid=%i): ", get_process_fullpath(), pid);
 
-void
-log (int log_fd, const FDEvent *event, const char *format, ...)
-{
-    if (format && format[0])
-    {
+      if (format && format[0]) {
         va_list args;
-        va_start (args, format);
-        log_to_fd (log_fd, format, args);
-        va_end (args);
-    }
-    if (event)
-        event->Dump(log_fd);
-}
-
-void
-FDEvent::Dump (int log_fd) const
-{
-    if (log_fd >= 0)
-    {
-        log_to_fd (log_fd, "%s\n", m_string_sp->c_str());
-        if (!m_frames.empty())
-            ::backtrace_symbols_fd (m_frames.data(), m_frames.size(), log_fd);
-        
-        if (m_create_event_sp)
-        {
-            log_to_fd (log_fd, "\nfd=%i was created with this event:\n", m_fd);
-            m_create_event_sp->Dump (log_fd);
-            log_to_fd (log_fd, "\n");
-        }
-    }
-}
-
-
-void
-backtrace_log (const char *format, ...)
-{
-    const int log_fd = get_logging_fd ();
-    if (log_fd >= 0)
-    {
-        if (format && format[0])
-        {
-            va_list args;
-            va_start (args, format);
-            log (format, args);
-            va_end (args);
-        }
-        
-        Frames frames;
-        if (get_backtrace(frames, 2))
-            ::backtrace_symbols_fd (frames.data(), frames.size(), log_fd);
-    }
-
-}
-
-void
-backtrace_error (const char *format, ...)
-{
-    const int pid = get_interposed_pid();
-    if (pid >= 0)
-    {
-        const int log_fd = get_logging_fd ();
-        if (log_fd >= 0)
-        {
-            log ("\nerror: %s (pid=%i): ", get_process_fullpath (), pid);
-
-            if (format && format[0])
-            {
-                va_list args;
-                va_start (args, format);
-                log (format, args);
-                va_end (args);
-            }
-        
-            Frames frames;
-            if (get_backtrace(frames, 2))
-                ::backtrace_symbols_fd (frames.data(), frames.size(), log_fd);
-        }
-    }
-}
-
-void
-save_backtrace (int fd, int err, const StringSP &string_sp, bool is_create)
-{
-    Frames frames;
-    get_backtrace(frames, 2);
-
-    FDEventSP fd_event_sp (new FDEvent (fd, err, string_sp, is_create, frames));
-
-    FDEventMap::iterator pos = g_fd_event_map.find (fd);
-    
-    if (pos != g_fd_event_map.end())
-    {
-        // We have history for this fd...
-        
-        FDEventArray &event_array = g_fd_event_map[fd];
-        if (fd_event_sp->IsCreateEvent())
-        {
-            // The current fd event is a function that creates 
-            // a descriptor, check in case last event was
-            // a create event.
-            if (event_array.back()->IsCreateEvent())
-            {
-                const int log_fd = get_logging_fd();
-                // Two fd create functions in a row, we missed
-                // a function that closes a fd...
-                log (log_fd, fd_event_sp.get(), "\nwarning: unmatched file descriptor create event fd=%i (we missed a file descriptor close event):\n", fd);
-            }
-            else if (g_compact)
-            {
-                // We are compacting so we remove previous create event
-                // when we get the correspinding delete event
-                event_array.pop_back();
-            }
-        }
-        else
-        {
-            // The current fd event is a function that deletes 
-            // a descriptor, check in case last event for this
-            // fd was a delete event (double close!)
-            if (event_array.back()->IsDeleteEvent())
-            {
-                const int log_fd = get_logging_fd();
-                // Two fd delete functions in a row, we must 
-                // have missed some function that opened a descriptor
-                log (log_fd, fd_event_sp.get(), "\nwarning: unmatched file descriptor close event for fd=%d (we missed the file descriptor create event):\n", fd);
-            }
-            else if (g_compact)
-            {
-                // Since this is a close event, we want to remember the open event 
-                // that this close if for...
-                fd_event_sp->SetCreateEvent(event_array.back());
-                // We are compacting so we remove previous create event
-                // when we get the correspinding delete event
-                event_array.pop_back();
-            }
-        }
-        
-        event_array.push_back(fd_event_sp);
-    }
-    else
-    {
-        g_fd_event_map[fd].push_back(fd_event_sp);
-    }
+        va_start(args, format);
+        log(format, args);
+        va_end(args);
+      }
+
+      Frames frames;
+      if (get_backtrace(frames, 2))
+        ::backtrace_symbols_fd(frames.data(), frames.size(), log_fd);
+    }
+  }
+}
+
+void save_backtrace(int fd, int err, const StringSP &string_sp,
+                    bool is_create) {
+  Frames frames;
+  get_backtrace(frames, 2);
+
+  FDEventSP fd_event_sp(new FDEvent(fd, err, string_sp, is_create, frames));
+
+  FDEventMap::iterator pos = g_fd_event_map.find(fd);
+
+  if (pos != g_fd_event_map.end()) {
+    // We have history for this fd...
+
+    FDEventArray &event_array = g_fd_event_map[fd];
+    if (fd_event_sp->IsCreateEvent()) {
+      // The current fd event is a function that creates
+      // a descriptor, check in case last event was
+      // a create event.
+      if (event_array.back()->IsCreateEvent()) {
+        const int log_fd = get_logging_fd();
+        // Two fd create functions in a row, we missed
+        // a function that closes a fd...
+        log(log_fd, fd_event_sp.get(), "\nwarning: unmatched file descriptor "
+                                       "create event fd=%i (we missed a file "
+                                       "descriptor close event):\n",
+            fd);
+      } else if (g_compact) {
+        // We are compacting so we remove previous create event
+        // when we get the correspinding delete event
+        event_array.pop_back();
+      }
+    } else {
+      // The current fd event is a function that deletes
+      // a descriptor, check in case last event for this
+      // fd was a delete event (double close!)
+      if (event_array.back()->IsDeleteEvent()) {
+        const int log_fd = get_logging_fd();
+        // Two fd delete functions in a row, we must
+        // have missed some function that opened a descriptor
+        log(log_fd, fd_event_sp.get(), "\nwarning: unmatched file descriptor "
+                                       "close event for fd=%d (we missed the "
+                                       "file descriptor create event):\n",
+            fd);
+      } else if (g_compact) {
+        // Since this is a close event, we want to remember the open event
+        // that this close if for...
+        fd_event_sp->SetCreateEvent(event_array.back());
+        // We are compacting so we remove previous create event
+        // when we get the correspinding delete event
+        event_array.pop_back();
+      }
+    }
+
+    event_array.push_back(fd_event_sp);
+  } else {
+    g_fd_event_map[fd].push_back(fd_event_sp);
+  }
 }
 
 //----------------------------------------------------------------------
 // socket() interpose function
 //----------------------------------------------------------------------
-extern "C" int
-socket$__interposed__ (int domain, int type, int protocol)
-{
-    const int pid = get_interposed_pid();
-    if (pid >= 0)
-    {
-        Locker locker (&g_mutex);
-        const int fd = ::socket (domain, type, protocol);
-        InvalidFDErrno fd_errno(fd);
-        StringSP description_sp(new String);
-        if (fd == -1)
-            description_sp->printf("pid=%i: socket (domain = %i, type = %i, protocol = %i) => fd=%i  errno = %i", pid, domain, type, protocol, fd, fd_errno.get_errno());
-        else
-            description_sp->printf("pid=%i: socket (domain = %i, type = %i, protocol = %i) => fd=%i", pid, domain, type, protocol, fd);
-        if (g_log_all_calls)
-            description_sp->log (get_logging_fd());
-        if (fd >= 0)
-            save_backtrace (fd, fd_errno.get_errno(), description_sp, true);
-        return fd;
-    }
-    else
-    {
-        return ::socket (domain, type, protocol);
-    }
+extern "C" int socket$__interposed__(int domain, int type, int protocol) {
+  const int pid = get_interposed_pid();
+  if (pid >= 0) {
+    Locker locker(&g_mutex);
+    const int fd = ::socket(domain, type, protocol);
+    InvalidFDErrno fd_errno(fd);
+    StringSP description_sp(new String);
+    if (fd == -1)
+      description_sp->printf("pid=%i: socket (domain = %i, type = %i, protocol "
+                             "= %i) => fd=%i  errno = %i",
+                             pid, domain, type, protocol, fd,
+                             fd_errno.get_errno());
+    else
+      description_sp->printf(
+          "pid=%i: socket (domain = %i, type = %i, protocol = %i) => fd=%i",
+          pid, domain, type, protocol, fd);
+    if (g_log_all_calls)
+      description_sp->log(get_logging_fd());
+    if (fd >= 0)
+      save_backtrace(fd, fd_errno.get_errno(), description_sp, true);
+    return fd;
+  } else {
+    return ::socket(domain, type, protocol);
+  }
 }
 
 //----------------------------------------------------------------------
 // socketpair() interpose function
 //----------------------------------------------------------------------
-extern "C" int
-socketpair$__interposed__ (int domain, int type, int protocol, int fds[2])
-{
-    const int pid = get_interposed_pid();
-    if (pid >= 0)
-    {
-        Locker locker (&g_mutex);
-        fds[0] = -1;
-        fds[1] = -1;
-        const int err = socketpair (domain, type, protocol, fds);
-        NegativeErrorErrno err_errno(err);
-        StringSP description_sp(new String ("pid=%i: socketpair (domain=%i, type=%i, protocol=%i, {fd=%i, fd=%i}) -> err=%i", pid, domain, type, protocol, fds[0], fds[1], err));
-        if (g_log_all_calls)
-            description_sp->log (get_logging_fd());
-        if (fds[0] >= 0)
-            save_backtrace (fds[0], err_errno.get_errno(), description_sp, true);
-        if (fds[1] >= 0)
-            save_backtrace (fds[1], err_errno.get_errno(), description_sp, true);
-        return err;
-    }
-    else
-    {
-        return socketpair (domain, type, protocol, fds);
-    }
+extern "C" int socketpair$__interposed__(int domain, int type, int protocol,
+                                         int fds[2]) {
+  const int pid = get_interposed_pid();
+  if (pid >= 0) {
+    Locker locker(&g_mutex);
+    fds[0] = -1;
+    fds[1] = -1;
+    const int err = socketpair(domain, type, protocol, fds);
+    NegativeErrorErrno err_errno(err);
+    StringSP description_sp(
+        new String("pid=%i: socketpair (domain=%i, type=%i, protocol=%i, "
+                   "{fd=%i, fd=%i}) -> err=%i",
+                   pid, domain, type, protocol, fds[0], fds[1], err));
+    if (g_log_all_calls)
+      description_sp->log(get_logging_fd());
+    if (fds[0] >= 0)
+      save_backtrace(fds[0], err_errno.get_errno(), description_sp, true);
+    if (fds[1] >= 0)
+      save_backtrace(fds[1], err_errno.get_errno(), description_sp, true);
+    return err;
+  } else {
+    return socketpair(domain, type, protocol, fds);
+  }
 }
 
 //----------------------------------------------------------------------
 // open() interpose function
 //----------------------------------------------------------------------
-extern "C" int	
-open$__interposed__ (const char *path, int oflag, int mode)
-{
-    const int pid = get_interposed_pid();
-    if (pid >= 0)
-    {
-        Locker locker (&g_mutex);
-        int fd = -2;
-        StringSP description_sp(new String);
-        if (oflag & O_CREAT)
-        {
-            fd = ::open (path, oflag, mode);
-            description_sp->printf("pid=%i: open (path = '%s', oflag = %i, mode = %i) -> fd=%i", pid, path, oflag, mode, fd);
-        }
-        else
-        {
-            fd = ::open (path, oflag);
-            description_sp->printf("pid=%i: open (path = '%s', oflag = %i) -> fd=%i", pid, path, oflag, fd);
-        }
-    
-        InvalidFDErrno fd_errno(fd);
-        if (g_log_all_calls)
-            description_sp->log (get_logging_fd());
-        if (fd >= 0)
-            save_backtrace (fd, fd_errno.get_errno(), description_sp, true);
-        return fd;
-    }
-    else
-    {
-        return ::open (path, oflag, mode);
-    }
+extern "C" int open$__interposed__(const char *path, int oflag, int mode) {
+  const int pid = get_interposed_pid();
+  if (pid >= 0) {
+    Locker locker(&g_mutex);
+    int fd = -2;
+    StringSP description_sp(new String);
+    if (oflag & O_CREAT) {
+      fd = ::open(path, oflag, mode);
+      description_sp->printf(
+          "pid=%i: open (path = '%s', oflag = %i, mode = %i) -> fd=%i", pid,
+          path, oflag, mode, fd);
+    } else {
+      fd = ::open(path, oflag);
+      description_sp->printf("pid=%i: open (path = '%s', oflag = %i) -> fd=%i",
+                             pid, path, oflag, fd);
+    }
+
+    InvalidFDErrno fd_errno(fd);
+    if (g_log_all_calls)
+      description_sp->log(get_logging_fd());
+    if (fd >= 0)
+      save_backtrace(fd, fd_errno.get_errno(), description_sp, true);
+    return fd;
+  } else {
+    return ::open(path, oflag, mode);
+  }
 }
 
 //----------------------------------------------------------------------
 // open$NOCANCEL() interpose function
 //----------------------------------------------------------------------
-extern "C" int	
-open$NOCANCEL$__interposed__ (const char *path, int oflag, int mode)
-{
-    const int pid = get_interposed_pid();
-    if (pid >= 0)
-    {
-        Locker locker (&g_mutex);
-        const int fd = ::open$NOCANCEL (path, oflag, mode);
-        InvalidFDErrno fd_errno(fd);
-        StringSP description_sp(new String ("pid=%i: open$NOCANCEL (path = '%s', oflag = %i, mode = %i) -> fd=%i", pid, path, oflag, mode, fd));
-        if (g_log_all_calls)
-            description_sp->log (get_logging_fd());
-        if (fd >= 0)
-            save_backtrace (fd, fd_errno.get_errno(), description_sp, true);
-        return fd;        
-    }
-    else
-    {
-        return ::open$NOCANCEL (path, oflag, mode);
-    }
+extern "C" int open$NOCANCEL$__interposed__(const char *path, int oflag,
+                                            int mode) {
+  const int pid = get_interposed_pid();
+  if (pid >= 0) {
+    Locker locker(&g_mutex);
+    const int fd = ::open$NOCANCEL(path, oflag, mode);
+    InvalidFDErrno fd_errno(fd);
+    StringSP description_sp(new String(
+        "pid=%i: open$NOCANCEL (path = '%s', oflag = %i, mode = %i) -> fd=%i",
+        pid, path, oflag, mode, fd));
+    if (g_log_all_calls)
+      description_sp->log(get_logging_fd());
+    if (fd >= 0)
+      save_backtrace(fd, fd_errno.get_errno(), description_sp, true);
+    return fd;
+  } else {
+    return ::open$NOCANCEL(path, oflag, mode);
+  }
 }
 
-
 //----------------------------------------------------------------------
 // __open_extended() interpose function
 //----------------------------------------------------------------------
-extern "C" int 
-__open_extended$__interposed__ (const char *path, int oflag, uid_t uid, gid_t gid, int mode, struct kauth_filesec *fsacl)
-{
-    const int pid = get_interposed_pid();
-    if (pid >= 0)
-    {
-        Locker locker (&g_mutex);
-        const int fd = ::__open_extended (path, oflag, uid, gid, mode, fsacl);
-        InvalidFDErrno fd_errno(fd);
-        StringSP description_sp(new String ("pid=%i: __open_extended (path='%s', oflag=%i, uid=%i, gid=%i, mode=%i, fsacl=%p) -> fd=%i", pid, path, oflag, uid, gid, mode, fsacl, fd));
-        if (g_log_all_calls)
-            description_sp->log (get_logging_fd());
-        if (fd >= 0)
-            save_backtrace (fd, fd_errno.get_errno(), description_sp, true);
-        return fd;
-    }
-    else
-    {
-        return ::__open_extended (path, oflag, uid, gid, mode, fsacl);
-    }
+extern "C" int __open_extended$__interposed__(const char *path, int oflag,
+                                              uid_t uid, gid_t gid, int mode,
+                                              struct kauth_filesec *fsacl) {
+  const int pid = get_interposed_pid();
+  if (pid >= 0) {
+    Locker locker(&g_mutex);
+    const int fd = ::__open_extended(path, oflag, uid, gid, mode, fsacl);
+    InvalidFDErrno fd_errno(fd);
+    StringSP description_sp(
+        new String("pid=%i: __open_extended (path='%s', oflag=%i, uid=%i, "
+                   "gid=%i, mode=%i, fsacl=%p) -> fd=%i",
+                   pid, path, oflag, uid, gid, mode, fsacl, fd));
+    if (g_log_all_calls)
+      description_sp->log(get_logging_fd());
+    if (fd >= 0)
+      save_backtrace(fd, fd_errno.get_errno(), description_sp, true);
+    return fd;
+  } else {
+    return ::__open_extended(path, oflag, uid, gid, mode, fsacl);
+  }
 }
 
 //----------------------------------------------------------------------
 // kqueue() interpose function
 //----------------------------------------------------------------------
-extern "C" int
-kqueue$__interposed__ (void)
-{
-    const int pid = get_interposed_pid();
-    if (pid >= 0)
-    {
-        Locker locker (&g_mutex);
-        const int fd = ::kqueue ();
-        InvalidFDErrno fd_errno(fd);
-        StringSP description_sp(new String ("pid=%i: kqueue () -> fd=%i", pid, fd));
-        if (g_log_all_calls)
-            description_sp->log (get_logging_fd());
-        if (fd >= 0)
-            save_backtrace (fd, fd_errno.get_errno(), description_sp, true);
-        return fd;
-    }
-    else
-    {
-        return ::kqueue ();
-    }
+extern "C" int kqueue$__interposed__(void) {
+  const int pid = get_interposed_pid();
+  if (pid >= 0) {
+    Locker locker(&g_mutex);
+    const int fd = ::kqueue();
+    InvalidFDErrno fd_errno(fd);
+    StringSP description_sp(new String("pid=%i: kqueue () -> fd=%i", pid, fd));
+    if (g_log_all_calls)
+      description_sp->log(get_logging_fd());
+    if (fd >= 0)
+      save_backtrace(fd, fd_errno.get_errno(), description_sp, true);
+    return fd;
+  } else {
+    return ::kqueue();
+  }
 }
 
 //----------------------------------------------------------------------
 // shm_open() interpose function
 //----------------------------------------------------------------------
-extern "C" int	
-shm_open$__interposed__ (const char *path, int oflag, int mode)
-{
-    const int pid = get_interposed_pid();
-    if (pid >= 0)
-    {
-        Locker locker (&g_mutex);
-        const int fd = ::shm_open (path, oflag, mode);
-        InvalidFDErrno fd_errno(fd);
-        StringSP description_sp(new String ("pid=%i: shm_open (path = '%s', oflag = %i, mode = %i) -> fd=%i", pid, path, oflag, mode, fd));
-        if (g_log_all_calls)
-            description_sp->log (get_logging_fd());
-        if (fd >= 0)
-            save_backtrace (fd, fd_errno.get_errno(), description_sp, true);
-        return fd;
-    }
-    else
-    {
-        return ::shm_open (path, oflag, mode);
-    }
+extern "C" int shm_open$__interposed__(const char *path, int oflag, int mode) {
+  const int pid = get_interposed_pid();
+  if (pid >= 0) {
+    Locker locker(&g_mutex);
+    const int fd = ::shm_open(path, oflag, mode);
+    InvalidFDErrno fd_errno(fd);
+    StringSP description_sp(new String(
+        "pid=%i: shm_open (path = '%s', oflag = %i, mode = %i) -> fd=%i", pid,
+        path, oflag, mode, fd));
+    if (g_log_all_calls)
+      description_sp->log(get_logging_fd());
+    if (fd >= 0)
+      save_backtrace(fd, fd_errno.get_errno(), description_sp, true);
+    return fd;
+  } else {
+    return ::shm_open(path, oflag, mode);
+  }
 }
 
 //----------------------------------------------------------------------
 // accept() interpose function
 //----------------------------------------------------------------------
-extern "C" int
-accept$__interposed__ (int socket, struct sockaddr *address, socklen_t *address_len)
-{
-    const int pid = get_interposed_pid();
-    if (pid >= 0)
-    {
-        Locker locker (&g_mutex);
-        const int fd = ::accept (socket, address, address_len);
-        InvalidFDErrno fd_errno(fd);
-        StringSP description_sp(new String ("pid=%i: accept (socket=%i, ...) -> fd=%i", pid, socket, fd));
-        if (g_log_all_calls)
-            description_sp->log (get_logging_fd());
-        if (fd >= 0)
-            save_backtrace (fd, fd_errno.get_errno(), description_sp, true);
-        return fd;
-    }
-    else
-    {
-        return ::accept (socket, address, address_len);
-    }
+extern "C" int accept$__interposed__(int socket, struct sockaddr *address,
+                                     socklen_t *address_len) {
+  const int pid = get_interposed_pid();
+  if (pid >= 0) {
+    Locker locker(&g_mutex);
+    const int fd = ::accept(socket, address, address_len);
+    InvalidFDErrno fd_errno(fd);
+    StringSP description_sp(new String(
+        "pid=%i: accept (socket=%i, ...) -> fd=%i", pid, socket, fd));
+    if (g_log_all_calls)
+      description_sp->log(get_logging_fd());
+    if (fd >= 0)
+      save_backtrace(fd, fd_errno.get_errno(), description_sp, true);
+    return fd;
+  } else {
+    return ::accept(socket, address, address_len);
+  }
 }
 
-
 //----------------------------------------------------------------------
 // accept$NOCANCEL() interpose function
 //----------------------------------------------------------------------
-extern "C" int
-accept$NOCANCEL$__interposed__ (int socket, struct sockaddr *address, socklen_t *address_len)
-{
-    const int pid = get_interposed_pid();
-    if (pid >= 0)
-    {
-        Locker locker (&g_mutex);
-        const int fd = ::accept$NOCANCEL (socket, address, address_len);
-        InvalidFDErrno fd_errno(fd);
-        StringSP description_sp(new String ("pid=%i: accept$NOCANCEL (socket=%i, ...) -> fd=%i", pid, socket, fd));
-        if (g_log_all_calls)
-            description_sp->log (get_logging_fd());
-        if (fd >= 0)
-            save_backtrace (fd, fd_errno.get_errno(), description_sp, true);
-        return fd;
-    }
-    else
-    {
-        return ::accept$NOCANCEL (socket, address, address_len);
-    }
+extern "C" int accept$NOCANCEL$__interposed__(int socket,
+                                              struct sockaddr *address,
+                                              socklen_t *address_len) {
+  const int pid = get_interposed_pid();
+  if (pid >= 0) {
+    Locker locker(&g_mutex);
+    const int fd = ::accept$NOCANCEL(socket, address, address_len);
+    InvalidFDErrno fd_errno(fd);
+    StringSP description_sp(new String(
+        "pid=%i: accept$NOCANCEL (socket=%i, ...) -> fd=%i", pid, socket, fd));
+    if (g_log_all_calls)
+      description_sp->log(get_logging_fd());
+    if (fd >= 0)
+      save_backtrace(fd, fd_errno.get_errno(), description_sp, true);
+    return fd;
+  } else {
+    return ::accept$NOCANCEL(socket, address, address_len);
+  }
 }
 
 //----------------------------------------------------------------------
 // dup() interpose function
 //----------------------------------------------------------------------
-extern "C" int	
-dup$__interposed__ (int fd2)
-{
-    const int pid = get_interposed_pid();
-    if (pid >= 0)
-    {
-        Locker locker (&g_mutex);
-        const int fd = ::dup (fd2);
-        InvalidFDErrno fd_errno(fd);
-        StringSP description_sp(new String ("pid=%i: dup (fd2=%i) -> fd=%i", pid, fd2, fd));
-        if (g_log_all_calls)
-            description_sp->log (get_logging_fd());
-        if (fd >= 0)
-            save_backtrace (fd, fd_errno.get_errno(), description_sp, true);
-        return fd;
-    }
-    else
-    {
-        return ::dup (fd2);
-    }
+extern "C" int dup$__interposed__(int fd2) {
+  const int pid = get_interposed_pid();
+  if (pid >= 0) {
+    Locker locker(&g_mutex);
+    const int fd = ::dup(fd2);
+    InvalidFDErrno fd_errno(fd);
+    StringSP description_sp(
+        new String("pid=%i: dup (fd2=%i) -> fd=%i", pid, fd2, fd));
+    if (g_log_all_calls)
+      description_sp->log(get_logging_fd());
+    if (fd >= 0)
+      save_backtrace(fd, fd_errno.get_errno(), description_sp, true);
+    return fd;
+  } else {
+    return ::dup(fd2);
+  }
 }
 
 //----------------------------------------------------------------------
 // dup2() interpose function
 //----------------------------------------------------------------------
-extern "C" int	
-dup2$__interposed__ (int fd1, int fd2)
-{
-    const int pid = get_interposed_pid();
-    if (pid >= 0)
-    {
-        Locker locker (&g_mutex);
-        // If "fd2" is already opened, it will be closed during the
-        // dup2 call below, so we need to see if we have fd2 in our
-        // open map and treat it as a close(fd2)
-        FDEventMap::iterator pos = g_fd_event_map.find (fd2);
-        StringSP dup2_close_description_sp(new String ("pid=%i: dup2 (fd1=%i, fd2=%i) -> will close (fd=%i)", pid, fd1, fd2, fd2));
-        if (pos != g_fd_event_map.end() && pos->second.back()->IsCreateEvent())
-            save_backtrace (fd2, 0, dup2_close_description_sp, false);
-
-        const int fd = ::dup2(fd1, fd2);
-        InvalidFDErrno fd_errno(fd);
-        StringSP description_sp(new String ("pid=%i: dup2 (fd1=%i, fd2=%i) -> fd=%i", pid, fd1, fd2, fd));
-        if (g_log_all_calls)
-            description_sp->log (get_logging_fd());
-
-        if (fd >= 0)
-            save_backtrace (fd, fd_errno.get_errno(), description_sp, true);
-        return fd;
-    }
-    else
-    {
-        return ::dup2(fd1, fd2);
-    }
+extern "C" int dup2$__interposed__(int fd1, int fd2) {
+  const int pid = get_interposed_pid();
+  if (pid >= 0) {
+    Locker locker(&g_mutex);
+    // If "fd2" is already opened, it will be closed during the
+    // dup2 call below, so we need to see if we have fd2 in our
+    // open map and treat it as a close(fd2)
+    FDEventMap::iterator pos = g_fd_event_map.find(fd2);
+    StringSP dup2_close_description_sp(
+        new String("pid=%i: dup2 (fd1=%i, fd2=%i) -> will close (fd=%i)", pid,
+                   fd1, fd2, fd2));
+    if (pos != g_fd_event_map.end() && pos->second.back()->IsCreateEvent())
+      save_backtrace(fd2, 0, dup2_close_description_sp, false);
+
+    const int fd = ::dup2(fd1, fd2);
+    InvalidFDErrno fd_errno(fd);
+    StringSP description_sp(new String("pid=%i: dup2 (fd1=%i, fd2=%i) -> fd=%i",
+                                       pid, fd1, fd2, fd));
+    if (g_log_all_calls)
+      description_sp->log(get_logging_fd());
+
+    if (fd >= 0)
+      save_backtrace(fd, fd_errno.get_errno(), description_sp, true);
+    return fd;
+  } else {
+    return ::dup2(fd1, fd2);
+  }
 }
 
 //----------------------------------------------------------------------
 // close() interpose function
 //----------------------------------------------------------------------
-extern "C" int 
-close$__interposed__ (int fd) 
-{
-    const int pid = get_interposed_pid();
-    if (pid >= 0)
-    {
-        Locker locker (&g_mutex);
-        const int err = close(fd);
-        NegativeErrorErrno err_errno(err);
-        StringSP description_sp (new String);
-        if (err == -1)
-            description_sp->printf("pid=%i: close (fd=%i) => %i errno = %i (%s))", pid, fd, err, err_errno.get_errno(), strerror(err_errno.get_errno()));
-        else
-            description_sp->printf("pid=%i: close (fd=%i) => %i", pid, fd, err);
-        if (g_log_all_calls)
-            description_sp->log (get_logging_fd());
-
-        if (err == 0)
-        {
-            if (fd >= 0)
-                save_backtrace (fd, err, description_sp, false);
-        }
-        else if (err == -1)
-        {
-            if (err_errno.get_errno() == EBADF && fd != -1) 
-            {
-                backtrace_error ("close (fd=%d) resulted in EBADF:\n", fd);
-
-                FDEventMap::iterator pos = g_fd_event_map.find (fd);
-                if (pos != g_fd_event_map.end())
-                {
-                    log (get_logging_fd(), pos->second.back().get(), "\nfd=%d was previously %s with this event:\n", fd, pos->second.back()->IsCreateEvent() ? "opened" : "closed");
-                }
-            }
-        }
-        return err;
-    }
-    else
-    {
-        return close (fd);        
-    }
+extern "C" int close$__interposed__(int fd) {
+  const int pid = get_interposed_pid();
+  if (pid >= 0) {
+    Locker locker(&g_mutex);
+    const int err = close(fd);
+    NegativeErrorErrno err_errno(err);
+    StringSP description_sp(new String);
+    if (err == -1)
+      description_sp->printf("pid=%i: close (fd=%i) => %i errno = %i (%s))",
+                             pid, fd, err, err_errno.get_errno(),
+                             strerror(err_errno.get_errno()));
+    else
+      description_sp->printf("pid=%i: close (fd=%i) => %i", pid, fd, err);
+    if (g_log_all_calls)
+      description_sp->log(get_logging_fd());
+
+    if (err == 0) {
+      if (fd >= 0)
+        save_backtrace(fd, err, description_sp, false);
+    } else if (err == -1) {
+      if (err_errno.get_errno() == EBADF && fd != -1) {
+        backtrace_error("close (fd=%d) resulted in EBADF:\n", fd);
+
+        FDEventMap::iterator pos = g_fd_event_map.find(fd);
+        if (pos != g_fd_event_map.end()) {
+          log(get_logging_fd(), pos->second.back().get(),
+              "\nfd=%d was previously %s with this event:\n", fd,
+              pos->second.back()->IsCreateEvent() ? "opened" : "closed");
+        }
+      }
+    }
+    return err;
+  } else {
+    return close(fd);
+  }
 }
 
 //----------------------------------------------------------------------
 // close$NOCANCEL() interpose function
 //----------------------------------------------------------------------
-extern "C" int
-close$NOCANCEL$__interposed__ (int fd)
-{
-    const int pid = get_interposed_pid();
-    if (pid >= 0)
-    {
-        Locker locker (&g_mutex);
-        const int err = close$NOCANCEL(fd);
-        NegativeErrorErrno err_errno(err);
-        StringSP description_sp (new String);
-        if (err == -1)
-            description_sp->printf("pid=%i: close$NOCANCEL (fd=%i) => %i errno = %i (%s))", pid, fd, err, err_errno.get_errno(), strerror(err_errno.get_errno()));
-        else
-            description_sp->printf("pid=%i: close$NOCANCEL (fd=%i) => %i", pid, fd, err);
-        if (g_log_all_calls)
-            description_sp->log (get_logging_fd());
-    
-        if (err == 0)
-        {
-            if (fd >= 0)
-                save_backtrace (fd, err, description_sp, false);
-        }
-        else if (err == -1)
-        {
-            if (err_errno.get_errno() == EBADF && fd != -1) 
-            {
-                backtrace_error ("close$NOCANCEL (fd=%d) resulted in EBADF\n:", fd);
-            
-                FDEventMap::iterator pos = g_fd_event_map.find (fd);
-                if (pos != g_fd_event_map.end())
-                {
-                    log (get_logging_fd(), pos->second.back().get(), "\nfd=%d was previously %s with this event:\n", fd, pos->second.back()->IsCreateEvent() ? "opened" : "closed");
-                }
-            }
-        }
-        return err;
-    }
-    else
-    {
-        return close$NOCANCEL(fd);
-    }    
+extern "C" int close$NOCANCEL$__interposed__(int fd) {
+  const int pid = get_interposed_pid();
+  if (pid >= 0) {
+    Locker locker(&g_mutex);
+    const int err = close$NOCANCEL(fd);
+    NegativeErrorErrno err_errno(err);
+    StringSP description_sp(new String);
+    if (err == -1)
+      description_sp->printf(
+          "pid=%i: close$NOCANCEL (fd=%i) => %i errno = %i (%s))", pid, fd, err,
+          err_errno.get_errno(), strerror(err_errno.get_errno()));
+    else
+      description_sp->printf("pid=%i: close$NOCANCEL (fd=%i) => %i", pid, fd,
+                             err);
+    if (g_log_all_calls)
+      description_sp->log(get_logging_fd());
+
+    if (err == 0) {
+      if (fd >= 0)
+        save_backtrace(fd, err, description_sp, false);
+    } else if (err == -1) {
+      if (err_errno.get_errno() == EBADF && fd != -1) {
+        backtrace_error("close$NOCANCEL (fd=%d) resulted in EBADF\n:", fd);
+
+        FDEventMap::iterator pos = g_fd_event_map.find(fd);
+        if (pos != g_fd_event_map.end()) {
+          log(get_logging_fd(), pos->second.back().get(),
+              "\nfd=%d was previously %s with this event:\n", fd,
+              pos->second.back()->IsCreateEvent() ? "opened" : "closed");
+        }
+      }
+    }
+    return err;
+  } else {
+    return close$NOCANCEL(fd);
+  }
 }
 
 //----------------------------------------------------------------------
 // pipe() interpose function
 //----------------------------------------------------------------------
-extern "C" int
-pipe$__interposed__ (int fds[2])
-{
-    const int pid = get_interposed_pid();
-    if (pid >= 0)
-    {
-        Locker locker (&g_mutex);
-        fds[0] = -1;
-        fds[1] = -1;
-        const int err = pipe (fds);
-        const int saved_errno = errno;
-        StringSP description_sp(new String ("pid=%i: pipe ({fd=%i, fd=%i}) -> err=%i", pid, fds[0], fds[1], err));
-        if (g_log_all_calls)
-            description_sp->log (get_logging_fd());
-        if (fds[0] >= 0)
-            save_backtrace (fds[0], saved_errno, description_sp, true);
-        if (fds[1] >= 0)
-            save_backtrace (fds[1], saved_errno, description_sp, true);
-        errno = saved_errno;
-        return err;
-    }
-    else
-    {
-        return pipe (fds);
-    }
+extern "C" int pipe$__interposed__(int fds[2]) {
+  const int pid = get_interposed_pid();
+  if (pid >= 0) {
+    Locker locker(&g_mutex);
+    fds[0] = -1;
+    fds[1] = -1;
+    const int err = pipe(fds);
+    const int saved_errno = errno;
+    StringSP description_sp(new String(
+        "pid=%i: pipe ({fd=%i, fd=%i}) -> err=%i", pid, fds[0], fds[1], err));
+    if (g_log_all_calls)
+      description_sp->log(get_logging_fd());
+    if (fds[0] >= 0)
+      save_backtrace(fds[0], saved_errno, description_sp, true);
+    if (fds[1] >= 0)
+      save_backtrace(fds[1], saved_errno, description_sp, true);
+    errno = saved_errno;
+    return err;
+  } else {
+    return pipe(fds);
+  }
 }
 
 //----------------------------------------------------------------------
@@ -1095,35 +938,27 @@ pipe$__interposed__ (int fds[2])
 // @param[in] fd
 //      The file descriptor whose history should be dumped
 //----------------------------------------------------------------------
-extern "C" void
-get_fd_history (int log_fd, int fd)
-{
-    // "create" below needs to be outside of the mutex locker scope
-    if (log_fd >= 0)
-    {
-        bool got_lock = false;
-        Locker locker (&g_mutex, got_lock);
-        if (got_lock)
-        {
-            FDEventMap::iterator pos = g_fd_event_map.find (fd);
-            log_to_fd (log_fd, "Dumping file descriptor history for fd=%i:\n", fd);
-            if (pos != g_fd_event_map.end())
-            {
-                FDEventArray &event_array = g_fd_event_map[fd];
-                const size_t num_events = event_array.size();
-                for (size_t i=0; i<num_events; ++i)
-                    event_array[i]->Dump (log_fd);
-            }
-            else
-            {
-                log_to_fd (log_fd, "error: no file descriptor events found for fd=%i\n", fd);
-            }
-        }
-        else
-        {
-            log_to_fd (log_fd, "error: fd event mutex is locked...\n");
-        }
+extern "C" void get_fd_history(int log_fd, int fd) {
+  // "create" below needs to be outside of the mutex locker scope
+  if (log_fd >= 0) {
+    bool got_lock = false;
+    Locker locker(&g_mutex, got_lock);
+    if (got_lock) {
+      FDEventMap::iterator pos = g_fd_event_map.find(fd);
+      log_to_fd(log_fd, "Dumping file descriptor history for fd=%i:\n", fd);
+      if (pos != g_fd_event_map.end()) {
+        FDEventArray &event_array = g_fd_event_map[fd];
+        const size_t num_events = event_array.size();
+        for (size_t i = 0; i < num_events; ++i)
+          event_array[i]->Dump(log_fd);
+      } else {
+        log_to_fd(log_fd, "error: no file descriptor events found for fd=%i\n",
+                  fd);
+      }
+    } else {
+      log_to_fd(log_fd, "error: fd event mutex is locked...\n");
     }
+  }
 }
 
 //----------------------------------------------------------------------
@@ -1148,5 +983,3 @@ DYLD_INTERPOSE(close$__interposed__, clo
 DYLD_INTERPOSE(close$NOCANCEL$__interposed__, close$NOCANCEL);
 
 } // namespace fd_interposing
-
-

Modified: lldb/trunk/examples/lookup/main.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/lookup/main.cpp?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/examples/lookup/main.cpp (original)
+++ lldb/trunk/examples/lookup/main.cpp Tue Sep  6 15:57:50 2016
@@ -19,11 +19,11 @@
 #include "LLDB/SBDebugger.h"
 #include "LLDB/SBFunction.h"
 #include "LLDB/SBModule.h"
+#include "LLDB/SBProcess.h"
 #include "LLDB/SBStream.h"
 #include "LLDB/SBSymbol.h"
 #include "LLDB/SBTarget.h"
 #include "LLDB/SBThread.h"
-#include "LLDB/SBProcess.h"
 #endif
 
 #include <string>
@@ -34,8 +34,8 @@ using namespace lldb;
 // This quick sample code shows how to create a debugger instance and
 // create an "i386" executable target. Then we can lookup the executable
 // module and resolve a file address into a section offset address,
-// and find all symbol context objects (if any) for that address: 
-// compile unit, function, deepest block, line table entry and the 
+// and find all symbol context objects (if any) for that address:
+// compile unit, function, deepest block, line table entry and the
 // symbol.
 //
 // To build the program, type (while in this directory):
@@ -44,192 +44,179 @@ using namespace lldb;
 //
 // then (for example):
 //
-//    $ DYLD_FRAMEWORK_PATH=/Volumes/data/lldb/svn/ToT/build/Debug ./a.out executable_path file_address
+//    $ DYLD_FRAMEWORK_PATH=/Volumes/data/lldb/svn/ToT/build/Debug ./a.out
+//    executable_path file_address
 //----------------------------------------------------------------------
-class LLDBSentry
-{
+class LLDBSentry {
 public:
-    LLDBSentry() {
-        // Initialize LLDB
-        SBDebugger::Initialize();
-    }
-    ~LLDBSentry() {
-        // Terminate LLDB
-        SBDebugger::Terminate();
-    }
+  LLDBSentry() {
+    // Initialize LLDB
+    SBDebugger::Initialize();
+  }
+  ~LLDBSentry() {
+    // Terminate LLDB
+    SBDebugger::Terminate();
+  }
 };
 
-static struct option g_long_options[] = 
-{
-    { "help",       no_argument,        NULL, 'h' },
-    { "verbose",    no_argument,        NULL, 'v' },
-	{ "arch",		required_argument,	NULL, 'a' },
-	{ "platform",   required_argument,	NULL, 'p' },
-	{ NULL,			0,					NULL,  0  }
-};
+static struct option g_long_options[] = {
+    {"help", no_argument, NULL, 'h'},
+    {"verbose", no_argument, NULL, 'v'},
+    {"arch", required_argument, NULL, 'a'},
+    {"platform", required_argument, NULL, 'p'},
+    {NULL, 0, NULL, 0}};
 
 #define PROGRAM_NAME "lldb-lookup"
-void
-usage ()
-{
-    puts (
-    "NAME\n"
-    "    " PROGRAM_NAME " -- symbolicate addresses using lldb.\n"
-    "\n"
-    "SYNOPSIS\n"
-    "    " PROGRAM_NAME " [[--arch=<ARCH>] [--platform=<PLATFORM>] [--verbose] [--help] --] <PATH> <ADDRESS> [<ADDRESS>....]\n"
-    "\n"
-    "DESCRIPTION\n"
-    "    Loads the executable pointed to by <PATH> and looks up and <ADDRESS>\n"
-    "    arguments\n"
-    "\n"
-    "EXAMPLE\n"
-    "   " PROGRAM_NAME " --arch=x86_64 -- /usr/lib/dyld 0x100000000\n"
-    );
-    exit(0);
+void usage() {
+  puts("NAME\n"
+       "    " PROGRAM_NAME " -- symbolicate addresses using lldb.\n"
+       "\n"
+       "SYNOPSIS\n"
+       "    " PROGRAM_NAME " [[--arch=<ARCH>] [--platform=<PLATFORM>] "
+                           "[--verbose] [--help] --] <PATH> <ADDRESS> "
+                           "[<ADDRESS>....]\n"
+       "\n"
+       "DESCRIPTION\n"
+       "    Loads the executable pointed to by <PATH> and looks up and "
+       "<ADDRESS>\n"
+       "    arguments\n"
+       "\n"
+       "EXAMPLE\n"
+       "   " PROGRAM_NAME " --arch=x86_64 -- /usr/lib/dyld 0x100000000\n");
+  exit(0);
 }
-int
-main (int argc, char const *argv[])
-{
-    // Use a sentry object to properly initialize/terminate LLDB.
-    LLDBSentry sentry;
-    
-    SBDebugger debugger (SBDebugger::Create());
-    
-    // Create a debugger instance so we can create a target
-    if (!debugger.IsValid())
-        fprintf (stderr, "error: failed to create a debugger object\n");
-    
-    bool show_usage = false;
-    bool verbose = false;
-    const char *arch = NULL;
-    const char *platform = NULL;
-    std::string short_options("h?");
-    for (const struct option *opt = g_long_options; opt->name; ++opt)
-    {
-        if (isprint(opt->val))
-        {
-            short_options.append(1, (char)opt->val);
-            switch (opt->has_arg)
-            {
-            case no_argument:
-                break;
-            case required_argument:
-                short_options.append(1, ':'); 
-                break;
-            case optional_argument:
-                short_options.append(2, ':'); 
-                break;
-            }   
-        }        
+int main(int argc, char const *argv[]) {
+  // Use a sentry object to properly initialize/terminate LLDB.
+  LLDBSentry sentry;
+
+  SBDebugger debugger(SBDebugger::Create());
+
+  // Create a debugger instance so we can create a target
+  if (!debugger.IsValid())
+    fprintf(stderr, "error: failed to create a debugger object\n");
+
+  bool show_usage = false;
+  bool verbose = false;
+  const char *arch = NULL;
+  const char *platform = NULL;
+  std::string short_options("h?");
+  for (const struct option *opt = g_long_options; opt->name; ++opt) {
+    if (isprint(opt->val)) {
+      short_options.append(1, (char)opt->val);
+      switch (opt->has_arg) {
+      case no_argument:
+        break;
+      case required_argument:
+        short_options.append(1, ':');
+        break;
+      case optional_argument:
+        short_options.append(2, ':');
+        break;
+      }
     }
+  }
 #ifdef __GLIBC__
-    optind = 0;
+  optind = 0;
 #else
-    optreset = 1;
-    optind = 1;
+  optreset = 1;
+  optind = 1;
 #endif
-    char ch;
-	while ((ch = getopt_long_only(argc, (char * const *)argv, short_options.c_str(), g_long_options, 0)) != -1)
-	{
-		switch (ch) 
-		{
-        case 0:
-            break;
-
-		case 'a':
-		    if (arch != NULL)
-		    {
-                fprintf (stderr, "error: the --arch option can only be specified once\n");
-                exit(1);
-		    }
-            arch = optarg;
-			break;
-
-        case 'p':
-            platform = optarg;
-            break;            
-            
-        case 'v':
-            verbose = true;
-            break;
-
-		case 'h':
-		case '?':
-		default:
-			show_usage = true;
-			break;
-		}
-	}
-	argc -= optind;
-	argv += optind;
-
-    if (show_usage || argc < 2)
-        usage();
-
-    int arg_idx = 0;
-    // The first argument is the file path we want to look something up in
-    const char *exe_file_path = argv[arg_idx];
-    const char *addr_cstr;
-    const bool add_dependent_libs = false;
-    SBError error;
-    SBStream strm;
-    strm.RedirectToFileHandle (stdout, false);
-
-    while ((addr_cstr = argv[++arg_idx]) != NULL)
-    {
-        // The second argument in the address that we want to lookup
-        lldb::addr_t file_addr = strtoull (addr_cstr, NULL, 0);
-
-        // Create a target using the executable.
-        SBTarget target = debugger.CreateTarget (exe_file_path,
-                                                 arch,
-                                                 platform,
-                                                 add_dependent_libs,
-                                                 error);
-        if (!error.Success())
-        {
-            fprintf (stderr, "error: %s\n", error.GetCString());
-            exit(1);
-        }
-
-        printf ("%sLooking up 0x%llx in '%s':\n", (arg_idx > 1) ? "\n" : "", file_addr, exe_file_path);
-
-        if (target.IsValid())
-        {
-            // Find the executable module so we can do a lookup inside it
-            SBFileSpec exe_file_spec (exe_file_path, true);
-            SBModule module (target.FindModule (exe_file_spec));
-        
-            // Take a file virtual address and resolve it to a section offset
-            // address that can be used to do a symbol lookup by address
-            SBAddress addr = module.ResolveFileAddress (file_addr);
-            bool success = addr.IsValid() && addr.GetSection().IsValid();
-            if (success)
-            {
-                // We can resolve a section offset address in the module
-                // and only ask for what we need. You can logical or together
-                // bits from the SymbolContextItem enumeration found in 
-                // lldb-enumeration.h to request only what you want. Here we
-                // are asking for everything. 
-                //
-                // NOTE: the less you ask for, the less LLDB will parse as
-                // LLDB does partial parsing on just about everything.
-                SBSymbolContext sc (module.ResolveSymbolContextForAddress (addr, eSymbolContextEverything));
-
-                strm.Printf ("    Address: %s + 0x%llx\n    Summary: ", addr.GetSection().GetName (), addr.GetOffset());
-                addr.GetDescription (strm);
-                strm.Printf ("\n");
-                if (verbose)
-                    sc.GetDescription (strm);                        
-            }
-            else
-            {
-                printf ("error: 0x%llx does not resolve to a valid file address in '%s'\n", file_addr, exe_file_path);
-            }
-        }
+  char ch;
+  while ((ch = getopt_long_only(argc, (char *const *)argv,
+                                short_options.c_str(), g_long_options, 0)) !=
+         -1) {
+    switch (ch) {
+    case 0:
+      break;
+
+    case 'a':
+      if (arch != NULL) {
+        fprintf(stderr,
+                "error: the --arch option can only be specified once\n");
+        exit(1);
+      }
+      arch = optarg;
+      break;
+
+    case 'p':
+      platform = optarg;
+      break;
+
+    case 'v':
+      verbose = true;
+      break;
+
+    case 'h':
+    case '?':
+    default:
+      show_usage = true;
+      break;
+    }
+  }
+  argc -= optind;
+  argv += optind;
+
+  if (show_usage || argc < 2)
+    usage();
+
+  int arg_idx = 0;
+  // The first argument is the file path we want to look something up in
+  const char *exe_file_path = argv[arg_idx];
+  const char *addr_cstr;
+  const bool add_dependent_libs = false;
+  SBError error;
+  SBStream strm;
+  strm.RedirectToFileHandle(stdout, false);
+
+  while ((addr_cstr = argv[++arg_idx]) != NULL) {
+    // The second argument in the address that we want to lookup
+    lldb::addr_t file_addr = strtoull(addr_cstr, NULL, 0);
+
+    // Create a target using the executable.
+    SBTarget target = debugger.CreateTarget(exe_file_path, arch, platform,
+                                            add_dependent_libs, error);
+    if (!error.Success()) {
+      fprintf(stderr, "error: %s\n", error.GetCString());
+      exit(1);
     }
 
-    return 0;
-}
+    printf("%sLooking up 0x%llx in '%s':\n", (arg_idx > 1) ? "\n" : "",
+           file_addr, exe_file_path);
 
+    if (target.IsValid()) {
+      // Find the executable module so we can do a lookup inside it
+      SBFileSpec exe_file_spec(exe_file_path, true);
+      SBModule module(target.FindModule(exe_file_spec));
+
+      // Take a file virtual address and resolve it to a section offset
+      // address that can be used to do a symbol lookup by address
+      SBAddress addr = module.ResolveFileAddress(file_addr);
+      bool success = addr.IsValid() && addr.GetSection().IsValid();
+      if (success) {
+        // We can resolve a section offset address in the module
+        // and only ask for what we need. You can logical or together
+        // bits from the SymbolContextItem enumeration found in
+        // lldb-enumeration.h to request only what you want. Here we
+        // are asking for everything.
+        //
+        // NOTE: the less you ask for, the less LLDB will parse as
+        // LLDB does partial parsing on just about everything.
+        SBSymbolContext sc(module.ResolveSymbolContextForAddress(
+            addr, eSymbolContextEverything));
+
+        strm.Printf("    Address: %s + 0x%llx\n    Summary: ",
+                    addr.GetSection().GetName(), addr.GetOffset());
+        addr.GetDescription(strm);
+        strm.Printf("\n");
+        if (verbose)
+          sc.GetDescription(strm);
+      } else {
+        printf(
+            "error: 0x%llx does not resolve to a valid file address in '%s'\n",
+            file_addr, exe_file_path);
+      }
+    }
+  }
+
+  return 0;
+}

Modified: lldb/trunk/examples/plugins/commands/fooplugin.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/plugins/commands/fooplugin.cpp?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/examples/plugins/commands/fooplugin.cpp (original)
+++ lldb/trunk/examples/plugins/commands/fooplugin.cpp Tue Sep  6 15:57:50 2016
@@ -8,8 +8,10 @@
 //===----------------------------------------------------------------------===//
 
 /*
-An example plugin for LLDB that provides a new foo command with a child subcommand
-Compile this into a dylib foo.dylib and load by placing in appropriate locations on disk or
+An example plugin for LLDB that provides a new foo command with a child
+subcommand
+Compile this into a dylib foo.dylib and load by placing in appropriate locations
+on disk or
 by typing plugin load foo.dylib at the LLDB command line
 */
 
@@ -18,39 +20,28 @@ by typing plugin load foo.dylib at the L
 #include <LLDB/SBDebugger.h>
 
 namespace lldb {
-    bool
-    PluginInitialize (lldb::SBDebugger debugger);
+bool PluginInitialize(lldb::SBDebugger debugger);
 }
 
-class ChildCommand : public lldb::SBCommandPluginInterface
-{
+class ChildCommand : public lldb::SBCommandPluginInterface {
 public:
-    virtual bool
-    DoExecute (lldb::SBDebugger debugger,
-               char** command,
-               lldb::SBCommandReturnObject &result)
-    {
-        if (command)
-        {
-            const char* arg = *command;
-            while (arg)
-            {
-                result.Printf("%s\n",arg);
-                arg = *(++command);
-            }
-            return true;
-        }
-        return false;
+  virtual bool DoExecute(lldb::SBDebugger debugger, char **command,
+                         lldb::SBCommandReturnObject &result) {
+    if (command) {
+      const char *arg = *command;
+      while (arg) {
+        result.Printf("%s\n", arg);
+        arg = *(++command);
+      }
+      return true;
     }
-    
+    return false;
+  }
 };
 
-bool
-lldb::PluginInitialize (lldb::SBDebugger debugger)
-{
-    lldb::SBCommandInterpreter interpreter = debugger.GetCommandInterpreter();
-    lldb::SBCommand foo = interpreter.AddMultiwordCommand("foo",NULL);
-    foo.AddCommand("child",new ChildCommand(),"a child of foo");
-    return true;
+bool lldb::PluginInitialize(lldb::SBDebugger debugger) {
+  lldb::SBCommandInterpreter interpreter = debugger.GetCommandInterpreter();
+  lldb::SBCommand foo = interpreter.AddMultiwordCommand("foo", NULL);
+  foo.AddCommand("child", new ChildCommand(), "a child of foo");
+  return true;
 }
-

Modified: lldb/trunk/examples/python/cmdtemplate.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/cmdtemplate.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/examples/python/cmdtemplate.py (original)
+++ lldb/trunk/examples/python/cmdtemplate.py Tue Sep  6 15:57:50 2016
@@ -4,7 +4,7 @@
 # Be sure to add the python path that points to the LLDB shared library.
 #
 # # To use this in the embedded python interpreter using "lldb" just
-# import it with the full path using the "command script import" 
+# import it with the full path using the "command script import"
 # command
 #   (lldb) command script import /path/to/cmdtemplate.py
 #----------------------------------------------------------------------
@@ -14,22 +14,51 @@ import commands
 import optparse
 import shlex
 
+
 def create_framestats_options():
     usage = "usage: %prog [options]"
-    description='''This command is meant to be an example of how to make an LLDB command that
+    description = '''This command is meant to be an example of how to make an LLDB command that
 does something useful, follows best practices, and exploits the SB API.
 Specifically, this command computes the aggregate and average size of the variables in the current frame
 and allows you to tweak exactly which variables are to be accounted in the computation.
 '''
-    parser = optparse.OptionParser(description=description, prog='framestats',usage=usage)
-    parser.add_option('-i', '--in-scope', action='store_true', dest='inscope', help='in_scope_only = True', default=False)
-    parser.add_option('-a', '--arguments', action='store_true', dest='arguments', help='arguments = True', default=False)
-    parser.add_option('-l', '--locals', action='store_true', dest='locals', help='locals = True', default=False)
-    parser.add_option('-s', '--statics', action='store_true', dest='statics', help='statics = True', default=False)
+    parser = optparse.OptionParser(
+        description=description,
+        prog='framestats',
+        usage=usage)
+    parser.add_option(
+        '-i',
+        '--in-scope',
+        action='store_true',
+        dest='inscope',
+        help='in_scope_only = True',
+        default=False)
+    parser.add_option(
+        '-a',
+        '--arguments',
+        action='store_true',
+        dest='arguments',
+        help='arguments = True',
+        default=False)
+    parser.add_option(
+        '-l',
+        '--locals',
+        action='store_true',
+        dest='locals',
+        help='locals = True',
+        default=False)
+    parser.add_option(
+        '-s',
+        '--statics',
+        action='store_true',
+        dest='statics',
+        help='statics = True',
+        default=False)
     return parser
 
+
 def the_framestats_command(debugger, command, result, dict):
-    # Use the Shell Lexer to properly parse up command options just like a 
+    # Use the Shell Lexer to properly parse up command options just like a
     # shell would
     command_args = shlex.split(command)
     parser = create_framestats_options()
@@ -38,9 +67,9 @@ def the_framestats_command(debugger, com
     except:
         # if you don't handle exceptions, passing an incorrect argument to the OptionParser will cause LLDB to exit
         # (courtesy of OptParse dealing with argument errors by throwing SystemExit)
-        result.SetError ("option parsing failed")
+        result.SetError("option parsing failed")
         return
-    
+
     # in a command - the lldb.* convenience variables are not to be used
     # and their values (if any) are undefined
     # this is the best practice to access those objects from within a command
@@ -51,26 +80,33 @@ def the_framestats_command(debugger, com
     if not frame.IsValid():
         return "no frame here"
     # from now on, replace lldb.<thing>.whatever with <thing>.whatever
-    variables_list = frame.GetVariables(options.arguments, options.locals, options.statics, options.inscope)
+    variables_list = frame.GetVariables(
+        options.arguments,
+        options.locals,
+        options.statics,
+        options.inscope)
     variables_count = variables_list.GetSize()
     if variables_count == 0:
         print >> result, "no variables here"
         return
     total_size = 0
-    for i in range(0,variables_count):
+    for i in range(0, variables_count):
         variable = variables_list.GetValueAtIndex(i)
         variable_type = variable.GetType()
         total_size = total_size + variable_type.GetByteSize()
     average_size = float(total_size) / variables_count
-    print >>result, "Your frame has %d variables. Their total size is %d bytes. The average size is %f bytes" % (variables_count,total_size,average_size)
+    print >>result, "Your frame has %d variables. Their total size is %d bytes. The average size is %f bytes" % (
+        variables_count, total_size, average_size)
     # not returning anything is akin to returning success
 
-def __lldb_init_module (debugger, dict):
-    # This initializer is being run from LLDB in the embedded command interpreter    
-    # Make the options so we can generate the help text for the new LLDB 
+
+def __lldb_init_module(debugger, dict):
+    # This initializer is being run from LLDB in the embedded command interpreter
+    # Make the options so we can generate the help text for the new LLDB
     # command line command prior to registering it with LLDB below
     parser = create_framestats_options()
     the_framestats_command.__doc__ = parser.format_help()
     # Add any commands contained in this module to LLDB
-    debugger.HandleCommand('command script add -f cmdtemplate.the_framestats_command framestats')
+    debugger.HandleCommand(
+        'command script add -f cmdtemplate.the_framestats_command framestats')
     print 'The "framestats" command has been installed, type "help framestats" or "framestats --help" for detailed help.'

Modified: lldb/trunk/examples/python/crashlog.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/crashlog.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/examples/python/crashlog.py (original)
+++ lldb/trunk/examples/python/crashlog.py Tue Sep  6 15:57:50 2016
@@ -11,13 +11,13 @@
 #   "crashlog" command installed, type "crashlog --help" for detailed help
 #   (lldb) crashlog ~/Library/Logs/DiagnosticReports/a.crash
 #
-# The benefit of running the crashlog command inside lldb in the 
-# embedded python interpreter is when the command completes, there 
+# The benefit of running the crashlog command inside lldb in the
+# embedded python interpreter is when the command completes, there
 # will be a target with all of the files loaded at the locations
 # described in the crash log. Only the files that have stack frames
 # in the backtrace will be loaded unless the "--load-all" option
 # has been specified. This allows users to explore the program in the
-# state it was in right at crash time. 
+# state it was in right at crash time.
 #
 # On MacOSX csh, tcsh:
 #   ( setenv PYTHONPATH /path/to/LLDB.framework/Resources/Python ; ./crashlog.py ~/Library/Logs/DiagnosticReports/a.crash )
@@ -34,7 +34,7 @@ import optparse
 import os
 import platform
 import plistlib
-import pprint # pp = pprint.PrettyPrinter(indent=4); pp.pprint(command_args)
+import pprint  # pp = pprint.PrettyPrinter(indent=4); pp.pprint(command_args)
 import re
 import shlex
 import string
@@ -42,7 +42,7 @@ import sys
 import time
 import uuid
 
-try: 
+try:
     # Just try for LLDB in case PYTHONPATH is already correctly setup
     import lldb
 except ImportError:
@@ -53,15 +53,20 @@ except ImportError:
         # On Darwin, try the currently selected Xcode directory
         xcode_dir = commands.getoutput("xcode-select --print-path")
         if xcode_dir:
-            lldb_python_dirs.append(os.path.realpath(xcode_dir + '/../SharedFrameworks/LLDB.framework/Resources/Python'))
-            lldb_python_dirs.append(xcode_dir + '/Library/PrivateFrameworks/LLDB.framework/Resources/Python')
-        lldb_python_dirs.append('/System/Library/PrivateFrameworks/LLDB.framework/Resources/Python')
+            lldb_python_dirs.append(
+                os.path.realpath(
+                    xcode_dir +
+                    '/../SharedFrameworks/LLDB.framework/Resources/Python'))
+            lldb_python_dirs.append(
+                xcode_dir + '/Library/PrivateFrameworks/LLDB.framework/Resources/Python')
+        lldb_python_dirs.append(
+            '/System/Library/PrivateFrameworks/LLDB.framework/Resources/Python')
     success = False
     for lldb_python_dir in lldb_python_dirs:
         if os.path.exists(lldb_python_dir):
             if not (sys.path.__contains__(lldb_python_dir)):
                 sys.path.append(lldb_python_dir)
-                try: 
+                try:
                     import lldb
                 except ImportError:
                     pass
@@ -81,19 +86,24 @@ PARSE_MODE_IMAGES = 2
 PARSE_MODE_THREGS = 3
 PARSE_MODE_SYSTEM = 4
 
+
 class CrashLog(symbolication.Symbolicator):
     """Class that does parses darwin crash logs"""
-    parent_process_regex = re.compile('^Parent Process:\s*(.*)\[(\d+)\]');
+    parent_process_regex = re.compile('^Parent Process:\s*(.*)\[(\d+)\]')
     thread_state_regex = re.compile('^Thread ([0-9]+) crashed with')
     thread_regex = re.compile('^Thread ([0-9]+)([^:]*):(.*)')
-    app_backtrace_regex = re.compile('^Application Specific Backtrace ([0-9]+)([^:]*):(.*)')
+    app_backtrace_regex = re.compile(
+        '^Application Specific Backtrace ([0-9]+)([^:]*):(.*)')
     frame_regex = re.compile('^([0-9]+)\s+([^ ]+)\s+(0x[0-9a-fA-F]+) +(.*)')
-    image_regex_uuid = re.compile('(0x[0-9a-fA-F]+)[- ]+(0x[0-9a-fA-F]+) +[+]?([^ ]+) +([^<]+)<([-0-9a-fA-F]+)> (.*)');
-    image_regex_no_uuid = re.compile('(0x[0-9a-fA-F]+)[- ]+(0x[0-9a-fA-F]+) +[+]?([^ ]+) +([^/]+)/(.*)');
+    image_regex_uuid = re.compile(
+        '(0x[0-9a-fA-F]+)[- ]+(0x[0-9a-fA-F]+) +[+]?([^ ]+) +([^<]+)<([-0-9a-fA-F]+)> (.*)')
+    image_regex_no_uuid = re.compile(
+        '(0x[0-9a-fA-F]+)[- ]+(0x[0-9a-fA-F]+) +[+]?([^ ]+) +([^/]+)/(.*)')
     empty_line_regex = re.compile('^$')
-        
+
     class Thread:
         """Class that represents a thread in a darwin crash log"""
+
         def __init__(self, index, app_specific_backtrace):
             self.index = index
             self.frames = list()
@@ -102,7 +112,7 @@ class CrashLog(symbolication.Symbolicato
             self.reason = None
             self.queue = None
             self.app_specific_backtrace = app_specific_backtrace
-        
+
         def dump(self, prefix):
             if self.app_specific_backtrace:
                 print "%Application Specific Backtrace[%u] %s" % (prefix, self.index, self.reason)
@@ -116,8 +126,8 @@ class CrashLog(symbolication.Symbolicato
                 print "%s  Registers:" % (prefix)
                 for reg in self.registers.keys():
                     print "%s    %-5s = %#16.16x" % (prefix, reg, self.registers[reg])
-        
-        def dump_symbolicated (self, crash_log, options):
+
+        def dump_symbolicated(self, crash_log, options):
             this_thread_crashed = self.app_specific_backtrace
             if not this_thread_crashed:
                 this_thread_crashed = self.did_crash()
@@ -128,25 +138,31 @@ class CrashLog(symbolication.Symbolicato
             #prev_frame_index = -1
             display_frame_idx = -1
             for frame_idx, frame in enumerate(self.frames):
-                disassemble = (this_thread_crashed or options.disassemble_all_threads) and frame_idx < options.disassemble_depth;
+                disassemble = (
+                    this_thread_crashed or options.disassemble_all_threads) and frame_idx < options.disassemble_depth
                 if frame_idx == 0:
-                    symbolicated_frame_addresses = crash_log.symbolicate (frame.pc & crash_log.addr_mask, options.verbose)
+                    symbolicated_frame_addresses = crash_log.symbolicate(
+                        frame.pc & crash_log.addr_mask, options.verbose)
                 else:
-                    # Any frame above frame zero and we have to subtract one to get the previous line entry
-                    symbolicated_frame_addresses = crash_log.symbolicate ((frame.pc & crash_log.addr_mask) - 1, options.verbose)
+                    # Any frame above frame zero and we have to subtract one to
+                    # get the previous line entry
+                    symbolicated_frame_addresses = crash_log.symbolicate(
+                        (frame.pc & crash_log.addr_mask) - 1, options.verbose)
 
                 if symbolicated_frame_addresses:
                     symbolicated_frame_address_idx = 0
                     for symbolicated_frame_address in symbolicated_frame_addresses:
                         display_frame_idx += 1
                         print '[%3u] %s' % (frame_idx, symbolicated_frame_address)
-                        if (options.source_all or self.did_crash()) and display_frame_idx < options.source_frames and options.source_context:
+                        if (options.source_all or self.did_crash(
+                        )) and display_frame_idx < options.source_frames and options.source_context:
                             source_context = options.source_context
                             line_entry = symbolicated_frame_address.get_symbol_context().line_entry
                             if line_entry.IsValid():
                                 strm = lldb.SBStream()
                                 if line_entry:
-                                    lldb.debugger.GetSourceManager().DisplaySourceLinesWithLineNumbers(line_entry.file, line_entry.line, source_context, source_context, "->", strm)
+                                    lldb.debugger.GetSourceManager().DisplaySourceLinesWithLineNumbers(
+                                        line_entry.file, line_entry.line, source_context, source_context, "->", strm)
                                 source_text = strm.GetData()
                                 if source_text:
                                     # Indent the source a bit
@@ -158,23 +174,25 @@ class CrashLog(symbolication.Symbolicato
                                 instructions = symbolicated_frame_address.get_instructions()
                                 if instructions:
                                     print
-                                    symbolication.disassemble_instructions (crash_log.get_target(), 
-                                                                            instructions, 
-                                                                            frame.pc, 
-                                                                            options.disassemble_before, 
-                                                                            options.disassemble_after, frame.index > 0)
+                                    symbolication.disassemble_instructions(
+                                        crash_log.get_target(),
+                                        instructions,
+                                        frame.pc,
+                                        options.disassemble_before,
+                                        options.disassemble_after,
+                                        frame.index > 0)
                                     print
                         symbolicated_frame_address_idx += 1
                 else:
                     print frame
-            
+
         def add_ident(self, ident):
-            if not ident in self.idents:
+            if ident not in self.idents:
                 self.idents.append(ident)
-            
+
         def did_crash(self):
-            return self.reason != None
-        
+            return self.reason is not None
+
         def __str__(self):
             if self.app_specific_backtrace:
                 s = "Application Specific Backtrace[%u]" % self.index
@@ -183,38 +201,51 @@ class CrashLog(symbolication.Symbolicato
             if self.reason:
                 s += ' %s' % self.reason
             return s
-        
-    
+
     class Frame:
         """Class that represents a stack frame in a thread in a darwin crash log"""
+
         def __init__(self, index, pc, description):
             self.pc = pc
             self.description = description
             self.index = index
-        
+
         def __str__(self):
             if self.description:
-                return "[%3u] 0x%16.16x %s" % (self.index, self.pc, self.description)
+                return "[%3u] 0x%16.16x %s" % (
+                    self.index, self.pc, self.description)
             else:
                 return "[%3u] 0x%16.16x" % (self.index, self.pc)
 
         def dump(self, prefix):
             print "%s%s" % (prefix, str(self))
-    
+
     class DarwinImage(symbolication.Image):
         """Class that represents a binary images in a darwin crash log"""
         dsymForUUIDBinary = os.path.expanduser('~rc/bin/dsymForUUID')
         if not os.path.exists(dsymForUUIDBinary):
             dsymForUUIDBinary = commands.getoutput('which dsymForUUID')
-            
-        dwarfdump_uuid_regex = re.compile('UUID: ([-0-9a-fA-F]+) \(([^\(]+)\) .*')
-        
-        def __init__(self, text_addr_lo, text_addr_hi, identifier, version, uuid, path):
-            symbolication.Image.__init__(self, path, uuid);
-            self.add_section (symbolication.Section(text_addr_lo, text_addr_hi, "__TEXT"))
+
+        dwarfdump_uuid_regex = re.compile(
+            'UUID: ([-0-9a-fA-F]+) \(([^\(]+)\) .*')
+
+        def __init__(
+                self,
+                text_addr_lo,
+                text_addr_hi,
+                identifier,
+                version,
+                uuid,
+                path):
+            symbolication.Image.__init__(self, path, uuid)
+            self.add_section(
+                symbolication.Section(
+                    text_addr_lo,
+                    text_addr_hi,
+                    "__TEXT"))
             self.identifier = identifier
             self.version = version
-        
+
         def locate_module_and_debug_symbols(self):
             # Don't load a module twice...
             if self.resolved:
@@ -224,63 +255,67 @@ class CrashLog(symbolication.Symbolicato
             uuid_str = self.get_normalized_uuid_string()
             print 'Getting symbols for %s %s...' % (uuid_str, self.path),
             if os.path.exists(self.dsymForUUIDBinary):
-                dsym_for_uuid_command = '%s %s' % (self.dsymForUUIDBinary, uuid_str)
+                dsym_for_uuid_command = '%s %s' % (
+                    self.dsymForUUIDBinary, uuid_str)
                 s = commands.getoutput(dsym_for_uuid_command)
                 if s:
-                    plist_root = plistlib.readPlistFromString (s)
+                    plist_root = plistlib.readPlistFromString(s)
                     if plist_root:
                         plist = plist_root[uuid_str]
                         if plist:
                             if 'DBGArchitecture' in plist:
                                 self.arch = plist['DBGArchitecture']
                             if 'DBGDSYMPath' in plist:
-                                self.symfile = os.path.realpath(plist['DBGDSYMPath'])
+                                self.symfile = os.path.realpath(
+                                    plist['DBGDSYMPath'])
                             if 'DBGSymbolRichExecutable' in plist:
-                                self.path = os.path.expanduser (plist['DBGSymbolRichExecutable'])
+                                self.path = os.path.expanduser(
+                                    plist['DBGSymbolRichExecutable'])
                                 self.resolved_path = self.path
             if not self.resolved_path and os.path.exists(self.path):
-                dwarfdump_cmd_output = commands.getoutput('dwarfdump --uuid "%s"' % self.path)
+                dwarfdump_cmd_output = commands.getoutput(
+                    'dwarfdump --uuid "%s"' % self.path)
                 self_uuid = self.get_uuid()
                 for line in dwarfdump_cmd_output.splitlines():
-                    match = self.dwarfdump_uuid_regex.search (line)
+                    match = self.dwarfdump_uuid_regex.search(line)
                     if match:
                         dwarf_uuid_str = match.group(1)
                         dwarf_uuid = uuid.UUID(dwarf_uuid_str)
                         if self_uuid == dwarf_uuid:
                             self.resolved_path = self.path
                             self.arch = match.group(2)
-                            break;
+                            break
                 if not self.resolved_path:
                     self.unavailable = True
                     print "error\n    error: unable to locate '%s' with UUID %s" % (self.path, uuid_str)
                     return False
-            if (self.resolved_path and os.path.exists(self.resolved_path)) or (self.path and os.path.exists(self.path)):
+            if (self.resolved_path and os.path.exists(self.resolved_path)) or (
+                    self.path and os.path.exists(self.path)):
                 print 'ok'
                 # if self.resolved_path:
-                #     print '  exe = "%s"' % self.resolved_path 
+                #     print '  exe = "%s"' % self.resolved_path
                 # if self.symfile:
                 #     print ' dsym = "%s"' % self.symfile
                 return True
             else:
                 self.unavailable = True
             return False
-        
-    
-        
+
     def __init__(self, path):
         """CrashLog constructor that take a path to a darwin crash log file"""
-        symbolication.Symbolicator.__init__(self);
-        self.path = os.path.expanduser(path);
+        symbolication.Symbolicator.__init__(self)
+        self.path = os.path.expanduser(path)
         self.info_lines = list()
         self.system_profile = list()
         self.threads = list()
-        self.backtraces = list() # For application specific backtraces
-        self.idents = list() # A list of the required identifiers for doing all stack backtraces
+        self.backtraces = list()  # For application specific backtraces
+        self.idents = list()  # A list of the required identifiers for doing all stack backtraces
         self.crashed_thread_idx = -1
         self.version = -1
         self.error = None
         self.target = None
-        # With possible initial component of ~ or ~user replaced by that user's home directory.
+        # With possible initial component of ~ or ~user replaced by that user's
+        # home directory.
         try:
             f = open(self.path)
         except IOError:
@@ -309,77 +344,80 @@ class CrashLog(symbolication.Symbolicato
                             self.threads.append(thread)
                     thread = None
                 else:
-                    # only append an extra empty line if the previous line 
+                    # only append an extra empty line if the previous line
                     # in the info_lines wasn't empty
                     if len(self.info_lines) > 0 and len(self.info_lines[-1]):
                         self.info_lines.append(line)
                 parse_mode = PARSE_MODE_NORMAL
                 # print 'PARSE_MODE_NORMAL'
             elif parse_mode == PARSE_MODE_NORMAL:
-                if line.startswith ('Process:'):
-                    (self.process_name, pid_with_brackets) = line[8:].strip().split(' [')
+                if line.startswith('Process:'):
+                    (self.process_name, pid_with_brackets) = line[
+                        8:].strip().split(' [')
                     self.process_id = pid_with_brackets.strip('[]')
-                elif line.startswith ('Path:'):
+                elif line.startswith('Path:'):
                     self.process_path = line[5:].strip()
-                elif line.startswith ('Identifier:'):
+                elif line.startswith('Identifier:'):
                     self.process_identifier = line[11:].strip()
-                elif line.startswith ('Version:'):
+                elif line.startswith('Version:'):
                     version_string = line[8:].strip()
                     matched_pair = re.search("(.+)\((.+)\)", version_string)
                     if matched_pair:
                         self.process_version = matched_pair.group(1)
-                        self.process_compatability_version = matched_pair.group(2)
+                        self.process_compatability_version = matched_pair.group(
+                            2)
                     else:
                         self.process = version_string
                         self.process_compatability_version = version_string
                 elif self.parent_process_regex.search(line):
-                    parent_process_match = self.parent_process_regex.search(line)
+                    parent_process_match = self.parent_process_regex.search(
+                        line)
                     self.parent_process_name = parent_process_match.group(1)
                     self.parent_process_id = parent_process_match.group(2)
-                elif line.startswith ('Exception Type:'):
+                elif line.startswith('Exception Type:'):
                     self.thread_exception = line[15:].strip()
                     continue
-                elif line.startswith ('Exception Codes:'):
+                elif line.startswith('Exception Codes:'):
                     self.thread_exception_data = line[16:].strip()
                     continue
-                elif line.startswith ('Crashed Thread:'):
+                elif line.startswith('Crashed Thread:'):
                     self.crashed_thread_idx = int(line[15:].strip().split()[0])
                     continue
-                elif line.startswith ('Report Version:'):
+                elif line.startswith('Report Version:'):
                     self.version = int(line[15:].strip())
                     continue
-                elif line.startswith ('System Profile:'):
+                elif line.startswith('System Profile:'):
                     parse_mode = PARSE_MODE_SYSTEM
                     continue
-                elif (line.startswith ('Interval Since Last Report:') or
-                      line.startswith ('Crashes Since Last Report:') or
-                      line.startswith ('Per-App Interval Since Last Report:') or
-                      line.startswith ('Per-App Crashes Since Last Report:') or
-                      line.startswith ('Sleep/Wake UUID:') or
-                      line.startswith ('Anonymous UUID:')):
+                elif (line.startswith('Interval Since Last Report:') or
+                      line.startswith('Crashes Since Last Report:') or
+                      line.startswith('Per-App Interval Since Last Report:') or
+                      line.startswith('Per-App Crashes Since Last Report:') or
+                      line.startswith('Sleep/Wake UUID:') or
+                      line.startswith('Anonymous UUID:')):
                     # ignore these
-                    continue  
-                elif line.startswith ('Thread'):
-                    thread_state_match = self.thread_state_regex.search (line)
+                    continue
+                elif line.startswith('Thread'):
+                    thread_state_match = self.thread_state_regex.search(line)
                     if thread_state_match:
                         app_specific_backtrace = False
-                        thread_state_match = self.thread_regex.search (line)
+                        thread_state_match = self.thread_regex.search(line)
                         thread_idx = int(thread_state_match.group(1))
                         parse_mode = PARSE_MODE_THREGS
                         thread = self.threads[thread_idx]
                     else:
-                        thread_match = self.thread_regex.search (line)
+                        thread_match = self.thread_regex.search(line)
                         if thread_match:
                             app_specific_backtrace = False
                             parse_mode = PARSE_MODE_THREAD
                             thread_idx = int(thread_match.group(1))
                             thread = CrashLog.Thread(thread_idx, False)
                     continue
-                elif line.startswith ('Binary Images:'):
+                elif line.startswith('Binary Images:'):
                     parse_mode = PARSE_MODE_IMAGES
                     continue
-                elif line.startswith ('Application Specific Backtrace'):
-                    app_backtrace_match = self.app_backtrace_regex.search (line)
+                elif line.startswith('Application Specific Backtrace'):
+                    app_backtrace_match = self.app_backtrace_regex.search(line)
                     if app_backtrace_match:
                         parse_mode = PARSE_MODE_THREAD
                         app_specific_backtrace = True
@@ -387,54 +425,56 @@ class CrashLog(symbolication.Symbolicato
                         thread = CrashLog.Thread(idx, True)
                 self.info_lines.append(line.strip())
             elif parse_mode == PARSE_MODE_THREAD:
-                if line.startswith ('Thread'):
+                if line.startswith('Thread'):
                     continue
                 frame_match = self.frame_regex.search(line)
                 if frame_match:
                     ident = frame_match.group(2)
                     thread.add_ident(ident)
-                    if not ident in self.idents:
+                    if ident not in self.idents:
                         self.idents.append(ident)
-                    thread.frames.append (CrashLog.Frame(int(frame_match.group(1)), int(frame_match.group(3), 0), frame_match.group(4)))
+                    thread.frames.append(CrashLog.Frame(int(frame_match.group(1)), int(
+                        frame_match.group(3), 0), frame_match.group(4)))
                 else:
                     print 'error: frame regex failed for line: "%s"' % line
             elif parse_mode == PARSE_MODE_IMAGES:
-                image_match = self.image_regex_uuid.search (line)
+                image_match = self.image_regex_uuid.search(line)
                 if image_match:
-                    image = CrashLog.DarwinImage (int(image_match.group(1),0), 
-                                                  int(image_match.group(2),0), 
-                                                  image_match.group(3).strip(), 
-                                                  image_match.group(4).strip(), 
-                                                  uuid.UUID(image_match.group(5)), 
-                                                  image_match.group(6))
-                    self.images.append (image)
+                    image = CrashLog.DarwinImage(int(image_match.group(1), 0),
+                                                 int(image_match.group(2), 0),
+                                                 image_match.group(3).strip(),
+                                                 image_match.group(4).strip(),
+                                                 uuid.UUID(image_match.group(5)),
+                                                 image_match.group(6))
+                    self.images.append(image)
                 else:
-                    image_match = self.image_regex_no_uuid.search (line)
+                    image_match = self.image_regex_no_uuid.search(line)
                     if image_match:
-                        image = CrashLog.DarwinImage (int(image_match.group(1),0), 
-                                                      int(image_match.group(2),0), 
-                                                      image_match.group(3).strip(), 
-                                                      image_match.group(4).strip(), 
-                                                      None,
-                                                      image_match.group(5))
-                        self.images.append (image)
+                        image = CrashLog.DarwinImage(int(image_match.group(1), 0),
+                                                     int(image_match.group(2), 0),
+                                                     image_match.group(3).strip(),
+                                                     image_match.group(4).strip(),
+                                                     None,
+                                                     image_match.group(5))
+                        self.images.append(image)
                     else:
                         print "error: image regex failed for: %s" % line
 
             elif parse_mode == PARSE_MODE_THREGS:
                 stripped_line = line.strip()
                 # "r12: 0x00007fff6b5939c8  r13: 0x0000000007000006  r14: 0x0000000000002a03  r15: 0x0000000000000c00"
-                reg_values = re.findall ('([a-zA-Z0-9]+: 0[Xx][0-9a-fA-F]+) *', stripped_line);
+                reg_values = re.findall(
+                    '([a-zA-Z0-9]+: 0[Xx][0-9a-fA-F]+) *', stripped_line)
                 for reg_value in reg_values:
-                    #print 'reg_value = "%s"' % reg_value
+                    # print 'reg_value = "%s"' % reg_value
                     (reg, value) = reg_value.split(': ')
-                    #print 'reg = "%s"' % reg
-                    #print 'value = "%s"' % value
+                    # print 'reg = "%s"' % reg
+                    # print 'value = "%s"' % value
                     thread.registers[reg.strip()] = int(value, 0)
             elif parse_mode == PARSE_MODE_SYSTEM:
                 self.system_profile.append(line)
         f.close()
-    
+
     def dump(self):
         print "Crash Log File: %s" % (self.path)
         if self.backtraces:
@@ -447,53 +487,56 @@ class CrashLog(symbolication.Symbolicato
         print "\nImages:"
         for image in self.images:
             image.dump('  ')
-    
+
     def find_image_with_identifier(self, identifier):
         for image in self.images:
             if image.identifier == identifier:
-                return image            
+                return image
         regex_text = '^.*\.%s$' % (re.escape(identifier))
         regex = re.compile(regex_text)
         for image in self.images:
             if regex.match(image.identifier):
                 return image
         return None
-    
+
     def create_target(self):
-        #print 'crashlog.create_target()...'
+        # print 'crashlog.create_target()...'
         if self.target is None:
             self.target = symbolication.Symbolicator.create_target(self)
             if self.target:
                 return self.target
-            # We weren't able to open the main executable as, but we can still symbolicate
+            # We weren't able to open the main executable as, but we can still
+            # symbolicate
             print 'crashlog.create_target()...2'
             if self.idents:
                 for ident in self.idents:
-                    image = self.find_image_with_identifier (ident)
+                    image = self.find_image_with_identifier(ident)
                     if image:
-                        self.target = image.create_target ()
+                        self.target = image.create_target()
                         if self.target:
-                            return self.target # success
+                            return self.target  # success
             print 'crashlog.create_target()...3'
             for image in self.images:
-                self.target = image.create_target ()
+                self.target = image.create_target()
                 if self.target:
-                    return self.target # success
+                    return self.target  # success
             print 'crashlog.create_target()...4'
             print 'error: unable to locate any executables from the crash log'
         return self.target
-    
+
     def get_target(self):
         return self.target
 
+
 def usage():
     print "Usage: lldb-symbolicate.py [-n name] executable-image"
     sys.exit(0)
 
+
 class Interactive(cmd.Cmd):
     '''Interactive prompt for analyzing one or more Darwin crash logs, type "help" to see a list of supported commands.'''
     image_option_parser = None
-    
+
     def __init__(self, crash_logs):
         cmd.Cmd.__init__(self)
         self.use_rawinput = False
@@ -515,10 +558,11 @@ class Interactive(cmd.Cmd):
         return True
 
     def do_symbolicate(self, line):
-        description='''Symbolicate one or more darwin crash log files by index to provide source file and line information,
+        description = '''Symbolicate one or more darwin crash log files by index to provide source file and line information,
         inlined stack frames back to the concrete functions, and disassemble the location of the crash
         for the first frame of the crashed thread.'''
-        option_parser = CreateSymbolicateCrashLogOptions ('symbolicate', description, False)
+        option_parser = CreateSymbolicateCrashLogOptions(
+            'symbolicate', description, False)
         command_args = shlex.split(line)
         try:
             (options, args) = option_parser.parse_args(command_args)
@@ -530,17 +574,18 @@ class Interactive(cmd.Cmd):
             for idx_str in args:
                 idx = int(idx_str)
                 if idx < len(self.crash_logs):
-                    SymbolicateCrashLog (self.crash_logs[idx], options)
+                    SymbolicateCrashLog(self.crash_logs[idx], options)
                 else:
                     print 'error: crash log index %u is out of range' % (idx)
         else:
-            # No arguments, symbolicate all crash logs using the options provided
+            # No arguments, symbolicate all crash logs using the options
+            # provided
             for idx in range(len(self.crash_logs)):
-                SymbolicateCrashLog (self.crash_logs[idx], options)                
-    
+                SymbolicateCrashLog(self.crash_logs[idx], options)
+
     def do_list(self, line=None):
         '''Dump a list of all crash logs that are currently loaded.
-        
+
         USAGE: list'''
         print '%u crash logs are loaded:' % len(self.crash_logs)
         for (crash_log_idx, crash_log) in enumerate(self.crash_logs):
@@ -549,16 +594,22 @@ class Interactive(cmd.Cmd):
     def do_image(self, line):
         '''Dump information about one or more binary images in the crash log given an image basename, or all images if no arguments are provided.'''
         usage = "usage: %prog [options] <PATH> [PATH ...]"
-        description='''Dump information about one or more images in all crash logs. The <PATH> can be a full path, image basename, or partial path. Searches are done in this order.'''
+        description = '''Dump information about one or more images in all crash logs. The <PATH> can be a full path, image basename, or partial path. Searches are done in this order.'''
         command_args = shlex.split(line)
         if not self.image_option_parser:
-            self.image_option_parser = optparse.OptionParser(description=description, prog='image',usage=usage)
-            self.image_option_parser.add_option('-a', '--all', action='store_true', help='show all images', default=False)
+            self.image_option_parser = optparse.OptionParser(
+                description=description, prog='image', usage=usage)
+            self.image_option_parser.add_option(
+                '-a',
+                '--all',
+                action='store_true',
+                help='show all images',
+                default=False)
         try:
             (options, args) = self.image_option_parser.parse_args(command_args)
         except:
             return
-        
+
         if args:
             for image_path in args:
                 fullpath_search = image_path[0] == '/'
@@ -577,12 +628,13 @@ class Interactive(cmd.Cmd):
                     if matches_found == 0:
                         for (image_idx, image) in enumerate(crash_log.images):
                             resolved_image_path = image.get_resolved_path()
-                            if resolved_image_path and string.find(image.get_resolved_path(), image_path) >= 0:
+                            if resolved_image_path and string.find(
+                                    image.get_resolved_path(), image_path) >= 0:
                                 print '[%u] ' % (crash_log_idx), image
         else:
             for crash_log in self.crash_logs:
                 for (image_idx, image) in enumerate(crash_log.images):
-                    print '[%u] %s' % (image_idx, image)            
+                    print '[%u] %s' % (image_idx, image)
         return False
 
 
@@ -591,10 +643,10 @@ def interactive_crashlogs(options, args)
     for arg in args:
         for resolved_path in glob.glob(arg):
             crash_log_files.append(resolved_path)
-    
-    crash_logs = list();
+
+    crash_logs = list()
     for crash_log_file in crash_log_files:
-        #print 'crash_log_file = "%s"' % crash_log_file
+        # print 'crash_log_file = "%s"' % crash_log_file
         crash_log = CrashLog(crash_log_file)
         if crash_log.error:
             print crash_log.error
@@ -606,29 +658,41 @@ def interactive_crashlogs(options, args)
             continue
         else:
             crash_logs.append(crash_log)
-    
+
     interpreter = Interactive(crash_logs)
     # List all crash logs that were imported
     interpreter.do_list()
     interpreter.cmdloop()
-    
+
 
 def save_crashlog(debugger, command, result, dict):
     usage = "usage: %prog [options] <output-path>"
-    description='''Export the state of current target into a crashlog file'''
-    parser = optparse.OptionParser(description=description, prog='save_crashlog',usage=usage)
-    parser.add_option('-v', '--verbose', action='store_true', dest='verbose', help='display verbose debug info', default=False)
+    description = '''Export the state of current target into a crashlog file'''
+    parser = optparse.OptionParser(
+        description=description,
+        prog='save_crashlog',
+        usage=usage)
+    parser.add_option(
+        '-v',
+        '--verbose',
+        action='store_true',
+        dest='verbose',
+        help='display verbose debug info',
+        default=False)
     try:
         (options, args) = parser.parse_args(shlex.split(command))
     except:
-        result.PutCString ("error: invalid options");
+        result.PutCString("error: invalid options")
         return
     if len(args) != 1:
-        result.PutCString ("error: invalid arguments, a single output file is the only valid argument")
+        result.PutCString(
+            "error: invalid arguments, a single output file is the only valid argument")
         return
     out_file = open(args[0], 'w')
     if not out_file:
-        result.PutCString ("error: failed to open file '%s' for writing...", args[0]);
+        result.PutCString(
+            "error: failed to open file '%s' for writing...",
+            args[0])
         return
     target = debugger.GetSelectedTarget()
     if target:
@@ -636,11 +700,16 @@ def save_crashlog(debugger, command, res
         if lldb.process:
             pid = lldb.process.id
             if pid != lldb.LLDB_INVALID_PROCESS_ID:
-                out_file.write('Process:         %s [%u]\n' % (identifier, pid))
+                out_file.write(
+                    'Process:         %s [%u]\n' %
+                    (identifier, pid))
         out_file.write('Path:            %s\n' % (target.executable.fullpath))
         out_file.write('Identifier:      %s\n' % (identifier))
-        out_file.write('\nDate/Time:       %s\n' % (datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")))
-        out_file.write('OS Version:      Mac OS X %s (%s)\n' % (platform.mac_ver()[0], commands.getoutput('sysctl -n kern.osversion')));
+        out_file.write('\nDate/Time:       %s\n' %
+                       (datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")))
+        out_file.write(
+            'OS Version:      Mac OS X %s (%s)\n' %
+            (platform.mac_ver()[0], commands.getoutput('sysctl -n kern.osversion')))
         out_file.write('Report Version:  9\n')
         for thread_idx in range(lldb.process.num_threads):
             thread = lldb.process.thread[thread_idx]
@@ -658,8 +727,10 @@ def save_crashlog(debugger, command, res
                         frame_offset = frame_pc - frame.function.addr.load_addr
                 elif frame.symbol:
                     frame_offset = frame_pc - frame.symbol.addr.load_addr
-                out_file.write('%-3u %-32s 0x%16.16x %s' % (frame_idx, frame.module.file.basename, frame_pc, frame.name))
-                if frame_offset > 0: 
+                out_file.write(
+                    '%-3u %-32s 0x%16.16x %s' %
+                    (frame_idx, frame.module.file.basename, frame_pc, frame.name))
+                if frame_offset > 0:
                     out_file.write(' + %u' % (frame_offset))
                 line_entry = frame.line_entry
                 if line_entry:
@@ -667,12 +738,14 @@ def save_crashlog(debugger, command, res
                         # This will output the fullpath + line + column
                         out_file.write(' %s' % (line_entry))
                     else:
-                        out_file.write(' %s:%u' % (line_entry.file.basename, line_entry.line))
+                        out_file.write(
+                            ' %s:%u' %
+                            (line_entry.file.basename, line_entry.line))
                         column = line_entry.column
-                        if column: 
+                        if column:
                             out_file.write(':%u' % (column))
                 out_file.write('\n')
-                
+
         out_file.write('\nBinary Images:\n')
         for module in target.modules:
             text_segment = module.section['__TEXT']
@@ -684,18 +757,27 @@ def save_crashlog(debugger, command, res
                     module_version = '???'
                     module_version_array = module.GetVersion()
                     if module_version_array:
-                        module_version = '.'.join(map(str,module_version_array))
-                    out_file.write ('    0x%16.16x - 0x%16.16x  %s (%s - ???) <%s> %s\n' % (text_segment_load_addr, text_segment_end_load_addr, identifier, module_version, module.GetUUIDString(), module.file.fullpath))
+                        module_version = '.'.join(
+                            map(str, module_version_array))
+                    out_file.write(
+                        '    0x%16.16x - 0x%16.16x  %s (%s - ???) <%s> %s\n' %
+                        (text_segment_load_addr,
+                         text_segment_end_load_addr,
+                         identifier,
+                         module_version,
+                         module.GetUUIDString(),
+                         module.file.fullpath))
         out_file.close()
     else:
-        result.PutCString ("error: invalid target");
-        
-    
+        result.PutCString("error: invalid target")
+
+
 def Symbolicate(debugger, command, result, dict):
     try:
-        SymbolicateCrashLogs (shlex.split(command))
+        SymbolicateCrashLogs(shlex.split(command))
     except:
-        result.PutCString ("error: python exception %s" % sys.exc_info()[0])
+        result.PutCString("error: python exception %s" % sys.exc_info()[0])
+
 
 def SymbolicateCrashLog(crash_log, options):
     if crash_log.error:
@@ -715,7 +797,7 @@ def SymbolicateCrashLog(crash_log, optio
             else:
                 print image
 
-    target = crash_log.create_target ()
+    target = crash_log.create_target()
     if not target:
         return
     exe_module = target.GetModuleAtIndex(0)
@@ -731,7 +813,7 @@ def SymbolicateCrashLog(crash_log, optio
             for thread in crash_log.threads:
                 if thread.did_crash():
                     for ident in thread.idents:
-                        images = crash_log.find_images_with_identifier (ident)
+                        images = crash_log.find_images_with_identifier(ident)
                         if images:
                             for image in images:
                                 images_to_load.append(image)
@@ -739,7 +821,7 @@ def SymbolicateCrashLog(crash_log, optio
                             print 'error: can\'t find image for identifier "%s"' % ident
         else:
             for ident in crash_log.idents:
-                images = crash_log.find_images_with_identifier (ident)
+                images = crash_log.find_images_with_identifier(ident)
                 if images:
                     for image in images:
                         images_to_load.append(image)
@@ -747,83 +829,172 @@ def SymbolicateCrashLog(crash_log, optio
                     print 'error: can\'t find image for identifier "%s"' % ident
 
     for image in images_to_load:
-        if not image in loaded_images:
-            err = image.add_module (target)
+        if image not in loaded_images:
+            err = image.add_module(target)
             if err:
                 print err
             else:
-                #print 'loaded %s' % image
+                # print 'loaded %s' % image
                 loaded_images.append(image)
 
     if crash_log.backtraces:
         for thread in crash_log.backtraces:
-            thread.dump_symbolicated (crash_log, options)
-            print                
+            thread.dump_symbolicated(crash_log, options)
+            print
 
     for thread in crash_log.threads:
-        thread.dump_symbolicated (crash_log, options)
-        print                
+        thread.dump_symbolicated(crash_log, options)
+        print
 
-        
-def CreateSymbolicateCrashLogOptions(command_name, description, add_interactive_options):
+
+def CreateSymbolicateCrashLogOptions(
+        command_name,
+        description,
+        add_interactive_options):
     usage = "usage: %prog [options] <FILE> [FILE ...]"
-    option_parser = optparse.OptionParser(description=description, prog='crashlog',usage=usage)
-    option_parser.add_option('--verbose'       , '-v', action='store_true', dest='verbose', help='display verbose debug info', default=False)
-    option_parser.add_option('--debug'         , '-g', action='store_true', dest='debug', help='display verbose debug logging', default=False)
-    option_parser.add_option('--load-all'      , '-a', action='store_true', dest='load_all_images', help='load all executable images, not just the images found in the crashed stack frames', default=False)
-    option_parser.add_option('--images'        ,       action='store_true', dest='dump_image_list', help='show image list', default=False)
-    option_parser.add_option('--debug-delay'   ,       type='int', dest='debug_delay', metavar='NSEC', help='pause for NSEC seconds for debugger', default=0)
-    option_parser.add_option('--crashed-only'  , '-c', action='store_true', dest='crashed_only', help='only symbolicate the crashed thread', default=False)
-    option_parser.add_option('--disasm-depth'  , '-d', type='int', dest='disassemble_depth', help='set the depth in stack frames that should be disassembled (default is 1)', default=1)
-    option_parser.add_option('--disasm-all'    , '-D',  action='store_true', dest='disassemble_all_threads', help='enabled disassembly of frames on all threads (not just the crashed thread)', default=False)
-    option_parser.add_option('--disasm-before' , '-B', type='int', dest='disassemble_before', help='the number of instructions to disassemble before the frame PC', default=4)
-    option_parser.add_option('--disasm-after'  , '-A', type='int', dest='disassemble_after', help='the number of instructions to disassemble after the frame PC', default=4)
-    option_parser.add_option('--source-context', '-C', type='int', metavar='NLINES', dest='source_context', help='show NLINES source lines of source context (default = 4)', default=4)
-    option_parser.add_option('--source-frames' ,       type='int', metavar='NFRAMES', dest='source_frames', help='show source for NFRAMES (default = 4)', default=4)
-    option_parser.add_option('--source-all'    ,       action='store_true', dest='source_all', help='show source for all threads, not just the crashed thread', default=False)
+    option_parser = optparse.OptionParser(
+        description=description, prog='crashlog', usage=usage)
+    option_parser.add_option(
+        '--verbose',
+        '-v',
+        action='store_true',
+        dest='verbose',
+        help='display verbose debug info',
+        default=False)
+    option_parser.add_option(
+        '--debug',
+        '-g',
+        action='store_true',
+        dest='debug',
+        help='display verbose debug logging',
+        default=False)
+    option_parser.add_option(
+        '--load-all',
+        '-a',
+        action='store_true',
+        dest='load_all_images',
+        help='load all executable images, not just the images found in the crashed stack frames',
+        default=False)
+    option_parser.add_option(
+        '--images',
+        action='store_true',
+        dest='dump_image_list',
+        help='show image list',
+        default=False)
+    option_parser.add_option(
+        '--debug-delay',
+        type='int',
+        dest='debug_delay',
+        metavar='NSEC',
+        help='pause for NSEC seconds for debugger',
+        default=0)
+    option_parser.add_option(
+        '--crashed-only',
+        '-c',
+        action='store_true',
+        dest='crashed_only',
+        help='only symbolicate the crashed thread',
+        default=False)
+    option_parser.add_option(
+        '--disasm-depth',
+        '-d',
+        type='int',
+        dest='disassemble_depth',
+        help='set the depth in stack frames that should be disassembled (default is 1)',
+        default=1)
+    option_parser.add_option(
+        '--disasm-all',
+        '-D',
+        action='store_true',
+        dest='disassemble_all_threads',
+        help='enabled disassembly of frames on all threads (not just the crashed thread)',
+        default=False)
+    option_parser.add_option(
+        '--disasm-before',
+        '-B',
+        type='int',
+        dest='disassemble_before',
+        help='the number of instructions to disassemble before the frame PC',
+        default=4)
+    option_parser.add_option(
+        '--disasm-after',
+        '-A',
+        type='int',
+        dest='disassemble_after',
+        help='the number of instructions to disassemble after the frame PC',
+        default=4)
+    option_parser.add_option(
+        '--source-context',
+        '-C',
+        type='int',
+        metavar='NLINES',
+        dest='source_context',
+        help='show NLINES source lines of source context (default = 4)',
+        default=4)
+    option_parser.add_option(
+        '--source-frames',
+        type='int',
+        metavar='NFRAMES',
+        dest='source_frames',
+        help='show source for NFRAMES (default = 4)',
+        default=4)
+    option_parser.add_option(
+        '--source-all',
+        action='store_true',
+        dest='source_all',
+        help='show source for all threads, not just the crashed thread',
+        default=False)
     if add_interactive_options:
-        option_parser.add_option('-i', '--interactive', action='store_true', help='parse all crash logs and enter interactive mode', default=False)
+        option_parser.add_option(
+            '-i',
+            '--interactive',
+            action='store_true',
+            help='parse all crash logs and enter interactive mode',
+            default=False)
     return option_parser
-    
+
+
 def SymbolicateCrashLogs(command_args):
-    description='''Symbolicate one or more darwin crash log files to provide source file and line information,
+    description = '''Symbolicate one or more darwin crash log files to provide source file and line information,
 inlined stack frames back to the concrete functions, and disassemble the location of the crash
 for the first frame of the crashed thread.
 If this script is imported into the LLDB command interpreter, a "crashlog" command will be added to the interpreter
 for use at the LLDB command line. After a crash log has been parsed and symbolicated, a target will have been
 created that has all of the shared libraries loaded at the load addresses found in the crash log file. This allows
-you to explore the program as if it were stopped at the locations described in the crash log and functions can 
+you to explore the program as if it were stopped at the locations described in the crash log and functions can
 be disassembled and lookups can be performed using the addresses found in the crash log.'''
-    option_parser = CreateSymbolicateCrashLogOptions ('crashlog', description, True)
+    option_parser = CreateSymbolicateCrashLogOptions(
+        'crashlog', description, True)
     try:
         (options, args) = option_parser.parse_args(command_args)
     except:
         return
-        
+
     if options.debug:
         print 'command_args = %s' % command_args
         print 'options', options
         print 'args', args
-        
+
     if options.debug_delay > 0:
         print "Waiting %u seconds for debugger to attach..." % options.debug_delay
         time.sleep(options.debug_delay)
     error = lldb.SBError()
-        
+
     if args:
         if options.interactive:
             interactive_crashlogs(options, args)
         else:
             for crash_log_file in args:
                 crash_log = CrashLog(crash_log_file)
-                SymbolicateCrashLog (crash_log, options)
+                SymbolicateCrashLog(crash_log, options)
 if __name__ == '__main__':
     # Create a new debugger instance
     lldb.debugger = lldb.SBDebugger.Create()
-    SymbolicateCrashLogs (sys.argv[1:])
-    lldb.SBDebugger.Destroy (lldb.debugger)
+    SymbolicateCrashLogs(sys.argv[1:])
+    lldb.SBDebugger.Destroy(lldb.debugger)
 elif getattr(lldb, 'debugger', None):
-    lldb.debugger.HandleCommand('command script add -f lldb.macosx.crashlog.Symbolicate crashlog')
-    lldb.debugger.HandleCommand('command script add -f lldb.macosx.crashlog.save_crashlog save_crashlog')
+    lldb.debugger.HandleCommand(
+        'command script add -f lldb.macosx.crashlog.Symbolicate crashlog')
+    lldb.debugger.HandleCommand(
+        'command script add -f lldb.macosx.crashlog.save_crashlog save_crashlog')
     print '"crashlog" and "save_crashlog" command installed, use the "--help" option for detailed help'
-

Modified: lldb/trunk/examples/python/delta.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/delta.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/examples/python/delta.py (original)
+++ lldb/trunk/examples/python/delta.py Tue Sep  6 15:57:50 2016
@@ -1,15 +1,15 @@
 #!/usr/bin/python
 
 #----------------------------------------------------------------------
-# This module will enable GDB remote packet logging when the 
+# This module will enable GDB remote packet logging when the
 # 'start_gdb_log' command is called with a filename to log to. When the
-# 'stop_gdb_log' command is called, it will disable the logging and 
+# 'stop_gdb_log' command is called, it will disable the logging and
 # print out statistics about how long commands took to execute and also
 # will primnt ou
 # Be sure to add the python path that points to the LLDB shared library.
 #
 # To use this in the embedded python interpreter using "lldb" just
-# import it with the full path using the "command script import" 
+# import it with the full path using the "command script import"
 # command. This can be done from the LLDB command line:
 #   (lldb) command script import /path/to/gdbremote.py
 # Or it can be added to your ~/.lldbinit file so this module is always
@@ -23,13 +23,16 @@ import shlex
 import re
 import tempfile
 
+
 def start_gdb_log(debugger, command, result, dict):
-    '''Start logging GDB remote packets by enabling logging with timestamps and 
+    '''Start logging GDB remote packets by enabling logging with timestamps and
     thread safe logging. Follow a call to this function with a call to "stop_gdb_log"
     in order to dump out the commands.'''
     global log_file
     if log_file:
-        result.PutCString ('error: logging is already in progress with file "%s"', log_file)
+        result.PutCString(
+            'error: logging is already in progress with file "%s"',
+            log_file)
     else:
         args_len = len(args)
         if args_len == 0:
@@ -38,36 +41,52 @@ def start_gdb_log(debugger, command, res
             log_file = args[0]
 
         if log_file:
-            debugger.HandleCommand('log enable --threadsafe --timestamp --file "%s" gdb-remote packets' % log_file);
-            result.PutCString ("GDB packet logging enable with log file '%s'\nUse the 'stop_gdb_log' command to stop logging and show packet statistics." % log_file)
+            debugger.HandleCommand(
+                'log enable --threadsafe --timestamp --file "%s" gdb-remote packets' %
+                log_file)
+            result.PutCString(
+                "GDB packet logging enable with log file '%s'\nUse the 'stop_gdb_log' command to stop logging and show packet statistics." %
+                log_file)
             return
 
-        result.PutCString ('error: invalid log file path')
-    result.PutCString (usage)
+        result.PutCString('error: invalid log file path')
+    result.PutCString(usage)
+
 
 def parse_time_log(debugger, command, result, dict):
-    # Any commands whose names might be followed by more valid C identifier 
+    # Any commands whose names might be followed by more valid C identifier
     # characters must be listed here
     command_args = shlex.split(command)
-    parse_time_log_args (command_args)
+    parse_time_log_args(command_args)
+
 
 def parse_time_log_args(command_args):
     usage = "usage: parse_time_log [options] [<LOGFILEPATH>]"
-    description='''Parse a log file that contains timestamps and convert the timestamps to delta times between log lines.'''
-    parser = optparse.OptionParser(description=description, prog='parse_time_log',usage=usage)
-    parser.add_option('-v', '--verbose', action='store_true', dest='verbose', help='display verbose debug info', default=False)
+    description = '''Parse a log file that contains timestamps and convert the timestamps to delta times between log lines.'''
+    parser = optparse.OptionParser(
+        description=description,
+        prog='parse_time_log',
+        usage=usage)
+    parser.add_option(
+        '-v',
+        '--verbose',
+        action='store_true',
+        dest='verbose',
+        help='display verbose debug info',
+        default=False)
     try:
         (options, args) = parser.parse_args(command_args)
     except:
         return
     for log_file in args:
-        parse_log_file (log_file, options)
+        parse_log_file(log_file, options)
+
 
 def parse_log_file(file, options):
     '''Parse a log file that was contains timestamps. These logs are typically
     generated using:
     (lldb) log enable --threadsafe --timestamp --file <FILE> ....
-    
+
     This log file will contain timestamps and this function will then normalize
     those packets to be relative to the first value timestamp that is found and
     show delta times between log lines and also keep track of how long it takes
@@ -86,9 +105,9 @@ def parse_log_file(file, options):
     file = open(file)
     lines = file.read().splitlines()
     for line in lines:
-        match = timestamp_regex.match (line)
+        match = timestamp_regex.match(line)
         if match:
-            curr_time = float (match.group(2))
+            curr_time = float(match.group(2))
             delta = 0.0
             if base_time:
                 delta = curr_time - last_time
@@ -99,17 +118,17 @@ def parse_log_file(file, options):
             last_time = curr_time
         else:
             print line
-                    
-    
-    
+
+
 if __name__ == '__main__':
     import sys
-    parse_time_log_args (sys.argv[1:])
+    parse_time_log_args(sys.argv[1:])
 
 else:
     import lldb
-    if lldb.debugger:    
+    if lldb.debugger:
         # This initializer is being run from LLDB in the embedded command interpreter
         # Add any commands contained in this module to LLDB
-        lldb.debugger.HandleCommand('command script add -f delta.parse_time_log parse_time_log')
+        lldb.debugger.HandleCommand(
+            'command script add -f delta.parse_time_log parse_time_log')
         print 'The "parse_time_log" command is now installed and ready for use, type "parse_time_log --help" for more information'

Modified: lldb/trunk/examples/python/diagnose_nsstring.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/diagnose_nsstring.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/examples/python/diagnose_nsstring.py (original)
+++ lldb/trunk/examples/python/diagnose_nsstring.py Tue Sep  6 15:57:50 2016
@@ -1,64 +1,67 @@
 # This implements the "diagnose-nsstring" command, usually installed in the debug session like
 #   command script import lldb.diagnose
 # it is used when NSString summary formatter fails to replicate the logic that went into LLDB making the
-# decisions it did and  providing some useful context information that can be used for improving the formatter
+# decisions it did and  providing some useful context information that can
+# be used for improving the formatter
 
 import lldb
 
-def read_memory(process,location,size):
-	data = ""
-	error = lldb.SBError()
-	for x in range(0,size-1):
-		byte = process.ReadUnsignedFromMemory(x+location,1,error)
-		if error.fail:
-			data = data + "err%s" % "" if x == size-2 else ":"
-		else:
-			try:
-				data = data + "0x%x" % byte
-				if byte == 0:
-					data = data + "(\\0)"
-				elif byte == 0xa:
-					data = data + "(\\a)"
-				elif byte == 0xb:
-					data = data + "(\\b)"
-				elif byte == 0xc:
-					data = data + "(\\c)"
-				elif byte == '\n':
-					data = data + "(\\n)"
-				else:
-					data = data + "(%s)" % chr(byte)
-				if x < size-2:
-					data = data + ":"
-			except Exception as e:
-				print e
-	return data
-
-def diagnose_nsstring_Command_Impl(debugger,command,result,internal_dict):
-	"""
-	A command to diagnose the LLDB NSString data formatter
-	invoke as
-	(lldb) diagnose-nsstring <expr returning NSString>
-	e.g.
-	(lldb) diagnose-nsstring @"Hello world"
-	"""
-	target = debugger.GetSelectedTarget()
-	process = target.GetProcess()
-	thread = process.GetSelectedThread()
-	frame = thread.GetSelectedFrame()
-	if not target.IsValid() or not process.IsValid():
-		return "unable to get target/process - cannot proceed"
-	options = lldb.SBExpressionOptions()
-	options.SetFetchDynamicValue()
-	error = lldb.SBError()
-	if frame.IsValid():
-		nsstring = frame.EvaluateExpression(command,options)
-	else:
-		nsstring = target.EvaluateExpression(command,options)
-	print >>result,str(nsstring)
-	nsstring_address = nsstring.GetValueAsUnsigned(0)
-	if nsstring_address == 0:
-		return "unable to obtain the string - cannot proceed"
-	expression = "\
+
+def read_memory(process, location, size):
+    data = ""
+    error = lldb.SBError()
+    for x in range(0, size - 1):
+        byte = process.ReadUnsignedFromMemory(x + location, 1, error)
+        if error.fail:
+            data = data + "err%s" % "" if x == size - 2 else ":"
+        else:
+            try:
+                data = data + "0x%x" % byte
+                if byte == 0:
+                    data = data + "(\\0)"
+                elif byte == 0xa:
+                    data = data + "(\\a)"
+                elif byte == 0xb:
+                    data = data + "(\\b)"
+                elif byte == 0xc:
+                    data = data + "(\\c)"
+                elif byte == '\n':
+                    data = data + "(\\n)"
+                else:
+                    data = data + "(%s)" % chr(byte)
+                if x < size - 2:
+                    data = data + ":"
+            except Exception as e:
+                print e
+    return data
+
+
+def diagnose_nsstring_Command_Impl(debugger, command, result, internal_dict):
+    """
+    A command to diagnose the LLDB NSString data formatter
+    invoke as
+    (lldb) diagnose-nsstring <expr returning NSString>
+    e.g.
+    (lldb) diagnose-nsstring @"Hello world"
+    """
+    target = debugger.GetSelectedTarget()
+    process = target.GetProcess()
+    thread = process.GetSelectedThread()
+    frame = thread.GetSelectedFrame()
+    if not target.IsValid() or not process.IsValid():
+        return "unable to get target/process - cannot proceed"
+    options = lldb.SBExpressionOptions()
+    options.SetFetchDynamicValue()
+    error = lldb.SBError()
+    if frame.IsValid():
+        nsstring = frame.EvaluateExpression(command, options)
+    else:
+        nsstring = target.EvaluateExpression(command, options)
+    print >>result, str(nsstring)
+    nsstring_address = nsstring.GetValueAsUnsigned(0)
+    if nsstring_address == 0:
+        return "unable to obtain the string - cannot proceed"
+    expression = "\
 struct $__lldb__notInlineMutable {\
     char* buffer;\
     signed long length;\
@@ -97,75 +100,84 @@ struct $__lldb__CFString {\
 };\
 "
 
-	expression = expression + "*(($__lldb__CFString*) %d)" % nsstring_address
-	# print expression
-	dumped = target.EvaluateExpression(expression,options)
-	print >>result, str(dumped)
-	
-	little_endian = (target.byte_order == lldb.eByteOrderLittle)
-	ptr_size = target.addr_size
-	
-	info_bits = dumped.GetChildMemberWithName("_cfinfo").GetChildAtIndex(0 if little_endian else 3).GetValueAsUnsigned(0)
-	is_mutable = (info_bits & 1) == 1
-	is_inline = (info_bits & 0x60) == 0
-	has_explicit_length = (info_bits & (1 | 4)) != 4
-	is_unicode = (info_bits & 0x10) == 0x10
-	is_special = (nsstring.GetDynamicValue(lldb.eDynamicCanRunTarget).GetTypeName() == "NSPathStore2")
-	has_null = (info_bits & 8) == 8
-    
-	print >>result,"\nInfo=%d\nMutable=%s\nInline=%s\nExplicit=%s\nUnicode=%s\nSpecial=%s\nNull=%s\n" % \
-		(info_bits, "yes" if is_mutable else "no","yes" if is_inline else "no","yes" if has_explicit_length else "no","yes" if is_unicode else "no","yes" if is_special else "no","yes" if has_null else "no")
-
-
-	explicit_length_offset = 0
-	if not has_null and has_explicit_length and not is_special:
-		explicit_length_offset = 2*ptr_size
-		if is_mutable and not is_inline:
-			explicit_length_offset = explicit_length_offset + ptr_size
-		elif is_inline:
-			pass
-		elif not is_inline and not is_mutable:
-			explicit_length_offset = explicit_length_offset + ptr_size
-		else:
-			explicit_length_offset = 0
-
-	if explicit_length_offset == 0:
-		print >>result,"There is no explicit length marker - skipping this step\n"
-	else:
-		explicit_length_offset = nsstring_address + explicit_length_offset
-		explicit_length = process.ReadUnsignedFromMemory(explicit_length_offset, 4, error)
-		print >>result,"Explicit length location is at 0x%x - read value is %d\n" % (explicit_length_offset,explicit_length)
-
-	if is_mutable:
-		location = 2 * ptr_size + nsstring_address
-		location = process.ReadPointerFromMemory(location,error)
-	elif is_inline and has_explicit_length and not is_unicode and not is_special and not is_mutable:
-		location = 3 * ptr_size + nsstring_address
-	elif is_unicode:
-		location = 2 * ptr_size + nsstring_address
-		if is_inline:
-			if not has_explicit_length:
-				print >>result,"Unicode & Inline & !Explicit is a new combo - no formula for it"
-			else:
-				location += ptr_size
-		else:
-			location = process.ReadPointerFromMemory(location,error)
-	elif is_special:
-		location = nsstring_address + ptr_size + 4
-	elif is_inline:
-		location = 2 * ptr_size + nsstring_address
-		if not has_explicit_length:
-			location += 1
-	else:
-		location = 2 * ptr_size + nsstring_address
-		location = process.ReadPointerFromMemory(location,error)
-	print >>result,"Expected data location: 0x%x\n" % (location)
-	print >>result,"1K of data around location: %s\n" % read_memory(process,location,1024)
-	print >>result,"5K of data around string pointer: %s\n" % read_memory(process,nsstring_address,1024*5)
+    expression = expression + "*(($__lldb__CFString*) %d)" % nsstring_address
+    # print expression
+    dumped = target.EvaluateExpression(expression, options)
+    print >>result, str(dumped)
+
+    little_endian = (target.byte_order == lldb.eByteOrderLittle)
+    ptr_size = target.addr_size
+
+    info_bits = dumped.GetChildMemberWithName("_cfinfo").GetChildAtIndex(
+        0 if little_endian else 3).GetValueAsUnsigned(0)
+    is_mutable = (info_bits & 1) == 1
+    is_inline = (info_bits & 0x60) == 0
+    has_explicit_length = (info_bits & (1 | 4)) != 4
+    is_unicode = (info_bits & 0x10) == 0x10
+    is_special = (
+        nsstring.GetDynamicValue(
+            lldb.eDynamicCanRunTarget).GetTypeName() == "NSPathStore2")
+    has_null = (info_bits & 8) == 8
+
+    print >>result, "\nInfo=%d\nMutable=%s\nInline=%s\nExplicit=%s\nUnicode=%s\nSpecial=%s\nNull=%s\n" % \
+        (info_bits, "yes" if is_mutable else "no", "yes" if is_inline else "no", "yes" if has_explicit_length else "no", "yes" if is_unicode else "no", "yes" if is_special else "no", "yes" if has_null else "no")
+
+    explicit_length_offset = 0
+    if not has_null and has_explicit_length and not is_special:
+        explicit_length_offset = 2 * ptr_size
+        if is_mutable and not is_inline:
+            explicit_length_offset = explicit_length_offset + ptr_size
+        elif is_inline:
+            pass
+        elif not is_inline and not is_mutable:
+            explicit_length_offset = explicit_length_offset + ptr_size
+        else:
+            explicit_length_offset = 0
+
+    if explicit_length_offset == 0:
+        print >>result, "There is no explicit length marker - skipping this step\n"
+    else:
+        explicit_length_offset = nsstring_address + explicit_length_offset
+        explicit_length = process.ReadUnsignedFromMemory(
+            explicit_length_offset, 4, error)
+        print >>result, "Explicit length location is at 0x%x - read value is %d\n" % (
+            explicit_length_offset, explicit_length)
+
+    if is_mutable:
+        location = 2 * ptr_size + nsstring_address
+        location = process.ReadPointerFromMemory(location, error)
+    elif is_inline and has_explicit_length and not is_unicode and not is_special and not is_mutable:
+        location = 3 * ptr_size + nsstring_address
+    elif is_unicode:
+        location = 2 * ptr_size + nsstring_address
+        if is_inline:
+            if not has_explicit_length:
+                print >>result, "Unicode & Inline & !Explicit is a new combo - no formula for it"
+            else:
+                location += ptr_size
+        else:
+            location = process.ReadPointerFromMemory(location, error)
+    elif is_special:
+        location = nsstring_address + ptr_size + 4
+    elif is_inline:
+        location = 2 * ptr_size + nsstring_address
+        if not has_explicit_length:
+            location += 1
+    else:
+        location = 2 * ptr_size + nsstring_address
+        location = process.ReadPointerFromMemory(location, error)
+    print >>result, "Expected data location: 0x%x\n" % (location)
+    print >>result, "1K of data around location: %s\n" % read_memory(
+        process, location, 1024)
+    print >>result, "5K of data around string pointer: %s\n" % read_memory(
+        process, nsstring_address, 1024 * 5)
+
 
 def __lldb_init_module(debugger, internal_dict):
-	debugger.HandleCommand("command script add -f %s.diagnose_nsstring_Command_Impl diagnose-nsstring" % __name__)
-	print 'The "diagnose-nsstring" command has been installed, type "help diagnose-nsstring" for detailed help.'
+    debugger.HandleCommand(
+        "command script add -f %s.diagnose_nsstring_Command_Impl diagnose-nsstring" %
+        __name__)
+    print 'The "diagnose-nsstring" command has been installed, type "help diagnose-nsstring" for detailed help.'
 
-__lldb_init_module(lldb.debugger,None)
-__lldb_init_module = None
\ No newline at end of file
+__lldb_init_module(lldb.debugger, None)
+__lldb_init_module = None

Modified: lldb/trunk/examples/python/diagnose_unwind.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/diagnose_unwind.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/examples/python/diagnose_unwind.py (original)
+++ lldb/trunk/examples/python/diagnose_unwind.py Tue Sep  6 15:57:50 2016
@@ -13,258 +13,301 @@ import shlex
 
 # Print the frame number, pc, frame pointer, module UUID and function name
 # Returns the SBModule that contains the PC, if it could be found
-def backtrace_print_frame (target, frame_num, addr, fp):
-  process = target.GetProcess()
-  addr_for_printing = addr
-  addr_width = process.GetAddressByteSize() * 2
-  if frame_num > 0:
-    addr = addr - 1
-
-  sbaddr = lldb.SBAddress()
-  try:
-    sbaddr.SetLoadAddress(addr, target)
-    module_description = ""
-    if sbaddr.GetModule():
-      module_filename = ""
-      module_uuid_str = sbaddr.GetModule().GetUUIDString()
-      if module_uuid_str == None:
-        module_uuid_str = ""
-      if sbaddr.GetModule().GetFileSpec():
-        module_filename = sbaddr.GetModule().GetFileSpec().GetFilename()
-        if module_filename == None:
-          module_filename = ""
-      if module_uuid_str != "" or module_filename != "":
-        module_description = '%s %s' % (module_filename, module_uuid_str)
-  except Exception:
-    print '%2d: pc==0x%-*x fp==0x%-*x' % (frame_num, addr_width, addr_for_printing, addr_width, fp)
-    return
-
-  sym_ctx = target.ResolveSymbolContextForAddress(sbaddr, lldb.eSymbolContextEverything)
-  if sym_ctx.IsValid() and sym_ctx.GetSymbol().IsValid():
-    function_start = sym_ctx.GetSymbol().GetStartAddress().GetLoadAddress(target)
-    offset = addr - function_start
-    print '%2d: pc==0x%-*x fp==0x%-*x %s %s + %d' % (frame_num, addr_width, addr_for_printing, addr_width, fp, module_description, sym_ctx.GetSymbol().GetName(), offset)
-  else:
-    print '%2d: pc==0x%-*x fp==0x%-*x %s' % (frame_num, addr_width, addr_for_printing, addr_width, fp, module_description)
-  return sbaddr.GetModule()
+
+
+def backtrace_print_frame(target, frame_num, addr, fp):
+    process = target.GetProcess()
+    addr_for_printing = addr
+    addr_width = process.GetAddressByteSize() * 2
+    if frame_num > 0:
+        addr = addr - 1
+
+    sbaddr = lldb.SBAddress()
+    try:
+        sbaddr.SetLoadAddress(addr, target)
+        module_description = ""
+        if sbaddr.GetModule():
+            module_filename = ""
+            module_uuid_str = sbaddr.GetModule().GetUUIDString()
+            if module_uuid_str is None:
+                module_uuid_str = ""
+            if sbaddr.GetModule().GetFileSpec():
+                module_filename = sbaddr.GetModule().GetFileSpec().GetFilename()
+                if module_filename is None:
+                    module_filename = ""
+            if module_uuid_str != "" or module_filename != "":
+                module_description = '%s %s' % (
+                    module_filename, module_uuid_str)
+    except Exception:
+        print '%2d: pc==0x%-*x fp==0x%-*x' % (frame_num, addr_width, addr_for_printing, addr_width, fp)
+        return
+
+    sym_ctx = target.ResolveSymbolContextForAddress(
+        sbaddr, lldb.eSymbolContextEverything)
+    if sym_ctx.IsValid() and sym_ctx.GetSymbol().IsValid():
+        function_start = sym_ctx.GetSymbol().GetStartAddress().GetLoadAddress(target)
+        offset = addr - function_start
+        print '%2d: pc==0x%-*x fp==0x%-*x %s %s + %d' % (frame_num, addr_width, addr_for_printing, addr_width, fp, module_description, sym_ctx.GetSymbol().GetName(), offset)
+    else:
+        print '%2d: pc==0x%-*x fp==0x%-*x %s' % (frame_num, addr_width, addr_for_printing, addr_width, fp, module_description)
+    return sbaddr.GetModule()
 
 # A simple stack walk algorithm that follows the frame chain.
 # Returns a two-element list; the first element is a list of modules
 # seen and the second element is a list of addresses seen during the backtrace.
-def simple_backtrace(debugger):
-  target = debugger.GetSelectedTarget()
-  process = target.GetProcess()
-  cur_thread = process.GetSelectedThread()
-
-  initial_fp = cur_thread.GetFrameAtIndex(0).GetFP()
-
-  # If the pseudoreg "fp" isn't recognized, on arm hardcode to r7 which is correct for Darwin programs.
-  if initial_fp == lldb.LLDB_INVALID_ADDRESS and target.triple[0:3] == "arm":
-    for reggroup in cur_thread.GetFrameAtIndex(1).registers:
-      if reggroup.GetName() == "General Purpose Registers":
-        for reg in reggroup:
-          if reg.GetName() == "r7":
-            initial_fp = int (reg.GetValue(), 16)
-
-  module_list = []
-  address_list = [cur_thread.GetFrameAtIndex(0).GetPC()]
-  this_module = backtrace_print_frame (target, 0, cur_thread.GetFrameAtIndex(0).GetPC(), initial_fp)
-  print_stack_frame (process, initial_fp)
-  print ""
-  if this_module != None:
-    module_list.append (this_module)
-  if cur_thread.GetNumFrames() < 2:
-    return [module_list, address_list]
 
-  cur_fp = process.ReadPointerFromMemory (initial_fp, lldb.SBError())
-  cur_pc = process.ReadPointerFromMemory (initial_fp + process.GetAddressByteSize(), lldb.SBError())
 
-  frame_num = 1
+def simple_backtrace(debugger):
+    target = debugger.GetSelectedTarget()
+    process = target.GetProcess()
+    cur_thread = process.GetSelectedThread()
 
-  while cur_pc != 0 and cur_fp != 0 and cur_pc != lldb.LLDB_INVALID_ADDRESS and cur_fp != lldb.LLDB_INVALID_ADDRESS:
-    address_list.append (cur_pc)
-    this_module = backtrace_print_frame (target, frame_num, cur_pc, cur_fp)
-    print_stack_frame (process, cur_fp)
+    initial_fp = cur_thread.GetFrameAtIndex(0).GetFP()
+
+    # If the pseudoreg "fp" isn't recognized, on arm hardcode to r7 which is
+    # correct for Darwin programs.
+    if initial_fp == lldb.LLDB_INVALID_ADDRESS and target.triple[0:3] == "arm":
+        for reggroup in cur_thread.GetFrameAtIndex(1).registers:
+            if reggroup.GetName() == "General Purpose Registers":
+                for reg in reggroup:
+                    if reg.GetName() == "r7":
+                        initial_fp = int(reg.GetValue(), 16)
+
+    module_list = []
+    address_list = [cur_thread.GetFrameAtIndex(0).GetPC()]
+    this_module = backtrace_print_frame(
+        target, 0, cur_thread.GetFrameAtIndex(0).GetPC(), initial_fp)
+    print_stack_frame(process, initial_fp)
     print ""
-    if this_module != None:
-      module_list.append (this_module)
-    frame_num = frame_num + 1
-    next_pc = 0
-    next_fp = 0
-    if target.triple[0:6] == "x86_64" or target.triple[0:4] == "i386" or target.triple[0:3] == "arm":
-      error = lldb.SBError()
-      next_pc = process.ReadPointerFromMemory(cur_fp + process.GetAddressByteSize(), error)
-      if not error.Success():
+    if this_module is not None:
+        module_list.append(this_module)
+    if cur_thread.GetNumFrames() < 2:
+        return [module_list, address_list]
+
+    cur_fp = process.ReadPointerFromMemory(initial_fp, lldb.SBError())
+    cur_pc = process.ReadPointerFromMemory(
+        initial_fp + process.GetAddressByteSize(), lldb.SBError())
+
+    frame_num = 1
+
+    while cur_pc != 0 and cur_fp != 0 and cur_pc != lldb.LLDB_INVALID_ADDRESS and cur_fp != lldb.LLDB_INVALID_ADDRESS:
+        address_list.append(cur_pc)
+        this_module = backtrace_print_frame(target, frame_num, cur_pc, cur_fp)
+        print_stack_frame(process, cur_fp)
+        print ""
+        if this_module is not None:
+            module_list.append(this_module)
+        frame_num = frame_num + 1
         next_pc = 0
-      next_fp = process.ReadPointerFromMemory(cur_fp, error)
-      if not error.Success():
         next_fp = 0
-    # Clear the 0th bit for arm frames - this indicates it is a thumb frame
-    if target.triple[0:3] == "arm" and (next_pc & 1) == 1:
-      next_pc = next_pc & ~1
-    cur_pc = next_pc
-    cur_fp = next_fp
-  this_module = backtrace_print_frame (target, frame_num, cur_pc, cur_fp)
-  print_stack_frame (process, cur_fp)
-  print ""
-  if this_module != None:
-    module_list.append (this_module)
-  return [module_list, address_list]
-
-def print_stack_frame(process, fp):
-  if fp == 0 or fp == lldb.LLDB_INVALID_ADDRESS or fp == 1:
-    return
-  addr_size = process.GetAddressByteSize()
-  addr = fp - (2 * addr_size)
-  i = 0
-  outline = "Stack frame from $fp-%d: " % (2 * addr_size)
-  error = lldb.SBError()
-  try:
-    while i < 5 and error.Success():
-      address = process.ReadPointerFromMemory(addr + (i * addr_size), error)
-      outline += " 0x%x" % address
-      i += 1
-    print outline
-  except Exception:
-    return
-
-def diagnose_unwind(debugger, command, result, dict):
-  """
-Gather diagnostic information to help debug incorrect unwind (backtrace) 
-behavior in lldb.  When there is a backtrace that doesn't look
-correct, run this command with the correct thread selected and a
-large amount of diagnostic information will be printed, it is likely
-to be helpful when reporting the problem.
-  """
-
-  command_args = shlex.split(command)
-  parser = create_diagnose_unwind_options()
-  try:
-    (options, args) = parser.parse_args(command_args)
-  except:
-   return
-  target = debugger.GetSelectedTarget()
-  if target:
-    process = target.GetProcess()
-    if process:
-      thread = process.GetSelectedThread()
-      if thread:
-        lldb_versions_match = re.search(r'[lL][lL][dD][bB]-(\d+)([.](\d+))?([.](\d+))?', debugger.GetVersionString())
-        lldb_version = 0
-        lldb_minor = 0
-        if len(lldb_versions_match.groups()) >= 1 and lldb_versions_match.groups()[0]:
-          lldb_major = int(lldb_versions_match.groups()[0])
-        if len(lldb_versions_match.groups()) >= 5 and lldb_versions_match.groups()[4]:
-          lldb_minor = int(lldb_versions_match.groups()[4])
+        if target.triple[
+            0:6] == "x86_64" or target.triple[
+            0:4] == "i386" or target.triple[
+                0:3] == "arm":
+            error = lldb.SBError()
+            next_pc = process.ReadPointerFromMemory(
+                cur_fp + process.GetAddressByteSize(), error)
+            if not error.Success():
+                next_pc = 0
+            next_fp = process.ReadPointerFromMemory(cur_fp, error)
+            if not error.Success():
+                next_fp = 0
+        # Clear the 0th bit for arm frames - this indicates it is a thumb frame
+        if target.triple[0:3] == "arm" and (next_pc & 1) == 1:
+            next_pc = next_pc & ~1
+        cur_pc = next_pc
+        cur_fp = next_fp
+    this_module = backtrace_print_frame(target, frame_num, cur_pc, cur_fp)
+    print_stack_frame(process, cur_fp)
+    print ""
+    if this_module is not None:
+        module_list.append(this_module)
+    return [module_list, address_list]
 
-        modules_seen = []
-        addresses_seen = []
 
-        print 'LLDB version %s' % debugger.GetVersionString()
-        print 'Unwind diagnostics for thread %d' % thread.GetIndexID()
-        print ""
-        print "============================================================================================="
-        print ""
-        print "OS plugin setting:"
-        debugger.HandleCommand("settings show target.process.python-os-plugin-path")
-        print ""
-        print "Live register context:"
-        thread.SetSelectedFrame(0)
-        debugger.HandleCommand("register read")
-        print ""
-        print "============================================================================================="
-        print ""
-        print "lldb's unwind algorithm:"
-        print ""
-        frame_num = 0
-        for frame in thread.frames:
-          if not frame.IsInlined():
-            this_module = backtrace_print_frame (target, frame_num, frame.GetPC(), frame.GetFP())
-            print_stack_frame (process, frame.GetFP())
-            print ""
-            if this_module != None:
-              modules_seen.append (this_module)
-            addresses_seen.append (frame.GetPC())
-            frame_num = frame_num + 1
-        print ""
-        print "============================================================================================="
-        print ""
-        print "Simple stack walk algorithm:"
-        print ""
-        (module_list, address_list) = simple_backtrace(debugger)
-        if module_list and module_list != None:
-          modules_seen += module_list
-        if address_list and address_list != None:
-          addresses_seen = set(addresses_seen)
-          addresses_seen.update(set(address_list))
+def print_stack_frame(process, fp):
+    if fp == 0 or fp == lldb.LLDB_INVALID_ADDRESS or fp == 1:
+        return
+    addr_size = process.GetAddressByteSize()
+    addr = fp - (2 * addr_size)
+    i = 0
+    outline = "Stack frame from $fp-%d: " % (2 * addr_size)
+    error = lldb.SBError()
+    try:
+        while i < 5 and error.Success():
+            address = process.ReadPointerFromMemory(
+                addr + (i * addr_size), error)
+            outline += " 0x%x" % address
+            i += 1
+        print outline
+    except Exception:
+        return
 
-        print ""
-        print "============================================================================================="
-        print ""
-        print "Modules seen in stack walks:"
-        print ""
-        modules_already_seen = set()
-        for module in modules_seen:
-          if module != None and module.GetFileSpec().GetFilename() != None:
-            if not module.GetFileSpec().GetFilename() in modules_already_seen:
-              debugger.HandleCommand('image list %s' % module.GetFileSpec().GetFilename())
-              modules_already_seen.add(module.GetFileSpec().GetFilename())
 
-        print ""
-        print "============================================================================================="
-        print ""
-        print "Disassembly ofaddresses seen in stack walks:"
-        print ""
-        additional_addresses_to_disassemble = addresses_seen
-        for frame in thread.frames:
-          if not frame.IsInlined():
-            print "--------------------------------------------------------------------------------------"
-            print ""
-            print "Disassembly of %s, frame %d, address 0x%x" % (frame.GetFunctionName(), frame.GetFrameID(), frame.GetPC())
-            print ""
-            if target.triple[0:6] == "x86_64" or target.triple[0:4] == "i386":
-              debugger.HandleCommand('disassemble -F att -a 0x%x' % frame.GetPC())
-            else:
-              debugger.HandleCommand('disassemble -a 0x%x' % frame.GetPC())
-            if frame.GetPC() in additional_addresses_to_disassemble:
-              additional_addresses_to_disassemble.remove (frame.GetPC())
-
-        for address in list(additional_addresses_to_disassemble):
-          print "--------------------------------------------------------------------------------------"
-          print ""
-          print "Disassembly of 0x%x" % address
-          print ""
-          if target.triple[0:6] == "x86_64" or target.triple[0:4] == "i386":
-            debugger.HandleCommand('disassemble -F att -a 0x%x' % address)
-          else:
-            debugger.HandleCommand('disassemble -a 0x%x' % address)
+def diagnose_unwind(debugger, command, result, dict):
+    """
+  Gather diagnostic information to help debug incorrect unwind (backtrace)
+  behavior in lldb.  When there is a backtrace that doesn't look
+  correct, run this command with the correct thread selected and a
+  large amount of diagnostic information will be printed, it is likely
+  to be helpful when reporting the problem.
+    """
+
+    command_args = shlex.split(command)
+    parser = create_diagnose_unwind_options()
+    try:
+        (options, args) = parser.parse_args(command_args)
+    except:
+        return
+    target = debugger.GetSelectedTarget()
+    if target:
+        process = target.GetProcess()
+        if process:
+            thread = process.GetSelectedThread()
+            if thread:
+                lldb_versions_match = re.search(
+                    r'[lL][lL][dD][bB]-(\d+)([.](\d+))?([.](\d+))?',
+                    debugger.GetVersionString())
+                lldb_version = 0
+                lldb_minor = 0
+                if len(lldb_versions_match.groups()
+                       ) >= 1 and lldb_versions_match.groups()[0]:
+                    lldb_major = int(lldb_versions_match.groups()[0])
+                if len(lldb_versions_match.groups()
+                       ) >= 5 and lldb_versions_match.groups()[4]:
+                    lldb_minor = int(lldb_versions_match.groups()[4])
+
+                modules_seen = []
+                addresses_seen = []
+
+                print 'LLDB version %s' % debugger.GetVersionString()
+                print 'Unwind diagnostics for thread %d' % thread.GetIndexID()
+                print ""
+                print "============================================================================================="
+                print ""
+                print "OS plugin setting:"
+                debugger.HandleCommand(
+                    "settings show target.process.python-os-plugin-path")
+                print ""
+                print "Live register context:"
+                thread.SetSelectedFrame(0)
+                debugger.HandleCommand("register read")
+                print ""
+                print "============================================================================================="
+                print ""
+                print "lldb's unwind algorithm:"
+                print ""
+                frame_num = 0
+                for frame in thread.frames:
+                    if not frame.IsInlined():
+                        this_module = backtrace_print_frame(
+                            target, frame_num, frame.GetPC(), frame.GetFP())
+                        print_stack_frame(process, frame.GetFP())
+                        print ""
+                        if this_module is not None:
+                            modules_seen.append(this_module)
+                        addresses_seen.append(frame.GetPC())
+                        frame_num = frame_num + 1
+                print ""
+                print "============================================================================================="
+                print ""
+                print "Simple stack walk algorithm:"
+                print ""
+                (module_list, address_list) = simple_backtrace(debugger)
+                if module_list and module_list is not None:
+                    modules_seen += module_list
+                if address_list and address_list is not None:
+                    addresses_seen = set(addresses_seen)
+                    addresses_seen.update(set(address_list))
+
+                print ""
+                print "============================================================================================="
+                print ""
+                print "Modules seen in stack walks:"
+                print ""
+                modules_already_seen = set()
+                for module in modules_seen:
+                    if module is not None and module.GetFileSpec().GetFilename() is not None:
+                        if not module.GetFileSpec().GetFilename() in modules_already_seen:
+                            debugger.HandleCommand(
+                                'image list %s' %
+                                module.GetFileSpec().GetFilename())
+                            modules_already_seen.add(
+                                module.GetFileSpec().GetFilename())
+
+                print ""
+                print "============================================================================================="
+                print ""
+                print "Disassembly ofaddresses seen in stack walks:"
+                print ""
+                additional_addresses_to_disassemble = addresses_seen
+                for frame in thread.frames:
+                    if not frame.IsInlined():
+                        print "--------------------------------------------------------------------------------------"
+                        print ""
+                        print "Disassembly of %s, frame %d, address 0x%x" % (frame.GetFunctionName(), frame.GetFrameID(), frame.GetPC())
+                        print ""
+                        if target.triple[
+                                0:6] == "x86_64" or target.triple[
+                                0:4] == "i386":
+                            debugger.HandleCommand(
+                                'disassemble -F att -a 0x%x' % frame.GetPC())
+                        else:
+                            debugger.HandleCommand(
+                                'disassemble -a 0x%x' %
+                                frame.GetPC())
+                        if frame.GetPC() in additional_addresses_to_disassemble:
+                            additional_addresses_to_disassemble.remove(
+                                frame.GetPC())
+
+                for address in list(additional_addresses_to_disassemble):
+                    print "--------------------------------------------------------------------------------------"
+                    print ""
+                    print "Disassembly of 0x%x" % address
+                    print ""
+                    if target.triple[
+                            0:6] == "x86_64" or target.triple[
+                            0:4] == "i386":
+                        debugger.HandleCommand(
+                            'disassemble -F att -a 0x%x' % address)
+                    else:
+                        debugger.HandleCommand('disassemble -a 0x%x' % address)
+
+                print ""
+                print "============================================================================================="
+                print ""
+                additional_addresses_to_show_unwind = addresses_seen
+                for frame in thread.frames:
+                    if not frame.IsInlined():
+                        print "--------------------------------------------------------------------------------------"
+                        print ""
+                        print "Unwind instructions for %s, frame %d" % (frame.GetFunctionName(), frame.GetFrameID())
+                        print ""
+                        debugger.HandleCommand(
+                            'image show-unwind -a "0x%x"' % frame.GetPC())
+                        if frame.GetPC() in additional_addresses_to_show_unwind:
+                            additional_addresses_to_show_unwind.remove(
+                                frame.GetPC())
+
+                for address in list(additional_addresses_to_show_unwind):
+                    print "--------------------------------------------------------------------------------------"
+                    print ""
+                    print "Unwind instructions for 0x%x" % address
+                    print ""
+                    debugger.HandleCommand(
+                        'image show-unwind -a "0x%x"' % address)
 
-        print ""
-        print "============================================================================================="
-        print ""
-        additional_addresses_to_show_unwind = addresses_seen
-        for frame in thread.frames:
-          if not frame.IsInlined():
-            print "--------------------------------------------------------------------------------------"
-            print ""
-            print "Unwind instructions for %s, frame %d" % (frame.GetFunctionName(), frame.GetFrameID())
-            print ""
-            debugger.HandleCommand('image show-unwind -a "0x%x"' % frame.GetPC())
-            if frame.GetPC() in additional_addresses_to_show_unwind:
-              additional_addresses_to_show_unwind.remove (frame.GetPC())
-
-        for address in list(additional_addresses_to_show_unwind):
-          print "--------------------------------------------------------------------------------------"
-          print ""
-          print "Unwind instructions for 0x%x" % address
-          print ""
-          debugger.HandleCommand('image show-unwind -a "0x%x"' % address)
 
 def create_diagnose_unwind_options():
-  usage = "usage: %prog"
-  description='''Print diagnostic information about a thread backtrace which will help to debug unwind problems'''
-  parser = optparse.OptionParser(description=description, prog='diagnose_unwind',usage=usage)
-  return parser
-
-lldb.debugger.HandleCommand('command script add -f %s.diagnose_unwind diagnose-unwind' % __name__)
+    usage = "usage: %prog"
+    description = '''Print diagnostic information about a thread backtrace which will help to debug unwind problems'''
+    parser = optparse.OptionParser(
+        description=description,
+        prog='diagnose_unwind',
+        usage=usage)
+    return parser
+
+lldb.debugger.HandleCommand(
+    'command script add -f %s.diagnose_unwind diagnose-unwind' %
+    __name__)
 print 'The "diagnose-unwind" command has been installed, type "help diagnose-unwind" for detailed help.'

Modified: lldb/trunk/examples/python/dict_utils.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/dict_utils.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/examples/python/dict_utils.py (original)
+++ lldb/trunk/examples/python/dict_utils.py Tue Sep  6 15:57:50 2016
@@ -1,27 +1,28 @@
- 
+
 class LookupDictionary(dict):
     """
     a dictionary which can lookup value by key, or keys by value
     """
+
     def __init__(self, items=[]):
         """items can be a list of pair_lists or a dictionary"""
         dict.__init__(self, items)
- 
-    def get_keys_for_value(self, value, fail_value = None):
+
+    def get_keys_for_value(self, value, fail_value=None):
         """find the key(s) as a list given a value"""
         list_result = [item[0] for item in self.items() if item[1] == value]
         if len(list_result) > 0:
             return list_result
         return fail_value
- 
-    def get_first_key_for_value(self, value, fail_value = None):
+
+    def get_first_key_for_value(self, value, fail_value=None):
         """return the first key of this dictionary given the value"""
         list_result = [item[0] for item in self.items() if item[1] == value]
         if len(list_result) > 0:
             return list_result[0]
         return fail_value
 
-    def get_value(self, key, fail_value = None):
+    def get_value(self, key, fail_value=None):
         """find the value given a key"""
         if key in self:
             return self[key]
@@ -29,12 +30,12 @@ class LookupDictionary(dict):
 
 
 class Enum(LookupDictionary):
-    
+
     def __init__(self, initial_value=0, items=[]):
         """items can be a list of pair_lists or a dictionary"""
         LookupDictionary.__init__(self, items)
         self.value = initial_value
-    
+
     def set_value(self, v):
         v_typename = typeof(v).__name__
         if v_typename == 'str':
@@ -44,18 +45,18 @@ class Enum(LookupDictionary):
                 v = 0
         else:
             self.value = v
-    
+
     def get_enum_value(self):
         return self.value
-    
+
     def get_enum_name(self):
         return self.__str__()
 
     def __str__(self):
-        s = self.get_first_key_for_value (self.value, None)
-        if s == None:
+        s = self.get_first_key_for_value(self.value, None)
+        if s is None:
             s = "%#8.8x" % self.value
         return s
-    
+
     def __repr__(self):
-        return self.__str__()
\ No newline at end of file
+        return self.__str__()

Modified: lldb/trunk/examples/python/disasm-stress-test.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/disasm-stress-test.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/examples/python/disasm-stress-test.py (original)
+++ lldb/trunk/examples/python/disasm-stress-test.py Tue Sep  6 15:57:50 2016
@@ -1,40 +1,82 @@
 #!/usr/bin/python
 
-import argparse, datetime, re, subprocess, sys, time
-
-parser = argparse.ArgumentParser(description="Run an exhaustive test of the LLDB disassembler for a specific architecture.")
-
-parser.add_argument('--arch', required=True, action='store', help='The architecture whose disassembler is to be tested')
-parser.add_argument('--bytes', required=True, action='store', type=int, help='The byte width of instructions for that architecture')
-parser.add_argument('--random', required=False, action='store_true', help='Enables non-sequential testing')
-parser.add_argument('--start', required=False, action='store', type=int, help='The first instruction value to test')
-parser.add_argument('--skip', required=False, action='store', type=int, help='The interval between instructions to test')
-parser.add_argument('--log', required=False, action='store', help='A log file to write the most recent instruction being tested')
-parser.add_argument('--time', required=False, action='store_true', help='Every 100,000 instructions, print an ETA to standard out')
-parser.add_argument('--lldb', required=False, action='store', help='The path to LLDB.framework, if LLDB should be overridden')
+import argparse
+import datetime
+import re
+import subprocess
+import sys
+import time
+
+parser = argparse.ArgumentParser(
+    description="Run an exhaustive test of the LLDB disassembler for a specific architecture.")
+
+parser.add_argument(
+    '--arch',
+    required=True,
+    action='store',
+    help='The architecture whose disassembler is to be tested')
+parser.add_argument(
+    '--bytes',
+    required=True,
+    action='store',
+    type=int,
+    help='The byte width of instructions for that architecture')
+parser.add_argument(
+    '--random',
+    required=False,
+    action='store_true',
+    help='Enables non-sequential testing')
+parser.add_argument(
+    '--start',
+    required=False,
+    action='store',
+    type=int,
+    help='The first instruction value to test')
+parser.add_argument(
+    '--skip',
+    required=False,
+    action='store',
+    type=int,
+    help='The interval between instructions to test')
+parser.add_argument(
+    '--log',
+    required=False,
+    action='store',
+    help='A log file to write the most recent instruction being tested')
+parser.add_argument(
+    '--time',
+    required=False,
+    action='store_true',
+    help='Every 100,000 instructions, print an ETA to standard out')
+parser.add_argument(
+    '--lldb',
+    required=False,
+    action='store',
+    help='The path to LLDB.framework, if LLDB should be overridden')
 
 arguments = sys.argv[1:]
 
 arg_ns = parser.parse_args(arguments)
 
+
 def AddLLDBToSysPathOnMacOSX():
     def GetLLDBFrameworkPath():
         lldb_path = subprocess.check_output(["xcrun", "-find", "lldb"])
         re_result = re.match("(.*)/Developer/usr/bin/lldb", lldb_path)
-        if re_result == None:
+        if re_result is None:
             return None
         xcode_contents_path = re_result.group(1)
         return xcode_contents_path + "/SharedFrameworks/LLDB.framework"
-    
+
     lldb_framework_path = GetLLDBFrameworkPath()
-    
-    if lldb_framework_path == None:
+
+    if lldb_framework_path is None:
         print "Couldn't find LLDB.framework"
         sys.exit(-1)
-    
+
     sys.path.append(lldb_framework_path + "/Resources/Python")
 
-if arg_ns.lldb == None:
+if arg_ns.lldb is None:
     AddLLDBToSysPathOnMacOSX()
 else:
     sys.path.append(arg_ns.lldb + "/Resources/Python")
@@ -53,16 +95,20 @@ if target.IsValid() == False:
     print "Couldn't create an SBTarget for architecture " + arg_ns.arch
     sys.exit(-1)
 
+
 def ResetLogFile(log_file):
     if log_file != sys.stdout:
         log_file.seek(0)
 
+
 def PrintByteArray(log_file, byte_array):
     for byte in byte_array:
         print >>log_file, hex(byte) + " ",
     print >>log_file
-    
+
+
 class SequentialInstructionProvider:
+
     def __init__(self, byte_width, log_file, start=0, skip=1):
         self.m_byte_width = byte_width
         self.m_log_file = log_file
@@ -70,70 +116,83 @@ class SequentialInstructionProvider:
         self.m_skip = skip
         self.m_value = start
         self.m_last = (1 << (byte_width * 8)) - 1
+
     def PrintCurrentState(self, ret):
         ResetLogFile(self.m_log_file)
         print >>self.m_log_file, self.m_value
         PrintByteArray(self.m_log_file, ret)
+
     def GetNextInstruction(self):
         if self.m_value > self.m_last:
             return None
         ret = bytearray(self.m_byte_width)
         for i in range(self.m_byte_width):
-            ret[self.m_byte_width - (i + 1)] = (self.m_value >> (i * 8)) & 255 
+            ret[self.m_byte_width - (i + 1)] = (self.m_value >> (i * 8)) & 255
         self.PrintCurrentState(ret)
         self.m_value += self.m_skip
         return ret
+
     def GetNumInstructions(self):
         return (self.m_last - self.m_start) / self.m_skip
+
     def __iter__(self):
         return self
+
     def next(self):
         ret = self.GetNextInstruction()
-        if ret == None:
+        if ret is None:
             raise StopIteration
         return ret
 
+
 class RandomInstructionProvider:
+
     def __init__(self, byte_width, log_file):
         self.m_byte_width = byte_width
         self.m_log_file = log_file
         self.m_random_file = open("/dev/random", 'r')
+
     def PrintCurrentState(self, ret):
         ResetLogFile(self.m_log_file)
         PrintByteArray(self.m_log_file, ret)
+
     def GetNextInstruction(self):
         ret = bytearray(self.m_byte_width)
         for i in range(self.m_byte_width):
             ret[i] = self.m_random_file.read(1)
         self.PrintCurrentState(ret)
         return ret
+
     def __iter__(self):
         return self
+
     def next(self):
         ret = self.GetNextInstruction()
-        if ret == None:
+        if ret is None:
             raise StopIteration
         return ret
 
 log_file = None
 
+
 def GetProviderWithArguments(args):
     global log_file
-    if args.log != None:
+    if args.log is not None:
         log_file = open(args.log, 'w')
     else:
         log_file = sys.stdout
     instruction_provider = None
-    if args.random == True:
+    if args.random:
         instruction_provider = RandomInstructionProvider(args.bytes, log_file)
     else:
         start = 0
         skip = 1
-        if args.start != None:
+        if args.start is not None:
             start = args.start
-        if args.skip != None:
+        if args.skip is not None:
             skip = args.skip
-        instruction_provider = SequentialInstructionProvider(args.bytes, log_file, start, skip)
+        instruction_provider = SequentialInstructionProvider(
+            args.bytes, log_file, start, skip)
     return instruction_provider
 
 instruction_provider = GetProviderWithArguments(arg_ns)
@@ -149,10 +208,13 @@ if actually_time:
 
 for inst_bytes in instruction_provider:
     if actually_time:
-        if (num_instructions_logged != 0) and (num_instructions_logged % 100000 == 0):
+        if (num_instructions_logged != 0) and (
+                num_instructions_logged % 100000 == 0):
             curr_time = time.time()
             elapsed_time = curr_time - start_time
-            remaining_time = float(total_num_instructions - num_instructions_logged) * (float(elapsed_time) / float(num_instructions_logged))
+            remaining_time = float(
+                total_num_instructions - num_instructions_logged) * (
+                float(elapsed_time) / float(num_instructions_logged))
             print str(datetime.timedelta(seconds=remaining_time))
         num_instructions_logged = num_instructions_logged + 1
     inst_list = target.GetInstructions(fake_address, inst_bytes)

Modified: lldb/trunk/examples/python/disasm.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/disasm.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/examples/python/disasm.py (original)
+++ lldb/trunk/examples/python/disasm.py Tue Sep  6 15:57:50 2016
@@ -12,10 +12,12 @@ import lldb
 import os
 import sys
 
-def disassemble_instructions (insts):
+
+def disassemble_instructions(insts):
     for i in insts:
         print i
 
+
 def usage():
     print "Usage: disasm.py [-n name] executable-image"
     print "       By default, it breaks at and disassembles the 'main' function."
@@ -36,63 +38,69 @@ else:
 # Create a new debugger instance
 debugger = lldb.SBDebugger.Create()
 
-# When we step or continue, don't return from the function until the process 
+# When we step or continue, don't return from the function until the process
 # stops. We do this by setting the async mode to false.
-debugger.SetAsync (False)
+debugger.SetAsync(False)
 
 # Create a target from a file and arch
 print "Creating a target for '%s'" % exe
 
-target = debugger.CreateTargetWithFileAndArch (exe, lldb.LLDB_ARCH_DEFAULT)
+target = debugger.CreateTargetWithFileAndArch(exe, lldb.LLDB_ARCH_DEFAULT)
 
 if target:
     # If the target is valid set a breakpoint at main
-    main_bp = target.BreakpointCreateByName (fname, target.GetExecutable().GetFilename());
+    main_bp = target.BreakpointCreateByName(
+        fname, target.GetExecutable().GetFilename())
 
     print main_bp
 
     # Launch the process. Since we specified synchronous mode, we won't return
     # from this function until we hit the breakpoint at main
-    process = target.LaunchSimple (None, None, os.getcwd())
-    
+    process = target.LaunchSimple(None, None, os.getcwd())
+
     # Make sure the launch went ok
     if process:
         # Print some simple process info
-        state = process.GetState ()
+        state = process.GetState()
         print process
         if state == lldb.eStateStopped:
             # Get the first thread
-            thread = process.GetThreadAtIndex (0)
+            thread = process.GetThreadAtIndex(0)
             if thread:
                 # Print some simple thread info
                 print thread
                 # Get the first frame
-                frame = thread.GetFrameAtIndex (0)
+                frame = thread.GetFrameAtIndex(0)
                 if frame:
                     # Print some simple frame info
                     print frame
                     function = frame.GetFunction()
                     # See if we have debug info (a function)
                     if function:
-                        # We do have a function, print some info for the function
+                        # We do have a function, print some info for the
+                        # function
                         print function
-                        # Now get all instructions for this function and print them
+                        # Now get all instructions for this function and print
+                        # them
                         insts = function.GetInstructions(target)
-                        disassemble_instructions (insts)
+                        disassemble_instructions(insts)
                     else:
-                        # See if we have a symbol in the symbol table for where we stopped
-                        symbol = frame.GetSymbol();
+                        # See if we have a symbol in the symbol table for where
+                        # we stopped
+                        symbol = frame.GetSymbol()
                         if symbol:
-                            # We do have a symbol, print some info for the symbol
+                            # We do have a symbol, print some info for the
+                            # symbol
                             print symbol
-                            # Now get all instructions for this symbol and print them
+                            # Now get all instructions for this symbol and
+                            # print them
                             insts = symbol.GetInstructions(target)
-                            disassemble_instructions (insts)
+                            disassemble_instructions(insts)
 
                     registerList = frame.GetRegisters()
                     print "Frame registers (size of register set = %d):" % registerList.GetSize()
                     for value in registerList:
-                        #print value
+                        # print value
                         print "%s (number of children = %d):" % (value.GetName(), value.GetNumChildren())
                         for child in value:
                             print "Name: ", child.GetName(), " Value: ", child.GetValue()
@@ -111,9 +119,8 @@ if target:
         elif state == lldb.eStateExited:
             print "Didn't hit the breakpoint at main, program has exited..."
         else:
-            print "Unexpected process state: %s, killing process..." % debugger.StateAsCString (state)
+            print "Unexpected process state: %s, killing process..." % debugger.StateAsCString(state)
             process.Kill()
 
-        
 
 lldb.SBDebugger.Terminate()

Modified: lldb/trunk/examples/python/file_extract.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/file_extract.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/examples/python/file_extract.py (original)
+++ lldb/trunk/examples/python/file_extract.py Tue Sep  6 15:57:50 2016
@@ -4,16 +4,17 @@ import string
 import struct
 import sys
 
+
 class FileExtract:
     '''Decode binary data from a file'''
-    
-    def __init__(self, f, b = '='):
+
+    def __init__(self, f, b='='):
         '''Initialize with an open binary file and optional byte order'''
-        
+
         self.file = f
         self.byte_order = b
         self.offsets = list()
-    
+
     def set_byte_order(self, b):
         '''Set the byte order, valid values are "big", "little", "swap", "native", "<", ">", "@", "="'''
         if b == 'big':
@@ -32,18 +33,18 @@ class FileExtract:
 
     def is_in_memory(self):
         return False
-    
-    def seek(self, offset, whence = 0):
+
+    def seek(self, offset, whence=0):
         if self.file:
             return self.file.seek(offset, whence)
-        raise ValueError    
+        raise ValueError
 
     def tell(self):
         if self.file:
             return self.file.tell()
-        raise ValueError    
-    
-    def read_size (self, byte_size):
+        raise ValueError
+
+    def read_size(self, byte_size):
         s = self.file.read(byte_size)
         if len(s) != byte_size:
             return None
@@ -53,12 +54,12 @@ class FileExtract:
         '''Push the current file offset and seek to "offset"'''
         self.offsets.append(self.file.tell())
         self.file.seek(offset, 0)
-    
+
     def pop_offset_and_seek(self):
         '''Pop a previously pushed file offset, or do nothing if there were no previously pushed offsets'''
         if len(self.offsets) > 0:
             self.file.seek(self.offsets.pop())
-        
+
     def get_sint8(self, fail_value=0):
         '''Extract a single int8_t from the binary file at the current file position, returns a single integer'''
         s = self.read_size(1)
@@ -112,7 +113,7 @@ class FileExtract:
             return v
         else:
             return fail_value
-        
+
     def get_sint64(self, fail_value=0):
         '''Extract a single int64_t from the binary file at the current file position, returns a single integer'''
         s = self.read_size(8)
@@ -131,7 +132,11 @@ class FileExtract:
         else:
             return fail_value
 
-    def get_fixed_length_c_string(self, n, fail_value='', isprint_only_with_space_padding=False):
+    def get_fixed_length_c_string(
+            self,
+            n,
+            fail_value='',
+            isprint_only_with_space_padding=False):
         '''Extract a single fixed length C string from the binary file at the current file position, returns a single C string'''
         s = self.read_size(n)
         if s:
@@ -174,7 +179,7 @@ class FileExtract:
 
     def get_n_sint16(self, n, fail_value=0):
         '''Extract "n" int16_t integers from the binary file at the current file position, returns a list of integers'''
-        s = self.read_size(2*n)
+        s = self.read_size(2 * n)
         if s:
             return struct.unpack(self.byte_order + ("%u" % n) + 'h', s)
         else:
@@ -182,7 +187,7 @@ class FileExtract:
 
     def get_n_uint16(self, n, fail_value=0):
         '''Extract "n" uint16_t integers from the binary file at the current file position, returns a list of integers'''
-        s = self.read_size(2*n)
+        s = self.read_size(2 * n)
         if s:
             return struct.unpack(self.byte_order + ("%u" % n) + 'H', s)
         else:
@@ -190,7 +195,7 @@ class FileExtract:
 
     def get_n_sint32(self, n, fail_value=0):
         '''Extract "n" int32_t integers from the binary file at the current file position, returns a list of integers'''
-        s = self.read_size(4*n)
+        s = self.read_size(4 * n)
         if s:
             return struct.unpack(self.byte_order + ("%u" % n) + 'i', s)
         else:
@@ -198,7 +203,7 @@ class FileExtract:
 
     def get_n_uint32(self, n, fail_value=0):
         '''Extract "n" uint32_t integers from the binary file at the current file position, returns a list of integers'''
-        s = self.read_size(4*n)
+        s = self.read_size(4 * n)
         if s:
             return struct.unpack(self.byte_order + ("%u" % n) + 'I', s)
         else:
@@ -206,7 +211,7 @@ class FileExtract:
 
     def get_n_sint64(self, n, fail_value=0):
         '''Extract "n" int64_t integers from the binary file at the current file position, returns a list of integers'''
-        s = self.read_size(8*n)
+        s = self.read_size(8 * n)
         if s:
             return struct.unpack(self.byte_order + ("%u" % n) + 'q', s)
         else:
@@ -214,7 +219,7 @@ class FileExtract:
 
     def get_n_uint64(self, n, fail_value=0):
         '''Extract "n" uint64_t integers from the binary file at the current file position, returns a list of integers'''
-        s = self.read_size(8*n)
+        s = self.read_size(8 * n)
         if s:
             return struct.unpack(self.byte_order + ("%u" % n) + 'Q', s)
         else:

Modified: lldb/trunk/examples/python/gdb_disassemble.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/gdb_disassemble.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/examples/python/gdb_disassemble.py (original)
+++ lldb/trunk/examples/python/gdb_disassemble.py Tue Sep  6 15:57:50 2016
@@ -1,5 +1,6 @@
 import lldb
 
+
 def disassemble(debugger, command, result, dict):
     if lldb.frame.function:
         instructions = lldb.frame.function.instructions
@@ -9,7 +10,7 @@ def disassemble(debugger, command, resul
         instructions = lldb.frame.symbol.instructions
         start_addr = lldb.frame.symbol.addr.load_addr
         name = lldb.frame.symbol.name
-    
+
     for inst in instructions:
         inst_addr = inst.addr.load_addr
         inst_offset = inst_addr - start_addr
@@ -18,7 +19,8 @@ def disassemble(debugger, command, resul
             print "<%s + %-4u> 0x%x %8s  %s ; %s" % (name, inst_offset, inst_addr, inst.mnemonic, inst.operands, comment)
         else:
             print "<%s + %-4u> 0x%x %8s  %s" % (name, inst_offset, inst_addr, inst.mnemonic, inst.operands)
-            
+
 # Install the command when the module gets imported
-lldb.debugger.HandleCommand('command script add -f gdb_disassemble.disassemble gdb-disassemble')
-print 'Installed "gdb-disassemble" command for disassembly'
\ No newline at end of file
+lldb.debugger.HandleCommand(
+    'command script add -f gdb_disassemble.disassemble gdb-disassemble')
+print 'Installed "gdb-disassemble" command for disassembly'

Modified: lldb/trunk/examples/python/gdbremote.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/gdbremote.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/examples/python/gdbremote.py (original)
+++ lldb/trunk/examples/python/gdbremote.py Tue Sep  6 15:57:50 2016
@@ -1,15 +1,15 @@
 #!/usr/bin/python
 
 #----------------------------------------------------------------------
-# This module will enable GDB remote packet logging when the 
+# This module will enable GDB remote packet logging when the
 # 'start_gdb_log' command is called with a filename to log to. When the
-# 'stop_gdb_log' command is called, it will disable the logging and 
+# 'stop_gdb_log' command is called, it will disable the logging and
 # print out statistics about how long commands took to execute and also
 # will primnt ou
 # Be sure to add the python path that points to the LLDB shared library.
 #
 # To use this in the embedded python interpreter using "lldb" just
-# import it with the full path using the "command script import" 
+# import it with the full path using the "command script import"
 # command. This can be done from the LLDB command line:
 #   (lldb) command script import /path/to/gdbremote.py
 # Or it can be added to your ~/.lldbinit file so this module is always
@@ -37,173 +37,186 @@ g_byte_order = 'little'
 g_number_regex = re.compile('^(0x[0-9a-fA-F]+|[0-9]+)')
 g_thread_id_regex = re.compile('^(-1|[0-9a-fA-F]+|0)')
 
+
 class TerminalColors:
     '''Simple terminal colors class'''
-    def __init__(self, enabled = True):
+
+    def __init__(self, enabled=True):
         # TODO: discover terminal type from "file" and disable if
         # it can't handle the color codes
         self.enabled = enabled
-    
+
     def reset(self):
         '''Reset all terminal colors and formatting.'''
         if self.enabled:
-            return "\x1b[0m";
+            return "\x1b[0m"
         return ''
-    
-    def bold(self, on = True):
+
+    def bold(self, on=True):
         '''Enable or disable bold depending on the "on" parameter.'''
         if self.enabled:
             if on:
-                return "\x1b[1m";
+                return "\x1b[1m"
             else:
-                return "\x1b[22m";
+                return "\x1b[22m"
         return ''
-    
-    def italics(self, on = True):
+
+    def italics(self, on=True):
         '''Enable or disable italics depending on the "on" parameter.'''
         if self.enabled:
             if on:
-                return "\x1b[3m";
+                return "\x1b[3m"
             else:
-                return "\x1b[23m";
+                return "\x1b[23m"
         return ''
-    
-    def underline(self, on = True):
+
+    def underline(self, on=True):
         '''Enable or disable underline depending on the "on" parameter.'''
         if self.enabled:
             if on:
-                return "\x1b[4m";
+                return "\x1b[4m"
             else:
-                return "\x1b[24m";
+                return "\x1b[24m"
         return ''
-    
-    def inverse(self, on = True):
+
+    def inverse(self, on=True):
         '''Enable or disable inverse depending on the "on" parameter.'''
         if self.enabled:
             if on:
-                return "\x1b[7m";
+                return "\x1b[7m"
             else:
-                return "\x1b[27m";
+                return "\x1b[27m"
         return ''
-    
-    def strike(self, on = True):
+
+    def strike(self, on=True):
         '''Enable or disable strike through depending on the "on" parameter.'''
         if self.enabled:
             if on:
-                return "\x1b[9m";
-            else:                
-                return "\x1b[29m";
+                return "\x1b[9m"
+            else:
+                return "\x1b[29m"
         return ''
-                     
-    def black(self, fg = True):        
-        '''Set the foreground or background color to black. 
+
+    def black(self, fg=True):
+        '''Set the foreground or background color to black.
         The foreground color will be set if "fg" tests True. The background color will be set if "fg" tests False.'''
-        if self.enabled:         
-            if fg:               
-                return "\x1b[30m";
+        if self.enabled:
+            if fg:
+                return "\x1b[30m"
             else:
-                return "\x1b[40m";
+                return "\x1b[40m"
         return ''
-    
-    def red(self, fg = True):          
-        '''Set the foreground or background color to red. 
+
+    def red(self, fg=True):
+        '''Set the foreground or background color to red.
         The foreground color will be set if "fg" tests True. The background color will be set if "fg" tests False.'''
-        if self.enabled:         
-            if fg:               
-                return "\x1b[31m";
-            else:                
-                return "\x1b[41m";
+        if self.enabled:
+            if fg:
+                return "\x1b[31m"
+            else:
+                return "\x1b[41m"
         return ''
-    
-    def green(self, fg = True):        
-        '''Set the foreground or background color to green. 
+
+    def green(self, fg=True):
+        '''Set the foreground or background color to green.
         The foreground color will be set if "fg" tests True. The background color will be set if "fg" tests False.'''
-        if self.enabled:         
-            if fg:               
-                return "\x1b[32m";
-            else:                
-                return "\x1b[42m";
+        if self.enabled:
+            if fg:
+                return "\x1b[32m"
+            else:
+                return "\x1b[42m"
         return ''
-    
-    def yellow(self, fg = True):       
-        '''Set the foreground or background color to yellow. 
+
+    def yellow(self, fg=True):
+        '''Set the foreground or background color to yellow.
         The foreground color will be set if "fg" tests True. The background color will be set if "fg" tests False.'''
-        if self.enabled:         
-            if fg:               
-                return "\x1b[33m";
-            else:                
-                return "\x1b[43m";
+        if self.enabled:
+            if fg:
+                return "\x1b[33m"
+            else:
+                return "\x1b[43m"
         return ''
-    
-    def blue(self, fg = True):         
-        '''Set the foreground or background color to blue. 
+
+    def blue(self, fg=True):
+        '''Set the foreground or background color to blue.
         The foreground color will be set if "fg" tests True. The background color will be set if "fg" tests False.'''
-        if self.enabled:         
-            if fg:               
-                return "\x1b[34m";
-            else:                
-                return "\x1b[44m";
+        if self.enabled:
+            if fg:
+                return "\x1b[34m"
+            else:
+                return "\x1b[44m"
         return ''
-    
-    def magenta(self, fg = True):      
-        '''Set the foreground or background color to magenta. 
+
+    def magenta(self, fg=True):
+        '''Set the foreground or background color to magenta.
         The foreground color will be set if "fg" tests True. The background color will be set if "fg" tests False.'''
-        if self.enabled:         
-            if fg:               
-                return "\x1b[35m";
-            else:                
-                return "\x1b[45m";
+        if self.enabled:
+            if fg:
+                return "\x1b[35m"
+            else:
+                return "\x1b[45m"
         return ''
-    
-    def cyan(self, fg = True):         
-        '''Set the foreground or background color to cyan. 
+
+    def cyan(self, fg=True):
+        '''Set the foreground or background color to cyan.
         The foreground color will be set if "fg" tests True. The background color will be set if "fg" tests False.'''
-        if self.enabled:         
-            if fg:               
-                return "\x1b[36m";
-            else:                
-                return "\x1b[46m";
+        if self.enabled:
+            if fg:
+                return "\x1b[36m"
+            else:
+                return "\x1b[46m"
         return ''
-    
-    def white(self, fg = True):        
-        '''Set the foreground or background color to white. 
+
+    def white(self, fg=True):
+        '''Set the foreground or background color to white.
         The foreground color will be set if "fg" tests True. The background color will be set if "fg" tests False.'''
-        if self.enabled:         
-            if fg:               
-                return "\x1b[37m";
-            else:                
-                return "\x1b[47m";
+        if self.enabled:
+            if fg:
+                return "\x1b[37m"
+            else:
+                return "\x1b[47m"
         return ''
-    
-    def default(self, fg = True):      
-        '''Set the foreground or background color to the default. 
+
+    def default(self, fg=True):
+        '''Set the foreground or background color to the default.
         The foreground color will be set if "fg" tests True. The background color will be set if "fg" tests False.'''
-        if self.enabled:         
-            if fg:               
-                return "\x1b[39m";
-            else:                
-                return "\x1b[49m";
+        if self.enabled:
+            if fg:
+                return "\x1b[39m"
+            else:
+                return "\x1b[49m"
         return ''
 
 
 def start_gdb_log(debugger, command, result, dict):
-    '''Start logging GDB remote packets by enabling logging with timestamps and 
+    '''Start logging GDB remote packets by enabling logging with timestamps and
     thread safe logging. Follow a call to this function with a call to "stop_gdb_log"
     in order to dump out the commands.'''
     global g_log_file
     command_args = shlex.split(command)
     usage = "usage: start_gdb_log [options] [<LOGFILEPATH>]"
-    description='''The command enables GDB remote packet logging with timestamps. The packets will be logged to <LOGFILEPATH> if supplied, or a temporary file will be used. Logging stops when stop_gdb_log is called and the packet times will
+    description = '''The command enables GDB remote packet logging with timestamps. The packets will be logged to <LOGFILEPATH> if supplied, or a temporary file will be used. Logging stops when stop_gdb_log is called and the packet times will
     be aggregated and displayed.'''
-    parser = optparse.OptionParser(description=description, prog='start_gdb_log',usage=usage)
-    parser.add_option('-v', '--verbose', action='store_true', dest='verbose', help='display verbose debug info', default=False)
+    parser = optparse.OptionParser(
+        description=description,
+        prog='start_gdb_log',
+        usage=usage)
+    parser.add_option(
+        '-v',
+        '--verbose',
+        action='store_true',
+        dest='verbose',
+        help='display verbose debug info',
+        default=False)
     try:
         (options, args) = parser.parse_args(command_args)
     except:
         return
 
     if g_log_file:
-        result.PutCString ('error: logging is already in progress with file "%s"' % g_log_file)
+        result.PutCString(
+            'error: logging is already in progress with file "%s"' %
+            g_log_file)
     else:
         args_len = len(args)
         if args_len == 0:
@@ -212,12 +225,17 @@ def start_gdb_log(debugger, command, res
             g_log_file = args[0]
 
         if g_log_file:
-            debugger.HandleCommand('log enable --threadsafe --timestamp --file "%s" gdb-remote packets' % g_log_file);
-            result.PutCString ("GDB packet logging enable with log file '%s'\nUse the 'stop_gdb_log' command to stop logging and show packet statistics." % g_log_file)
+            debugger.HandleCommand(
+                'log enable --threadsafe --timestamp --file "%s" gdb-remote packets' %
+                g_log_file)
+            result.PutCString(
+                "GDB packet logging enable with log file '%s'\nUse the 'stop_gdb_log' command to stop logging and show packet statistics." %
+                g_log_file)
             return
 
-        result.PutCString ('error: invalid log file path')
-    result.PutCString (usage)
+        result.PutCString('error: invalid log file path')
+    result.PutCString(usage)
+
 
 def stop_gdb_log(debugger, command, result, dict):
     '''Stop logging GDB remote packets to the file that was specified in a call
@@ -225,17 +243,50 @@ def stop_gdb_log(debugger, command, resu
     timestamp in the log file. Also print out statistics for how long each
     command took to allow performance bottlenecks to be determined.'''
     global g_log_file
-    # Any commands whose names might be followed by more valid C identifier 
+    # Any commands whose names might be followed by more valid C identifier
     # characters must be listed here
     command_args = shlex.split(command)
     usage = "usage: stop_gdb_log [options]"
-    description='''The command stops a previously enabled GDB remote packet logging command. Packet logging must have been previously enabled with a call to start_gdb_log.'''
-    parser = optparse.OptionParser(description=description, prog='stop_gdb_log',usage=usage)
-    parser.add_option('-v', '--verbose', action='store_true', dest='verbose', help='display verbose debug info', default=False)
-    parser.add_option('-q', '--quiet', action='store_true', dest='quiet', help='display verbose debug info', default=False)
-    parser.add_option('-C', '--color', action='store_true', dest='color', help='add terminal colors', default=False)
-    parser.add_option('-c', '--sort-by-count', action='store_true', dest='sort_count', help='display verbose debug info', default=False)
-    parser.add_option('-s', '--symbolicate', action='store_true', dest='symbolicate', help='symbolicate addresses in log using current "lldb.target"', default=False)
+    description = '''The command stops a previously enabled GDB remote packet logging command. Packet logging must have been previously enabled with a call to start_gdb_log.'''
+    parser = optparse.OptionParser(
+        description=description,
+        prog='stop_gdb_log',
+        usage=usage)
+    parser.add_option(
+        '-v',
+        '--verbose',
+        action='store_true',
+        dest='verbose',
+        help='display verbose debug info',
+        default=False)
+    parser.add_option(
+        '-q',
+        '--quiet',
+        action='store_true',
+        dest='quiet',
+        help='display verbose debug info',
+        default=False)
+    parser.add_option(
+        '-C',
+        '--color',
+        action='store_true',
+        dest='color',
+        help='add terminal colors',
+        default=False)
+    parser.add_option(
+        '-c',
+        '--sort-by-count',
+        action='store_true',
+        dest='sort_count',
+        help='display verbose debug info',
+        default=False)
+    parser.add_option(
+        '-s',
+        '--symbolicate',
+        action='store_true',
+        dest='symbolicate',
+        help='symbolicate addresses in log using current "lldb.target"',
+        default=False)
     try:
         (options, args) = parser.parse_args(command_args)
     except:
@@ -251,34 +302,41 @@ def stop_gdb_log(debugger, command, resu
             print "error: can't symbolicate without a target"
 
     if not g_log_file:
-        result.PutCString ('error: logging must have been previously enabled with a call to "stop_gdb_log"')
-    elif os.path.exists (g_log_file):
+        result.PutCString(
+            'error: logging must have been previously enabled with a call to "stop_gdb_log"')
+    elif os.path.exists(g_log_file):
         if len(args) == 0:
-            debugger.HandleCommand('log disable gdb-remote packets');
-            result.PutCString ("GDB packet logging disabled. Logged packets are in '%s'" % g_log_file)
-            parse_gdb_log_file (g_log_file, options)
+            debugger.HandleCommand('log disable gdb-remote packets')
+            result.PutCString(
+                "GDB packet logging disabled. Logged packets are in '%s'" %
+                g_log_file)
+            parse_gdb_log_file(g_log_file, options)
         else:
-            result.PutCString (usage)
+            result.PutCString(usage)
     else:
         print 'error: the GDB packet log file "%s" does not exist' % g_log_file
 
+
 def is_hex_byte(str):
     if len(str) == 2:
-        return str[0] in string.hexdigits and str[1] in string.hexdigits;
+        return str[0] in string.hexdigits and str[1] in string.hexdigits
     return False
 
 # global register info list
 g_register_infos = list()
 g_max_register_info_name_len = 0
 
+
 class RegisterInfo:
     """Class that represents register information"""
+
     def __init__(self, kvp):
         self.info = dict()
         for kv in kvp:
             key = kv[0]
             value = kv[1]
             self.info[key] = value
+
     def name(self):
         '''Get the name of the register.'''
         if self.info and 'name' in self.info:
@@ -310,9 +368,9 @@ class RegisterInfo:
                 return '0x%8.8x' % (uval)
             elif bit_size == 64:
                 return '0x%16.16x' % (uval)
-        bytes = list();
+        bytes = list()
         uval = packet.get_hex_uint8()
-        while uval != None:
+        while uval is not None:
             bytes.append(uval)
             uval = packet.get_hex_uint8()
         value_str = '0x'
@@ -321,7 +379,7 @@ class RegisterInfo:
         for byte in bytes:
             value_str += '%2.2x' % byte
         return '%s' % (value_str)
-    
+
     def __str__(self):
         '''Dump the register info key/value pairs'''
         s = ''
@@ -330,25 +388,27 @@ class RegisterInfo:
                 s += ', '
             s += "%s=%s " % (key, self.info[key])
         return s
-    
+
+
 class Packet:
     """Class that represents a packet that contains string data"""
+
     def __init__(self, packet_str):
         self.str = packet_str
-        
+
     def peek_char(self):
         ch = 0
         if self.str:
             ch = self.str[0]
         return ch
-        
+
     def get_char(self):
         ch = 0
         if self.str:
             ch = self.str[0]
             self.str = self.str[1:]
         return ch
-        
+
     def skip_exact_string(self, s):
         if self.str and self.str.startswith(s):
             self.str = self.str[len(s):]
@@ -356,22 +416,23 @@ class Packet:
         else:
             return False
 
-    def get_thread_id(self, fail_value = -1):
-        match = g_number_regex.match (self.str)
+    def get_thread_id(self, fail_value=-1):
+        match = g_number_regex.match(self.str)
         if match:
             number_str = match.group(1)
             self.str = self.str[len(number_str):]
             return int(number_str, 0)
         else:
             return fail_value
-        
+
     def get_hex_uint8(self):
-        if self.str and len(self.str) >= 2 and self.str[0] in string.hexdigits and self.str[1] in string.hexdigits:
+        if self.str and len(self.str) >= 2 and self.str[
+                0] in string.hexdigits and self.str[1] in string.hexdigits:
             uval = int(self.str[0:2], 16)
             self.str = self.str[2:]
             return uval
         return None
-        
+
     def get_hex_uint16(self, byte_order):
         uval = 0
         if byte_order == 'big':
@@ -381,7 +442,7 @@ class Packet:
             uval |= self.get_hex_uint8()
             uval |= self.get_hex_uint8() << 8
         return uval
-        
+
     def get_hex_uint32(self, byte_order):
         uval = 0
         if byte_order == 'big':
@@ -395,7 +456,7 @@ class Packet:
             uval |= self.get_hex_uint8() << 16
             uval |= self.get_hex_uint8() << 24
         return uval
-        
+
     def get_hex_uint64(self, byte_order):
         uval = 0
         if byte_order == 'big':
@@ -417,65 +478,64 @@ class Packet:
             uval |= self.get_hex_uint8() << 48
             uval |= self.get_hex_uint8() << 56
         return uval
-    
+
     def get_number(self, fail_value=-1):
         '''Get a number from the packet. The number must be in big endian format and should be parsed
-        according to its prefix (starts with "0x" means hex, starts with "0" means octal, starts with 
+        according to its prefix (starts with "0x" means hex, starts with "0" means octal, starts with
         [1-9] means decimal, etc)'''
-        match = g_number_regex.match (self.str)
+        match = g_number_regex.match(self.str)
         if match:
             number_str = match.group(1)
             self.str = self.str[len(number_str):]
             return int(number_str, 0)
         else:
             return fail_value
-        
-        
+
     def get_hex_ascii_str(self, n=0):
         hex_chars = self.get_hex_chars(n)
         if hex_chars:
             return binascii.unhexlify(hex_chars)
         else:
             return None
-    
-    def get_hex_chars(self, n = 0):
+
+    def get_hex_chars(self, n=0):
         str_len = len(self.str)
         if n == 0:
-            # n was zero, so we need to determine all hex chars and 
+            # n was zero, so we need to determine all hex chars and
             # stop when we hit the end of the string of a non-hex character
             while n < str_len and self.str[n] in string.hexdigits:
                 n = n + 1
         else:
             if n > str_len:
-                return None # Not enough chars
+                return None  # Not enough chars
             # Verify all chars are hex if a length was specified
             for i in range(n):
                 if self.str[i] not in string.hexdigits:
-                    return None # Not all hex digits
+                    return None  # Not all hex digits
         if n == 0:
             return None
         hex_str = self.str[0:n]
         self.str = self.str[n:]
         return hex_str
-        
-    def get_hex_uint(self, byte_order, n = 0):
+
+    def get_hex_uint(self, byte_order, n=0):
         if byte_order == 'big':
             hex_str = self.get_hex_chars(n)
-            if hex_str == None:
+            if hex_str is None:
                 return None
             return int(hex_str, 16)
         else:
             uval = self.get_hex_uint8()
-            if uval == None:
+            if uval is None:
                 return None
             uval_result = 0
             shift = 0
-            while uval != None:
+            while uval is not None:
                 uval_result |= (uval << shift)
                 shift += 8
                 uval = self.get_hex_uint8()
             return uval_result
-        
+
     def get_key_value_pairs(self):
         kvp = list()
         if ';' in self.str:
@@ -494,36 +554,41 @@ class Packet:
         for str in strings:
             hex_values.append(Packet(str).get_hex_uint(byte_order))
         return hex_values
-    
+
     def __str__(self):
         return self.str
-    
+
     def __len__(self):
         return len(self.str)
 
 g_thread_suffix_regex = re.compile(';thread:([0-9a-fA-F]+);')
+
+
 def get_thread_from_thread_suffix(str):
     if str:
-        match = g_thread_suffix_regex.match (str)
+        match = g_thread_suffix_regex.match(str)
         if match:
             return int(match.group(1), 16)
     return None
 
+
 def cmd_qThreadStopInfo(options, cmd, args):
     packet = Packet(args)
     tid = packet.get_hex_uint('big')
     print "get_thread_stop_info  (tid = 0x%x)" % (tid)
-    
+
+
 def cmd_stop_reply(options, cmd, args):
     print "get_last_stop_info()"
     return False
 
+
 def rsp_stop_reply(options, cmd, cmd_args, rsp):
     global g_byte_order
     packet = Packet(rsp)
     stop_type = packet.get_char()
     if stop_type == 'T' or stop_type == 'S':
-        signo  = packet.get_hex_uint8()
+        signo = packet.get_hex_uint8()
         key_value_pairs = packet.get_key_value_pairs()
         for key_value_pair in key_value_pairs:
             key = key_value_pair[0]
@@ -532,18 +597,19 @@ def rsp_stop_reply(options, cmd, cmd_arg
                 if reg_num < len(g_register_infos):
                     reg_info = g_register_infos[reg_num]
                     key_value_pair[0] = reg_info.name()
-                    key_value_pair[1] = reg_info.get_value_from_hex_string (key_value_pair[1])
+                    key_value_pair[1] = reg_info.get_value_from_hex_string(
+                        key_value_pair[1])
             elif key == 'jthreads' or key == 'jstopinfo':
                 key_value_pair[1] = binascii.unhexlify(key_value_pair[1])
         key_value_pairs.insert(0, ['signal', signo])
         print 'stop_reply():'
-        dump_key_value_pairs (key_value_pairs)
+        dump_key_value_pairs(key_value_pairs)
     elif stop_type == 'W':
         exit_status = packet.get_hex_uint8()
         print 'stop_reply(): exit (status=%i)' % exit_status
     elif stop_type == 'O':
         print 'stop_reply(): stdout = "%s"' % packet.str
-        
+
 
 def cmd_unknown_packet(options, cmd, args):
     if args:
@@ -552,6 +618,7 @@ def cmd_unknown_packet(options, cmd, arg
         print "cmd: %s", cmd
     return False
 
+
 def cmd_qSymbol(options, cmd, args):
     if args == ':':
         print 'ready to serve symbols'
@@ -571,6 +638,7 @@ def cmd_qSymbol(options, cmd, args):
             else:
                 print 'error: bad command format'
 
+
 def rsp_qSymbol(options, cmd, cmd_args, rsp):
     if len(rsp) == 0:
         print "Unsupported"
@@ -585,11 +653,13 @@ def rsp_qSymbol(options, cmd, cmd_args,
             else:
                 print 'error: response string should start with "qSymbol:": respnse is "%s"' % (rsp)
 
+
 def cmd_qXfer(options, cmd, args):
     # $qXfer:features:read:target.xml:0,1ffff#14
     print "read target special data %s" % (args)
     return True
 
+
 def rsp_qXfer(options, cmd, cmd_args, rsp):
     data = string.split(cmd_args, ':')
     if data[0] == 'features':
@@ -606,25 +676,30 @@ def rsp_qXfer(options, cmd, cmd_args, rs
                         if not 'value_regnums' in reg_element.attrib:
                             reg_info = RegisterInfo([])
                             if 'name' in reg_element.attrib:
-                                reg_info.info['name'] = reg_element.attrib['name']
+                                reg_info.info[
+                                    'name'] = reg_element.attrib['name']
                             else:
                                 reg_info.info['name'] = 'unspecified'
                             if 'encoding' in reg_element.attrib:
-                                reg_info.info['encoding'] = reg_element.attrib['encoding']
+                                reg_info.info['encoding'] = reg_element.attrib[
+                                    'encoding']
                             else:
                                 reg_info.info['encoding'] = 'uint'
                             if 'offset' in reg_element.attrib:
-                                reg_info.info['offset'] = reg_element.attrib['offset']
+                                reg_info.info[
+                                    'offset'] = reg_element.attrib['offset']
                             if 'bitsize' in reg_element.attrib:
-                                reg_info.info['bitsize'] = reg_element.attrib['bitsize']
+                                reg_info.info[
+                                    'bitsize'] = reg_element.attrib['bitsize']
                             g_register_infos.append(reg_info)
                     print 'XML for "%s":' % (data[2])
                     ET.dump(xml_root)
 
+
 def cmd_A(options, cmd, args):
     print 'launch process:'
     packet = Packet(args)
-    while 1:
+    while True:
         arg_len = packet.get_number()
         if arg_len == -1:
             break
@@ -634,13 +709,15 @@ def cmd_A(options, cmd, args):
         if arg_idx == -1:
             break
         if not packet.skip_exact_string(','):
-            break;
+            break
         arg_value = packet.get_hex_ascii_str(arg_len)
         print 'argv[%u] = "%s"' % (arg_idx, arg_value)
-        
+
+
 def cmd_qC(options, cmd, args):
     print "query_current_thread_id()"
 
+
 def rsp_qC(options, cmd, cmd_args, rsp):
     packet = Packet(rsp)
     if packet.skip_exact_string("QC"):
@@ -649,16 +726,19 @@ def rsp_qC(options, cmd, cmd_args, rsp):
     else:
         print "current_thread_id = old thread ID"
 
+
 def cmd_query_packet(options, cmd, args):
     if args:
         print "%s%s" % (cmd, args)
     else:
         print "%s" % (cmd)
     return False
-    
+
+
 def rsp_ok_error(rsp):
     print "rsp: ", rsp
 
+
 def rsp_ok_means_supported(options, cmd, cmd_args, rsp):
     if rsp == 'OK':
         print "%s%s is supported" % (cmd, cmd_args)
@@ -667,6 +747,7 @@ def rsp_ok_means_supported(options, cmd,
     else:
         print "%s%s -> %s" % (cmd, cmd_args, rsp)
 
+
 def rsp_ok_means_success(options, cmd, cmd_args, rsp):
     if rsp == 'OK':
         print "success"
@@ -675,17 +756,19 @@ def rsp_ok_means_success(options, cmd, c
     else:
         print "%s%s -> %s" % (cmd, cmd_args, rsp)
 
+
 def dump_key_value_pairs(key_value_pairs):
     max_key_len = 0
     for key_value_pair in key_value_pairs:
         key_len = len(key_value_pair[0])
         if max_key_len < key_len:
-           max_key_len = key_len 
+            max_key_len = key_len
     for key_value_pair in key_value_pairs:
         key = key_value_pair[0]
         value = key_value_pair[1]
         print "%*s = %s" % (max_key_len, key, value)
 
+
 def rsp_dump_key_value_pairs(options, cmd, cmd_args, rsp):
     if rsp:
         print '%s response:' % (cmd)
@@ -695,14 +778,17 @@ def rsp_dump_key_value_pairs(options, cm
     else:
         print "not supported"
 
+
 def cmd_c(options, cmd, args):
     print "continue()"
     return False
 
+
 def cmd_s(options, cmd, args):
     print "step()"
     return False
-    
+
+
 def cmd_vCont(options, cmd, args):
     if args == '?':
         print "%s: get supported extended continue modes" % (cmd)
@@ -735,15 +821,16 @@ def cmd_vCont(options, cmd, args):
             print "extended_continue (%s, other-threads: suspend)" % (s)
     return False
 
+
 def rsp_vCont(options, cmd, cmd_args, rsp):
     if cmd_args == '?':
         # Skip the leading 'vCont;'
         rsp = rsp[6:]
         modes = string.split(rsp, ';')
         s = "%s: supported extended continue modes include: " % (cmd)
-        
+
         for i, mode in enumerate(modes):
-            if i: 
+            if i:
                 s += ', '
             if mode == 'c':
                 s += 'continue'
@@ -758,7 +845,7 @@ def rsp_vCont(options, cmd, cmd_args, rs
         print s
     elif rsp:
         if rsp[0] == 'T' or rsp[0] == 'S' or rsp[0] == 'W' or rsp[0] == 'X':
-            rsp_stop_reply (options, cmd, cmd_args, rsp)
+            rsp_stop_reply(options, cmd, cmd_args, rsp)
             return
         if rsp[0] == 'O':
             print "stdout: %s" % (rsp)
@@ -766,6 +853,7 @@ def rsp_vCont(options, cmd, cmd_args, rs
     else:
         print "not supported (cmd = '%s', args = '%s', rsp = '%s')" % (cmd, cmd_args, rsp)
 
+
 def cmd_vAttach(options, cmd, args):
     (extra_command, args) = string.split(args, ';')
     if extra_command:
@@ -773,12 +861,13 @@ def cmd_vAttach(options, cmd, args):
     else:
         print "attach(pid = %u)" % int(args, 16)
     return False
-    
+
 
 def cmd_qRegisterInfo(options, cmd, args):
     print 'query_register_info(reg_num=%i)' % (int(args, 16))
     return False
 
+
 def rsp_qRegisterInfo(options, cmd, cmd_args, rsp):
     global g_max_register_info_name_len
     print 'query_register_info(reg_num=%i):' % (int(cmd_args, 16)),
@@ -796,14 +885,16 @@ def rsp_qRegisterInfo(options, cmd, cmd_
         print reg_info
     return False
 
+
 def cmd_qThreadInfo(options, cmd, args):
     if cmd == 'qfThreadInfo':
         query_type = 'first'
-    else: 
+    else:
         query_type = 'subsequent'
     print 'get_current_thread_list(type=%s)' % (query_type)
     return False
 
+
 def rsp_qThreadInfo(options, cmd, cmd_args, rsp):
     packet = Packet(rsp)
     response_type = packet.get_char()
@@ -817,11 +908,13 @@ def rsp_qThreadInfo(options, cmd, cmd_ar
     elif response_type == 'l':
         print 'END'
 
+
 def rsp_hex_big_endian(options, cmd, cmd_args, rsp):
     packet = Packet(rsp)
     uval = packet.get_hex_uint('big')
     print '%s: 0x%x' % (cmd, uval)
 
+
 def cmd_read_mem_bin(options, cmd, args):
     # x0x7fff5fc39200,0x200
     packet = Packet(args)
@@ -831,6 +924,7 @@ def cmd_read_mem_bin(options, cmd, args)
     print 'binary_read_memory (addr = 0x%16.16x, size = %u)' % (addr, size)
     return False
 
+
 def rsp_mem_bin_bytes(options, cmd, cmd_args, rsp):
     packet = Packet(cmd_args)
     addr = packet.get_number()
@@ -838,7 +932,8 @@ def rsp_mem_bin_bytes(options, cmd, cmd_
     size = packet.get_number()
     print 'memory:'
     if size > 0:
-        dump_hex_memory_buffer (addr, rsp) 
+        dump_hex_memory_buffer(addr, rsp)
+
 
 def cmd_read_memory(options, cmd, args):
     packet = Packet(args)
@@ -848,12 +943,13 @@ def cmd_read_memory(options, cmd, args):
     print 'read_memory (addr = 0x%16.16x, size = %u)' % (addr, size)
     return False
 
+
 def dump_hex_memory_buffer(addr, hex_byte_str):
     packet = Packet(hex_byte_str)
     idx = 0
     ascii = ''
     uval = packet.get_hex_uint8()
-    while uval != None:
+    while uval is not None:
         if ((idx % 16) == 0):
             if ascii:
                 print '  ', ascii
@@ -868,8 +964,9 @@ def dump_hex_memory_buffer(addr, hex_byt
         idx = idx + 1
     if ascii:
         print '  ', ascii
-        ascii = ''        
-    
+        ascii = ''
+
+
 def cmd_write_memory(options, cmd, args):
     packet = Packet(args)
     addr = packet.get_hex_uint('big')
@@ -881,9 +978,10 @@ def cmd_write_memory(options, cmd, args)
         print 'error: invalid write memory command (missing colon after size)'
         return
     print 'write_memory (addr = 0x%16.16x, size = %u, data:' % (addr, size)
-    dump_hex_memory_buffer (addr, packet.str) 
+    dump_hex_memory_buffer(addr, packet.str)
     return False
 
+
 def cmd_alloc_memory(options, cmd, args):
     packet = Packet(args)
     byte_size = packet.get_hex_uint('big')
@@ -893,11 +991,13 @@ def cmd_alloc_memory(options, cmd, args)
     print 'allocate_memory (byte-size = %u (0x%x), permissions = %s)' % (byte_size, byte_size, packet.str)
     return False
 
+
 def rsp_alloc_memory(options, cmd, cmd_args, rsp):
     packet = Packet(rsp)
     addr = packet.get_hex_uint('big')
     print 'addr = 0x%x' % addr
 
+
 def cmd_dealloc_memory(options, cmd, args):
     packet = Packet(args)
     addr = packet.get_hex_uint('big')
@@ -906,17 +1006,21 @@ def cmd_dealloc_memory(options, cmd, arg
     else:
         print 'deallocate_memory (addr = 0x%x, permissions = %s)' % (addr, packet.str)
     return False
+
+
 def rsp_memory_bytes(options, cmd, cmd_args, rsp):
     addr = Packet(cmd_args).get_hex_uint('big')
-    dump_hex_memory_buffer (addr, rsp) 
+    dump_hex_memory_buffer(addr, rsp)
+
 
 def get_register_name_equal_value(options, reg_num, hex_value_str):
     if reg_num < len(g_register_infos):
         reg_info = g_register_infos[reg_num]
-        value_str = reg_info.get_value_from_hex_string (hex_value_str)
+        value_str = reg_info.get_value_from_hex_string(hex_value_str)
         s = reg_info.name() + ' = '
         if options.symbolicator:
-            symbolicated_addresses = options.symbolicator.symbolicate (int(value_str, 0))
+            symbolicated_addresses = options.symbolicator.symbolicate(
+                int(value_str, 0))
             if symbolicated_addresses:
                 s += options.colors.magenta()
                 s += '%s' % symbolicated_addresses[0]
@@ -928,30 +1032,33 @@ def get_register_name_equal_value(option
         reg_value = Packet(hex_value_str).get_hex_uint(g_byte_order)
         return 'reg(%u) = 0x%x' % (reg_num, reg_value)
 
+
 def cmd_read_one_reg(options, cmd, args):
     packet = Packet(args)
     reg_num = packet.get_hex_uint('big')
-    tid = get_thread_from_thread_suffix (packet.str)
+    tid = get_thread_from_thread_suffix(packet.str)
     name = None
     if reg_num < len(g_register_infos):
-        name = g_register_infos[reg_num].name ()
+        name = g_register_infos[reg_num].name()
     if packet.str:
-        packet.get_char() # skip ;
+        packet.get_char()  # skip ;
         thread_info = packet.get_key_value_pairs()
         tid = int(thread_info[0][1], 16)
     s = 'read_register (reg_num=%u' % reg_num
     if name:
         s += ' (%s)' % (name)
-    if tid != None:
+    if tid is not None:
         s += ', tid = 0x%4.4x' % (tid)
     s += ')'
     print s
     return False
 
+
 def rsp_read_one_reg(options, cmd, cmd_args, rsp):
     packet = Packet(cmd_args)
     reg_num = packet.get_hex_uint('big')
-    print get_register_name_equal_value (options, reg_num, rsp)
+    print get_register_name_equal_value(options, reg_num, rsp)
+
 
 def cmd_write_one_reg(options, cmd, args):
     packet = Packet(args)
@@ -961,157 +1068,169 @@ def cmd_write_one_reg(options, cmd, args
     else:
         name = None
         hex_value_str = packet.get_hex_chars()
-        tid = get_thread_from_thread_suffix (packet.str)
+        tid = get_thread_from_thread_suffix(packet.str)
         s = 'write_register (reg_num=%u' % reg_num
         if name:
             s += ' (%s)' % (name)
         s += ', value = '
         s += get_register_name_equal_value(options, reg_num, hex_value_str)
-        if tid != None:
+        if tid is not None:
             s += ', tid = 0x%4.4x' % (tid)
         s += ')'
         print s
     return False
 
+
 def dump_all_regs(packet):
     for reg_info in g_register_infos:
         nibble_size = reg_info.bit_size() / 4
         hex_value_str = packet.get_hex_chars(nibble_size)
-        if hex_value_str != None:
-            value = reg_info.get_value_from_hex_string (hex_value_str)
+        if hex_value_str is not None:
+            value = reg_info.get_value_from_hex_string(hex_value_str)
             print '%*s = %s' % (g_max_register_info_name_len, reg_info.name(), value)
         else:
             return
-    
+
+
 def cmd_read_all_regs(cmd, cmd_args):
     packet = Packet(cmd_args)
-    packet.get_char() # toss the 'g' command character
-    tid = get_thread_from_thread_suffix (packet.str)
-    if tid != None:
+    packet.get_char()  # toss the 'g' command character
+    tid = get_thread_from_thread_suffix(packet.str)
+    if tid is not None:
         print 'read_all_register(thread = 0x%4.4x)' % tid
     else:
         print 'read_all_register()'
     return False
 
+
 def rsp_read_all_regs(options, cmd, cmd_args, rsp):
     packet = Packet(rsp)
-    dump_all_regs (packet)
+    dump_all_regs(packet)
+
 
 def cmd_write_all_regs(options, cmd, args):
     packet = Packet(args)
     print 'write_all_registers()'
-    dump_all_regs (packet)
+    dump_all_regs(packet)
     return False
-    
-g_bp_types = [ "software_bp", "hardware_bp", "write_wp", "read_wp", "access_wp" ]
+
+g_bp_types = ["software_bp", "hardware_bp", "write_wp", "read_wp", "access_wp"]
+
 
 def cmd_bp(options, cmd, args):
     if cmd == 'Z':
         s = 'set_'
     else:
         s = 'clear_'
-    packet = Packet (args)
+    packet = Packet(args)
     bp_type = packet.get_hex_uint('big')
-    packet.get_char() # Skip ,
+    packet.get_char()  # Skip ,
     bp_addr = packet.get_hex_uint('big')
-    packet.get_char() # Skip ,
+    packet.get_char()  # Skip ,
     bp_size = packet.get_hex_uint('big')
     s += g_bp_types[bp_type]
     s += " (addr = 0x%x, size = %u)" % (bp_addr, bp_size)
     print s
     return False
 
+
 def cmd_mem_rgn_info(options, cmd, args):
     packet = Packet(args)
-    packet.get_char() # skip ':' character
+    packet.get_char()  # skip ':' character
     addr = packet.get_hex_uint('big')
     print 'get_memory_region_info (addr=0x%x)' % (addr)
     return False
 
+
 def cmd_kill(options, cmd, args):
     print 'kill_process()'
     return False
 
+
 def cmd_jThreadsInfo(options, cmd, args):
     print 'jThreadsInfo()'
     return False
-    
+
+
 def cmd_jGetLoadedDynamicLibrariesInfos(options, cmd, args):
     print 'jGetLoadedDynamicLibrariesInfos()'
     return False
 
-def decode_packet(s, start_index = 0):
-    #print '\ndecode_packet("%s")' % (s[start_index:])
+
+def decode_packet(s, start_index=0):
+    # print '\ndecode_packet("%s")' % (s[start_index:])
     index = s.find('}', start_index)
     have_escapes = index != -1
     if have_escapes:
         normal_s = s[start_index:index]
     else:
         normal_s = s[start_index:]
-    #print 'normal_s = "%s"' % (normal_s)
+    # print 'normal_s = "%s"' % (normal_s)
     if have_escapes:
-        escape_char = '%c' % (ord(s[index+1]) ^ 0x20)
-        #print 'escape_char for "%s" = %c' % (s[index:index+2], escape_char)
-        return normal_s + escape_char + decode_packet(s, index+2)
+        escape_char = '%c' % (ord(s[index + 1]) ^ 0x20)
+        # print 'escape_char for "%s" = %c' % (s[index:index+2], escape_char)
+        return normal_s + escape_char + decode_packet(s, index + 2)
     else:
         return normal_s
 
+
 def rsp_json(options, cmd, cmd_args, rsp):
     print '%s() reply:' % (cmd)
     json_tree = json.loads(rsp)
     print json.dumps(json_tree, indent=4, separators=(',', ': '))
-    
-        
+
+
 def rsp_jGetLoadedDynamicLibrariesInfos(options, cmd, cmd_args, rsp):
     if cmd_args:
         rsp_json(options, cmd, cmd_args, rsp)
     else:
         rsp_ok_means_supported(options, cmd, cmd_args, rsp)
-    
+
 gdb_remote_commands = {
-    '\\?'                     : { 'cmd' : cmd_stop_reply        , 'rsp' : rsp_stop_reply          , 'name' : "stop reply pacpket"},
-    'qThreadStopInfo'         : { 'cmd' : cmd_qThreadStopInfo   , 'rsp' : rsp_stop_reply          , 'name' : "stop reply pacpket"},
-    'QStartNoAckMode'         : { 'cmd' : cmd_query_packet      , 'rsp' : rsp_ok_means_supported  , 'name' : "query if no ack mode is supported"},
-    'QThreadSuffixSupported'  : { 'cmd' : cmd_query_packet      , 'rsp' : rsp_ok_means_supported  , 'name' : "query if thread suffix is supported" },
-    'QListThreadsInStopReply' : { 'cmd' : cmd_query_packet      , 'rsp' : rsp_ok_means_supported  , 'name' : "query if threads in stop reply packets are supported" },
-    'QSetDetachOnError'       : { 'cmd' : cmd_query_packet      , 'rsp' : rsp_ok_means_success    , 'name' : "set if we should detach on error" },
-    'QSetDisableASLR'         : { 'cmd' : cmd_query_packet      , 'rsp' : rsp_ok_means_success    , 'name' : "set if we should disable ASLR" },
-    'qLaunchSuccess'          : { 'cmd' : cmd_query_packet      , 'rsp' : rsp_ok_means_success    , 'name' : "check on launch success for the A packet" },
-    'A'                       : { 'cmd' : cmd_A                 , 'rsp' : rsp_ok_means_success    , 'name' : "launch process" },
-    'QLaunchArch'             : { 'cmd' : cmd_query_packet      , 'rsp' : rsp_ok_means_supported  , 'name' : "set if we should disable ASLR" },
-    'qVAttachOrWaitSupported' : { 'cmd' : cmd_query_packet      , 'rsp' : rsp_ok_means_supported  , 'name' : "set the launch architecture" },
-    'qHostInfo'               : { 'cmd' : cmd_query_packet      , 'rsp' : rsp_dump_key_value_pairs, 'name' : "get host information" },
-    'qC'                      : { 'cmd' : cmd_qC                , 'rsp' : rsp_qC                  , 'name' : "return the current thread ID" },
-    'vCont'                   : { 'cmd' : cmd_vCont             , 'rsp' : rsp_vCont               , 'name' : "extended continue command" },
-    'vAttach'                 : { 'cmd' : cmd_vAttach           , 'rsp' : rsp_stop_reply          , 'name' : "attach to process" },
-    'c'                       : { 'cmd' : cmd_c                 , 'rsp' : rsp_stop_reply          , 'name' : "continue" },
-    's'                       : { 'cmd' : cmd_s                 , 'rsp' : rsp_stop_reply          , 'name' : "step" },
-    'qRegisterInfo'           : { 'cmd' : cmd_qRegisterInfo     , 'rsp' : rsp_qRegisterInfo       , 'name' : "query register info" },
-    'qfThreadInfo'            : { 'cmd' : cmd_qThreadInfo       , 'rsp' : rsp_qThreadInfo         , 'name' : "get current thread list" },
-    'qsThreadInfo'            : { 'cmd' : cmd_qThreadInfo       , 'rsp' : rsp_qThreadInfo         , 'name' : "get current thread list" },
-    'qShlibInfoAddr'          : { 'cmd' : cmd_query_packet      , 'rsp' : rsp_hex_big_endian      , 'name' : "get shared library info address" },
-    'qMemoryRegionInfo'       : { 'cmd' : cmd_mem_rgn_info      , 'rsp' : rsp_dump_key_value_pairs, 'name' : "get memory region information" },
-    'qProcessInfo'            : { 'cmd' : cmd_query_packet      , 'rsp' : rsp_dump_key_value_pairs, 'name' : "get process info" },
-    'qSupported'              : { 'cmd' : cmd_query_packet      , 'rsp' : rsp_ok_means_supported  , 'name' : "query supported" },
-    'qXfer:'                  : { 'cmd' : cmd_qXfer             , 'rsp' : rsp_qXfer               , 'name' : "qXfer" },
-    'qSymbol:'                : { 'cmd' : cmd_qSymbol           , 'rsp' : rsp_qSymbol             , 'name' : "qSymbol" },
-    'x'                       : { 'cmd' : cmd_read_mem_bin      , 'rsp' : rsp_mem_bin_bytes       , 'name' : "read memory binary" },
-    'X'                       : { 'cmd' : cmd_write_memory      , 'rsp' : rsp_ok_means_success    , 'name' : "write memory binary" },
-    'm'                       : { 'cmd' : cmd_read_memory       , 'rsp' : rsp_memory_bytes        , 'name' : "read memory" },
-    'M'                       : { 'cmd' : cmd_write_memory      , 'rsp' : rsp_ok_means_success    , 'name' : "write memory" },
-    '_M'                      : { 'cmd' : cmd_alloc_memory      , 'rsp' : rsp_alloc_memory        , 'name' : "allocate memory" },
-    '_m'                      : { 'cmd' : cmd_dealloc_memory    , 'rsp' : rsp_ok_means_success    , 'name' : "deallocate memory" },
-    'p'                       : { 'cmd' : cmd_read_one_reg      , 'rsp' : rsp_read_one_reg        , 'name' : "read single register" },
-    'P'                       : { 'cmd' : cmd_write_one_reg     , 'rsp' : rsp_ok_means_success    , 'name' : "write single register" },
-    'g'                       : { 'cmd' : cmd_read_all_regs     , 'rsp' : rsp_read_all_regs       , 'name' : "read all registers" },
-    'G'                       : { 'cmd' : cmd_write_all_regs    , 'rsp' : rsp_ok_means_success    , 'name' : "write all registers" },
-    'z'                       : { 'cmd' : cmd_bp                , 'rsp' : rsp_ok_means_success    , 'name' : "clear breakpoint or watchpoint" },
-    'Z'                       : { 'cmd' : cmd_bp                , 'rsp' : rsp_ok_means_success    , 'name' : "set breakpoint or watchpoint" },
-    'k'                       : { 'cmd' : cmd_kill              , 'rsp' : rsp_stop_reply          , 'name' : "kill process" },
-    'jThreadsInfo'            : { 'cmd' : cmd_jThreadsInfo      , 'rsp' : rsp_json                , 'name' : "JSON get all threads info" },
-    'jGetLoadedDynamicLibrariesInfos:' : { 'cmd' : cmd_jGetLoadedDynamicLibrariesInfos, 'rsp' : rsp_jGetLoadedDynamicLibrariesInfos, 'name' : 'JSON get loaded dynamic libraries' },
+    '\\?': {'cmd': cmd_stop_reply, 'rsp': rsp_stop_reply, 'name': "stop reply pacpket"},
+    'qThreadStopInfo': {'cmd': cmd_qThreadStopInfo, 'rsp': rsp_stop_reply, 'name': "stop reply pacpket"},
+    'QStartNoAckMode': {'cmd': cmd_query_packet, 'rsp': rsp_ok_means_supported, 'name': "query if no ack mode is supported"},
+    'QThreadSuffixSupported': {'cmd': cmd_query_packet, 'rsp': rsp_ok_means_supported, 'name': "query if thread suffix is supported"},
+    'QListThreadsInStopReply': {'cmd': cmd_query_packet, 'rsp': rsp_ok_means_supported, 'name': "query if threads in stop reply packets are supported"},
+    'QSetDetachOnError': {'cmd': cmd_query_packet, 'rsp': rsp_ok_means_success, 'name': "set if we should detach on error"},
+    'QSetDisableASLR': {'cmd': cmd_query_packet, 'rsp': rsp_ok_means_success, 'name': "set if we should disable ASLR"},
+    'qLaunchSuccess': {'cmd': cmd_query_packet, 'rsp': rsp_ok_means_success, 'name': "check on launch success for the A packet"},
+    'A': {'cmd': cmd_A, 'rsp': rsp_ok_means_success, 'name': "launch process"},
+    'QLaunchArch': {'cmd': cmd_query_packet, 'rsp': rsp_ok_means_supported, 'name': "set if we should disable ASLR"},
+    'qVAttachOrWaitSupported': {'cmd': cmd_query_packet, 'rsp': rsp_ok_means_supported, 'name': "set the launch architecture"},
+    'qHostInfo': {'cmd': cmd_query_packet, 'rsp': rsp_dump_key_value_pairs, 'name': "get host information"},
+    'qC': {'cmd': cmd_qC, 'rsp': rsp_qC, 'name': "return the current thread ID"},
+    'vCont': {'cmd': cmd_vCont, 'rsp': rsp_vCont, 'name': "extended continue command"},
+    'vAttach': {'cmd': cmd_vAttach, 'rsp': rsp_stop_reply, 'name': "attach to process"},
+    'c': {'cmd': cmd_c, 'rsp': rsp_stop_reply, 'name': "continue"},
+    's': {'cmd': cmd_s, 'rsp': rsp_stop_reply, 'name': "step"},
+    'qRegisterInfo': {'cmd': cmd_qRegisterInfo, 'rsp': rsp_qRegisterInfo, 'name': "query register info"},
+    'qfThreadInfo': {'cmd': cmd_qThreadInfo, 'rsp': rsp_qThreadInfo, 'name': "get current thread list"},
+    'qsThreadInfo': {'cmd': cmd_qThreadInfo, 'rsp': rsp_qThreadInfo, 'name': "get current thread list"},
+    'qShlibInfoAddr': {'cmd': cmd_query_packet, 'rsp': rsp_hex_big_endian, 'name': "get shared library info address"},
+    'qMemoryRegionInfo': {'cmd': cmd_mem_rgn_info, 'rsp': rsp_dump_key_value_pairs, 'name': "get memory region information"},
+    'qProcessInfo': {'cmd': cmd_query_packet, 'rsp': rsp_dump_key_value_pairs, 'name': "get process info"},
+    'qSupported': {'cmd': cmd_query_packet, 'rsp': rsp_ok_means_supported, 'name': "query supported"},
+    'qXfer:': {'cmd': cmd_qXfer, 'rsp': rsp_qXfer, 'name': "qXfer"},
+    'qSymbol:': {'cmd': cmd_qSymbol, 'rsp': rsp_qSymbol, 'name': "qSymbol"},
+    'x': {'cmd': cmd_read_mem_bin, 'rsp': rsp_mem_bin_bytes, 'name': "read memory binary"},
+    'X': {'cmd': cmd_write_memory, 'rsp': rsp_ok_means_success, 'name': "write memory binary"},
+    'm': {'cmd': cmd_read_memory, 'rsp': rsp_memory_bytes, 'name': "read memory"},
+    'M': {'cmd': cmd_write_memory, 'rsp': rsp_ok_means_success, 'name': "write memory"},
+    '_M': {'cmd': cmd_alloc_memory, 'rsp': rsp_alloc_memory, 'name': "allocate memory"},
+    '_m': {'cmd': cmd_dealloc_memory, 'rsp': rsp_ok_means_success, 'name': "deallocate memory"},
+    'p': {'cmd': cmd_read_one_reg, 'rsp': rsp_read_one_reg, 'name': "read single register"},
+    'P': {'cmd': cmd_write_one_reg, 'rsp': rsp_ok_means_success, 'name': "write single register"},
+    'g': {'cmd': cmd_read_all_regs, 'rsp': rsp_read_all_regs, 'name': "read all registers"},
+    'G': {'cmd': cmd_write_all_regs, 'rsp': rsp_ok_means_success, 'name': "write all registers"},
+    'z': {'cmd': cmd_bp, 'rsp': rsp_ok_means_success, 'name': "clear breakpoint or watchpoint"},
+    'Z': {'cmd': cmd_bp, 'rsp': rsp_ok_means_success, 'name': "set breakpoint or watchpoint"},
+    'k': {'cmd': cmd_kill, 'rsp': rsp_stop_reply, 'name': "kill process"},
+    'jThreadsInfo': {'cmd': cmd_jThreadsInfo, 'rsp': rsp_json, 'name': "JSON get all threads info"},
+    'jGetLoadedDynamicLibrariesInfos:': {'cmd': cmd_jGetLoadedDynamicLibrariesInfos, 'rsp': rsp_jGetLoadedDynamicLibrariesInfos, 'name': 'JSON get loaded dynamic libraries'},
 }
 
+
 def calculate_mean_and_standard_deviation(floats):
     sum = 0.0
     count = len(floats)
@@ -1119,20 +1238,22 @@ def calculate_mean_and_standard_deviatio
         return (0.0, 0.0)
     for f in floats:
         sum += f
-    mean =  sum / count
+    mean = sum / count
     accum = 0.0
     for f in floats:
         delta = f - mean
         accum += delta * delta
-        
-    std_dev = math.sqrt(accum / (count-1));
+
+    std_dev = math.sqrt(accum / (count - 1))
     return (mean, std_dev)
 
+
 def parse_gdb_log_file(path, options):
     f = open(path)
     parse_gdb_log(f, options)
     f.close()
-    
+
+
 def parse_gdb_log(file, options):
     '''Parse a GDB log file that was generated by enabling logging with:
     (lldb) log enable --threadsafe --timestamp --file <FILE> gdb-remote packets
@@ -1143,15 +1264,17 @@ def parse_gdb_log(file, options):
     handy when trying to figure out why some operation in the debugger is taking
     a long time during a preset set of debugger commands.'''
 
-    tricky_commands = [ 'qRegisterInfo' ]
+    tricky_commands = ['qRegisterInfo']
     timestamp_regex = re.compile('(\s*)([1-9][0-9]+\.[0-9]+)([^0-9].*)$')
     packet_name_regex = re.compile('([A-Za-z_]+)[^a-z]')
-    packet_transmit_name_regex = re.compile('(?P<direction>send|read) packet: (?P<packet>.*)')
+    packet_transmit_name_regex = re.compile(
+        '(?P<direction>send|read) packet: (?P<packet>.*)')
     packet_contents_name_regex = re.compile('\$([^#]+)#[0-9a-fA-F]{2}')
     packet_checksum_regex = re.compile('.*#[0-9a-fA-F]{2}$')
-    packet_names_regex_str = '(' + '|'.join(gdb_remote_commands.keys()) + ')(.*)';
-    packet_names_regex = re.compile(packet_names_regex_str);
-    
+    packet_names_regex_str = '(' + \
+        '|'.join(gdb_remote_commands.keys()) + ')(.*)'
+    packet_names_regex = re.compile(packet_names_regex_str)
+
     base_time = 0.0
     last_time = 0.0
     packet_send_time = 0.0
@@ -1181,22 +1304,24 @@ def parse_gdb_log(file, options):
             if not options.quiet and not hide_next_response:
                 print '#  ', line
             sys.stdout.write(options.colors.reset())
-                
-            #print 'direction = "%s", packet = "%s"' % (direction, packet)
-            
+
+            # print 'direction = "%s", packet = "%s"' % (direction, packet)
+
             if packet[0] == '+':
                 if is_command:
                     print '-->',
                 else:
                     print '<--',
-                if not options.quiet: print 'ACK'
+                if not options.quiet:
+                    print 'ACK'
                 continue
             elif packet[0] == '-':
                 if is_command:
                     print '-->',
                 else:
                     print '<--',
-                if not options.quiet: print 'NACK'
+                if not options.quiet:
+                    print 'NACK'
                 continue
             elif packet[0] == '$':
                 m = packet_contents_name_regex.match(packet)
@@ -1222,7 +1347,7 @@ def parse_gdb_log(file, options):
                     contents = decode_packet(m.group(1))
                     if is_command:
                         hide_next_response = False
-                        m = packet_names_regex.match (contents)
+                        m = packet_names_regex.match(contents)
                         if m:
                             last_command = m.group(1)
                             if last_command == '?':
@@ -1230,13 +1355,14 @@ def parse_gdb_log(file, options):
                             packet_name = last_command
                             last_command_args = m.group(2)
                             last_command_packet = contents
-                            hide_next_response = gdb_remote_commands[last_command]['cmd'](options, last_command, last_command_args)
+                            hide_next_response = gdb_remote_commands[last_command][
+                                'cmd'](options, last_command, last_command_args)
                         else:
-                            packet_match = packet_name_regex.match (contents)
+                            packet_match = packet_name_regex.match(contents)
                             if packet_match:
                                 packet_name = packet_match.group(1)
                                 for tricky_cmd in tricky_commands:
-                                    if packet_name.find (tricky_cmd) == 0:
+                                    if packet_name.find(tricky_cmd) == 0:
                                         packet_name = tricky_cmd
                             else:
                                 packet_name = contents
@@ -1244,16 +1370,17 @@ def parse_gdb_log(file, options):
                             last_command_args = None
                             last_command_packet = None
                     elif last_command:
-                        gdb_remote_commands[last_command]['rsp'](options, last_command, last_command_args, contents)
+                        gdb_remote_commands[last_command]['rsp'](
+                            options, last_command, last_command_args, contents)
                 else:
                     print 'error: invalid packet: "', packet, '"'
             else:
                 print '???'
         else:
             print '## ', line
-        match = timestamp_regex.match (line)
+        match = timestamp_regex.match(line)
         if match:
-            curr_time = float (match.group(2))
+            curr_time = float(match.group(2))
             if last_time and not is_command:
                 delta = curr_time - last_time
                 packet_times.append(delta)
@@ -1262,7 +1389,7 @@ def parse_gdb_log(file, options):
                 delta = curr_time - last_time
             else:
                 base_time = curr_time
-            
+
             if is_command:
                 packet_send_time = curr_time
             elif line.find('read packet: $') >= 0 and packet_name:
@@ -1300,30 +1427,68 @@ def parse_gdb_log(file, options):
         print '# Packet                   Time (sec) Percent Count '
         print '#------------------------- ---------- ------- ------'
         if options and options.sort_count:
-            res = sorted(packet_count, key=packet_count.__getitem__, reverse=True)
+            res = sorted(
+                packet_count,
+                key=packet_count.__getitem__,
+                reverse=True)
         else:
-            res = sorted(packet_total_times, key=packet_total_times.__getitem__, reverse=True)
+            res = sorted(
+                packet_total_times,
+                key=packet_total_times.__getitem__,
+                reverse=True)
 
         if last_time > 0.0:
             for item in res:
                 packet_total_time = packet_total_times[item]
-                packet_percent = (packet_total_time / total_packet_time)*100.0
+                packet_percent = (
+                    packet_total_time / total_packet_time) * 100.0
                 if packet_percent >= 10.0:
                     print "  %24s %.6f   %.2f%% %6d" % (item, packet_total_time, packet_percent, packet_count[item])
                 else:
                     print "  %24s %.6f   %.2f%%  %6d" % (item, packet_total_time, packet_percent, packet_count[item])
-                    
-    
-    
+
+
 if __name__ == '__main__':
     usage = "usage: gdbremote [options]"
-    description='''The command disassembles a GDB remote packet log.'''
-    parser = optparse.OptionParser(description=description, prog='gdbremote',usage=usage)
-    parser.add_option('-v', '--verbose', action='store_true', dest='verbose', help='display verbose debug info', default=False)
-    parser.add_option('-q', '--quiet', action='store_true', dest='quiet', help='display verbose debug info', default=False)
-    parser.add_option('-C', '--color', action='store_true', dest='color', help='add terminal colors', default=False)
-    parser.add_option('-c', '--sort-by-count', action='store_true', dest='sort_count', help='display verbose debug info', default=False)
-    parser.add_option('--crashlog', type='string', dest='crashlog', help='symbolicate using a darwin crash log file', default=False)
+    description = '''The command disassembles a GDB remote packet log.'''
+    parser = optparse.OptionParser(
+        description=description,
+        prog='gdbremote',
+        usage=usage)
+    parser.add_option(
+        '-v',
+        '--verbose',
+        action='store_true',
+        dest='verbose',
+        help='display verbose debug info',
+        default=False)
+    parser.add_option(
+        '-q',
+        '--quiet',
+        action='store_true',
+        dest='quiet',
+        help='display verbose debug info',
+        default=False)
+    parser.add_option(
+        '-C',
+        '--color',
+        action='store_true',
+        dest='color',
+        help='add terminal colors',
+        default=False)
+    parser.add_option(
+        '-c',
+        '--sort-by-count',
+        action='store_true',
+        dest='sort_count',
+        help='display verbose debug info',
+        default=False)
+    parser.add_option(
+        '--crashlog',
+        type='string',
+        dest='crashlog',
+        help='symbolicate using a darwin crash log file',
+        default=False)
     try:
         (options, args) = parser.parse_args(sys.argv[1:])
     except:
@@ -1346,17 +1511,19 @@ if __name__ == '__main__':
             print '#----------------------------------------------------------------------'
             print "# GDB remote log file: '%s'" % file
             print '#----------------------------------------------------------------------'
-            parse_gdb_log_file (file, options)
+            parse_gdb_log_file(file, options)
         if options.symbolicator:
             print '%s' % (options.symbolicator)
     else:
         parse_gdb_log(sys.stdin, options)
-        
+
 else:
     import lldb
-    if lldb.debugger:    
+    if lldb.debugger:
         # This initializer is being run from LLDB in the embedded command interpreter
         # Add any commands contained in this module to LLDB
-        lldb.debugger.HandleCommand('command script add -f gdbremote.start_gdb_log start_gdb_log')
-        lldb.debugger.HandleCommand('command script add -f gdbremote.stop_gdb_log stop_gdb_log')
+        lldb.debugger.HandleCommand(
+            'command script add -f gdbremote.start_gdb_log start_gdb_log')
+        lldb.debugger.HandleCommand(
+            'command script add -f gdbremote.stop_gdb_log stop_gdb_log')
         print 'The "start_gdb_log" and "stop_gdb_log" commands are now installed and ready for use, type "start_gdb_log --help" or "stop_gdb_log --help" for more information'

Modified: lldb/trunk/examples/python/globals.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/globals.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/examples/python/globals.py (original)
+++ lldb/trunk/examples/python/globals.py Tue Sep  6 15:57:50 2016
@@ -15,58 +15,92 @@ import os
 import shlex
 import sys
 
+
 def get_globals(raw_path, options):
     error = lldb.SBError()
     # Resolve the path if needed
     path = os.path.expanduser(raw_path)
     # Create a target using path + options
-    target = lldb.debugger.CreateTarget(path, options.arch, options.platform, False, error)
+    target = lldb.debugger.CreateTarget(
+        path, options.arch, options.platform, False, error)
     if target:
         # Get the executable module
         module = target.module[target.executable.basename]
         if module:
             # Keep track of which variables we have already looked up
             global_names = list()
-            # Iterate through all symbols in the symbol table and watch for any DATA symbols
+            # Iterate through all symbols in the symbol table and watch for any
+            # DATA symbols
             for symbol in module.symbols:
                 if symbol.type == lldb.eSymbolTypeData:
-                    # The symbol is a DATA symbol, lets try and find all global variables 
+                    # The symbol is a DATA symbol, lets try and find all global variables
                     # that match this name and print them
                     global_name = symbol.name
                     # Make sure we don't lookup the same variable twice
                     if global_name not in global_names:
                         global_names.append(global_name)
                         # Find all global variables by name
-                        global_variable_list = module.FindGlobalVariables (target, global_name, lldb.UINT32_MAX)
+                        global_variable_list = module.FindGlobalVariables(
+                            target, global_name, lldb.UINT32_MAX)
                         if global_variable_list:
                             # Print results for anything that matched
                             for global_variable in global_variable_list:
-                                print 'name = %s' % global_variable.name    # returns the global variable name as a string
-                                print 'value = %s' % global_variable.value  # Returns the variable value as a string
+                                # returns the global variable name as a string
+                                print 'name = %s' % global_variable.name
+                                # Returns the variable value as a string
+                                print 'value = %s' % global_variable.value
                                 print 'type = %s' % global_variable.type    # Returns an lldb.SBType object
-                                print 'addr = %s' % global_variable.addr    # Returns an lldb.SBAddress (section offset address) for this global
-                                print 'file_addr = 0x%x' % global_variable.addr.file_addr    # Returns the file virtual address for this global
-                                print 'location = %s' % global_variable.location    # returns the global variable value as a string
-                                print 'size = %s' % global_variable.size    # Returns the size in bytes of this global variable
+                                # Returns an lldb.SBAddress (section offset
+                                # address) for this global
+                                print 'addr = %s' % global_variable.addr
+                                # Returns the file virtual address for this
+                                # global
+                                print 'file_addr = 0x%x' % global_variable.addr.file_addr
+                                # returns the global variable value as a string
+                                print 'location = %s' % global_variable.location
+                                # Returns the size in bytes of this global
+                                # variable
+                                print 'size = %s' % global_variable.size
                                 print
 
+
 def globals(command_args):
     '''Extract all globals from any arguments which must be paths to object files.'''
     usage = "usage: %prog [options] <PATH> [PATH ...]"
-    description='''This command will find all globals in the specified object file and return an list() of lldb.SBValue objects (which might be empty).'''
-    parser = optparse.OptionParser(description=description, prog='globals',usage=usage)
-    parser.add_option('-v', '--verbose', action='store_true', dest='verbose', help='display verbose debug info', default=False)
-    parser.add_option('-a', '--arch', type='string', metavar='arch', dest='arch', help='Specify an architecture (or triple) to use when extracting from a file.')
-    parser.add_option('-p', '--platform', type='string', metavar='platform', dest='platform', help='Specify the platform to use when creating the debug target. Valid values include "localhost", "darwin-kernel", "ios-simulator", "remote-freebsd", "remote-macosx", "remote-ios", "remote-linux".')
+    description = '''This command will find all globals in the specified object file and return an list() of lldb.SBValue objects (which might be empty).'''
+    parser = optparse.OptionParser(
+        description=description,
+        prog='globals',
+        usage=usage)
+    parser.add_option(
+        '-v',
+        '--verbose',
+        action='store_true',
+        dest='verbose',
+        help='display verbose debug info',
+        default=False)
+    parser.add_option(
+        '-a',
+        '--arch',
+        type='string',
+        metavar='arch',
+        dest='arch',
+        help='Specify an architecture (or triple) to use when extracting from a file.')
+    parser.add_option(
+        '-p',
+        '--platform',
+        type='string',
+        metavar='platform',
+        dest='platform',
+        help='Specify the platform to use when creating the debug target. Valid values include "localhost", "darwin-kernel", "ios-simulator", "remote-freebsd", "remote-macosx", "remote-ios", "remote-linux".')
     try:
         (options, args) = parser.parse_args(command_args)
     except:
         return
-    
+
     for path in args:
-        get_globals (path, options)
-    
+        get_globals(path, options)
+
 if __name__ == '__main__':
     lldb.debugger = lldb.SBDebugger.Create()
-    globals (sys.argv[1:])
-
+    globals(sys.argv[1:])

Modified: lldb/trunk/examples/python/jump.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/jump.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/examples/python/jump.py (original)
+++ lldb/trunk/examples/python/jump.py Tue Sep  6 15:57:50 2016
@@ -1,8 +1,10 @@
-import lldb, re
+import lldb
+import re
 
-def parse_linespec (linespec, frame, result):
+
+def parse_linespec(linespec, frame, result):
     """Handles a subset of GDB-style linespecs.  Specifically:
-       
+
        number           - A line in the current file
        +offset          - The line /offset/ lines after this line
        -offset          - The line /offset/ lines before this line
@@ -21,65 +23,73 @@ def parse_linespec (linespec, frame, res
 
     if (not matched):
         mo = re.match("^([0-9]+)$", linespec)
-        if (mo != None):
+        if (mo is not None):
             matched = True
-            #print "Matched <linenum>"
+            # print "Matched <linenum>"
             line_number = int(mo.group(1))
             line_entry = frame.GetLineEntry()
             if not line_entry.IsValid():
-                result.AppendMessage("Specified a line in the current file, but the current frame doesn't have line table information.")
+                result.AppendMessage(
+                    "Specified a line in the current file, but the current frame doesn't have line table information.")
                 return
-            breakpoint = target.BreakpointCreateByLocation (line_entry.GetFileSpec(), line_number)
+            breakpoint = target.BreakpointCreateByLocation(
+                line_entry.GetFileSpec(), line_number)
 
     if (not matched):
         mo = re.match("^\+([0-9]+)$", linespec)
-        if (mo != None):
+        if (mo is not None):
             matched = True
-            #print "Matched +<count>"
+            # print "Matched +<count>"
             line_number = int(mo.group(1))
             line_entry = frame.GetLineEntry()
             if not line_entry.IsValid():
-                result.AppendMessage("Specified a line in the current file, but the current frame doesn't have line table information.")
+                result.AppendMessage(
+                    "Specified a line in the current file, but the current frame doesn't have line table information.")
                 return
-            breakpoint = target.BreakpointCreateByLocation(line_entry.GetFileSpec(), (line_entry.GetLine() + line_number))
-     
+            breakpoint = target.BreakpointCreateByLocation(
+                line_entry.GetFileSpec(), (line_entry.GetLine() + line_number))
+
     if (not matched):
         mo = re.match("^\-([0-9]+)$", linespec)
-        if (mo != None):
+        if (mo is not None):
             matched = True
-            #print "Matched -<count>"
+            # print "Matched -<count>"
             line_number = int(mo.group(1))
             line_entry = frame.GetLineEntry()
             if not line_entry.IsValid():
-                result.AppendMessage("Specified a line in the current file, but the current frame doesn't have line table information.")
+                result.AppendMessage(
+                    "Specified a line in the current file, but the current frame doesn't have line table information.")
                 return
-            breakpoint = target.BreakpointCreateByLocation(line_entry.GetFileSpec(), (line_entry.GetLine() - line_number))
+            breakpoint = target.BreakpointCreateByLocation(
+                line_entry.GetFileSpec(), (line_entry.GetLine() - line_number))
 
     if (not matched):
         mo = re.match("^(.*):([0-9]+)$", linespec)
-        if (mo != None):
+        if (mo is not None):
             matched = True
-            #print "Matched <filename>:<linenum>"
+            # print "Matched <filename>:<linenum>"
             file_name = mo.group(1)
             line_number = int(mo.group(2))
-            breakpoint = target.BreakpointCreateByLocation(file_name, line_number)
+            breakpoint = target.BreakpointCreateByLocation(
+                file_name, line_number)
 
     if (not matched):
         mo = re.match("\*((0x)?([0-9a-f]+))$", linespec)
-        if (mo != None):
+        if (mo is not None):
             matched = True
-            #print "Matched <address-expression>"
+            # print "Matched <address-expression>"
             address = long(mo.group(1), base=0)
             breakpoint = target.BreakpointCreateByAddress(address)
 
     if (not matched):
-        #print "Trying <function-name>"
+        # print "Trying <function-name>"
         breakpoint = target.BreakpointCreateByName(linespec)
 
     num_locations = breakpoint.GetNumLocations()
 
     if (num_locations == 0):
-        result.AppendMessage("The line specification provided doesn't resolve to any addresses.")
+        result.AppendMessage(
+            "The line specification provided doesn't resolve to any addresses.")
 
     addr_list = []
 
@@ -91,6 +101,7 @@ def parse_linespec (linespec, frame, res
 
     return addr_list
 
+
 def usage_string():
     return """   Sets the program counter to a specific address.
 
@@ -106,7 +117,8 @@ Command Options Usage:
 
 <location-id> serves to disambiguate when multiple locations could be meant."""
 
-def jump (debugger, command, result, internal_dict):
+
+def jump(debugger, command, result, internal_dict):
     if (command == ""):
         result.AppendMessage(usage_string())
 
@@ -151,17 +163,28 @@ def jump (debugger, command, result, int
             if (desired_index >= 0) and (desired_index < len(addresses)):
                 desired_address = addresses[desired_index]
             else:
-                result.AppendMessage("Desired index " + args[1] + " is not one of the options.")
+                result.AppendMessage(
+                    "Desired index " +
+                    args[1] +
+                    " is not one of the options.")
                 return
         else:
             index = 0
-            result.AppendMessage("The specified location resolves to multiple targets.");
+            result.AppendMessage(
+                "The specified location resolves to multiple targets.")
             for address in addresses:
                 stream.Clear()
                 address.GetDescription(stream)
-                result.AppendMessage("  Location ID " + str(index) + ": " + stream.GetData())
+                result.AppendMessage(
+                    "  Location ID " +
+                    str(index) +
+                    ": " +
+                    stream.GetData())
                 index = index + 1
-            result.AppendMessage("Please type 'jump " + command + " <location-id>' to choose one.")
+            result.AppendMessage(
+                "Please type 'jump " +
+                command +
+                " <location-id>' to choose one.")
             return
 
     frame.SetPC(desired_address.GetLoadAddress(target))

Modified: lldb/trunk/examples/python/lldb_module_utils.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/lldb_module_utils.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/examples/python/lldb_module_utils.py (original)
+++ lldb/trunk/examples/python/lldb_module_utils.py Tue Sep  6 15:57:50 2016
@@ -6,18 +6,29 @@ import shlex
 import string
 import sys
 
-def create_dump_module_line_tables_options ():
+
+def create_dump_module_line_tables_options():
     usage = "usage: dump_module_line_tables [options] MODULE1 [MODULE2 ...]"
-    description='''Dumps all line tables from all compile units for any modules specified as arguments. Specifying the --verbose flag will output address ranges for each line entry.'''
-    parser = optparse.OptionParser(description=description, prog='start_gdb_log',usage=usage)
-    parser.add_option('-v', '--verbose', action='store_true', dest='verbose', help='Display verbose output.', default=False)
+    description = '''Dumps all line tables from all compile units for any modules specified as arguments. Specifying the --verbose flag will output address ranges for each line entry.'''
+    parser = optparse.OptionParser(
+        description=description,
+        prog='start_gdb_log',
+        usage=usage)
+    parser.add_option(
+        '-v',
+        '--verbose',
+        action='store_true',
+        dest='verbose',
+        help='Display verbose output.',
+        default=False)
     return parser
-    
+
+
 def dump_module_line_tables(debugger, command, result, dict):
     '''Dumps all line tables from all compile units for any modules specified as arguments.'''
     command_args = shlex.split(command)
-    
-    parser = create_dump_module_line_tables_options ()
+
+    parser = create_dump_module_line_tables_options()
     try:
         (options, args) = parser.parse_args(command_args)
     except:
@@ -27,33 +38,41 @@ def dump_module_line_tables(debugger, co
         lldb.target = target
         for module_name in command_args:
             result.PutCString('Searching for module "%s"' % (module_name,))
-            module_fspec = lldb.SBFileSpec (module_name, False)
-            module = target.FindModule (module_fspec);
+            module_fspec = lldb.SBFileSpec(module_name, False)
+            module = target.FindModule(module_fspec)
             if module:
-                for cu_idx in range (module.GetNumCompileUnits()):
+                for cu_idx in range(module.GetNumCompileUnits()):
                     cu = module.GetCompileUnitAtIndex(cu_idx)
                     result.PutCString("\n%s:" % (cu.file))
                     for line_idx in range(cu.GetNumLineEntries()):
                         line_entry = cu.GetLineEntryAtIndex(line_idx)
                         start_file_addr = line_entry.addr.file_addr
                         end_file_addr = line_entry.end_addr.file_addr
-                        # If the two addresses are equal, this line table entry is a termination entry
+                        # If the two addresses are equal, this line table entry
+                        # is a termination entry
                         if options.verbose:
                             if start_file_addr != end_file_addr:
-                                result.PutCString('[%#x - %#x): %s' % (start_file_addr, end_file_addr, line_entry))
+                                result.PutCString(
+                                    '[%#x - %#x): %s' %
+                                    (start_file_addr, end_file_addr, line_entry))
                         else:
                             if start_file_addr == end_file_addr:
-                                result.PutCString('%#x: END' % (start_file_addr))
+                                result.PutCString('%#x: END' %
+                                                  (start_file_addr))
                             else:
-                                result.PutCString('%#x: %s' % (start_file_addr, line_entry))
+                                result.PutCString(
+                                    '%#x: %s' %
+                                    (start_file_addr, line_entry))
                         if start_file_addr == end_file_addr:
                             result.Printf("\n")
             else:
-                result.PutCString ("no module for '%s'" % module)
+                result.PutCString("no module for '%s'" % module)
     else:
-        result.PutCString ("error: invalid target")
+        result.PutCString("error: invalid target")
 
-parser = create_dump_module_line_tables_options ()
+parser = create_dump_module_line_tables_options()
 dump_module_line_tables.__doc__ = parser.format_help()
-lldb.debugger.HandleCommand('command script add -f %s.dump_module_line_tables dump_module_line_tables' % __name__)
-print 'Installed "dump_module_line_tables" command'
\ No newline at end of file
+lldb.debugger.HandleCommand(
+    'command script add -f %s.dump_module_line_tables dump_module_line_tables' %
+    __name__)
+print 'Installed "dump_module_line_tables" command'

Modified: lldb/trunk/examples/python/lldbtk.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/lldbtk.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/examples/python/lldbtk.py (original)
+++ lldb/trunk/examples/python/lldbtk.py Tue Sep  6 15:57:50 2016
@@ -6,7 +6,9 @@ import sys
 from Tkinter import *
 import ttk
 
+
 class ValueTreeItemDelegate(object):
+
     def __init__(self, value):
         self.value = value
 
@@ -24,36 +26,44 @@ class ValueTreeItemDelegate(object):
         if summary is None:
             summary = ''
         has_children = self.value.MightHaveChildren()
-        return { '#0' : name,
-                 'typename' : typename,
-                 'value' : value,
-                 'summary' : summary,
-                 'children' : has_children,
-                 'tree-item-delegate' : self }
-        
+        return {'#0': name,
+                'typename': typename,
+                'value': value,
+                'summary': summary,
+                'children': has_children,
+                'tree-item-delegate': self}
+
     def get_child_item_dictionaries(self):
         item_dicts = list()
         for i in range(self.value.num_children):
-            item_delegate = ValueTreeItemDelegate(self.value.GetChildAtIndex(i))
+            item_delegate = ValueTreeItemDelegate(
+                self.value.GetChildAtIndex(i))
             item_dicts.append(item_delegate.get_item_dictionary())
         return item_dicts
 
+
 class FrameTreeItemDelegate(object):
+
     def __init__(self, frame):
         self.frame = frame
 
     def get_item_dictionary(self):
         id = self.frame.GetFrameID()
-        name = 'frame #%u' % (id);
+        name = 'frame #%u' % (id)
         value = '0x%16.16x' % (self.frame.GetPC())
         stream = lldb.SBStream()
         self.frame.GetDescription(stream)
         summary = stream.GetData().split("`")[1]
-        return { '#0' : name,
-                 'value': value, 
-                 'summary': summary, 
-                 'children' : self.frame.GetVariables(True, True, True, True).GetSize() > 0,
-                 'tree-item-delegate' : self }
+        return {
+            '#0': name,
+            'value': value,
+            'summary': summary,
+            'children': self.frame.GetVariables(
+                True,
+                True,
+                True,
+                True).GetSize() > 0,
+            'tree-item-delegate': self}
 
     def get_child_item_dictionaries(self):
         item_dicts = list()
@@ -64,29 +74,33 @@ class FrameTreeItemDelegate(object):
             item_dicts.append(item_delegate.get_item_dictionary())
         return item_dicts
 
+
 class ThreadTreeItemDelegate(object):
-   def __init__(self, thread):
-       self.thread = thread
 
-   def get_item_dictionary(self):
-       num_frames = self.thread.GetNumFrames()
-       name = 'thread #%u' % (self.thread.GetIndexID())
-       value = '0x%x' % (self.thread.GetThreadID())
-       summary = '%u frames' % (num_frames)
-       return { '#0' : name,
-                'value': value, 
-                'summary': summary,
-                'children' : num_frames > 0,
-                'tree-item-delegate' : self }
-
-   def get_child_item_dictionaries(self):
-       item_dicts = list()
-       for frame in self.thread:
-           item_delegate = FrameTreeItemDelegate(frame)
-           item_dicts.append(item_delegate.get_item_dictionary())
-       return item_dicts
-        
+    def __init__(self, thread):
+        self.thread = thread
+
+    def get_item_dictionary(self):
+        num_frames = self.thread.GetNumFrames()
+        name = 'thread #%u' % (self.thread.GetIndexID())
+        value = '0x%x' % (self.thread.GetThreadID())
+        summary = '%u frames' % (num_frames)
+        return {'#0': name,
+                'value': value,
+                'summary': summary,
+                'children': num_frames > 0,
+                'tree-item-delegate': self}
+
+    def get_child_item_dictionaries(self):
+        item_dicts = list()
+        for frame in self.thread:
+            item_delegate = FrameTreeItemDelegate(frame)
+            item_dicts.append(item_delegate.get_item_dictionary())
+        return item_dicts
+
+
 class ProcessTreeItemDelegate(object):
+
     def __init__(self, process):
         self.process = process
 
@@ -95,11 +109,11 @@ class ProcessTreeItemDelegate(object):
         num_threads = self.process.GetNumThreads()
         value = str(self.process.GetProcessID())
         summary = self.process.target.executable.fullpath
-        return { '#0' : 'process',
-                 'value': value, 
-                 'summary': summary,
-                 'children' : num_threads > 0,
-                 'tree-item-delegate' : self }
+        return {'#0': 'process',
+                'value': value,
+                'summary': summary,
+                'children': num_threads > 0,
+                'tree-item-delegate': self}
 
     def get_child_item_dictionaries(self):
         item_dicts = list()
@@ -108,18 +122,20 @@ class ProcessTreeItemDelegate(object):
             item_dicts.append(item_delegate.get_item_dictionary())
         return item_dicts
 
+
 class TargetTreeItemDelegate(object):
+
     def __init__(self, target):
         self.target = target
 
     def get_item_dictionary(self):
         value = str(self.target.triple)
         summary = self.target.executable.fullpath
-        return { '#0' : 'target',
-                 'value': value, 
-                 'summary': summary,
-                 'children' : True,
-                 'tree-item-delegate' : self }
+        return {'#0': 'target',
+                'value': value,
+                'summary': summary,
+                'children': True,
+                'tree-item-delegate': self}
 
     def get_child_item_dictionaries(self):
         item_dicts = list()
@@ -127,7 +143,9 @@ class TargetTreeItemDelegate(object):
         item_dicts.append(image_item_delegate.get_item_dictionary())
         return item_dicts
 
+
 class TargetImagesTreeItemDelegate(object):
+
     def __init__(self, target):
         self.target = target
 
@@ -135,21 +153,24 @@ class TargetImagesTreeItemDelegate(objec
         value = str(self.target.triple)
         summary = self.target.executable.fullpath
         num_modules = self.target.GetNumModules()
-        return { '#0' : 'images',
-                 'value': '', 
-                 'summary': '%u images' % num_modules,
-                 'children' : num_modules > 0,
-                 'tree-item-delegate' : self }
+        return {'#0': 'images',
+                'value': '',
+                'summary': '%u images' % num_modules,
+                'children': num_modules > 0,
+                'tree-item-delegate': self}
 
     def get_child_item_dictionaries(self):
         item_dicts = list()
         for i in range(self.target.GetNumModules()):
             module = self.target.GetModuleAtIndex(i)
-            image_item_delegate = ModuleTreeItemDelegate(self.target, module, i)
+            image_item_delegate = ModuleTreeItemDelegate(
+                self.target, module, i)
             item_dicts.append(image_item_delegate.get_item_dictionary())
         return item_dicts
 
+
 class ModuleTreeItemDelegate(object):
+
     def __init__(self, target, module, index):
         self.target = target
         self.module = module
@@ -159,25 +180,30 @@ class ModuleTreeItemDelegate(object):
         name = 'module %u' % (self.index)
         value = self.module.file.basename
         summary = self.module.file.dirname
-        return { '#0' : name,
-                 'value': value, 
-                 'summary': summary,
-                 'children' : True,
-                 'tree-item-delegate' : self }
+        return {'#0': name,
+                'value': value,
+                'summary': summary,
+                'children': True,
+                'tree-item-delegate': self}
 
     def get_child_item_dictionaries(self):
         item_dicts = list()
-        sections_item_delegate = ModuleSectionsTreeItemDelegate(self.target, self.module)
+        sections_item_delegate = ModuleSectionsTreeItemDelegate(
+            self.target, self.module)
         item_dicts.append(sections_item_delegate.get_item_dictionary())
 
-        symbols_item_delegate = ModuleSymbolsTreeItemDelegate(self.target, self.module)
+        symbols_item_delegate = ModuleSymbolsTreeItemDelegate(
+            self.target, self.module)
         item_dicts.append(symbols_item_delegate.get_item_dictionary())
 
-        comp_units_item_delegate = ModuleCompileUnitsTreeItemDelegate(self.target, self.module)
+        comp_units_item_delegate = ModuleCompileUnitsTreeItemDelegate(
+            self.target, self.module)
         item_dicts.append(comp_units_item_delegate.get_item_dictionary())
         return item_dicts
 
+
 class ModuleSectionsTreeItemDelegate(object):
+
     def __init__(self, target, module):
         self.target = target
         self.module = module
@@ -186,11 +212,11 @@ class ModuleSectionsTreeItemDelegate(obj
         name = 'sections'
         value = ''
         summary = '%u sections' % (self.module.GetNumSections())
-        return { '#0' : name,
-                 'value': value, 
-                 'summary': summary,
-                 'children' : True,
-                 'tree-item-delegate' : self }
+        return {'#0': name,
+                'value': value,
+                'summary': summary,
+                'children': True,
+                'tree-item-delegate': self}
 
     def get_child_item_dictionaries(self):
         item_dicts = list()
@@ -201,7 +227,9 @@ class ModuleSectionsTreeItemDelegate(obj
             item_dicts.append(image_item_delegate.get_item_dictionary())
         return item_dicts
 
+
 class SectionTreeItemDelegate(object):
+
     def __init__(self, target, section):
         self.target = target
         self.section = section
@@ -214,11 +242,11 @@ class SectionTreeItemDelegate(object):
         else:
             value = '0x%16.16x *' % (self.section.file_addr)
         summary = ''
-        return { '#0' : name,
-                 'value': value, 
-                 'summary': summary,
-                 'children' : self.section.GetNumSubSections() > 0,
-                 'tree-item-delegate' : self }
+        return {'#0': name,
+                'value': value,
+                'summary': summary,
+                'children': self.section.GetNumSubSections() > 0,
+                'tree-item-delegate': self}
 
     def get_child_item_dictionaries(self):
         item_dicts = list()
@@ -226,10 +254,12 @@ class SectionTreeItemDelegate(object):
         for i in range(num_sections):
             section = self.section.GetSubSectionAtIndex(i)
             image_item_delegate = SectionTreeItemDelegate(self.target, section)
-            item_dicts.append(image_item_delegate.get_item_dictionary())            
+            item_dicts.append(image_item_delegate.get_item_dictionary())
         return item_dicts
 
+
 class ModuleCompileUnitsTreeItemDelegate(object):
+
     def __init__(self, target, module):
         self.target = target
         self.module = module
@@ -238,11 +268,11 @@ class ModuleCompileUnitsTreeItemDelegate
         name = 'compile units'
         value = ''
         summary = '%u compile units' % (self.module.GetNumSections())
-        return { '#0' : name,
-                 'value': value, 
-                 'summary': summary,
-                 'children' : self.module.GetNumCompileUnits() > 0,
-                 'tree-item-delegate' : self }
+        return {'#0': name,
+                'value': value,
+                'summary': summary,
+                'children': self.module.GetNumCompileUnits() > 0,
+                'tree-item-delegate': self}
 
     def get_child_item_dictionaries(self):
         item_dicts = list()
@@ -253,7 +283,9 @@ class ModuleCompileUnitsTreeItemDelegate
             item_dicts.append(image_item_delegate.get_item_dictionary())
         return item_dicts
 
+
 class CompileUnitTreeItemDelegate(object):
+
     def __init__(self, target, cu):
         self.target = target
         self.cu = cu
@@ -263,11 +295,11 @@ class CompileUnitTreeItemDelegate(object
         value = ''
         num_lines = self.cu.GetNumLineEntries()
         summary = ''
-        return { '#0' : name,
-                 'value': value, 
-                 'summary': summary,
-                 'children' : num_lines > 0,
-                 'tree-item-delegate' : self }
+        return {'#0': name,
+                'value': value,
+                'summary': summary,
+                'children': num_lines > 0,
+                'tree-item-delegate': self}
 
     def get_child_item_dictionaries(self):
         item_dicts = list()
@@ -275,7 +307,9 @@ class CompileUnitTreeItemDelegate(object
         item_dicts.append(item_delegate.get_item_dictionary())
         return item_dicts
 
+
 class LineTableTreeItemDelegate(object):
+
     def __init__(self, target, cu):
         self.target = target
         self.cu = cu
@@ -285,22 +319,25 @@ class LineTableTreeItemDelegate(object):
         value = ''
         num_lines = self.cu.GetNumLineEntries()
         summary = '%u line entries' % (num_lines)
-        return { '#0' : name,
-                 'value': value, 
-                 'summary': summary,
-                 'children' : num_lines > 0,
-                 'tree-item-delegate' : self }
+        return {'#0': name,
+                'value': value,
+                'summary': summary,
+                'children': num_lines > 0,
+                'tree-item-delegate': self}
 
     def get_child_item_dictionaries(self):
         item_dicts = list()
         num_lines = self.cu.GetNumLineEntries()
         for i in range(num_lines):
             line_entry = self.cu.GetLineEntryAtIndex(i)
-            item_delegate = LineEntryTreeItemDelegate(self.target, line_entry, i)
+            item_delegate = LineEntryTreeItemDelegate(
+                self.target, line_entry, i)
             item_dicts.append(item_delegate.get_item_dictionary())
         return item_dicts
 
+
 class LineEntryTreeItemDelegate(object):
+
     def __init__(self, target, line_entry, index):
         self.target = target
         self.line_entry = line_entry
@@ -314,18 +351,21 @@ class LineEntryTreeItemDelegate(object):
             value = '0x%16.16x' % (load_addr)
         else:
             value = '0x%16.16x *' % (address.file_addr)
-        summary = self.line_entry.GetFileSpec().fullpath + ':' + str(self.line_entry.line)
-        return { '#0' : name,
-                 'value': value, 
-                 'summary': summary,
-                 'children' : False,
-                 'tree-item-delegate' : self }
+        summary = self.line_entry.GetFileSpec().fullpath + ':' + \
+            str(self.line_entry.line)
+        return {'#0': name,
+                'value': value,
+                'summary': summary,
+                'children': False,
+                'tree-item-delegate': self}
 
     def get_child_item_dictionaries(self):
         item_dicts = list()
         return item_dicts
 
+
 class InstructionTreeItemDelegate(object):
+
     def __init__(self, target, instr):
         self.target = target
         self.instr = instr
@@ -337,15 +377,18 @@ class InstructionTreeItemDelegate(object
             name = '0x%16.16x' % (load_addr)
         else:
             name = '0x%16.16x *' % (address.file_addr)
-        value = self.instr.GetMnemonic(self.target) + ' ' + self.instr.GetOperands(self.target)
+        value = self.instr.GetMnemonic(
+            self.target) + ' ' + self.instr.GetOperands(self.target)
         summary = self.instr.GetComment(self.target)
-        return { '#0' : name,
-                 'value': value, 
-                 'summary': summary,
-                 'children' : False,
-                 'tree-item-delegate' : self }
+        return {'#0': name,
+                'value': value,
+                'summary': summary,
+                'children': False,
+                'tree-item-delegate': self}
+
 
 class ModuleSymbolsTreeItemDelegate(object):
+
     def __init__(self, target, module):
         self.target = target
         self.module = module
@@ -354,22 +397,25 @@ class ModuleSymbolsTreeItemDelegate(obje
         name = 'symbols'
         value = ''
         summary = '%u symbols' % (self.module.GetNumSymbols())
-        return { '#0' : name,
-                 'value': value, 
-                 'summary': summary,
-                 'children' : True,
-                 'tree-item-delegate' : self }
+        return {'#0': name,
+                'value': value,
+                'summary': summary,
+                'children': True,
+                'tree-item-delegate': self}
 
     def get_child_item_dictionaries(self):
         item_dicts = list()
         num_symbols = self.module.GetNumSymbols()
         for i in range(num_symbols):
             symbol = self.module.GetSymbolAtIndex(i)
-            image_item_delegate = SymbolTreeItemDelegate(self.target, symbol, i)
+            image_item_delegate = SymbolTreeItemDelegate(
+                self.target, symbol, i)
             item_dicts.append(image_item_delegate.get_item_dictionary())
         return item_dicts
 
+
 class SymbolTreeItemDelegate(object):
+
     def __init__(self, target, symbol, index):
         self.target = target
         self.symbol = symbol
@@ -384,20 +430,19 @@ class SymbolTreeItemDelegate(object):
         else:
             value = '0x%16.16x *' % (address.file_addr)
         summary = self.symbol.name
-        return { '#0' : name,
-                 'value': value, 
-                 'summary': summary,
-                 'children' : False,
-                 'tree-item-delegate' : self }
+        return {'#0': name,
+                'value': value,
+                'summary': summary,
+                'children': False,
+                'tree-item-delegate': self}
 
     def get_child_item_dictionaries(self):
         item_dicts = list()
         return item_dicts
 
 
-         
 class DelegateTree(ttk.Frame):
-     
+
     def __init__(self, column_dicts, delegate, title, name):
         ttk.Frame.__init__(self, name=name)
         self.pack(expand=Y, fill=BOTH)
@@ -409,36 +454,42 @@ class DelegateTree(ttk.Frame):
         frame.pack(side=TOP, fill=BOTH, expand=Y)
         self._create_treeview(frame)
         self._populate_root()
-                     
+
     def _create_treeview(self, parent):
         frame = ttk.Frame(parent)
         frame.pack(side=TOP, fill=BOTH, expand=Y)
-         
+
         column_ids = list()
-        for i in range(1,len(self.columns_dicts)):
+        for i in range(1, len(self.columns_dicts)):
             column_ids.append(self.columns_dicts[i]['id'])
         # create the tree and scrollbars
         self.tree = ttk.Treeview(columns=column_ids)
-         
-        scroll_bar_v = ttk.Scrollbar(orient=VERTICAL, command= self.tree.yview)
-        scroll_bar_h = ttk.Scrollbar(orient=HORIZONTAL, command= self.tree.xview)
+
+        scroll_bar_v = ttk.Scrollbar(orient=VERTICAL, command=self.tree.yview)
+        scroll_bar_h = ttk.Scrollbar(
+            orient=HORIZONTAL, command=self.tree.xview)
         self.tree['yscroll'] = scroll_bar_v.set
         self.tree['xscroll'] = scroll_bar_h.set
-         
+
         # setup column headings and columns properties
         for columns_dict in self.columns_dicts:
-            self.tree.heading(columns_dict['id'], text=columns_dict['text'], anchor=columns_dict['anchor'])
-            self.tree.column(columns_dict['id'], stretch=columns_dict['stretch'])
-         
+            self.tree.heading(
+                columns_dict['id'],
+                text=columns_dict['text'],
+                anchor=columns_dict['anchor'])
+            self.tree.column(
+                columns_dict['id'],
+                stretch=columns_dict['stretch'])
+
         # add tree and scrollbars to frame
         self.tree.grid(in_=frame, row=0, column=0, sticky=NSEW)
         scroll_bar_v.grid(in_=frame, row=0, column=1, sticky=NS)
         scroll_bar_h.grid(in_=frame, row=1, column=0, sticky=EW)
-         
+
         # set frame resizing priorities
         frame.rowconfigure(0, weight=1)
         frame.columnconfigure(0, weight=1)
-         
+
         # action to perform when a node is expanded
         self.tree.bind('<<TreeviewOpen>>', self._update_tree)
 
@@ -453,22 +504,22 @@ class DelegateTree(ttk.Frame):
                     first = False
                 else:
                     values.append(item_dict[columns_dict['id']])
-            item_id = self.tree.insert (parent_id, # root item has an empty name
-                                        END, 
-                                        text=name, 
-                                        values=values)
+            item_id = self.tree.insert(parent_id,  # root item has an empty name
+                                       END,
+                                       text=name,
+                                       values=values)
             self.item_id_to_item_dict[item_id] = item_dict
             if item_dict['children']:
                 self.tree.insert(item_id, END, text='dummy')
-        
+
     def _populate_root(self):
         # use current directory as root node
         self.insert_items('', self.delegate.get_child_item_dictionaries())
-    
+
     def _update_tree(self, event):
         # user expanded a node - build the related directory
-        item_id = self.tree.focus()      # the id of the expanded node        
-        children = self.tree.get_children (item_id)
+        item_id = self.tree.focus()      # the id of the expanded node
+        children = self.tree.get_children(item_id)
         if len(children):
             first_child = children[0]
             # if the node only has a 'dummy' child, remove it and
@@ -477,12 +528,15 @@ class DelegateTree(ttk.Frame):
             if self.tree.item(first_child, option='text') == 'dummy':
                 self.tree.delete(first_child)
                 item_dict = self.item_id_to_item_dict[item_id]
-                item_dicts = item_dict['tree-item-delegate'].get_child_item_dictionaries()
+                item_dicts = item_dict[
+                    'tree-item-delegate'].get_child_item_dictionaries()
                 self.insert_items(item_id, item_dicts)
 
+
 @lldb.command("tk-variables")
 def tk_variable_display(debugger, command, result, dict):
-    sys.argv = ['tk-variables'] # needed for tree creation in TK library as it uses sys.argv...
+    # needed for tree creation in TK library as it uses sys.argv...
+    sys.argv = ['tk-variables']
     target = debugger.GetSelectedTarget()
     if not target:
         print >>result, "invalid target"
@@ -501,16 +555,22 @@ def tk_variable_display(debugger, comman
         return
     # Parse command line args
     command_args = shlex.split(command)
-    column_dicts = [{ 'id' : '#0'      , 'text' : 'Name'   , 'anchor' : W , 'stretch' : 0 },
-                    { 'id' : 'typename', 'text' : 'Type'   , 'anchor' : W , 'stretch' : 0 },
-                    { 'id' : 'value'   , 'text' : 'Value'  , 'anchor' : W , 'stretch' : 0 },
-                    { 'id' : 'summary' , 'text' : 'Summary', 'anchor' : W , 'stretch' : 1 }]
-    tree = DelegateTree(column_dicts, FrameTreeItemDelegate(frame), 'Variables', 'lldb-tk-variables')
+    column_dicts = [{'id': '#0', 'text': 'Name', 'anchor': W, 'stretch': 0},
+                    {'id': 'typename', 'text': 'Type', 'anchor': W, 'stretch': 0},
+                    {'id': 'value', 'text': 'Value', 'anchor': W, 'stretch': 0},
+                    {'id': 'summary', 'text': 'Summary', 'anchor': W, 'stretch': 1}]
+    tree = DelegateTree(
+        column_dicts,
+        FrameTreeItemDelegate(frame),
+        'Variables',
+        'lldb-tk-variables')
     tree.mainloop()
 
+
 @lldb.command("tk-process")
 def tk_process_display(debugger, command, result, dict):
-    sys.argv = ['tk-process'] # needed for tree creation in TK library as it uses sys.argv...
+    # needed for tree creation in TK library as it uses sys.argv...
+    sys.argv = ['tk-process']
     target = debugger.GetSelectedTarget()
     if not target:
         print >>result, "invalid target"
@@ -520,25 +580,34 @@ def tk_process_display(debugger, command
         print >>result, "invalid process"
         return
     # Parse command line args
-    columnd_dicts = [{ 'id' : '#0'     , 'text' : 'Name'   , 'anchor' : W , 'stretch' : 0 },
-                     { 'id' : 'value'  , 'text' : 'Value'  , 'anchor' : W , 'stretch' : 0 },
-                     { 'id' : 'summary', 'text' : 'Summary', 'anchor' : W , 'stretch' : 1 }];
+    columnd_dicts = [{'id': '#0', 'text': 'Name', 'anchor': W, 'stretch': 0},
+                     {'id': 'value', 'text': 'Value', 'anchor': W, 'stretch': 0},
+                     {'id': 'summary', 'text': 'Summary', 'anchor': W, 'stretch': 1}]
     command_args = shlex.split(command)
-    tree = DelegateTree(columnd_dicts, ProcessTreeItemDelegate(process), 'Process', 'lldb-tk-process')
+    tree = DelegateTree(
+        columnd_dicts,
+        ProcessTreeItemDelegate(process),
+        'Process',
+        'lldb-tk-process')
     tree.mainloop()
 
+
 @lldb.command("tk-target")
 def tk_target_display(debugger, command, result, dict):
-    sys.argv = ['tk-target'] # needed for tree creation in TK library as it uses sys.argv...
+    # needed for tree creation in TK library as it uses sys.argv...
+    sys.argv = ['tk-target']
     target = debugger.GetSelectedTarget()
     if not target:
         print >>result, "invalid target"
         return
     # Parse command line args
-    columnd_dicts = [{ 'id' : '#0'     , 'text' : 'Name'   , 'anchor' : W , 'stretch' : 0 },
-                     { 'id' : 'value'  , 'text' : 'Value'  , 'anchor' : W , 'stretch' : 0 },
-                     { 'id' : 'summary', 'text' : 'Summary', 'anchor' : W , 'stretch' : 1 }];
+    columnd_dicts = [{'id': '#0', 'text': 'Name', 'anchor': W, 'stretch': 0},
+                     {'id': 'value', 'text': 'Value', 'anchor': W, 'stretch': 0},
+                     {'id': 'summary', 'text': 'Summary', 'anchor': W, 'stretch': 1}]
     command_args = shlex.split(command)
-    tree = DelegateTree(columnd_dicts, TargetTreeItemDelegate(target), 'Target', 'lldb-tk-target')
+    tree = DelegateTree(
+        columnd_dicts,
+        TargetTreeItemDelegate(target),
+        'Target',
+        'lldb-tk-target')
     tree.mainloop()
-

Modified: lldb/trunk/examples/python/mach_o.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/mach_o.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/examples/python/mach_o.py (original)
+++ lldb/trunk/examples/python/mach_o.py Tue Sep  6 15:57:50 2016
@@ -12,169 +12,170 @@ import sys
 import uuid
 
 # Mach header "magic" constants
-MH_MAGIC                    = 0xfeedface
-MH_CIGAM                    = 0xcefaedfe
-MH_MAGIC_64                 = 0xfeedfacf
-MH_CIGAM_64                 = 0xcffaedfe
-FAT_MAGIC                   = 0xcafebabe
-FAT_CIGAM                   = 0xbebafeca
+MH_MAGIC = 0xfeedface
+MH_CIGAM = 0xcefaedfe
+MH_MAGIC_64 = 0xfeedfacf
+MH_CIGAM_64 = 0xcffaedfe
+FAT_MAGIC = 0xcafebabe
+FAT_CIGAM = 0xbebafeca
 
 # Mach haeder "filetype" constants
-MH_OBJECT                   = 0x00000001
-MH_EXECUTE                  = 0x00000002
-MH_FVMLIB                   = 0x00000003
-MH_CORE                     = 0x00000004
-MH_PRELOAD                  = 0x00000005
-MH_DYLIB                    = 0x00000006
-MH_DYLINKER                 = 0x00000007
-MH_BUNDLE                   = 0x00000008
-MH_DYLIB_STUB               = 0x00000009
-MH_DSYM                     = 0x0000000a
-MH_KEXT_BUNDLE              = 0x0000000b
+MH_OBJECT = 0x00000001
+MH_EXECUTE = 0x00000002
+MH_FVMLIB = 0x00000003
+MH_CORE = 0x00000004
+MH_PRELOAD = 0x00000005
+MH_DYLIB = 0x00000006
+MH_DYLINKER = 0x00000007
+MH_BUNDLE = 0x00000008
+MH_DYLIB_STUB = 0x00000009
+MH_DSYM = 0x0000000a
+MH_KEXT_BUNDLE = 0x0000000b
 
 # Mach haeder "flag" constant bits
-MH_NOUNDEFS                 = 0x00000001
-MH_INCRLINK                 = 0x00000002
-MH_DYLDLINK                 = 0x00000004
-MH_BINDATLOAD               = 0x00000008
-MH_PREBOUND                 = 0x00000010
-MH_SPLIT_SEGS               = 0x00000020
-MH_LAZY_INIT                = 0x00000040
-MH_TWOLEVEL                 = 0x00000080
-MH_FORCE_FLAT               = 0x00000100
-MH_NOMULTIDEFS              = 0x00000200
-MH_NOFIXPREBINDING          = 0x00000400
-MH_PREBINDABLE              = 0x00000800
-MH_ALLMODSBOUND             = 0x00001000
-MH_SUBSECTIONS_VIA_SYMBOLS  = 0x00002000
-MH_CANONICAL                = 0x00004000
-MH_WEAK_DEFINES             = 0x00008000
-MH_BINDS_TO_WEAK            = 0x00010000
-MH_ALLOW_STACK_EXECUTION    = 0x00020000
-MH_ROOT_SAFE                = 0x00040000
-MH_SETUID_SAFE              = 0x00080000
-MH_NO_REEXPORTED_DYLIBS     = 0x00100000
-MH_PIE                      = 0x00200000
-MH_DEAD_STRIPPABLE_DYLIB    = 0x00400000
-MH_HAS_TLV_DESCRIPTORS      = 0x00800000
-MH_NO_HEAP_EXECUTION        = 0x01000000
+MH_NOUNDEFS = 0x00000001
+MH_INCRLINK = 0x00000002
+MH_DYLDLINK = 0x00000004
+MH_BINDATLOAD = 0x00000008
+MH_PREBOUND = 0x00000010
+MH_SPLIT_SEGS = 0x00000020
+MH_LAZY_INIT = 0x00000040
+MH_TWOLEVEL = 0x00000080
+MH_FORCE_FLAT = 0x00000100
+MH_NOMULTIDEFS = 0x00000200
+MH_NOFIXPREBINDING = 0x00000400
+MH_PREBINDABLE = 0x00000800
+MH_ALLMODSBOUND = 0x00001000
+MH_SUBSECTIONS_VIA_SYMBOLS = 0x00002000
+MH_CANONICAL = 0x00004000
+MH_WEAK_DEFINES = 0x00008000
+MH_BINDS_TO_WEAK = 0x00010000
+MH_ALLOW_STACK_EXECUTION = 0x00020000
+MH_ROOT_SAFE = 0x00040000
+MH_SETUID_SAFE = 0x00080000
+MH_NO_REEXPORTED_DYLIBS = 0x00100000
+MH_PIE = 0x00200000
+MH_DEAD_STRIPPABLE_DYLIB = 0x00400000
+MH_HAS_TLV_DESCRIPTORS = 0x00800000
+MH_NO_HEAP_EXECUTION = 0x01000000
 
 # Mach load command constants
-LC_REQ_DYLD                 = 0x80000000
-LC_SEGMENT                  = 0x00000001
-LC_SYMTAB                   = 0x00000002
-LC_SYMSEG                   = 0x00000003
-LC_THREAD                   = 0x00000004
-LC_UNIXTHREAD               = 0x00000005
-LC_LOADFVMLIB               = 0x00000006
-LC_IDFVMLIB                 = 0x00000007
-LC_IDENT                    = 0x00000008
-LC_FVMFILE                  = 0x00000009
-LC_PREPAGE                  = 0x0000000a
-LC_DYSYMTAB                 = 0x0000000b
-LC_LOAD_DYLIB               = 0x0000000c
-LC_ID_DYLIB                 = 0x0000000d
-LC_LOAD_DYLINKER            = 0x0000000e
-LC_ID_DYLINKER              = 0x0000000f
-LC_PREBOUND_DYLIB           = 0x00000010
-LC_ROUTINES                 = 0x00000011
-LC_SUB_FRAMEWORK            = 0x00000012
-LC_SUB_UMBRELLA             = 0x00000013
-LC_SUB_CLIENT               = 0x00000014
-LC_SUB_LIBRARY              = 0x00000015
-LC_TWOLEVEL_HINTS           = 0x00000016
-LC_PREBIND_CKSUM            = 0x00000017
-LC_LOAD_WEAK_DYLIB          = 0x00000018 | LC_REQ_DYLD
-LC_SEGMENT_64               = 0x00000019
-LC_ROUTINES_64              = 0x0000001a
-LC_UUID                     = 0x0000001b
-LC_RPATH                    = 0x0000001c | LC_REQ_DYLD
-LC_CODE_SIGNATURE           = 0x0000001d
-LC_SEGMENT_SPLIT_INFO       = 0x0000001e
-LC_REEXPORT_DYLIB           = 0x0000001f | LC_REQ_DYLD
-LC_LAZY_LOAD_DYLIB          = 0x00000020
-LC_ENCRYPTION_INFO          = 0x00000021
-LC_DYLD_INFO                = 0x00000022
-LC_DYLD_INFO_ONLY           = 0x00000022 | LC_REQ_DYLD
-LC_LOAD_UPWARD_DYLIB        = 0x00000023 | LC_REQ_DYLD
-LC_VERSION_MIN_MACOSX       = 0x00000024
-LC_VERSION_MIN_IPHONEOS     = 0x00000025
-LC_FUNCTION_STARTS          = 0x00000026
-LC_DYLD_ENVIRONMENT         = 0x00000027
+LC_REQ_DYLD = 0x80000000
+LC_SEGMENT = 0x00000001
+LC_SYMTAB = 0x00000002
+LC_SYMSEG = 0x00000003
+LC_THREAD = 0x00000004
+LC_UNIXTHREAD = 0x00000005
+LC_LOADFVMLIB = 0x00000006
+LC_IDFVMLIB = 0x00000007
+LC_IDENT = 0x00000008
+LC_FVMFILE = 0x00000009
+LC_PREPAGE = 0x0000000a
+LC_DYSYMTAB = 0x0000000b
+LC_LOAD_DYLIB = 0x0000000c
+LC_ID_DYLIB = 0x0000000d
+LC_LOAD_DYLINKER = 0x0000000e
+LC_ID_DYLINKER = 0x0000000f
+LC_PREBOUND_DYLIB = 0x00000010
+LC_ROUTINES = 0x00000011
+LC_SUB_FRAMEWORK = 0x00000012
+LC_SUB_UMBRELLA = 0x00000013
+LC_SUB_CLIENT = 0x00000014
+LC_SUB_LIBRARY = 0x00000015
+LC_TWOLEVEL_HINTS = 0x00000016
+LC_PREBIND_CKSUM = 0x00000017
+LC_LOAD_WEAK_DYLIB = 0x00000018 | LC_REQ_DYLD
+LC_SEGMENT_64 = 0x00000019
+LC_ROUTINES_64 = 0x0000001a
+LC_UUID = 0x0000001b
+LC_RPATH = 0x0000001c | LC_REQ_DYLD
+LC_CODE_SIGNATURE = 0x0000001d
+LC_SEGMENT_SPLIT_INFO = 0x0000001e
+LC_REEXPORT_DYLIB = 0x0000001f | LC_REQ_DYLD
+LC_LAZY_LOAD_DYLIB = 0x00000020
+LC_ENCRYPTION_INFO = 0x00000021
+LC_DYLD_INFO = 0x00000022
+LC_DYLD_INFO_ONLY = 0x00000022 | LC_REQ_DYLD
+LC_LOAD_UPWARD_DYLIB = 0x00000023 | LC_REQ_DYLD
+LC_VERSION_MIN_MACOSX = 0x00000024
+LC_VERSION_MIN_IPHONEOS = 0x00000025
+LC_FUNCTION_STARTS = 0x00000026
+LC_DYLD_ENVIRONMENT = 0x00000027
 
 # Mach CPU constants
-CPU_ARCH_MASK               = 0xff000000
-CPU_ARCH_ABI64              = 0x01000000
-CPU_TYPE_ANY                = 0xffffffff
-CPU_TYPE_VAX                = 1
-CPU_TYPE_MC680x0            = 6
-CPU_TYPE_I386               = 7
-CPU_TYPE_X86_64             = CPU_TYPE_I386 | CPU_ARCH_ABI64
-CPU_TYPE_MIPS               = 8
-CPU_TYPE_MC98000            = 10
-CPU_TYPE_HPPA               = 11
-CPU_TYPE_ARM                = 12
-CPU_TYPE_MC88000            = 13
-CPU_TYPE_SPARC              = 14
-CPU_TYPE_I860               = 15
-CPU_TYPE_ALPHA              = 16
-CPU_TYPE_POWERPC            = 18
-CPU_TYPE_POWERPC64          = CPU_TYPE_POWERPC | CPU_ARCH_ABI64
+CPU_ARCH_MASK = 0xff000000
+CPU_ARCH_ABI64 = 0x01000000
+CPU_TYPE_ANY = 0xffffffff
+CPU_TYPE_VAX = 1
+CPU_TYPE_MC680x0 = 6
+CPU_TYPE_I386 = 7
+CPU_TYPE_X86_64 = CPU_TYPE_I386 | CPU_ARCH_ABI64
+CPU_TYPE_MIPS = 8
+CPU_TYPE_MC98000 = 10
+CPU_TYPE_HPPA = 11
+CPU_TYPE_ARM = 12
+CPU_TYPE_MC88000 = 13
+CPU_TYPE_SPARC = 14
+CPU_TYPE_I860 = 15
+CPU_TYPE_ALPHA = 16
+CPU_TYPE_POWERPC = 18
+CPU_TYPE_POWERPC64 = CPU_TYPE_POWERPC | CPU_ARCH_ABI64
 
 # VM protection constants
-VM_PROT_READ    = 1
-VM_PROT_WRITE   = 2
+VM_PROT_READ = 1
+VM_PROT_WRITE = 2
 VM_PROT_EXECUTE = 4
 
 # VM protection constants
-N_STAB          = 0xe0
-N_PEXT          = 0x10
-N_TYPE          = 0x0e
-N_EXT           = 0x01
+N_STAB = 0xe0
+N_PEXT = 0x10
+N_TYPE = 0x0e
+N_EXT = 0x01
 
 # Values for nlist N_TYPE bits of the "Mach.NList.type" field.
-N_UNDF          = 0x0
-N_ABS           = 0x2
-N_SECT          = 0xe
-N_PBUD          = 0xc
-N_INDR          = 0xa
+N_UNDF = 0x0
+N_ABS = 0x2
+N_SECT = 0xe
+N_PBUD = 0xc
+N_INDR = 0xa
 
 # Section indexes for the "Mach.NList.sect_idx" fields
-NO_SECT         = 0
-MAX_SECT        = 255
+NO_SECT = 0
+MAX_SECT = 255
 
 # Stab defines
-N_GSYM          = 0x20
-N_FNAME         = 0x22
-N_FUN           = 0x24
-N_STSYM         = 0x26
-N_LCSYM         = 0x28
-N_BNSYM         = 0x2e
-N_OPT           = 0x3c
-N_RSYM          = 0x40
-N_SLINE         = 0x44
-N_ENSYM         = 0x4e
-N_SSYM          = 0x60
-N_SO            = 0x64
-N_OSO           = 0x66
-N_LSYM          = 0x80
-N_BINCL         = 0x82
-N_SOL           = 0x84
-N_PARAMS        = 0x86
-N_VERSION       = 0x88
-N_OLEVEL        = 0x8A
-N_PSYM          = 0xa0
-N_EINCL         = 0xa2
-N_ENTRY         = 0xa4
-N_LBRAC         = 0xc0
-N_EXCL          = 0xc2
-N_RBRAC         = 0xe0
-N_BCOMM         = 0xe2
-N_ECOMM         = 0xe4
-N_ECOML         = 0xe8
-N_LENG          = 0xfe
+N_GSYM = 0x20
+N_FNAME = 0x22
+N_FUN = 0x24
+N_STSYM = 0x26
+N_LCSYM = 0x28
+N_BNSYM = 0x2e
+N_OPT = 0x3c
+N_RSYM = 0x40
+N_SLINE = 0x44
+N_ENSYM = 0x4e
+N_SSYM = 0x60
+N_SO = 0x64
+N_OSO = 0x66
+N_LSYM = 0x80
+N_BINCL = 0x82
+N_SOL = 0x84
+N_PARAMS = 0x86
+N_VERSION = 0x88
+N_OLEVEL = 0x8A
+N_PSYM = 0xa0
+N_EINCL = 0xa2
+N_ENTRY = 0xa4
+N_LBRAC = 0xc0
+N_EXCL = 0xc2
+N_RBRAC = 0xe0
+N_BCOMM = 0xe2
+N_ECOMM = 0xe4
+N_ECOML = 0xe8
+N_LENG = 0xfe
+
+vm_prot_names = ['---', 'r--', '-w-', 'rw-', '--x', 'r-x', '-wx', 'rwx']
 
-vm_prot_names = [ '---', 'r--', '-w-', 'rw-', '--x', 'r-x', '-wx', 'rwx' ]
 
 def dump_memory(base_addr, data, hex_bytes_len, num_per_line):
     hex_bytes = data.encode('hex')
@@ -184,14 +185,14 @@ def dump_memory(base_addr, data, hex_byt
     ascii_str = ''
     i = 0
     while i < hex_bytes_len:
-        if ((i/2) % num_per_line) == 0:
+        if ((i / 2) % num_per_line) == 0:
             if i > 0:
                 print ' %s' % (ascii_str)
                 ascii_str = ''
-            print '0x%8.8x:' % (addr+i),
-        hex_byte = hex_bytes[i:i+2]
+            print '0x%8.8x:' % (addr + i),
+        hex_byte = hex_bytes[i:i + 2]
         print hex_byte,
-        int_byte = int (hex_byte, 16)
+        int_byte = int(hex_byte, 16)
         ascii_char = '%c' % (int_byte)
         if int_byte >= 32 and int_byte < 127:
             ascii_str += ascii_char
@@ -199,167 +200,169 @@ def dump_memory(base_addr, data, hex_byt
             ascii_str += '.'
         i = i + 2
     if ascii_str:
-        if (i/2) % num_per_line:
-            padding = num_per_line - ((i/2) % num_per_line)
+        if (i / 2) % num_per_line:
+            padding = num_per_line - ((i / 2) % num_per_line)
         else:
             padding = 0
-        print '%*s%s' % (padding*3+1,'',ascii_str)
+        print '%*s%s' % (padding * 3 + 1, '', ascii_str)
     print
-        
-    
+
+
 class TerminalColors:
     '''Simple terminal colors class'''
-    def __init__(self, enabled = True):
+
+    def __init__(self, enabled=True):
         # TODO: discover terminal type from "file" and disable if
         # it can't handle the color codes
         self.enabled = enabled
-    
+
     def reset(self):
         '''Reset all terminal colors and formatting.'''
         if self.enabled:
-            return "\x1b[0m";
+            return "\x1b[0m"
         return ''
-    
-    def bold(self, on = True):
+
+    def bold(self, on=True):
         '''Enable or disable bold depending on the "on" parameter.'''
         if self.enabled:
             if on:
-                return "\x1b[1m";
+                return "\x1b[1m"
             else:
-                return "\x1b[22m";
+                return "\x1b[22m"
         return ''
-    
-    def italics(self, on = True):
+
+    def italics(self, on=True):
         '''Enable or disable italics depending on the "on" parameter.'''
         if self.enabled:
             if on:
-                return "\x1b[3m";
+                return "\x1b[3m"
             else:
-                return "\x1b[23m";
+                return "\x1b[23m"
         return ''
-    
-    def underline(self, on = True):
+
+    def underline(self, on=True):
         '''Enable or disable underline depending on the "on" parameter.'''
         if self.enabled:
             if on:
-                return "\x1b[4m";
+                return "\x1b[4m"
             else:
-                return "\x1b[24m";
+                return "\x1b[24m"
         return ''
-    
-    def inverse(self, on = True):
+
+    def inverse(self, on=True):
         '''Enable or disable inverse depending on the "on" parameter.'''
         if self.enabled:
             if on:
-                return "\x1b[7m";
+                return "\x1b[7m"
             else:
-                return "\x1b[27m";
+                return "\x1b[27m"
         return ''
-    
-    def strike(self, on = True):
+
+    def strike(self, on=True):
         '''Enable or disable strike through depending on the "on" parameter.'''
         if self.enabled:
             if on:
-                return "\x1b[9m";
-            else:                
-                return "\x1b[29m";
+                return "\x1b[9m"
+            else:
+                return "\x1b[29m"
         return ''
-                     
-    def black(self, fg = True):        
-        '''Set the foreground or background color to black. 
+
+    def black(self, fg=True):
+        '''Set the foreground or background color to black.
         The foreground color will be set if "fg" tests True. The background color will be set if "fg" tests False.'''
-        if self.enabled:         
-            if fg:               
-                return "\x1b[30m";
+        if self.enabled:
+            if fg:
+                return "\x1b[30m"
             else:
-                return "\x1b[40m";
+                return "\x1b[40m"
         return ''
-    
-    def red(self, fg = True):          
-        '''Set the foreground or background color to red. 
+
+    def red(self, fg=True):
+        '''Set the foreground or background color to red.
         The foreground color will be set if "fg" tests True. The background color will be set if "fg" tests False.'''
-        if self.enabled:         
-            if fg:               
-                return "\x1b[31m";
-            else:                
-                return "\x1b[41m";
+        if self.enabled:
+            if fg:
+                return "\x1b[31m"
+            else:
+                return "\x1b[41m"
         return ''
-    
-    def green(self, fg = True):        
-        '''Set the foreground or background color to green. 
+
+    def green(self, fg=True):
+        '''Set the foreground or background color to green.
         The foreground color will be set if "fg" tests True. The background color will be set if "fg" tests False.'''
-        if self.enabled:         
-            if fg:               
-                return "\x1b[32m";
-            else:                
-                return "\x1b[42m";
+        if self.enabled:
+            if fg:
+                return "\x1b[32m"
+            else:
+                return "\x1b[42m"
         return ''
-    
-    def yellow(self, fg = True):       
-        '''Set the foreground or background color to yellow. 
+
+    def yellow(self, fg=True):
+        '''Set the foreground or background color to yellow.
         The foreground color will be set if "fg" tests True. The background color will be set if "fg" tests False.'''
-        if self.enabled:         
-            if fg:               
-                return "\x1b[43m";
-            else:                
-                return "\x1b[33m";
+        if self.enabled:
+            if fg:
+                return "\x1b[43m"
+            else:
+                return "\x1b[33m"
         return ''
-    
-    def blue(self, fg = True):         
-        '''Set the foreground or background color to blue. 
+
+    def blue(self, fg=True):
+        '''Set the foreground or background color to blue.
         The foreground color will be set if "fg" tests True. The background color will be set if "fg" tests False.'''
-        if self.enabled:         
-            if fg:               
-                return "\x1b[34m";
-            else:                
-                return "\x1b[44m";
+        if self.enabled:
+            if fg:
+                return "\x1b[34m"
+            else:
+                return "\x1b[44m"
         return ''
-    
-    def magenta(self, fg = True):      
-        '''Set the foreground or background color to magenta. 
+
+    def magenta(self, fg=True):
+        '''Set the foreground or background color to magenta.
         The foreground color will be set if "fg" tests True. The background color will be set if "fg" tests False.'''
-        if self.enabled:         
-            if fg:               
-                return "\x1b[35m";
-            else:                
-                return "\x1b[45m";
+        if self.enabled:
+            if fg:
+                return "\x1b[35m"
+            else:
+                return "\x1b[45m"
         return ''
-    
-    def cyan(self, fg = True):         
-        '''Set the foreground or background color to cyan. 
+
+    def cyan(self, fg=True):
+        '''Set the foreground or background color to cyan.
         The foreground color will be set if "fg" tests True. The background color will be set if "fg" tests False.'''
-        if self.enabled:         
-            if fg:               
-                return "\x1b[36m";
-            else:                
-                return "\x1b[46m";
+        if self.enabled:
+            if fg:
+                return "\x1b[36m"
+            else:
+                return "\x1b[46m"
         return ''
-    
-    def white(self, fg = True):        
-        '''Set the foreground or background color to white. 
+
+    def white(self, fg=True):
+        '''Set the foreground or background color to white.
         The foreground color will be set if "fg" tests True. The background color will be set if "fg" tests False.'''
-        if self.enabled:         
-            if fg:               
-                return "\x1b[37m";
-            else:                
-                return "\x1b[47m";
+        if self.enabled:
+            if fg:
+                return "\x1b[37m"
+            else:
+                return "\x1b[47m"
         return ''
-    
-    def default(self, fg = True):      
-        '''Set the foreground or background color to the default. 
+
+    def default(self, fg=True):
+        '''Set the foreground or background color to the default.
         The foreground color will be set if "fg" tests True. The background color will be set if "fg" tests False.'''
-        if self.enabled:         
-            if fg:               
-                return "\x1b[39m";
-            else:                
-                return "\x1b[49m";
+        if self.enabled:
+            if fg:
+                return "\x1b[39m"
+            else:
+                return "\x1b[49m"
         return ''
 
+
 def swap_unpack_char():
     """Returns the unpack prefix that will for non-native endian-ness."""
     if struct.pack('H', 1).startswith("\x00"):
         return '<'
-    return '>'    
+    return '>'
 
 
 def dump_hex_bytes(addr, s, bytes_per_line=16):
@@ -374,6 +377,7 @@ def dump_hex_bytes(addr, s, bytes_per_li
         i += 1
     print line
 
+
 def dump_hex_byte_string_diff(addr, a, b, bytes_per_line=16):
     i = 0
     line = ''
@@ -383,7 +387,7 @@ def dump_hex_byte_string_diff(addr, a, b
         max_len = b_len
     else:
         max_len = a_len
-    tty_colors = TerminalColors (True)
+    tty_colors = TerminalColors(True)
     for i in range(max_len):
         ch = None
         if i < a_len:
@@ -402,89 +406,94 @@ def dump_hex_byte_string_diff(addr, a, b
             if line:
                 print line
             line = '%#8.8x: ' % (addr + i)
-        if mismatch: line += tty_colors.red()
+        if mismatch:
+            line += tty_colors.red()
         line += "%02X " % ord(ch)
-        if mismatch: line += tty_colors.default()
+        if mismatch:
+            line += tty_colors.default()
         i += 1
-    
+
     print line
 
+
 class Mach:
     """Class that does everything mach-o related"""
-    
+
     class Arch:
         """Class that implements mach-o architectures"""
 
-        def __init__(self, c=0, s=0):   
-            self.cpu=c
-            self.sub=s
+        def __init__(self, c=0, s=0):
+            self.cpu = c
+            self.sub = s
 
         def set_cpu_type(self, c):
-            self.cpu=c
+            self.cpu = c
+
         def set_cpu_subtype(self, s):
-            self.sub=s
+            self.sub = s
+
         def set_arch(self, c, s):
-            self.cpu=c
-            self.sub=s
+            self.cpu = c
+            self.sub = s
+
         def is_64_bit(self):
             return (self.cpu & CPU_ARCH_ABI64) != 0
 
         cpu_infos = [
-            [ "arm"         , CPU_TYPE_ARM       , CPU_TYPE_ANY ],
-            [ "arm"         , CPU_TYPE_ARM       , 0            ],
-            [ "armv4"       , CPU_TYPE_ARM       , 5            ],
-            [ "armv6"       , CPU_TYPE_ARM       , 6            ],
-            [ "armv5"       , CPU_TYPE_ARM       , 7            ],
-            [ "xscale"      , CPU_TYPE_ARM       , 8            ],
-            [ "armv7"       , CPU_TYPE_ARM       , 9            ],
-            [ "armv7f"      , CPU_TYPE_ARM       , 10           ],
-            [ "armv7s"      , CPU_TYPE_ARM       , 11           ],
-            [ "armv7k"      , CPU_TYPE_ARM       , 12           ],
-            [ "armv7m"      , CPU_TYPE_ARM       , 15           ],
-            [ "armv7em"     , CPU_TYPE_ARM       , 16           ],
-            [ "ppc"         , CPU_TYPE_POWERPC   , CPU_TYPE_ANY ],
-            [ "ppc"         , CPU_TYPE_POWERPC   , 0            ],
-            [ "ppc601"      , CPU_TYPE_POWERPC   , 1            ],
-            [ "ppc602"      , CPU_TYPE_POWERPC   , 2            ],
-            [ "ppc603"      , CPU_TYPE_POWERPC   , 3            ],
-            [ "ppc603e"     , CPU_TYPE_POWERPC   , 4            ],
-            [ "ppc603ev"    , CPU_TYPE_POWERPC   , 5            ],
-            [ "ppc604"      , CPU_TYPE_POWERPC   , 6            ],
-            [ "ppc604e"     , CPU_TYPE_POWERPC   , 7            ],
-            [ "ppc620"      , CPU_TYPE_POWERPC   , 8            ],
-            [ "ppc750"      , CPU_TYPE_POWERPC   , 9            ],
-            [ "ppc7400"     , CPU_TYPE_POWERPC   , 10           ],
-            [ "ppc7450"     , CPU_TYPE_POWERPC   , 11           ],
-            [ "ppc970"      , CPU_TYPE_POWERPC   , 100          ],
-            [ "ppc64"       , CPU_TYPE_POWERPC64 , 0            ],
-            [ "ppc970-64"   , CPU_TYPE_POWERPC64 , 100          ],
-            [ "i386"        , CPU_TYPE_I386      , 3            ],
-            [ "i486"        , CPU_TYPE_I386      , 4            ],
-            [ "i486sx"      , CPU_TYPE_I386      , 0x84         ],
-            [ "i386"        , CPU_TYPE_I386      , CPU_TYPE_ANY ],
-            [ "x86_64"      , CPU_TYPE_X86_64    , 3            ],
-            [ "x86_64"      , CPU_TYPE_X86_64    , CPU_TYPE_ANY ],
+            ["arm", CPU_TYPE_ARM, CPU_TYPE_ANY],
+            ["arm", CPU_TYPE_ARM, 0],
+            ["armv4", CPU_TYPE_ARM, 5],
+            ["armv6", CPU_TYPE_ARM, 6],
+            ["armv5", CPU_TYPE_ARM, 7],
+            ["xscale", CPU_TYPE_ARM, 8],
+            ["armv7", CPU_TYPE_ARM, 9],
+            ["armv7f", CPU_TYPE_ARM, 10],
+            ["armv7s", CPU_TYPE_ARM, 11],
+            ["armv7k", CPU_TYPE_ARM, 12],
+            ["armv7m", CPU_TYPE_ARM, 15],
+            ["armv7em", CPU_TYPE_ARM, 16],
+            ["ppc", CPU_TYPE_POWERPC, CPU_TYPE_ANY],
+            ["ppc", CPU_TYPE_POWERPC, 0],
+            ["ppc601", CPU_TYPE_POWERPC, 1],
+            ["ppc602", CPU_TYPE_POWERPC, 2],
+            ["ppc603", CPU_TYPE_POWERPC, 3],
+            ["ppc603e", CPU_TYPE_POWERPC, 4],
+            ["ppc603ev", CPU_TYPE_POWERPC, 5],
+            ["ppc604", CPU_TYPE_POWERPC, 6],
+            ["ppc604e", CPU_TYPE_POWERPC, 7],
+            ["ppc620", CPU_TYPE_POWERPC, 8],
+            ["ppc750", CPU_TYPE_POWERPC, 9],
+            ["ppc7400", CPU_TYPE_POWERPC, 10],
+            ["ppc7450", CPU_TYPE_POWERPC, 11],
+            ["ppc970", CPU_TYPE_POWERPC, 100],
+            ["ppc64", CPU_TYPE_POWERPC64, 0],
+            ["ppc970-64", CPU_TYPE_POWERPC64, 100],
+            ["i386", CPU_TYPE_I386, 3],
+            ["i486", CPU_TYPE_I386, 4],
+            ["i486sx", CPU_TYPE_I386, 0x84],
+            ["i386", CPU_TYPE_I386, CPU_TYPE_ANY],
+            ["x86_64", CPU_TYPE_X86_64, 3],
+            ["x86_64", CPU_TYPE_X86_64, CPU_TYPE_ANY],
         ]
 
         def __str__(self):
             for info in self.cpu_infos:
                 if self.cpu == info[1] and (self.sub & 0x00ffffff) == info[2]:
                     return info[0]
-            return "{0}.{1}".format(self.cpu,self.sub)
+            return "{0}.{1}".format(self.cpu, self.sub)
 
-    
     class Magic(dict_utils.Enum):
 
         enum = {
-            'MH_MAGIC'      : MH_MAGIC,
-            'MH_CIGAM'      : MH_CIGAM,
-            'MH_MAGIC_64'   : MH_MAGIC_64,
-            'MH_CIGAM_64'   : MH_CIGAM_64,
-            'FAT_MAGIC'     : FAT_MAGIC,
-            'FAT_CIGAM'     : FAT_CIGAM
+            'MH_MAGIC': MH_MAGIC,
+            'MH_CIGAM': MH_CIGAM,
+            'MH_MAGIC_64': MH_MAGIC_64,
+            'MH_CIGAM_64': MH_CIGAM_64,
+            'FAT_MAGIC': FAT_MAGIC,
+            'FAT_CIGAM': FAT_CIGAM
         }
 
-        def __init__(self, initial_value = 0):
+        def __init__(self, initial_value=0):
             dict_utils.Enum.__init__(self, initial_value, self.enum)
 
         def is_skinny_mach_file(self):
@@ -492,11 +501,11 @@ class Mach:
 
         def is_universal_mach_file(self):
             return self.value == FAT_MAGIC or self.value == FAT_CIGAM
-            
+
         def unpack(self, data):
             data.set_byte_order('native')
-            self.value = data.get_uint32();
-        
+            self.value = data.get_uint32()
+
         def get_byte_order(self):
             if self.value == MH_CIGAM or self.value == MH_CIGAM_64 or self.value == FAT_CIGAM:
                 return swap_unpack_char()
@@ -505,58 +514,59 @@ class Mach:
 
         def is_64_bit(self):
             return self.value == MH_MAGIC_64 or self.value == MH_CIGAM_64
-    
+
     def __init__(self):
         self.magic = Mach.Magic()
         self.content = None
         self.path = None
 
-    def extract (self, path, extractor):
-        self.path = path;
+    def extract(self, path, extractor):
+        self.path = path
         self.unpack(extractor)
-        
+
     def parse(self, path):
-        self.path = path;
+        self.path = path
         try:
             f = open(self.path)
             file_extractor = file_extract.FileExtract(f, '=')
             self.unpack(file_extractor)
-            #f.close()
-        except IOError as (errno, strerror):
+            # f.close()
+        except IOError as xxx_todo_changeme:
+            (errno, strerror) = xxx_todo_changeme.args
             print "I/O error({0}): {1}".format(errno, strerror)
         except ValueError:
             print "Could not convert data to an integer."
         except:
             print "Unexpected error:", sys.exc_info()[0]
             raise
-    
+
     def compare(self, rhs):
         self.content.compare(rhs.content)
-    
-    def dump(self, options = None):
+
+    def dump(self, options=None):
         self.content.dump(options)
 
-    def dump_header(self, dump_description = True, options = None):
+    def dump_header(self, dump_description=True, options=None):
         self.content.dump_header(dump_description, options)
 
-    def dump_load_commands(self, dump_description = True, options = None):
+    def dump_load_commands(self, dump_description=True, options=None):
         self.content.dump_load_commands(dump_description, options)
 
-    def dump_sections(self, dump_description = True, options = None):
+    def dump_sections(self, dump_description=True, options=None):
         self.content.dump_sections(dump_description, options)
 
     def dump_section_contents(self, options):
         self.content.dump_section_contents(options)
 
-    def dump_symtab(self, dump_description = True, options = None):
+    def dump_symtab(self, dump_description=True, options=None):
         self.content.dump_symtab(dump_description, options)
 
     def dump_symbol_names_matching_regex(self, regex, file=None):
         self.content.dump_symbol_names_matching_regex(regex, file)
-    
+
     def description(self):
         return self.content.description()
-    
+
     def unpack(self, data):
         self.magic.unpack(data)
         if self.magic.is_skinny_mach_file():
@@ -566,21 +576,21 @@ class Mach:
         else:
             self.content = None
 
-        if self.content != None:
+        if self.content is not None:
             self.content.unpack(data, self.magic)
 
     def is_valid(self):
-        return self.content != None
+        return self.content is not None
 
     class Universal:
-        
-        def __init__(self, path):   
-            self.path       = path
-            self.type       = 'universal'
-            self.file_off   = 0
-            self.magic      = None
-            self.nfat_arch  = 0
-            self.archs      = list()
+
+        def __init__(self, path):
+            self.path = path
+            self.type = 'universal'
+            self.file_off = 0
+            self.magic = None
+            self.nfat_arch = 0
+            self.archs = list()
 
         def description(self):
             s = '%#8.8x: %s (' % (self.file_off, self.path)
@@ -593,14 +603,14 @@ class Mach:
             s += ')'
             return s
 
-        def unpack(self, data, magic = None):
+        def unpack(self, data, magic=None):
             self.file_off = data.tell()
             if magic is None:
                 self.magic = Mach.Magic()
                 self.magic.unpack(data)
             else:
                 self.magic = magic
-                self.file_off = self.file_off - 4                
+                self.file_off = self.file_off - 4
             # Universal headers are always in big endian
             data.set_byte_order('big')
             self.nfat_arch = data.get_uint32()
@@ -609,15 +619,15 @@ class Mach:
                 self.archs[i].unpack(data)
             for i in range(self.nfat_arch):
                 self.archs[i].mach = Mach.Skinny(self.path)
-                data.seek (self.archs[i].offset, 0)
+                data.seek(self.archs[i].offset, 0)
                 skinny_magic = Mach.Magic()
-                skinny_magic.unpack (data)
+                skinny_magic.unpack(data)
                 self.archs[i].mach.unpack(data, skinny_magic)
 
         def compare(self, rhs):
             print 'error: comparing two universal files is not supported yet'
             return False
-        
+
         def dump(self, options):
             if options.dump_header:
                 print
@@ -633,21 +643,21 @@ class Mach:
                 for i in range(self.nfat_arch):
                     self.archs[i].mach.dump(options)
 
-        def dump_header(self, dump_description = True, options = None):
+        def dump_header(self, dump_description=True, options=None):
             if dump_description:
                 print self.description()
             for i in range(self.nfat_arch):
                 self.archs[i].mach.dump_header(True, options)
                 print
 
-        def dump_load_commands(self, dump_description = True, options = None):
+        def dump_load_commands(self, dump_description=True, options=None):
             if dump_description:
                 print self.description()
             for i in range(self.nfat_arch):
                 self.archs[i].mach.dump_load_commands(True, options)
                 print
 
-        def dump_sections(self, dump_description = True, options = None):
+        def dump_sections(self, dump_description=True, options=None):
             if dump_description:
                 print self.description()
             for i in range(self.nfat_arch):
@@ -659,7 +669,7 @@ class Mach:
                 self.archs[i].mach.dump_section_contents(options)
                 print
 
-        def dump_symtab(self, dump_description = True, options = None):
+        def dump_symtab(self, dump_description=True, options=None):
             if dump_description:
                 print self.description()
             for i in range(self.nfat_arch):
@@ -668,50 +678,58 @@ class Mach:
 
         def dump_symbol_names_matching_regex(self, regex, file=None):
             for i in range(self.nfat_arch):
-                self.archs[i].mach.dump_symbol_names_matching_regex(regex, file)
+                self.archs[i].mach.dump_symbol_names_matching_regex(
+                    regex, file)
 
         class ArchInfo:
-            
-            def __init__(self):   
-                self.arch   = Mach.Arch(0,0)
+
+            def __init__(self):
+                self.arch = Mach.Arch(0, 0)
                 self.offset = 0
-                self.size   = 0
-                self.align  = 0
-                self.mach   = None
+                self.size = 0
+                self.align = 0
+                self.mach = None
 
             def unpack(self, data):
                 # Universal headers are always in big endian
                 data.set_byte_order('big')
-                self.arch.cpu, self.arch.sub, self.offset, self.size, self.align = data.get_n_uint32(5)
-                
-            def dump_header(self, dump_description = True, options = None):
+                self.arch.cpu, self.arch.sub, self.offset, self.size, self.align = data.get_n_uint32(
+                    5)
+
+            def dump_header(self, dump_description=True, options=None):
                 if options.verbose:
                     print "CPU        SUBTYPE    OFFSET     SIZE       ALIGN"
                     print "---------- ---------- ---------- ---------- ----------"
                 else:
                     print "ARCH       FILEOFFSET FILESIZE   ALIGN"
                     print "---------- ---------- ---------- ----------"
+
             def dump_flat(self, options):
                 if options.verbose:
                     print "%#8.8x %#8.8x %#8.8x %#8.8x %#8.8x" % (self.arch.cpu, self.arch.sub, self.offset, self.size, self.align)
                 else:
                     print "%-10s %#8.8x %#8.8x %#8.8x" % (self.arch, self.offset, self.size, self.align)
+
             def dump(self):
                 print "   cputype: %#8.8x" % self.arch.cpu
                 print "cpusubtype: %#8.8x" % self.arch.sub
                 print "    offset: %#8.8x" % self.offset
                 print "      size: %#8.8x" % self.size
                 print "     align: %#8.8x" % self.align
+
             def __str__(self):
-                return "Mach.Universal.ArchInfo: %#8.8x %#8.8x %#8.8x %#8.8x %#8.8x" % (self.arch.cpu, self.arch.sub, self.offset, self.size, self.align)
+                return "Mach.Universal.ArchInfo: %#8.8x %#8.8x %#8.8x %#8.8x %#8.8x" % (
+                    self.arch.cpu, self.arch.sub, self.offset, self.size, self.align)
+
             def __repr__(self):
-                return "Mach.Universal.ArchInfo: %#8.8x %#8.8x %#8.8x %#8.8x %#8.8x" % (self.arch.cpu, self.arch.sub, self.offset, self.size, self.align)
-                
+                return "Mach.Universal.ArchInfo: %#8.8x %#8.8x %#8.8x %#8.8x %#8.8x" % (
+                    self.arch.cpu, self.arch.sub, self.offset, self.size, self.align)
+
     class Flags:
 
         def __init__(self, b):
             self.bits = b
-        
+
         def __str__(self):
             s = ''
             if self.bits & MH_NOUNDEFS:
@@ -772,46 +790,46 @@ class Mach:
     class FileType(dict_utils.Enum):
 
         enum = {
-            'MH_OBJECT'         : MH_OBJECT        ,
-            'MH_EXECUTE'        : MH_EXECUTE       ,
-            'MH_FVMLIB'         : MH_FVMLIB        ,
-            'MH_CORE'           : MH_CORE          ,
-            'MH_PRELOAD'        : MH_PRELOAD       ,
-            'MH_DYLIB'          : MH_DYLIB         ,
-            'MH_DYLINKER'       : MH_DYLINKER      ,
-            'MH_BUNDLE'         : MH_BUNDLE        ,
-            'MH_DYLIB_STUB'     : MH_DYLIB_STUB    ,
-            'MH_DSYM'           : MH_DSYM          ,
-            'MH_KEXT_BUNDLE'    : MH_KEXT_BUNDLE
+            'MH_OBJECT': MH_OBJECT,
+            'MH_EXECUTE': MH_EXECUTE,
+            'MH_FVMLIB': MH_FVMLIB,
+            'MH_CORE': MH_CORE,
+            'MH_PRELOAD': MH_PRELOAD,
+            'MH_DYLIB': MH_DYLIB,
+            'MH_DYLINKER': MH_DYLINKER,
+            'MH_BUNDLE': MH_BUNDLE,
+            'MH_DYLIB_STUB': MH_DYLIB_STUB,
+            'MH_DSYM': MH_DSYM,
+            'MH_KEXT_BUNDLE': MH_KEXT_BUNDLE
         }
 
-        def __init__(self, initial_value = 0):
+        def __init__(self, initial_value=0):
             dict_utils.Enum.__init__(self, initial_value, self.enum)
-        
+
     class Skinny:
-        
-        def __init__(self, path): 
-            self.path       = path
-            self.type       = 'skinny'
-            self.data       = None
-            self.file_off   = 0
-            self.magic      = 0
-            self.arch       = Mach.Arch(0,0)
-            self.filetype   = Mach.FileType(0)
-            self.ncmds      = 0
+
+        def __init__(self, path):
+            self.path = path
+            self.type = 'skinny'
+            self.data = None
+            self.file_off = 0
+            self.magic = 0
+            self.arch = Mach.Arch(0, 0)
+            self.filetype = Mach.FileType(0)
+            self.ncmds = 0
             self.sizeofcmds = 0
-            self.flags      = Mach.Flags(0)
-            self.uuid       = None
-            self.commands   = list()
-            self.segments   = list()
-            self.sections   = list()
-            self.symbols    = list()
+            self.flags = Mach.Flags(0)
+            self.uuid = None
+            self.commands = list()
+            self.segments = list()
+            self.sections = list()
+            self.symbols = list()
             self.sections.append(Mach.Section())
 
         def description(self):
             return '%#8.8x: %s (%s)' % (self.file_off, self.path, self.arch)
-            
-        def unpack(self, data, magic = None):
+
+        def unpack(self, data, magic=None):
             self.data = data
             self.file_off = data.tell()
             if magic is None:
@@ -821,43 +839,44 @@ class Mach:
                 self.magic = magic
                 self.file_off = self.file_off - 4
             data.set_byte_order(self.magic.get_byte_order())
-            self.arch.cpu, self.arch.sub, self.filetype.value, self.ncmds, self.sizeofcmds, bits = data.get_n_uint32(6)
+            self.arch.cpu, self.arch.sub, self.filetype.value, self.ncmds, self.sizeofcmds, bits = data.get_n_uint32(
+                6)
             self.flags.bits = bits
 
             if self.is_64_bit():
-                data.get_uint32() # Skip reserved word in mach_header_64
+                data.get_uint32()  # Skip reserved word in mach_header_64
 
-            for i in range(0,self.ncmds):
-                lc = self.unpack_load_command (data)
-                self.commands.append (lc)
+            for i in range(0, self.ncmds):
+                lc = self.unpack_load_command(data)
+                self.commands.append(lc)
 
         def get_data(self):
             if self.data:
                 self.data.set_byte_order(self.magic.get_byte_order())
                 return self.data
             return None
-            
-        def unpack_load_command (self, data):
+
+        def unpack_load_command(self, data):
             lc = Mach.LoadCommand()
-            lc.unpack (self, data)
-            lc_command = lc.command.get_enum_value();
-            if (lc_command == LC_SEGMENT or 
-                lc_command == LC_SEGMENT_64):
+            lc.unpack(self, data)
+            lc_command = lc.command.get_enum_value()
+            if (lc_command == LC_SEGMENT or
+                    lc_command == LC_SEGMENT_64):
                 lc = Mach.SegmentLoadCommand(lc)
                 lc.unpack(self, data)
-            elif (lc_command == LC_LOAD_DYLIB or 
-                  lc_command == LC_ID_DYLIB or 
-                  lc_command == LC_LOAD_WEAK_DYLIB or 
+            elif (lc_command == LC_LOAD_DYLIB or
+                  lc_command == LC_ID_DYLIB or
+                  lc_command == LC_LOAD_WEAK_DYLIB or
                   lc_command == LC_REEXPORT_DYLIB):
                 lc = Mach.DylibLoadCommand(lc)
                 lc.unpack(self, data)
             elif (lc_command == LC_LOAD_DYLINKER or
-                  lc_command == LC_SUB_FRAMEWORK or 
-                  lc_command == LC_SUB_CLIENT or 
-                  lc_command == LC_SUB_UMBRELLA or 
-                  lc_command == LC_SUB_LIBRARY or 
-                  lc_command == LC_ID_DYLINKER or 
-                  lc_command == LC_RPATH):            
+                  lc_command == LC_SUB_FRAMEWORK or
+                  lc_command == LC_SUB_CLIENT or
+                  lc_command == LC_SUB_UMBRELLA or
+                  lc_command == LC_SUB_LIBRARY or
+                  lc_command == LC_ID_DYLINKER or
+                  lc_command == LC_RPATH):
                 lc = Mach.LoadDYLDLoadCommand(lc)
                 lc.unpack(self, data)
             elif (lc_command == LC_DYLD_INFO_ONLY):
@@ -872,8 +891,8 @@ class Mach:
             elif (lc_command == LC_UUID):
                 lc = Mach.UUIDLoadCommand(lc)
                 lc.unpack(self, data)
-            elif (lc_command == LC_CODE_SIGNATURE or 
-                  lc_command == LC_SEGMENT_SPLIT_INFO or 
+            elif (lc_command == LC_CODE_SIGNATURE or
+                  lc_command == LC_SEGMENT_SPLIT_INFO or
                   lc_command == LC_FUNCTION_STARTS):
                 lc = Mach.DataBlobLoadCommand(lc)
                 lc.unpack(self, data)
@@ -885,7 +904,7 @@ class Mach:
                 lc.unpack(self, data)
             lc.skip(data)
             return lc
-        
+
         def compare(self, rhs):
             print "\nComparing:"
             print "a) %s %s" % (self.arch, self.path)
@@ -897,8 +916,8 @@ class Mach:
                     if rhs_section:
                         print 'comparing %s.%s...' % (lhs_section.segname, lhs_section.sectname),
                         sys.stdout.flush()
-                        lhs_data = lhs_section.get_contents (self)
-                        rhs_data = rhs_section.get_contents (rhs)
+                        lhs_data = lhs_section.get_contents(self)
+                        rhs_data = rhs_section.get_contents(rhs)
                         if lhs_data and rhs_data:
                             if lhs_data == rhs_data:
                                 print 'ok'
@@ -919,10 +938,10 @@ class Mach:
                                 #         result = False
                                 # else:
                                 result = False
-                                print 'error: sections differ'                                
-                                #print 'a) %s' % (lhs_section)
+                                print 'error: sections differ'
+                                # print 'a) %s' % (lhs_section)
                                 # dump_hex_byte_string_diff(0, lhs_data, rhs_data)
-                                #print 'b) %s' % (rhs_section)
+                                # print 'b) %s' % (rhs_section)
                                 # dump_hex_byte_string_diff(0, rhs_data, lhs_data)
                         elif lhs_data and not rhs_data:
                             print 'error: section data missing from b:'
@@ -950,7 +969,8 @@ class Mach:
             if not result:
                 print 'error: mach files differ'
             return result
-        def dump_header(self, dump_description = True, options = None):
+
+        def dump_header(self, dump_description=True, options=None):
             if options.verbose:
                 print "MAGIC      CPU        SUBTYPE    FILETYPE   NUM CMDS SIZE CMDS  FLAGS"
                 print "---------- ---------- ---------- ---------- -------- ---------- ----------"
@@ -960,7 +980,7 @@ class Mach:
 
         def dump_flat(self, options):
             if options.verbose:
-                print "%#8.8x %#8.8x %#8.8x %#8.8x %#8u %#8.8x %#8.8x" % (self.magic, self.arch.cpu , self.arch.sub, self.filetype.value, self.ncmds, self.sizeofcmds, self.flags.bits)
+                print "%#8.8x %#8.8x %#8.8x %#8.8x %#8u %#8.8x %#8.8x" % (self.magic, self.arch.cpu, self.arch.sub, self.filetype.value, self.ncmds, self.sizeofcmds, self.flags.bits)
             else:
                 print "%-12s %-10s %-14s %#8u %#8.8x %s" % (self.magic, self.arch, self.filetype, self.ncmds, self.sizeofcmds, self.flags)
 
@@ -980,9 +1000,9 @@ class Mach:
                 else:
                     print "No symbols"
             if options.find_mangled:
-                self.dump_symbol_names_matching_regex (re.compile('^_?_Z'))
+                self.dump_symbol_names_matching_regex(re.compile('^_?_Z'))
 
-        def dump_header(self, dump_description = True, options = None):
+        def dump_header(self, dump_description=True, options=None):
             if dump_description:
                 print self.description()
             print "Mach Header"
@@ -993,32 +1013,32 @@ class Mach:
             print "       ncmds: %#8.8x %u" % (self.ncmds, self.ncmds)
             print "  sizeofcmds: %#8.8x" % self.sizeofcmds
             print "       flags: %#8.8x %s" % (self.flags.bits, self.flags)
-            
-        def dump_load_commands(self, dump_description = True, options = None):
+
+        def dump_load_commands(self, dump_description=True, options=None):
             if dump_description:
                 print self.description()
             for lc in self.commands:
                 print lc
-        
-        def get_section_by_name (self, name):
+
+        def get_section_by_name(self, name):
             for section in self.sections:
                 if section.sectname and section.sectname == name:
                     return section
             return None
 
-        def get_section_by_section (self, other_section):
+        def get_section_by_section(self, other_section):
             for section in self.sections:
                 if section.sectname == other_section.sectname and section.segname == other_section.segname:
                     return section
             return None
-        
-        def dump_sections(self, dump_description = True, options = None):
+
+        def dump_sections(self, dump_description=True, options=None):
             if dump_description:
                 print self.description()
             num_sections = len(self.sections)
             if num_sections > 1:
                 self.sections[1].dump_header()
-                for sect_idx in range(1,num_sections):
+                for sect_idx in range(1, num_sections):
                     print "%s" % self.sections[sect_idx]
 
         def dump_section_contents(self, options):
@@ -1026,27 +1046,34 @@ class Mach:
             for sectname in options.section_names:
                 section = self.get_section_by_name(sectname)
                 if section:
-                    sect_bytes = section.get_contents (self)
+                    sect_bytes = section.get_contents(self)
                     if options.outfile:
                         if not saved_section_to_disk:
                             outfile = open(options.outfile, 'w')
                             if options.extract_modules:
-                                #print "Extracting modules from mach file..."
-                                data = file_extract.FileExtract(StringIO.StringIO(sect_bytes), self.data.byte_order)
+                                # print "Extracting modules from mach file..."
+                                data = file_extract.FileExtract(
+                                    StringIO.StringIO(sect_bytes), self.data.byte_order)
                                 version = data.get_uint32()
                                 num_modules = data.get_uint32()
-                                #print "version = %u, num_modules = %u" % (version, num_modules)
+                                # print "version = %u, num_modules = %u" %
+                                # (version, num_modules)
                                 for i in range(num_modules):
                                     data_offset = data.get_uint64()
                                     data_size = data.get_uint64()
                                     name_offset = data.get_uint32()
                                     language = data.get_uint32()
                                     flags = data.get_uint32()
-                                    data.seek (name_offset)
+                                    data.seek(name_offset)
                                     module_name = data.get_c_string()
-                                    #print "module[%u] data_offset = %#16.16x, data_size = %#16.16x, name_offset = %#16.16x (%s), language = %u, flags = %#x" % (i, data_offset, data_size, name_offset, module_name, language, flags)
-                                    data.seek (data_offset)
-                                    outfile.write(data.read_size (data_size))
+                                    # print "module[%u] data_offset = %#16.16x,
+                                    # data_size = %#16.16x, name_offset =
+                                    # %#16.16x (%s), language = %u, flags =
+                                    # %#x" % (i, data_offset, data_size,
+                                    # name_offset, module_name, language,
+                                    # flags)
+                                    data.seek(data_offset)
+                                    outfile.write(data.read_size(data_size))
                             else:
                                 print "Saving section %s to '%s'" % (sectname, options.outfile)
                                 outfile.write(sect_bytes)
@@ -1058,7 +1085,7 @@ class Mach:
                         print 'section %s:\n' % (sectname)
                         section.dump_header()
                         print '%s\n' % (section)
-                        dump_memory (0, sect_bytes, options.max_count, 16)
+                        dump_memory(0, sect_bytes, options.max_count, 16)
                 else:
                     print 'error: no section named "%s" was found' % (sectname)
 
@@ -1069,16 +1096,16 @@ class Mach:
                 if segment.segname == segname:
                     return segment
             return None
-        
+
         def get_first_load_command(self, lc_enum_value):
             for lc in self.commands:
                 if lc.command.value == lc_enum_value:
                     return lc
             return None
-        
+
         def get_symtab(self):
             if self.data and not self.symbols:
-                lc_symtab = self.get_first_load_command (LC_SYMTAB)
+                lc_symtab = self.get_first_load_command(LC_SYMTAB)
                 if lc_symtab:
                     symtab_offset = self.file_off
                     if self.data.is_in_memory():
@@ -1090,105 +1117,106 @@ class Mach:
                             symtab_offset = linkedit_vmaddr + lc_symtab.stroff - linkedit_fileoff
                     else:
                         symtab_offset += lc_symtab.symoff
-                
-                    self.data.seek (symtab_offset)
+
+                    self.data.seek(symtab_offset)
                     is_64 = self.is_64_bit()
                     for i in range(lc_symtab.nsyms):
                         nlist = Mach.NList()
-                        nlist.unpack (self, self.data, lc_symtab)
+                        nlist.unpack(self, self.data, lc_symtab)
                         self.symbols.append(nlist)
                 else:
-                    print "no LC_SYMTAB"                
-            
-        def dump_symtab(self, dump_description = True, options = None):
+                    print "no LC_SYMTAB"
+
+        def dump_symtab(self, dump_description=True, options=None):
             self.get_symtab()
             if dump_description:
                 print self.description()
             for i, symbol in enumerate(self.symbols):
                 print '[%5u] %s' % (i, symbol)
-        
+
         def dump_symbol_names_matching_regex(self, regex, file=None):
             self.get_symtab()
             for symbol in self.symbols:
-                if symbol.name and regex.search (symbol.name):
+                if symbol.name and regex.search(symbol.name):
                     print symbol.name
                     if file:
                         file.write('%s\n' % (symbol.name))
-        
+
         def is_64_bit(self):
             return self.magic.is_64_bit()
-        
+
     class LoadCommand:
+
         class Command(dict_utils.Enum):
             enum = {
-                'LC_SEGMENT'                : LC_SEGMENT,
-                'LC_SYMTAB'                 : LC_SYMTAB,
-                'LC_SYMSEG'                 : LC_SYMSEG,
-                'LC_THREAD'                 : LC_THREAD,
-                'LC_UNIXTHREAD'             : LC_UNIXTHREAD,
-                'LC_LOADFVMLIB'             : LC_LOADFVMLIB,
-                'LC_IDFVMLIB'               : LC_IDFVMLIB,
-                'LC_IDENT'                  : LC_IDENT,
-                'LC_FVMFILE'                : LC_FVMFILE,
-                'LC_PREPAGE'                : LC_PREPAGE,
-                'LC_DYSYMTAB'               : LC_DYSYMTAB,
-                'LC_LOAD_DYLIB'             : LC_LOAD_DYLIB,
-                'LC_ID_DYLIB'               : LC_ID_DYLIB,
-                'LC_LOAD_DYLINKER'          : LC_LOAD_DYLINKER,
-                'LC_ID_DYLINKER'            : LC_ID_DYLINKER,
-                'LC_PREBOUND_DYLIB'         : LC_PREBOUND_DYLIB,
-                'LC_ROUTINES'               : LC_ROUTINES,
-                'LC_SUB_FRAMEWORK'          : LC_SUB_FRAMEWORK,
-                'LC_SUB_UMBRELLA'           : LC_SUB_UMBRELLA,
-                'LC_SUB_CLIENT'             : LC_SUB_CLIENT,
-                'LC_SUB_LIBRARY'            : LC_SUB_LIBRARY,
-                'LC_TWOLEVEL_HINTS'         : LC_TWOLEVEL_HINTS,
-                'LC_PREBIND_CKSUM'          : LC_PREBIND_CKSUM,
-                'LC_LOAD_WEAK_DYLIB'        : LC_LOAD_WEAK_DYLIB,
-                'LC_SEGMENT_64'             : LC_SEGMENT_64,
-                'LC_ROUTINES_64'            : LC_ROUTINES_64,
-                'LC_UUID'                   : LC_UUID,
-                'LC_RPATH'                  : LC_RPATH,
-                'LC_CODE_SIGNATURE'         : LC_CODE_SIGNATURE,
-                'LC_SEGMENT_SPLIT_INFO'     : LC_SEGMENT_SPLIT_INFO,
-                'LC_REEXPORT_DYLIB'         : LC_REEXPORT_DYLIB,
-                'LC_LAZY_LOAD_DYLIB'        : LC_LAZY_LOAD_DYLIB,
-                'LC_ENCRYPTION_INFO'        : LC_ENCRYPTION_INFO,
-                'LC_DYLD_INFO'              : LC_DYLD_INFO,
-                'LC_DYLD_INFO_ONLY'         : LC_DYLD_INFO_ONLY,
-                'LC_LOAD_UPWARD_DYLIB'      : LC_LOAD_UPWARD_DYLIB,
-                'LC_VERSION_MIN_MACOSX'     : LC_VERSION_MIN_MACOSX,
-                'LC_VERSION_MIN_IPHONEOS'   : LC_VERSION_MIN_IPHONEOS,
-                'LC_FUNCTION_STARTS'        : LC_FUNCTION_STARTS,
-                'LC_DYLD_ENVIRONMENT'       : LC_DYLD_ENVIRONMENT
+                'LC_SEGMENT': LC_SEGMENT,
+                'LC_SYMTAB': LC_SYMTAB,
+                'LC_SYMSEG': LC_SYMSEG,
+                'LC_THREAD': LC_THREAD,
+                'LC_UNIXTHREAD': LC_UNIXTHREAD,
+                'LC_LOADFVMLIB': LC_LOADFVMLIB,
+                'LC_IDFVMLIB': LC_IDFVMLIB,
+                'LC_IDENT': LC_IDENT,
+                'LC_FVMFILE': LC_FVMFILE,
+                'LC_PREPAGE': LC_PREPAGE,
+                'LC_DYSYMTAB': LC_DYSYMTAB,
+                'LC_LOAD_DYLIB': LC_LOAD_DYLIB,
+                'LC_ID_DYLIB': LC_ID_DYLIB,
+                'LC_LOAD_DYLINKER': LC_LOAD_DYLINKER,
+                'LC_ID_DYLINKER': LC_ID_DYLINKER,
+                'LC_PREBOUND_DYLIB': LC_PREBOUND_DYLIB,
+                'LC_ROUTINES': LC_ROUTINES,
+                'LC_SUB_FRAMEWORK': LC_SUB_FRAMEWORK,
+                'LC_SUB_UMBRELLA': LC_SUB_UMBRELLA,
+                'LC_SUB_CLIENT': LC_SUB_CLIENT,
+                'LC_SUB_LIBRARY': LC_SUB_LIBRARY,
+                'LC_TWOLEVEL_HINTS': LC_TWOLEVEL_HINTS,
+                'LC_PREBIND_CKSUM': LC_PREBIND_CKSUM,
+                'LC_LOAD_WEAK_DYLIB': LC_LOAD_WEAK_DYLIB,
+                'LC_SEGMENT_64': LC_SEGMENT_64,
+                'LC_ROUTINES_64': LC_ROUTINES_64,
+                'LC_UUID': LC_UUID,
+                'LC_RPATH': LC_RPATH,
+                'LC_CODE_SIGNATURE': LC_CODE_SIGNATURE,
+                'LC_SEGMENT_SPLIT_INFO': LC_SEGMENT_SPLIT_INFO,
+                'LC_REEXPORT_DYLIB': LC_REEXPORT_DYLIB,
+                'LC_LAZY_LOAD_DYLIB': LC_LAZY_LOAD_DYLIB,
+                'LC_ENCRYPTION_INFO': LC_ENCRYPTION_INFO,
+                'LC_DYLD_INFO': LC_DYLD_INFO,
+                'LC_DYLD_INFO_ONLY': LC_DYLD_INFO_ONLY,
+                'LC_LOAD_UPWARD_DYLIB': LC_LOAD_UPWARD_DYLIB,
+                'LC_VERSION_MIN_MACOSX': LC_VERSION_MIN_MACOSX,
+                'LC_VERSION_MIN_IPHONEOS': LC_VERSION_MIN_IPHONEOS,
+                'LC_FUNCTION_STARTS': LC_FUNCTION_STARTS,
+                'LC_DYLD_ENVIRONMENT': LC_DYLD_ENVIRONMENT
             }
-            
-            def __init__(self, initial_value = 0):
+
+            def __init__(self, initial_value=0):
                 dict_utils.Enum.__init__(self, initial_value, self.enum)
 
-            
-        def __init__(self, c=None, l=0,o=0):   
-            if c != None:
+        def __init__(self, c=None, l=0, o=0):
+            if c is not None:
                 self.command = c
             else:
                 self.command = Mach.LoadCommand.Command(0)
             self.length = l
             self.file_off = o
-        
+
         def unpack(self, mach_file, data):
             self.file_off = data.tell()
             self.command.value, self.length = data.get_n_uint32(2)
 
         def skip(self, data):
-            data.seek (self.file_off + self.length, 0)
+            data.seek(self.file_off + self.length, 0)
 
         def __str__(self):
             lc_name = self.command.get_enum_name()
-            return '%#8.8x: <%#4.4x> %-24s' % (self.file_off, self.length, lc_name)
+            return '%#8.8x: <%#4.4x> %-24s' % (self.file_off,
+                                               self.length, lc_name)
 
     class Section:
 
-        def __init__(self):   
+        def __init__(self):
             self.index = 0
             self.is_64 = False
             self.sectname = None
@@ -1206,64 +1234,76 @@ class Mach:
 
         def unpack(self, is_64, data):
             self.is_64 = is_64
-            self.sectname = data.get_fixed_length_c_string (16, '', True)
-            self.segname = data.get_fixed_length_c_string (16, '', True)
+            self.sectname = data.get_fixed_length_c_string(16, '', True)
+            self.segname = data.get_fixed_length_c_string(16, '', True)
             if self.is_64:
                 self.addr, self.size = data.get_n_uint64(2)
-                self.offset, self.align, self.reloff, self.nreloc, self.flags, self.reserved1, self.reserved2, self.reserved3 = data.get_n_uint32(8)
+                self.offset, self.align, self.reloff, self.nreloc, self.flags, self.reserved1, self.reserved2, self.reserved3 = data.get_n_uint32(
+                    8)
             else:
                 self.addr, self.size = data.get_n_uint32(2)
-                self.offset, self.align, self.reloff, self.nreloc, self.flags, self.reserved1, self.reserved2 = data.get_n_uint32(7)
-            
+                self.offset, self.align, self.reloff, self.nreloc, self.flags, self.reserved1, self.reserved2 = data.get_n_uint32(
+                    7)
+
         def dump_header(self):
             if self.is_64:
-                print "INDEX ADDRESS            SIZE               OFFSET     ALIGN      RELOFF     NRELOC     FLAGS      RESERVED1  RESERVED2  RESERVED3  NAME";
-                print "===== ------------------ ------------------ ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------------------";
+                print "INDEX ADDRESS            SIZE               OFFSET     ALIGN      RELOFF     NRELOC     FLAGS      RESERVED1  RESERVED2  RESERVED3  NAME"
+                print "===== ------------------ ------------------ ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------------------"
             else:
-                print "INDEX ADDRESS    SIZE       OFFSET     ALIGN      RELOFF     NRELOC     FLAGS      RESERVED1  RESERVED2  NAME";
-                print "===== ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------------------";
+                print "INDEX ADDRESS    SIZE       OFFSET     ALIGN      RELOFF     NRELOC     FLAGS      RESERVED1  RESERVED2  NAME"
+                print "===== ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------------------"
 
         def __str__(self):
             if self.is_64:
-                return "[%3u] %#16.16x %#16.16x %#8.8x %#8.8x %#8.8x %#8.8x %#8.8x %#8.8x %#8.8x %#8.8x %s.%s" % (self.index, self.addr, self.size, self.offset, self.align, self.reloff, self.nreloc, self.flags, self.reserved1, self.reserved2, self.reserved3, self.segname, self.sectname)
+                return "[%3u] %#16.16x %#16.16x %#8.8x %#8.8x %#8.8x %#8.8x %#8.8x %#8.8x %#8.8x %#8.8x %s.%s" % (
+                    self.index, self.addr, self.size, self.offset, self.align, self.reloff, self.nreloc, self.flags, self.reserved1, self.reserved2, self.reserved3, self.segname, self.sectname)
             else:
-                return "[%3u] %#8.8x %#8.8x %#8.8x %#8.8x %#8.8x %#8.8x %#8.8x %#8.8x %#8.8x %s.%s" % (self.index, self.addr, self.size, self.offset, self.align, self.reloff, self.nreloc, self.flags, self.reserved1, self.reserved2, self.segname, self.sectname)
+                return "[%3u] %#8.8x %#8.8x %#8.8x %#8.8x %#8.8x %#8.8x %#8.8x %#8.8x %#8.8x %s.%s" % (
+                    self.index, self.addr, self.size, self.offset, self.align, self.reloff, self.nreloc, self.flags, self.reserved1, self.reserved2, self.segname, self.sectname)
 
         def get_contents(self, mach_file):
             '''Get the section contents as a python string'''
-            if self.size > 0 and mach_file.get_segment(self.segname).filesize > 0:
+            if self.size > 0 and mach_file.get_segment(
+                    self.segname).filesize > 0:
                 data = mach_file.get_data()
                 if data:
                     section_data_offset = mach_file.file_off + self.offset
-                    #print '%s.%s is at offset 0x%x with size 0x%x' % (self.segname, self.sectname, section_data_offset, self.size)
-                    data.push_offset_and_seek (section_data_offset)
+                    # print '%s.%s is at offset 0x%x with size 0x%x' %
+                    # (self.segname, self.sectname, section_data_offset,
+                    # self.size)
+                    data.push_offset_and_seek(section_data_offset)
                     bytes = data.read_size(self.size)
                     data.pop_offset_and_seek()
                     return bytes
             return None
-    
+
     class DylibLoadCommand(LoadCommand):
-        def __init__(self, lc):   
+
+        def __init__(self, lc):
             Mach.LoadCommand.__init__(self, lc.command, lc.length, lc.file_off)
             self.name = None
             self.timestamp = 0
             self.current_version = 0
             self.compatibility_version = 0
-        
+
         def unpack(self, mach_file, data):
             byte_order_char = mach_file.magic.get_byte_order()
-            name_offset, self.timestamp, self.current_version, self.compatibility_version = data.get_n_uint32(4)
+            name_offset, self.timestamp, self.current_version, self.compatibility_version = data.get_n_uint32(
+                4)
             data.seek(self.file_off + name_offset, 0)
             self.name = data.get_fixed_length_c_string(self.length - 24)
 
         def __str__(self):
-            s = Mach.LoadCommand.__str__(self);
-            s += "%#8.8x %#8.8x %#8.8x " % (self.timestamp, self.current_version, self.compatibility_version)
+            s = Mach.LoadCommand.__str__(self)
+            s += "%#8.8x %#8.8x %#8.8x " % (self.timestamp,
+                                            self.current_version,
+                                            self.compatibility_version)
             s += self.name
             return s
-    
+
     class LoadDYLDLoadCommand(LoadCommand):
-        def __init__(self, lc):   
+
+        def __init__(self, lc):
             Mach.LoadCommand.__init__(self, lc.command, lc.length, lc.file_off)
             self.name = None
 
@@ -1272,13 +1312,15 @@ class Mach:
             self.name = data.get_fixed_length_c_string(self.length - 12)
 
         def __str__(self):
-            s = Mach.LoadCommand.__str__(self);
+            s = Mach.LoadCommand.__str__(self)
             s += "%s" % self.name
             return s
 
     class UnixThreadLoadCommand(LoadCommand):
+
         class ThreadState:
-            def __init__(self):   
+
+            def __init__(self):
                 self.flavor = 0
                 self.count = 0
                 self.register_values = list()
@@ -1286,9 +1328,10 @@ class Mach:
             def unpack(self, data):
                 self.flavor, self.count = data.get_n_uint32(2)
                 self.register_values = data.get_n_uint32(self.count)
-            
+
             def __str__(self):
-                s = "flavor = %u, count = %u, regs =" % (self.flavor, self.count)
+                s = "flavor = %u, count = %u, regs =" % (
+                    self.flavor, self.count)
                 i = 0
                 for register_value in self.register_values:
                     if i % 8 == 0:
@@ -1296,24 +1339,25 @@ class Mach:
                     s += " %#8.8x" % register_value
                     i += 1
                 return s
-            
-        def __init__(self, lc):   
+
+        def __init__(self, lc):
             Mach.LoadCommand.__init__(self, lc.command, lc.length, lc.file_off)
             self.reg_sets = list()
 
         def unpack(self, mach_file, data):
             reg_set = Mach.UnixThreadLoadCommand.ThreadState()
-            reg_set.unpack (data)
+            reg_set.unpack(data)
             self.reg_sets.append(reg_set)
 
         def __str__(self):
-            s = Mach.LoadCommand.__str__(self);
+            s = Mach.LoadCommand.__str__(self)
             for reg_set in self.reg_sets:
                 s += "%s" % reg_set
             return s
 
     class DYLDInfoOnlyLoadCommand(LoadCommand):
-        def __init__(self, lc):   
+
+        def __init__(self, lc):
             Mach.LoadCommand.__init__(self, lc.command, lc.length, lc.file_off)
             self.rebase_off = 0
             self.rebase_size = 0
@@ -1328,19 +1372,26 @@ class Mach:
 
         def unpack(self, mach_file, data):
             byte_order_char = mach_file.magic.get_byte_order()
-            self.rebase_off, self.rebase_size, self.bind_off, self.bind_size, self.weak_bind_off, self.weak_bind_size, self.lazy_bind_off, self.lazy_bind_size, self.export_off, self.export_size = data.get_n_uint32(10)
+            self.rebase_off, self.rebase_size, self.bind_off, self.bind_size, self.weak_bind_off, self.weak_bind_size, self.lazy_bind_off, self.lazy_bind_size, self.export_off, self.export_size = data.get_n_uint32(
+                10)
 
         def __str__(self):
-            s = Mach.LoadCommand.__str__(self);
-            s += "rebase_off = %#8.8x, rebase_size = %u, " % (self.rebase_off, self.rebase_size)
-            s += "bind_off = %#8.8x, bind_size = %u, " % (self.bind_off, self.bind_size)
-            s += "weak_bind_off = %#8.8x, weak_bind_size = %u, " % (self.weak_bind_off, self.weak_bind_size)
-            s += "lazy_bind_off = %#8.8x, lazy_bind_size = %u, " % (self.lazy_bind_off, self.lazy_bind_size)
-            s += "export_off = %#8.8x, export_size = %u, " % (self.export_off, self.export_size)
+            s = Mach.LoadCommand.__str__(self)
+            s += "rebase_off = %#8.8x, rebase_size = %u, " % (
+                self.rebase_off, self.rebase_size)
+            s += "bind_off = %#8.8x, bind_size = %u, " % (
+                self.bind_off, self.bind_size)
+            s += "weak_bind_off = %#8.8x, weak_bind_size = %u, " % (
+                self.weak_bind_off, self.weak_bind_size)
+            s += "lazy_bind_off = %#8.8x, lazy_bind_size = %u, " % (
+                self.lazy_bind_off, self.lazy_bind_size)
+            s += "export_off = %#8.8x, export_size = %u, " % (
+                self.export_off, self.export_size)
             return s
 
     class DYLDSymtabLoadCommand(LoadCommand):
-        def __init__(self, lc):   
+
+        def __init__(self, lc):
             Mach.LoadCommand.__init__(self, lc.command, lc.length, lc.file_off)
             self.ilocalsym = 0
             self.nlocalsym = 0
@@ -1363,10 +1414,11 @@ class Mach:
 
         def unpack(self, mach_file, data):
             byte_order_char = mach_file.magic.get_byte_order()
-            self.ilocalsym, self.nlocalsym, self.iextdefsym, self.nextdefsym, self.iundefsym, self.nundefsym, self.tocoff, self.ntoc, self.modtaboff, self.nmodtab, self.extrefsymoff, self.nextrefsyms, self.indirectsymoff, self.nindirectsyms, self.extreloff, self.nextrel, self.locreloff, self.nlocrel = data.get_n_uint32(18)
+            self.ilocalsym, self.nlocalsym, self.iextdefsym, self.nextdefsym, self.iundefsym, self.nundefsym, self.tocoff, self.ntoc, self.modtaboff, self.nmodtab, self.extrefsymoff, self.nextrefsyms, self.indirectsymoff, self.nindirectsyms, self.extreloff, self.nextrel, self.locreloff, self.nlocrel = data.get_n_uint32(
+                18)
 
         def __str__(self):
-            s = Mach.LoadCommand.__str__(self);
+            s = Mach.LoadCommand.__str__(self)
             # s += "ilocalsym = %u, nlocalsym = %u, " % (self.ilocalsym, self.nlocalsym)
             # s += "iextdefsym = %u, nextdefsym = %u, " % (self.iextdefsym, self.nextdefsym)
             # s += "iundefsym %u, nundefsym = %u, " % (self.iundefsym, self.nundefsym)
@@ -1375,20 +1427,31 @@ class Mach:
             # s += "extrefsymoff = %#8.8x, nextrefsyms = %u, " % (self.extrefsymoff, self.nextrefsyms)
             # s += "indirectsymoff = %#8.8x, nindirectsyms = %u, " % (self.indirectsymoff, self.nindirectsyms)
             # s += "extreloff = %#8.8x, nextrel = %u, " % (self.extreloff, self.nextrel)
-            # s += "locreloff = %#8.8x, nlocrel = %u" % (self.locreloff, self.nlocrel)
-            s += "ilocalsym      = %-10u, nlocalsym     = %u\n" % (self.ilocalsym, self.nlocalsym)
-            s += "                                             iextdefsym     = %-10u, nextdefsym    = %u\n" % (self.iextdefsym, self.nextdefsym)
-            s += "                                             iundefsym      = %-10u, nundefsym     = %u\n" % (self.iundefsym, self.nundefsym)
-            s += "                                             tocoff         = %#8.8x, ntoc          = %u\n" % (self.tocoff, self.ntoc)
-            s += "                                             modtaboff      = %#8.8x, nmodtab       = %u\n" % (self.modtaboff, self.nmodtab)
-            s += "                                             extrefsymoff   = %#8.8x, nextrefsyms   = %u\n" % (self.extrefsymoff, self.nextrefsyms)
-            s += "                                             indirectsymoff = %#8.8x, nindirectsyms = %u\n" % (self.indirectsymoff, self.nindirectsyms)
-            s += "                                             extreloff      = %#8.8x, nextrel       = %u\n" % (self.extreloff, self.nextrel)
-            s += "                                             locreloff      = %#8.8x, nlocrel       = %u" % (self.locreloff, self.nlocrel)
+            # s += "locreloff = %#8.8x, nlocrel = %u" % (self.locreloff,
+            # self.nlocrel)
+            s += "ilocalsym      = %-10u, nlocalsym     = %u\n" % (
+                self.ilocalsym, self.nlocalsym)
+            s += "                                             iextdefsym     = %-10u, nextdefsym    = %u\n" % (
+                self.iextdefsym, self.nextdefsym)
+            s += "                                             iundefsym      = %-10u, nundefsym     = %u\n" % (
+                self.iundefsym, self.nundefsym)
+            s += "                                             tocoff         = %#8.8x, ntoc          = %u\n" % (
+                self.tocoff, self.ntoc)
+            s += "                                             modtaboff      = %#8.8x, nmodtab       = %u\n" % (
+                self.modtaboff, self.nmodtab)
+            s += "                                             extrefsymoff   = %#8.8x, nextrefsyms   = %u\n" % (
+                self.extrefsymoff, self.nextrefsyms)
+            s += "                                             indirectsymoff = %#8.8x, nindirectsyms = %u\n" % (
+                self.indirectsymoff, self.nindirectsyms)
+            s += "                                             extreloff      = %#8.8x, nextrel       = %u\n" % (
+                self.extreloff, self.nextrel)
+            s += "                                             locreloff      = %#8.8x, nlocrel       = %u" % (
+                self.locreloff, self.nlocrel)
             return s
 
-    class SymtabLoadCommand(LoadCommand):                
-        def __init__(self, lc):   
+    class SymtabLoadCommand(LoadCommand):
+
+        def __init__(self, lc):
             Mach.LoadCommand.__init__(self, lc.command, lc.length, lc.file_off)
             self.symoff = 0
             self.nsyms = 0
@@ -1397,16 +1460,18 @@ class Mach:
 
         def unpack(self, mach_file, data):
             byte_order_char = mach_file.magic.get_byte_order()
-            self.symoff, self.nsyms, self.stroff, self.strsize = data.get_n_uint32(4)
-                
+            self.symoff, self.nsyms, self.stroff, self.strsize = data.get_n_uint32(
+                4)
+
         def __str__(self):
-            s = Mach.LoadCommand.__str__(self);
-            s += "symoff = %#8.8x, nsyms = %u, stroff = %#8.8x, strsize = %u" % (self.symoff, self.nsyms, self.stroff, self.strsize)
+            s = Mach.LoadCommand.__str__(self)
+            s += "symoff = %#8.8x, nsyms = %u, stroff = %#8.8x, strsize = %u" % (
+                self.symoff, self.nsyms, self.stroff, self.strsize)
             return s
 
-
     class UUIDLoadCommand(LoadCommand):
-        def __init__(self, lc):   
+
+        def __init__(self, lc):
             Mach.LoadCommand.__init__(self, lc.command, lc.length, lc.file_off)
             self.uuid = None
 
@@ -1419,12 +1484,13 @@ class Mach:
             mach_file.uuid = self.uuid
 
         def __str__(self):
-            s = Mach.LoadCommand.__str__(self);
+            s = Mach.LoadCommand.__str__(self)
             s += self.uuid.__str__()
             return s
 
     class DataBlobLoadCommand(LoadCommand):
-        def __init__(self, lc):   
+
+        def __init__(self, lc):
             Mach.LoadCommand.__init__(self, lc.command, lc.length, lc.file_off)
             self.dataoff = 0
             self.datasize = 0
@@ -1434,12 +1500,14 @@ class Mach:
             self.dataoff, self.datasize = data.get_n_uint32(2)
 
         def __str__(self):
-            s = Mach.LoadCommand.__str__(self);
-            s += "dataoff = %#8.8x, datasize = %u" % (self.dataoff, self.datasize)
+            s = Mach.LoadCommand.__str__(self)
+            s += "dataoff = %#8.8x, datasize = %u" % (
+                self.dataoff, self.datasize)
             return s
 
     class EncryptionInfoLoadCommand(LoadCommand):
-        def __init__(self, lc):   
+
+        def __init__(self, lc):
             Mach.LoadCommand.__init__(self, lc.command, lc.length, lc.file_off)
             self.cryptoff = 0
             self.cryptsize = 0
@@ -1450,13 +1518,14 @@ class Mach:
             self.cryptoff, self.cryptsize, self.cryptid = data.get_n_uint32(3)
 
         def __str__(self):
-            s = Mach.LoadCommand.__str__(self);
-            s += "file-range = [%#8.8x - %#8.8x), cryptsize = %u, cryptid = %u" % (self.cryptoff, self.cryptoff + self.cryptsize, self.cryptsize, self.cryptid)
+            s = Mach.LoadCommand.__str__(self)
+            s += "file-range = [%#8.8x - %#8.8x), cryptsize = %u, cryptid = %u" % (
+                self.cryptoff, self.cryptoff + self.cryptsize, self.cryptsize, self.cryptid)
             return s
 
     class SegmentLoadCommand(LoadCommand):
-        
-        def __init__(self, lc):   
+
+        def __init__(self, lc):
             Mach.LoadCommand.__init__(self, lc.command, lc.length, lc.file_off)
             self.segname = None
             self.vmaddr = 0
@@ -1467,72 +1536,79 @@ class Mach:
             self.initprot = 0
             self.nsects = 0
             self.flags = 0
-        
+
         def unpack(self, mach_file, data):
-            is_64 = self.command.get_enum_value() == LC_SEGMENT_64;
-            self.segname = data.get_fixed_length_c_string (16, '', True)
+            is_64 = self.command.get_enum_value() == LC_SEGMENT_64
+            self.segname = data.get_fixed_length_c_string(16, '', True)
             if is_64:
-                self.vmaddr, self.vmsize, self.fileoff, self.filesize = data.get_n_uint64(4)
+                self.vmaddr, self.vmsize, self.fileoff, self.filesize = data.get_n_uint64(
+                    4)
             else:
-                self.vmaddr, self.vmsize, self.fileoff, self.filesize = data.get_n_uint32(4)
-            self.maxprot, self.initprot, self.nsects, self.flags = data.get_n_uint32(4)
+                self.vmaddr, self.vmsize, self.fileoff, self.filesize = data.get_n_uint32(
+                    4)
+            self.maxprot, self.initprot, self.nsects, self.flags = data.get_n_uint32(
+                4)
             mach_file.segments.append(self)
             for i in range(self.nsects):
                 section = Mach.Section()
                 section.unpack(is_64, data)
-                section.index = len (mach_file.sections)
+                section.index = len(mach_file.sections)
                 mach_file.sections.append(section)
 
-        
         def __str__(self):
-            s = Mach.LoadCommand.__str__(self);
+            s = Mach.LoadCommand.__str__(self)
             if self.command.get_enum_value() == LC_SEGMENT:
-                s += "%#8.8x %#8.8x %#8.8x %#8.8x " % (self.vmaddr, self.vmsize, self.fileoff, self.filesize)
+                s += "%#8.8x %#8.8x %#8.8x %#8.8x " % (
+                    self.vmaddr, self.vmsize, self.fileoff, self.filesize)
             else:
-                s += "%#16.16x %#16.16x %#16.16x %#16.16x " % (self.vmaddr, self.vmsize, self.fileoff, self.filesize)
-            s += "%s %s %3u %#8.8x" % (vm_prot_names[self.maxprot], vm_prot_names[self.initprot], self.nsects, self.flags)
+                s += "%#16.16x %#16.16x %#16.16x %#16.16x " % (
+                    self.vmaddr, self.vmsize, self.fileoff, self.filesize)
+            s += "%s %s %3u %#8.8x" % (vm_prot_names[self.maxprot], vm_prot_names[
+                                       self.initprot], self.nsects, self.flags)
             s += ' ' + self.segname
             return s
 
-    class NList:                
+    class NList:
+
         class Type:
+
             class Stab(dict_utils.Enum):
                 enum = {
-                    'N_GSYM'    : N_GSYM    ,
-                    'N_FNAME'   : N_FNAME   ,
-                    'N_FUN'     : N_FUN     ,
-                    'N_STSYM'   : N_STSYM   ,
-                    'N_LCSYM'   : N_LCSYM   ,
-                    'N_BNSYM'   : N_BNSYM   ,
-                    'N_OPT'     : N_OPT     ,
-                    'N_RSYM'    : N_RSYM    ,
-                    'N_SLINE'   : N_SLINE   ,
-                    'N_ENSYM'   : N_ENSYM   ,
-                    'N_SSYM'    : N_SSYM    ,
-                    'N_SO'      : N_SO      ,
-                    'N_OSO'     : N_OSO     ,
-                    'N_LSYM'    : N_LSYM    ,
-                    'N_BINCL'   : N_BINCL   ,
-                    'N_SOL'     : N_SOL     ,
-                    'N_PARAMS'  : N_PARAMS  ,
-                    'N_VERSION' : N_VERSION ,
-                    'N_OLEVEL'  : N_OLEVEL  ,
-                    'N_PSYM'    : N_PSYM    ,
-                    'N_EINCL'   : N_EINCL   ,
-                    'N_ENTRY'   : N_ENTRY   ,
-                    'N_LBRAC'   : N_LBRAC   ,
-                    'N_EXCL'    : N_EXCL    ,
-                    'N_RBRAC'   : N_RBRAC   ,
-                    'N_BCOMM'   : N_BCOMM   ,
-                    'N_ECOMM'   : N_ECOMM   ,
-                    'N_ECOML'   : N_ECOML   ,
-                    'N_LENG'    : N_LENG
+                    'N_GSYM': N_GSYM,
+                    'N_FNAME': N_FNAME,
+                    'N_FUN': N_FUN,
+                    'N_STSYM': N_STSYM,
+                    'N_LCSYM': N_LCSYM,
+                    'N_BNSYM': N_BNSYM,
+                    'N_OPT': N_OPT,
+                    'N_RSYM': N_RSYM,
+                    'N_SLINE': N_SLINE,
+                    'N_ENSYM': N_ENSYM,
+                    'N_SSYM': N_SSYM,
+                    'N_SO': N_SO,
+                    'N_OSO': N_OSO,
+                    'N_LSYM': N_LSYM,
+                    'N_BINCL': N_BINCL,
+                    'N_SOL': N_SOL,
+                    'N_PARAMS': N_PARAMS,
+                    'N_VERSION': N_VERSION,
+                    'N_OLEVEL': N_OLEVEL,
+                    'N_PSYM': N_PSYM,
+                    'N_EINCL': N_EINCL,
+                    'N_ENTRY': N_ENTRY,
+                    'N_LBRAC': N_LBRAC,
+                    'N_EXCL': N_EXCL,
+                    'N_RBRAC': N_RBRAC,
+                    'N_BCOMM': N_BCOMM,
+                    'N_ECOMM': N_ECOMM,
+                    'N_ECOML': N_ECOML,
+                    'N_LENG': N_LENG
                 }
 
-                def __init__(self, magic = 0):
+                def __init__(self, magic=0):
                     dict_utils.Enum.__init__(self, magic, self.enum)
 
-            def __init__(self, t = 0):
+            def __init__(self, t=0):
                 self.value = t
 
             def __str__(self):
@@ -1561,7 +1637,6 @@ class Mach:
                         type_str += ' | EXT '
                     return type_str
 
-
         def __init__(self):
             self.index = 0
             self.name_offset = 0
@@ -1580,8 +1655,11 @@ class Mach:
                 self.value = data.get_uint64()
             else:
                 self.value = data.get_uint32()
-            data.push_offset_and_seek (mach_file.file_off + symtab_lc.stroff + self.name_offset)
-            #print "get string for symbol[%u]" % self.index
+            data.push_offset_and_seek(
+                mach_file.file_off +
+                symtab_lc.stroff +
+                self.name_offset)
+            # print "get string for symbol[%u]" % self.index
             self.name = data.get_c_string()
             data.pop_offset_and_seek()
 
@@ -1589,12 +1667,12 @@ class Mach:
             name_display = ''
             if len(self.name):
                 name_display = ' "%s"' % self.name
-            return '%#8.8x %#2.2x (%-20s) %#2.2x %#4.4x %16.16x%s' % (self.name_offset, self.type.value, self.type, self.sect_idx, self.desc, self.value, name_display)
-
+            return '%#8.8x %#2.2x (%-20s) %#2.2x %#4.4x %16.16x%s' % (self.name_offset,
+                                                                      self.type.value, self.type, self.sect_idx, self.desc, self.value, name_display)
 
     class Interactive(cmd.Cmd):
         '''Interactive command interpreter to mach-o files.'''
-        
+
         def __init__(self, mach, options):
             cmd.Cmd.__init__(self)
             self.intro = 'Interactive mach-o command interpreter'
@@ -1629,28 +1707,109 @@ class Mach:
             '''Dump all mach-o sections'''
             self.mach.dump_sections(True, self.options)
             return False
-        
+
         def do_symtab(self, line):
             '''Dump all mach-o symbols in the symbol table'''
             self.mach.dump_symtab(True, self.options)
             return False
 
 if __name__ == '__main__':
-    parser = optparse.OptionParser(description='A script that parses skinny and universal mach-o files.')
-    parser.add_option('--arch', '-a', type='string', metavar='arch', dest='archs', action='append', help='specify one or more architectures by name')
-    parser.add_option('-v', '--verbose', action='store_true', dest='verbose', help='display verbose debug info', default=False)
-    parser.add_option('-H', '--header', action='store_true', dest='dump_header', help='dump the mach-o file header', default=False)
-    parser.add_option('-l', '--load-commands', action='store_true', dest='dump_load_commands', help='dump the mach-o load commands', default=False)
-    parser.add_option('-s', '--symtab', action='store_true', dest='dump_symtab', help='dump the mach-o symbol table', default=False)
-    parser.add_option('-S', '--sections', action='store_true', dest='dump_sections', help='dump the mach-o sections', default=False)
-    parser.add_option('--section', type='string', metavar='sectname', dest='section_names', action='append', help='Specify one or more section names to dump', default=[])
-    parser.add_option('-o', '--out', type='string', dest='outfile', help='Used in conjunction with the --section=NAME option to save a single section\'s data to disk.', default=False)
-    parser.add_option('-i', '--interactive', action='store_true', dest='interactive', help='enable interactive mode', default=False)
-    parser.add_option('-m', '--mangled', action='store_true', dest='find_mangled', help='dump all mangled names in a mach file', default=False)
-    parser.add_option('-c', '--compare', action='store_true', dest='compare', help='compare two mach files', default=False)
-    parser.add_option('-M', '--extract-modules', action='store_true', dest='extract_modules', help='Extract modules from file', default=False)
-    parser.add_option('-C', '--count', type='int', dest='max_count', help='Sets the max byte count when dumping section data', default=-1)
-    
+    parser = optparse.OptionParser(
+        description='A script that parses skinny and universal mach-o files.')
+    parser.add_option(
+        '--arch',
+        '-a',
+        type='string',
+        metavar='arch',
+        dest='archs',
+        action='append',
+        help='specify one or more architectures by name')
+    parser.add_option(
+        '-v',
+        '--verbose',
+        action='store_true',
+        dest='verbose',
+        help='display verbose debug info',
+        default=False)
+    parser.add_option(
+        '-H',
+        '--header',
+        action='store_true',
+        dest='dump_header',
+        help='dump the mach-o file header',
+        default=False)
+    parser.add_option(
+        '-l',
+        '--load-commands',
+        action='store_true',
+        dest='dump_load_commands',
+        help='dump the mach-o load commands',
+        default=False)
+    parser.add_option(
+        '-s',
+        '--symtab',
+        action='store_true',
+        dest='dump_symtab',
+        help='dump the mach-o symbol table',
+        default=False)
+    parser.add_option(
+        '-S',
+        '--sections',
+        action='store_true',
+        dest='dump_sections',
+        help='dump the mach-o sections',
+        default=False)
+    parser.add_option(
+        '--section',
+        type='string',
+        metavar='sectname',
+        dest='section_names',
+        action='append',
+        help='Specify one or more section names to dump',
+        default=[])
+    parser.add_option(
+        '-o',
+        '--out',
+        type='string',
+        dest='outfile',
+        help='Used in conjunction with the --section=NAME option to save a single section\'s data to disk.',
+        default=False)
+    parser.add_option(
+        '-i',
+        '--interactive',
+        action='store_true',
+        dest='interactive',
+        help='enable interactive mode',
+        default=False)
+    parser.add_option(
+        '-m',
+        '--mangled',
+        action='store_true',
+        dest='find_mangled',
+        help='dump all mangled names in a mach file',
+        default=False)
+    parser.add_option(
+        '-c',
+        '--compare',
+        action='store_true',
+        dest='compare',
+        help='compare two mach files',
+        default=False)
+    parser.add_option(
+        '-M',
+        '--extract-modules',
+        action='store_true',
+        dest='extract_modules',
+        help='Extract modules from file',
+        default=False)
+    parser.add_option(
+        '-C',
+        '--count',
+        type='int',
+        dest='max_count',
+        help='Sets the max byte count when dumping section data',
+        default=-1)
+
     (options, mach_files) = parser.parse_args()
     if options.extract_modules:
         if options.section_names:
@@ -1683,5 +1842,4 @@ if __name__ == '__main__':
                 interpreter = Mach.Interactive(mach, options)
                 interpreter.cmdloop()
             else:
-                mach.dump(options)            
-
+                mach.dump(options)

Modified: lldb/trunk/examples/python/memory.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/memory.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/examples/python/memory.py (original)
+++ lldb/trunk/examples/python/memory.py Tue Sep  6 15:57:50 2016
@@ -4,7 +4,7 @@
 # Be sure to add the python path that points to the LLDB shared library.
 #
 # # To use this in the embedded python interpreter using "lldb" just
-# import it with the full path using the "command script import" 
+# import it with the full path using the "command script import"
 # command
 #   (lldb) command script import /path/to/cmdtemplate.py
 #----------------------------------------------------------------------
@@ -15,7 +15,7 @@ import os
 import re
 import sys
 
-try: 
+try:
     # Just try for LLDB in case PYTHONPATH is already correctly setup
     import lldb
 except ImportError:
@@ -26,15 +26,20 @@ except ImportError:
         # On Darwin, try the currently selected Xcode directory
         xcode_dir = commands.getoutput("xcode-select --print-path")
         if xcode_dir:
-            lldb_python_dirs.append(os.path.realpath(xcode_dir + '/../SharedFrameworks/LLDB.framework/Resources/Python'))
-            lldb_python_dirs.append(xcode_dir + '/Library/PrivateFrameworks/LLDB.framework/Resources/Python')
-        lldb_python_dirs.append('/System/Library/PrivateFrameworks/LLDB.framework/Resources/Python')
+            lldb_python_dirs.append(
+                os.path.realpath(
+                    xcode_dir +
+                    '/../SharedFrameworks/LLDB.framework/Resources/Python'))
+            lldb_python_dirs.append(
+                xcode_dir + '/Library/PrivateFrameworks/LLDB.framework/Resources/Python')
+        lldb_python_dirs.append(
+            '/System/Library/PrivateFrameworks/LLDB.framework/Resources/Python')
     success = False
     for lldb_python_dir in lldb_python_dirs:
         if os.path.exists(lldb_python_dir):
             if not (sys.path.__contains__(lldb_python_dir)):
                 sys.path.append(lldb_python_dir)
-                try: 
+                try:
                     import lldb
                 except ImportError:
                     pass
@@ -53,52 +58,129 @@ import string
 import struct
 import time
 
+
 def append_data_callback(option, opt_str, value, parser):
     if opt_str == "--uint8":
         int8 = int(value, 0)
-        parser.values.data += struct.pack('1B',int8)
+        parser.values.data += struct.pack('1B', int8)
     if opt_str == "--uint16":
         int16 = int(value, 0)
-        parser.values.data += struct.pack('1H',int16)
+        parser.values.data += struct.pack('1H', int16)
     if opt_str == "--uint32":
         int32 = int(value, 0)
-        parser.values.data += struct.pack('1I',int32)
+        parser.values.data += struct.pack('1I', int32)
     if opt_str == "--uint64":
         int64 = int(value, 0)
-        parser.values.data += struct.pack('1Q',int64)
+        parser.values.data += struct.pack('1Q', int64)
     if opt_str == "--int8":
         int8 = int(value, 0)
-        parser.values.data += struct.pack('1b',int8)
+        parser.values.data += struct.pack('1b', int8)
     if opt_str == "--int16":
         int16 = int(value, 0)
-        parser.values.data += struct.pack('1h',int16)
+        parser.values.data += struct.pack('1h', int16)
     if opt_str == "--int32":
         int32 = int(value, 0)
-        parser.values.data += struct.pack('1i',int32)
+        parser.values.data += struct.pack('1i', int32)
     if opt_str == "--int64":
         int64 = int(value, 0)
-        parser.values.data += struct.pack('1q',int64)
+        parser.values.data += struct.pack('1q', int64)
+
 
 def create_memfind_options():
     usage = "usage: %prog [options] STARTADDR [ENDADDR]"
-    description='''This command can find data in a specified address range. 
+    description = '''This command can find data in a specified address range.
 Options are used to specify the data that is to be looked for and the options
 can be specified multiple times to look for longer streams of data.
 '''
-    parser = optparse.OptionParser(description=description, prog='memfind',usage=usage)
-    parser.add_option('-s', '--size', type='int', metavar='BYTESIZE', dest='size', help='Specify the byte size to search.', default=0)
-    parser.add_option('--int8', action="callback", callback=append_data_callback, type='string', metavar='INT', dest='data', help='Specify a 8 bit signed integer value to search for in memory.', default='')
-    parser.add_option('--int16', action="callback", callback=append_data_callback, type='string', metavar='INT', dest='data', help='Specify a 16 bit signed integer value to search for in memory.', default='')
-    parser.add_option('--int32', action="callback", callback=append_data_callback, type='string', metavar='INT', dest='data', help='Specify a 32 bit signed integer value to search for in memory.', default='')
-    parser.add_option('--int64', action="callback", callback=append_data_callback, type='string', metavar='INT', dest='data', help='Specify a 64 bit signed integer value to search for in memory.', default='')
-    parser.add_option('--uint8', action="callback", callback=append_data_callback, type='string', metavar='INT', dest='data', help='Specify a 8 bit unsigned integer value to search for in memory.', default='')
-    parser.add_option('--uint16', action="callback", callback=append_data_callback, type='string', metavar='INT', dest='data', help='Specify a 16 bit unsigned integer value to search for in memory.', default='')
-    parser.add_option('--uint32', action="callback", callback=append_data_callback, type='string', metavar='INT', dest='data', help='Specify a 32 bit unsigned integer value to search for in memory.', default='')
-    parser.add_option('--uint64', action="callback", callback=append_data_callback, type='string', metavar='INT', dest='data', help='Specify a 64 bit unsigned integer value to search for in memory.', default='')
+    parser = optparse.OptionParser(
+        description=description,
+        prog='memfind',
+        usage=usage)
+    parser.add_option(
+        '-s',
+        '--size',
+        type='int',
+        metavar='BYTESIZE',
+        dest='size',
+        help='Specify the byte size to search.',
+        default=0)
+    parser.add_option(
+        '--int8',
+        action="callback",
+        callback=append_data_callback,
+        type='string',
+        metavar='INT',
+        dest='data',
+        help='Specify a 8 bit signed integer value to search for in memory.',
+        default='')
+    parser.add_option(
+        '--int16',
+        action="callback",
+        callback=append_data_callback,
+        type='string',
+        metavar='INT',
+        dest='data',
+        help='Specify a 16 bit signed integer value to search for in memory.',
+        default='')
+    parser.add_option(
+        '--int32',
+        action="callback",
+        callback=append_data_callback,
+        type='string',
+        metavar='INT',
+        dest='data',
+        help='Specify a 32 bit signed integer value to search for in memory.',
+        default='')
+    parser.add_option(
+        '--int64',
+        action="callback",
+        callback=append_data_callback,
+        type='string',
+        metavar='INT',
+        dest='data',
+        help='Specify a 64 bit signed integer value to search for in memory.',
+        default='')
+    parser.add_option(
+        '--uint8',
+        action="callback",
+        callback=append_data_callback,
+        type='string',
+        metavar='INT',
+        dest='data',
+        help='Specify a 8 bit unsigned integer value to search for in memory.',
+        default='')
+    parser.add_option(
+        '--uint16',
+        action="callback",
+        callback=append_data_callback,
+        type='string',
+        metavar='INT',
+        dest='data',
+        help='Specify a 16 bit unsigned integer value to search for in memory.',
+        default='')
+    parser.add_option(
+        '--uint32',
+        action="callback",
+        callback=append_data_callback,
+        type='string',
+        metavar='INT',
+        dest='data',
+        help='Specify a 32 bit unsigned integer value to search for in memory.',
+        default='')
+    parser.add_option(
+        '--uint64',
+        action="callback",
+        callback=append_data_callback,
+        type='string',
+        metavar='INT',
+        dest='data',
+        help='Specify a 64 bit unsigned integer value to search for in memory.',
+        default='')
     return parser
-    
-def memfind_command (debugger, command, result, dict):
-    # Use the Shell Lexer to properly parse up command options just like a 
+
+
+def memfind_command(debugger, command, result, dict):
+    # Use the Shell Lexer to properly parse up command options just like a
     # shell would
     command_args = shlex.split(command)
     parser = create_memfind_options()
@@ -111,39 +193,49 @@ def memfind_command (debugger, command,
     #     result.SetStatus (lldb.eReturnStatusFailed)
     #     print >>result, "error: option parsing failed" # returning a string is the same as returning an error whose description is the string
     #     return
-    memfind (debugger.GetSelectedTarget(), options, args, result)
-    
+    memfind(debugger.GetSelectedTarget(), options, args, result)
+
+
 def print_error(str, show_usage, result):
     print >>result, str
     if show_usage:
         print >>result, create_memfind_options().format_help()
 
-def memfind (target, options, args, result):
+
+def memfind(target, options, args, result):
     num_args = len(args)
     start_addr = 0
     if num_args == 1:
         if options.size > 0:
-            print_error ("error: --size must be specified if there is no ENDADDR argument", True, result)
+            print_error(
+                "error: --size must be specified if there is no ENDADDR argument",
+                True,
+                result)
             return
         start_addr = int(args[0], 0)
     elif num_args == 2:
         if options.size != 0:
-            print_error ("error: --size can't be specified with an ENDADDR argument", True, result)
+            print_error(
+                "error: --size can't be specified with an ENDADDR argument",
+                True,
+                result)
             return
         start_addr = int(args[0], 0)
         end_addr = int(args[1], 0)
         if start_addr >= end_addr:
-            print_error ("error: inavlid memory range [%#x - %#x)" % (start_addr, end_addr), True, result)
+            print_error(
+                "error: inavlid memory range [%#x - %#x)" %
+                (start_addr, end_addr), True, result)
             return
         options.size = end_addr - start_addr
     else:
-        print_error ("error: memfind takes 1 or 2 arguments", True, result)
+        print_error("error: memfind takes 1 or 2 arguments", True, result)
         return
-    
+
     if not options.data:
         print >>result, 'error: no data specified to search for'
         return
-        
+
     if not target:
         print >>result, 'error: invalid target'
         return
@@ -151,31 +243,34 @@ def memfind (target, options, args, resu
     if not process:
         print >>result, 'error: invalid process'
         return
-    
+
     error = lldb.SBError()
-    bytes = process.ReadMemory (start_addr, options.size, error)
+    bytes = process.ReadMemory(start_addr, options.size, error)
     if error.Success():
         num_matches = 0
-        print >>result, "Searching memory range [%#x - %#x) for" % (start_addr, end_addr),
+        print >>result, "Searching memory range [%#x - %#x) for" % (
+            start_addr, end_addr),
         for byte in options.data:
             print >>result, '%2.2x' % ord(byte),
         print >>result
-        
+
         match_index = string.find(bytes, options.data)
         while match_index != -1:
             num_matches = num_matches + 1
-            print >>result, '%#x: %#x + %u' % (start_addr + match_index, start_addr, match_index)
+            print >>result, '%#x: %#x + %u' % (start_addr +
+                                               match_index, start_addr, match_index)
             match_index = string.find(bytes, options.data, match_index + 1)
-            
+
         if num_matches == 0:
             print >>result, "error: no matches found"
     else:
         print >>result, 'error: %s' % (error.GetCString())
-        
+
 
 if __name__ == '__main__':
     print 'error: this script is designed to be used within the embedded script interpreter in LLDB'
 elif getattr(lldb, 'debugger', None):
     memfind_command.__doc__ = create_memfind_options().format_help()
-    lldb.debugger.HandleCommand('command script add -f memory.memfind_command memfind')
+    lldb.debugger.HandleCommand(
+        'command script add -f memory.memfind_command memfind')
     print '"memfind" command installed, use the "--help" option for detailed help'

Modified: lldb/trunk/examples/python/operating_system.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/operating_system.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/examples/python/operating_system.py (original)
+++ lldb/trunk/examples/python/operating_system.py Tue Sep  6 15:57:50 2016
@@ -3,21 +3,22 @@
 import lldb
 import struct
 
+
 class OperatingSystemPlugIn(object):
     """Class that provides data for an instance of a LLDB 'OperatingSystemPython' plug-in class"""
-    
+
     def __init__(self, process):
         '''Initialization needs a valid.SBProcess object.
-        
+
         This plug-in will get created after a live process is valid and has stopped for the
         first time.'''
         self.process = None
         self.registers = None
         self.threads = None
-        if type(process) is lldb.SBProcess and process.IsValid():
+        if isinstance(process, lldb.SBProcess) and process.IsValid():
             self.process = process
-            self.threads = None # Will be an dictionary containing info for each thread
-    
+            self.threads = None  # Will be an dictionary containing info for each thread
+
     def get_target(self):
         # NOTE: Don't use "lldb.target" when trying to get your target as the "lldb.target"
         # tracks the current target in the LLDB command interpreter which isn't the
@@ -26,11 +27,16 @@ class OperatingSystemPlugIn(object):
 
     def create_thread(self, tid, context):
         if tid == 0x444444444:
-            thread_info = { 'tid' : tid, 'name' : 'four'  , 'queue' : 'queue4', 'state' : 'stopped', 'stop_reason' : 'none' }
+            thread_info = {
+                'tid': tid,
+                'name': 'four',
+                'queue': 'queue4',
+                'state': 'stopped',
+                'stop_reason': 'none'}
             self.threads.append(thread_info)
             return thread_info
         return None
-        
+
     def get_thread_info(self):
         if not self.threads:
             # The sample dictionary below shows the values that can be returned for a thread
@@ -48,57 +54,178 @@ class OperatingSystemPlugIn(object):
             #   Specifying this key/value pair for a thread will avoid a call to get_register_data()
             #   and can be used when your registers are in a thread context structure that is contiguous
             #   in memory. Don't specify this if your register layout in memory doesn't match the layout
-            #   described by the dictionary returned from a call to the get_register_info() method.
-            self.threads = [
-                    { 'tid' : 0x111111111, 'name' : 'one'  , 'queue' : 'queue1', 'state' : 'stopped', 'stop_reason' : 'breakpoint'},
-                    { 'tid' : 0x222222222, 'name' : 'two'  , 'queue' : 'queue2', 'state' : 'stopped', 'stop_reason' : 'none'      },
-                    { 'tid' : 0x333333333, 'name' : 'three', 'queue' : 'queue3', 'state' : 'stopped', 'stop_reason' : 'trace'     , 'register_data_addr' : 0x100000000 }
-                ]
+            # described by the dictionary returned from a call to the
+            # get_register_info() method.
+            self.threads = [{'tid': 0x111111111,
+                             'name': 'one',
+                             'queue': 'queue1',
+                             'state': 'stopped',
+                             'stop_reason': 'breakpoint'},
+                            {'tid': 0x222222222,
+                             'name': 'two',
+                             'queue': 'queue2',
+                             'state': 'stopped',
+                             'stop_reason': 'none'},
+                            {'tid': 0x333333333,
+                             'name': 'three',
+                             'queue': 'queue3',
+                             'state': 'stopped',
+                             'stop_reason': 'trace',
+                             'register_data_addr': 0x100000000}]
         return self.threads
-    
+
     def get_register_info(self):
-        if self.registers == None:
-            self.registers = dict()            
+        if self.registers is None:
+            self.registers = dict()
             triple = self.process.target.triple
             if triple:
                 arch = triple.split('-')[0]
                 if arch == 'x86_64':
                     self.registers['sets'] = ['GPR', 'FPU', 'EXC']
                     self.registers['registers'] = [
-                        { 'name':'rax'       , 'bitsize' :  64, 'offset' :   0, 'encoding':'uint'  , 'format':'hex'         , 'set': 0, 'gcc' : 0, 'dwarf' : 0},
-                        { 'name':'rbx'       , 'bitsize' :  64, 'offset' :   8, 'encoding':'uint'  , 'format':'hex'         , 'set': 0, 'gcc' : 3, 'dwarf' : 3},
-                        { 'name':'rcx'       , 'bitsize' :  64, 'offset' :  16, 'encoding':'uint'  , 'format':'hex'         , 'set': 0, 'gcc' : 2, 'dwarf' : 2, 'generic':'arg4', 'alt-name':'arg4', },
-                        { 'name':'rdx'       , 'bitsize' :  64, 'offset' :  24, 'encoding':'uint'  , 'format':'hex'         , 'set': 0, 'gcc' : 1, 'dwarf' : 1, 'generic':'arg3', 'alt-name':'arg3', },
-                        { 'name':'rdi'       , 'bitsize' :  64, 'offset' :  32, 'encoding':'uint'  , 'format':'hex'         , 'set': 0, 'gcc' : 5, 'dwarf' : 5, 'generic':'arg1', 'alt-name':'arg1', },
-                        { 'name':'rsi'       , 'bitsize' :  64, 'offset' :  40, 'encoding':'uint'  , 'format':'hex'         , 'set': 0, 'gcc' : 4, 'dwarf' : 4, 'generic':'arg2', 'alt-name':'arg2', },
-                        { 'name':'rbp'       , 'bitsize' :  64, 'offset' :  48, 'encoding':'uint'  , 'format':'hex'         , 'set': 0, 'gcc' : 6, 'dwarf' : 6, 'generic':'fp'  , 'alt-name':'fp', },
-                        { 'name':'rsp'       , 'bitsize' :  64, 'offset' :  56, 'encoding':'uint'  , 'format':'hex'         , 'set': 0, 'gcc' : 7, 'dwarf' : 7, 'generic':'sp'  , 'alt-name':'sp', },
-                        { 'name':'r8'        , 'bitsize' :  64, 'offset' :  64, 'encoding':'uint'  , 'format':'hex'         , 'set': 0, 'gcc' : 8, 'dwarf' : 8, 'generic':'arg5', 'alt-name':'arg5', },
-                        { 'name':'r9'        , 'bitsize' :  64, 'offset' :  72, 'encoding':'uint'  , 'format':'hex'         , 'set': 0, 'gcc' : 9, 'dwarf' : 9, 'generic':'arg6', 'alt-name':'arg6', },
-                        { 'name':'r10'       , 'bitsize' :  64, 'offset' :  80, 'encoding':'uint'  , 'format':'hex'         , 'set': 0, 'gcc' : 10, 'dwarf' : 10},
-                        { 'name':'r11'       , 'bitsize' :  64, 'offset' :  88, 'encoding':'uint'  , 'format':'hex'         , 'set': 0, 'gcc' : 11, 'dwarf' : 11},
-                        { 'name':'r12'       , 'bitsize' :  64, 'offset' :  96, 'encoding':'uint'  , 'format':'hex'         , 'set': 0, 'gcc' : 12, 'dwarf' : 12},
-                        { 'name':'r13'       , 'bitsize' :  64, 'offset' : 104, 'encoding':'uint'  , 'format':'hex'         , 'set': 0, 'gcc' : 13, 'dwarf' : 13},
-                        { 'name':'r14'       , 'bitsize' :  64, 'offset' : 112, 'encoding':'uint'  , 'format':'hex'         , 'set': 0, 'gcc' : 14, 'dwarf' : 14},
-                        { 'name':'r15'       , 'bitsize' :  64, 'offset' : 120, 'encoding':'uint'  , 'format':'hex'         , 'set': 0, 'gcc' : 15, 'dwarf' : 15},
-                        { 'name':'rip'       , 'bitsize' :  64, 'offset' : 128, 'encoding':'uint'  , 'format':'hex'         , 'set': 0, 'gcc' : 16, 'dwarf' : 16, 'generic':'pc', 'alt-name':'pc' },
-                        { 'name':'rflags'    , 'bitsize' :  64, 'offset' : 136, 'encoding':'uint'  , 'format':'hex'         , 'set': 0, 'generic':'flags', 'alt-name':'flags' },
-                        { 'name':'cs'        , 'bitsize' :  64, 'offset' : 144, 'encoding':'uint'  , 'format':'hex'         , 'set': 0                          },
-                        { 'name':'fs'        , 'bitsize' :  64, 'offset' : 152, 'encoding':'uint'  , 'format':'hex'         , 'set': 0                          },
-                        { 'name':'gs'        , 'bitsize' :  64, 'offset' : 160, 'encoding':'uint'  , 'format':'hex'         , 'set': 0                          },
-                        ]
+                        {'name': 'rax', 'bitsize': 64, 'offset': 0, 'encoding': 'uint', 'format': 'hex', 'set': 0, 'gcc': 0, 'dwarf': 0},
+                        {'name': 'rbx', 'bitsize': 64, 'offset': 8, 'encoding': 'uint', 'format': 'hex', 'set': 0, 'gcc': 3, 'dwarf': 3},
+                        {'name': 'rcx', 'bitsize': 64, 'offset': 16, 'encoding': 'uint', 'format': 'hex', 'set': 0, 'gcc': 2, 'dwarf': 2, 'generic': 'arg4', 'alt-name': 'arg4', },
+                        {'name': 'rdx', 'bitsize': 64, 'offset': 24, 'encoding': 'uint', 'format': 'hex', 'set': 0, 'gcc': 1, 'dwarf': 1, 'generic': 'arg3', 'alt-name': 'arg3', },
+                        {'name': 'rdi', 'bitsize': 64, 'offset': 32, 'encoding': 'uint', 'format': 'hex', 'set': 0, 'gcc': 5, 'dwarf': 5, 'generic': 'arg1', 'alt-name': 'arg1', },
+                        {'name': 'rsi', 'bitsize': 64, 'offset': 40, 'encoding': 'uint', 'format': 'hex', 'set': 0, 'gcc': 4, 'dwarf': 4, 'generic': 'arg2', 'alt-name': 'arg2', },
+                        {'name': 'rbp', 'bitsize': 64, 'offset': 48, 'encoding': 'uint', 'format': 'hex', 'set': 0, 'gcc': 6, 'dwarf': 6, 'generic': 'fp', 'alt-name': 'fp', },
+                        {'name': 'rsp', 'bitsize': 64, 'offset': 56, 'encoding': 'uint', 'format': 'hex', 'set': 0, 'gcc': 7, 'dwarf': 7, 'generic': 'sp', 'alt-name': 'sp', },
+                        {'name': 'r8', 'bitsize': 64, 'offset': 64, 'encoding': 'uint', 'format': 'hex', 'set': 0, 'gcc': 8, 'dwarf': 8, 'generic': 'arg5', 'alt-name': 'arg5', },
+                        {'name': 'r9', 'bitsize': 64, 'offset': 72, 'encoding': 'uint', 'format': 'hex', 'set': 0, 'gcc': 9, 'dwarf': 9, 'generic': 'arg6', 'alt-name': 'arg6', },
+                        {'name': 'r10', 'bitsize': 64, 'offset': 80, 'encoding': 'uint', 'format': 'hex', 'set': 0, 'gcc': 10, 'dwarf': 10},
+                        {'name': 'r11', 'bitsize': 64, 'offset': 88, 'encoding': 'uint', 'format': 'hex', 'set': 0, 'gcc': 11, 'dwarf': 11},
+                        {'name': 'r12', 'bitsize': 64, 'offset': 96, 'encoding': 'uint', 'format': 'hex', 'set': 0, 'gcc': 12, 'dwarf': 12},
+                        {'name': 'r13', 'bitsize': 64, 'offset': 104, 'encoding': 'uint', 'format': 'hex', 'set': 0, 'gcc': 13, 'dwarf': 13},
+                        {'name': 'r14', 'bitsize': 64, 'offset': 112, 'encoding': 'uint', 'format': 'hex', 'set': 0, 'gcc': 14, 'dwarf': 14},
+                        {'name': 'r15', 'bitsize': 64, 'offset': 120, 'encoding': 'uint', 'format': 'hex', 'set': 0, 'gcc': 15, 'dwarf': 15},
+                        {'name': 'rip', 'bitsize': 64, 'offset': 128, 'encoding': 'uint', 'format': 'hex', 'set': 0, 'gcc': 16, 'dwarf': 16, 'generic': 'pc', 'alt-name': 'pc'},
+                        {'name': 'rflags', 'bitsize': 64, 'offset': 136, 'encoding': 'uint', 'format': 'hex', 'set': 0, 'generic': 'flags', 'alt-name': 'flags'},
+                        {'name': 'cs', 'bitsize': 64, 'offset': 144, 'encoding': 'uint', 'format': 'hex', 'set': 0},
+                        {'name': 'fs', 'bitsize': 64, 'offset': 152, 'encoding': 'uint', 'format': 'hex', 'set': 0},
+                        {'name': 'gs', 'bitsize': 64, 'offset': 160, 'encoding': 'uint', 'format': 'hex', 'set': 0},
+                    ]
         return self.registers
-            
+
     def get_register_data(self, tid):
         if tid == 0x111111111:
-            return struct.pack('21Q',1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21);
+            return struct.pack(
+                '21Q',
+                1,
+                2,
+                3,
+                4,
+                5,
+                6,
+                7,
+                8,
+                9,
+                10,
+                11,
+                12,
+                13,
+                14,
+                15,
+                16,
+                17,
+                18,
+                19,
+                20,
+                21)
         elif tid == 0x222222222:
-            return struct.pack('21Q',11,12,13,14,15,16,17,18,19,110,111,112,113,114,115,116,117,118,119,120,121);
+            return struct.pack(
+                '21Q',
+                11,
+                12,
+                13,
+                14,
+                15,
+                16,
+                17,
+                18,
+                19,
+                110,
+                111,
+                112,
+                113,
+                114,
+                115,
+                116,
+                117,
+                118,
+                119,
+                120,
+                121)
         elif tid == 0x333333333:
-            return struct.pack('21Q',21,22,23,24,25,26,27,28,29,210,211,212,213,214,215,216,217,218,219,220,221);
+            return struct.pack(
+                '21Q',
+                21,
+                22,
+                23,
+                24,
+                25,
+                26,
+                27,
+                28,
+                29,
+                210,
+                211,
+                212,
+                213,
+                214,
+                215,
+                216,
+                217,
+                218,
+                219,
+                220,
+                221)
         elif tid == 0x444444444:
-            return struct.pack('21Q',31,32,33,34,35,36,37,38,39,310,311,312,313,314,315,316,317,318,319,320,321);
+            return struct.pack(
+                '21Q',
+                31,
+                32,
+                33,
+                34,
+                35,
+                36,
+                37,
+                38,
+                39,
+                310,
+                311,
+                312,
+                313,
+                314,
+                315,
+                316,
+                317,
+                318,
+                319,
+                320,
+                321)
         else:
-            return struct.pack('21Q',41,42,43,44,45,46,47,48,49,410,411,412,413,414,415,416,417,418,419,420,421);
+            return struct.pack(
+                '21Q',
+                41,
+                42,
+                43,
+                44,
+                45,
+                46,
+                47,
+                48,
+                49,
+                410,
+                411,
+                412,
+                413,
+                414,
+                415,
+                416,
+                417,
+                418,
+                419,
+                420,
+                421)
         return None
-    

Modified: lldb/trunk/examples/python/performance.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/performance.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/examples/python/performance.py (original)
+++ lldb/trunk/examples/python/performance.py Tue Sep  6 15:57:50 2016
@@ -21,7 +21,7 @@ import types
 #----------------------------------------------------------------------
 # Code that auto imports LLDB
 #----------------------------------------------------------------------
-try: 
+try:
     # Just try for LLDB in case PYTHONPATH is already correctly setup
     import lldb
 except ImportError:
@@ -32,15 +32,20 @@ except ImportError:
         # On Darwin, try the currently selected Xcode directory
         xcode_dir = commands.getoutput("xcode-select --print-path")
         if xcode_dir:
-            lldb_python_dirs.append(os.path.realpath(xcode_dir + '/../SharedFrameworks/LLDB.framework/Resources/Python'))
-            lldb_python_dirs.append(xcode_dir + '/Library/PrivateFrameworks/LLDB.framework/Resources/Python')
-        lldb_python_dirs.append('/System/Library/PrivateFrameworks/LLDB.framework/Resources/Python')
+            lldb_python_dirs.append(
+                os.path.realpath(
+                    xcode_dir +
+                    '/../SharedFrameworks/LLDB.framework/Resources/Python'))
+            lldb_python_dirs.append(
+                xcode_dir + '/Library/PrivateFrameworks/LLDB.framework/Resources/Python')
+        lldb_python_dirs.append(
+            '/System/Library/PrivateFrameworks/LLDB.framework/Resources/Python')
     success = False
     for lldb_python_dir in lldb_python_dirs:
         if os.path.exists(lldb_python_dir):
             if not (sys.path.__contains__(lldb_python_dir)):
                 sys.path.append(lldb_python_dir)
-                try: 
+                try:
                     import lldb
                 except ImportError:
                     pass
@@ -53,7 +58,8 @@ except ImportError:
         sys.exit(1)
 
 
-class Timer:    
+class Timer:
+
     def __enter__(self):
         self.start = time.clock()
         return self
@@ -62,30 +68,45 @@ class Timer:
         self.end = time.clock()
         self.interval = self.end - self.start
 
+
 class Action(object):
     """Class that encapsulates actions to take when a thread stops for a reason."""
-    def __init__(self, callback = None, callback_owner = None):
+
+    def __init__(self, callback=None, callback_owner=None):
         self.callback = callback
         self.callback_owner = callback_owner
-    def ThreadStopped (self, thread):
+
+    def ThreadStopped(self, thread):
         assert False, "performance.Action.ThreadStopped(self, thread) must be overridden in a subclass"
 
+
 class PlanCompleteAction (Action):
-    def __init__(self, callback = None, callback_owner = None):
+
+    def __init__(self, callback=None, callback_owner=None):
         Action.__init__(self, callback, callback_owner)
-    def ThreadStopped (self, thread):
+
+    def ThreadStopped(self, thread):
         if thread.GetStopReason() == lldb.eStopReasonPlanComplete:
             if self.callback:
                 if self.callback_owner:
-                    self.callback (self.callback_owner, thread)
+                    self.callback(self.callback_owner, thread)
                 else:
-                    self.callback (thread)
+                    self.callback(thread)
             return True
         return False
 
 
 class BreakpointAction (Action):
-    def __init__(self, callback = None, callback_owner = None, name = None, module = None, file = None, line = None, breakpoint = None):
+
+    def __init__(
+            self,
+            callback=None,
+            callback_owner=None,
+            name=None,
+            module=None,
+            file=None,
+            line=None,
+            breakpoint=None):
         Action.__init__(self, callback, callback_owner)
         self.modules = lldb.SBFileSpecList()
         self.files = lldb.SBFileSpecList()
@@ -97,7 +118,8 @@ class BreakpointAction (Action):
             if module:
                 if isinstance(module, types.ListType):
                     for module_path in module:
-                        self.modules.Append(lldb.SBFileSpec(module_path, False))
+                        self.modules.Append(
+                            lldb.SBFileSpec(module_path, False))
                 elif isinstance(module, types.StringTypes):
                     self.modules.Append(lldb.SBFileSpec(module, False))
             if name:
@@ -109,22 +131,30 @@ class BreakpointAction (Action):
                             self.files.Append(lldb.SBFileSpec(f, False))
                     elif isinstance(file, types.StringTypes):
                         self.files.Append(lldb.SBFileSpec(file, False))
-                self.breakpoints.append (self.target.BreakpointCreateByName(name, self.modules, self.files))
+                self.breakpoints.append(
+                    self.target.BreakpointCreateByName(
+                        name, self.modules, self.files))
             elif file and line:
-                self.breakpoints.append (self.target.BreakpointCreateByLocation(file, line))
-    def ThreadStopped (self, thread):
+                self.breakpoints.append(
+                    self.target.BreakpointCreateByLocation(
+                        file, line))
+
+    def ThreadStopped(self, thread):
         if thread.GetStopReason() == lldb.eStopReasonBreakpoint:
             for bp in self.breakpoints:
                 if bp.GetID() == thread.GetStopReasonDataAtIndex(0):
                     if self.callback:
                         if self.callback_owner:
-                            self.callback (self.callback_owner, thread)
+                            self.callback(self.callback_owner, thread)
                         else:
-                            self.callback (thread)
+                            self.callback(thread)
                     return True
         return False
+
+
 class TestCase:
     """Class that aids in running performance tests."""
+
     def __init__(self):
         self.verbose = False
         self.debugger = lldb.SBDebugger.Create()
@@ -137,36 +167,37 @@ class TestCase:
         self.user_actions = list()
         self.builtin_actions = list()
         self.bp_id_to_dict = dict()
-        
+
     def Setup(self, args):
         self.launch_info = lldb.SBLaunchInfo(args)
-        
-    def Run (self, args):
+
+    def Run(self, args):
         assert False, "performance.TestCase.Run(self, args) must be subclassed"
-    
+
     def Launch(self):
         if self.target:
             error = lldb.SBError()
-            self.process = self.target.Launch (self.launch_info, error)
+            self.process = self.target.Launch(self.launch_info, error)
             if not error.Success():
                 print "error: %s" % error.GetCString()
             if self.process:
-                self.process.GetBroadcaster().AddListener(self.listener, lldb.SBProcess.eBroadcastBitStateChanged | lldb.SBProcess.eBroadcastBitInterrupt)
+                self.process.GetBroadcaster().AddListener(self.listener,
+                                                          lldb.SBProcess.eBroadcastBitStateChanged | lldb.SBProcess.eBroadcastBitInterrupt)
                 return True
         return False
-        
-    def WaitForNextProcessEvent (self):
+
+    def WaitForNextProcessEvent(self):
         event = None
         if self.process:
             while event is None:
                 process_event = lldb.SBEvent()
-                if self.listener.WaitForEvent (lldb.UINT32_MAX, process_event):
-                    state = lldb.SBProcess.GetStateFromEvent (process_event)
+                if self.listener.WaitForEvent(lldb.UINT32_MAX, process_event):
+                    state = lldb.SBProcess.GetStateFromEvent(process_event)
                     if self.verbose:
                         print "event = %s" % (lldb.SBDebugger.StateAsCString(state))
                     if lldb.SBProcess.GetRestartedFromEvent(process_event):
                         continue
-                    if state == lldb.eStateInvalid or state == lldb.eStateDetached or state == lldb.eStateCrashed or  state == lldb.eStateUnloaded or state == lldb.eStateExited:
+                    if state == lldb.eStateInvalid or state == lldb.eStateDetached or state == lldb.eStateCrashed or state == lldb.eStateUnloaded or state == lldb.eStateExited:
                         event = process_event
                         self.done = True
                     elif state == lldb.eStateConnected or state == lldb.eStateAttaching or state == lldb.eStateLaunching or state == lldb.eStateRunning or state == lldb.eStateStepping or state == lldb.eStateSuspended:
@@ -179,10 +210,10 @@ class TestCase:
                         for thread in self.process:
                             frame = thread.GetFrameAtIndex(0)
                             select_thread = False
-                            
+
                             stop_reason = thread.GetStopReason()
                             if self.verbose:
-                                print "tid = %#x pc = %#x " % (thread.GetThreadID(),frame.GetPC()),
+                                print "tid = %#x pc = %#x " % (thread.GetThreadID(), frame.GetPC()),
                             if stop_reason == lldb.eStopReasonNone:
                                 if self.verbose:
                                     print "none"
@@ -222,37 +253,53 @@ class TestCase:
                                 select_thread = True
                                 if self.verbose:
                                     print "signal %d" % (thread.GetStopReasonDataAtIndex(0))
-                            
+
                             if select_thread and not selected_thread:
                                 self.thread = thread
-                                selected_thread = self.process.SetSelectedThread(thread)
-                            
+                                selected_thread = self.process.SetSelectedThread(
+                                    thread)
+
                             for action in self.user_actions:
-                                action.ThreadStopped (thread)
-                                    
+                                action.ThreadStopped(thread)
 
                         if fatal:
-                            # if self.verbose: 
+                            # if self.verbose:
                             #     Xcode.RunCommand(self.debugger,"bt all",true)
                             sys.exit(1)
         return event
-    
+
+
 class Measurement:
     '''A class that encapsulates a measurement'''
+
     def __init__(self):
         object.__init__(self)
+
     def Measure(self):
         assert False, "performance.Measurement.Measure() must be subclassed"
-        
+
+
 class MemoryMeasurement(Measurement):
     '''A class that can measure memory statistics for a process.'''
+
     def __init__(self, pid):
         Measurement.__init__(self)
         self.pid = pid
-        self.stats = ["rprvt","rshrd","rsize","vsize","vprvt","kprvt","kshrd","faults","cow","pageins"]
-        self.command = "top -l 1 -pid %u -stats %s" % (self.pid, ",".join(self.stats))
+        self.stats = [
+            "rprvt",
+            "rshrd",
+            "rsize",
+            "vsize",
+            "vprvt",
+            "kprvt",
+            "kshrd",
+            "faults",
+            "cow",
+            "pageins"]
+        self.command = "top -l 1 -pid %u -stats %s" % (
+            self.pid, ",".join(self.stats))
         self.value = dict()
-    
+
     def Measure(self):
         output = commands.getoutput(self.command).split("\n")[-1]
         values = re.split('[-+\s]+', output)
@@ -263,14 +310,14 @@ class MemoryMeasurement(Measurement):
                     multiplier = 1024
                     stat = stat[:-1]
                 elif stat[-1] == 'M':
-                    multiplier = 1024*1024
+                    multiplier = 1024 * 1024
                     stat = stat[:-1]
                 elif stat[-1] == 'G':
-                    multiplier = 1024*1024*1024
+                    multiplier = 1024 * 1024 * 1024
                 elif stat[-1] == 'T':
-                    multiplier = 1024*1024*1024*1024
+                    multiplier = 1024 * 1024 * 1024 * 1024
                     stat = stat[:-1]
-                self.value[self.stats[idx]] = int (stat) * multiplier
+                self.value[self.stats[idx]] = int(stat) * multiplier
 
     def __str__(self):
         '''Dump the MemoryMeasurement current value'''
@@ -282,37 +329,47 @@ class MemoryMeasurement(Measurement):
         return s
 
 
-class TesterTestCase(TestCase):    
+class TesterTestCase(TestCase):
+
     def __init__(self):
         TestCase.__init__(self)
         self.verbose = True
         self.num_steps = 5
-    
-    def BreakpointHit (self, thread):
+
+    def BreakpointHit(self, thread):
         bp_id = thread.GetStopReasonDataAtIndex(0)
         loc_id = thread.GetStopReasonDataAtIndex(1)
         print "Breakpoint %i.%i hit: %s" % (bp_id, loc_id, thread.process.target.FindBreakpointByID(bp_id))
         thread.StepOver()
-    
-    def PlanComplete (self, thread):
+
+    def PlanComplete(self, thread):
         if self.num_steps > 0:
             thread.StepOver()
             self.num_steps = self.num_steps - 1
         else:
             thread.process.Kill()
 
-    def Run (self, args):
+    def Run(self, args):
         self.Setup(args)
         with Timer() as total_time:
             self.target = self.debugger.CreateTarget(args[0])
             if self.target:
                 with Timer() as breakpoint_timer:
                     bp = self.target.BreakpointCreateByName("main")
-                print('Breakpoint time = %.03f sec.' % breakpoint_timer.interval)
-                
-                self.user_actions.append (BreakpointAction(breakpoint=bp, callback=TesterTestCase.BreakpointHit, callback_owner=self))
-                self.user_actions.append (PlanCompleteAction(callback=TesterTestCase.PlanComplete, callback_owner=self))
-                
+                print(
+                    'Breakpoint time = %.03f sec.' %
+                    breakpoint_timer.interval)
+
+                self.user_actions.append(
+                    BreakpointAction(
+                        breakpoint=bp,
+                        callback=TesterTestCase.BreakpointHit,
+                        callback_owner=self))
+                self.user_actions.append(
+                    PlanCompleteAction(
+                        callback=TesterTestCase.PlanComplete,
+                        callback_owner=self))
+
                 if self.Launch():
                     while not self.done:
                         self.WaitForNextProcessEvent()
@@ -321,12 +378,12 @@ class TesterTestCase(TestCase):
             else:
                 print "error: failed to create target with '%s'" % (args[0])
         print('Total time = %.03f sec.' % total_time.interval)
-        
+
 
 if __name__ == '__main__':
     lldb.SBDebugger.Initialize()
     test = TesterTestCase()
-    test.Run (sys.argv[1:])
+    test.Run(sys.argv[1:])
     mem = MemoryMeasurement(os.getpid())
     mem.Measure()
     print str(mem)

Modified: lldb/trunk/examples/python/process_events.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/process_events.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/examples/python/process_events.py (original)
+++ lldb/trunk/examples/python/process_events.py Tue Sep  6 15:57:50 2016
@@ -17,7 +17,7 @@ import sys
 #----------------------------------------------------------------------
 # Code that auto imports LLDB
 #----------------------------------------------------------------------
-try: 
+try:
     # Just try for LLDB in case PYTHONPATH is already correctly setup
     import lldb
 except ImportError:
@@ -28,15 +28,20 @@ except ImportError:
         # On Darwin, try the currently selected Xcode directory
         xcode_dir = commands.getoutput("xcode-select --print-path")
         if xcode_dir:
-            lldb_python_dirs.append(os.path.realpath(xcode_dir + '/../SharedFrameworks/LLDB.framework/Resources/Python'))
-            lldb_python_dirs.append(xcode_dir + '/Library/PrivateFrameworks/LLDB.framework/Resources/Python')
-        lldb_python_dirs.append('/System/Library/PrivateFrameworks/LLDB.framework/Resources/Python')
+            lldb_python_dirs.append(
+                os.path.realpath(
+                    xcode_dir +
+                    '/../SharedFrameworks/LLDB.framework/Resources/Python'))
+            lldb_python_dirs.append(
+                xcode_dir + '/Library/PrivateFrameworks/LLDB.framework/Resources/Python')
+        lldb_python_dirs.append(
+            '/System/Library/PrivateFrameworks/LLDB.framework/Resources/Python')
     success = False
     for lldb_python_dir in lldb_python_dirs:
         if os.path.exists(lldb_python_dir):
             if not (sys.path.__contains__(lldb_python_dir)):
                 sys.path.append(lldb_python_dir)
-                try: 
+                try:
                     import lldb
                 except ImportError:
                     pass
@@ -48,117 +53,241 @@ except ImportError:
         print "error: couldn't locate the 'lldb' module, please set PYTHONPATH correctly"
         sys.exit(1)
 
+
 def print_threads(process, options):
     if options.show_threads:
         for thread in process:
             print '%s %s' % (thread, thread.GetFrameAtIndex(0))
 
+
 def run_commands(command_interpreter, commands):
     return_obj = lldb.SBCommandReturnObject()
     for command in commands:
-        command_interpreter.HandleCommand( command, return_obj )
+        command_interpreter.HandleCommand(command, return_obj)
         if return_obj.Succeeded():
             print return_obj.GetOutput()
         else:
             print return_obj
             if options.stop_on_error:
                 break
-    
+
+
 def main(argv):
-    description='''Debugs a program using the LLDB python API and uses asynchronous broadcast events to watch for process state changes.'''
-    epilog='''Examples:
+    description = '''Debugs a program using the LLDB python API and uses asynchronous broadcast events to watch for process state changes.'''
+    epilog = '''Examples:
 
 #----------------------------------------------------------------------
-# Run "/bin/ls" with the arguments "-lAF /tmp/", and set a breakpoint 
+# Run "/bin/ls" with the arguments "-lAF /tmp/", and set a breakpoint
 # at "malloc" and backtrace and read all registers each time we stop
 #----------------------------------------------------------------------
 % ./process_events.py --breakpoint malloc --stop-command bt --stop-command 'register read' -- /bin/ls -lAF /tmp/
 
 '''
     optparse.OptionParser.format_epilog = lambda self, formatter: self.epilog
-    parser = optparse.OptionParser(description=description, prog='process_events',usage='usage: process_events [options] program [arg1 arg2]', epilog=epilog)
-    parser.add_option('-v', '--verbose', action='store_true', dest='verbose', help="Enable verbose logging.", default=False)
-    parser.add_option('-b', '--breakpoint', action='append', type='string', metavar='BPEXPR', dest='breakpoints', help='Breakpoint commands to create after the target has been created, the values will be sent to the "_regexp-break" command which supports breakpoints by name, file:line, and address.')
-    parser.add_option('-a', '--arch', type='string', dest='arch', help='The architecture to use when creating the debug target.', default=None)
-    parser.add_option('--platform', type='string', metavar='platform', dest='platform', help='Specify the platform to use when creating the debug target. Valid values include "localhost", "darwin-kernel", "ios-simulator", "remote-freebsd", "remote-macosx", "remote-ios", "remote-linux".', default=None)
-    parser.add_option('-l', '--launch-command', action='append', type='string', metavar='CMD', dest='launch_commands', help='LLDB command interpreter commands to run once after the process has launched. This option can be specified more than once.', default=[])
-    parser.add_option('-s', '--stop-command', action='append', type='string', metavar='CMD', dest='stop_commands', help='LLDB command interpreter commands to run each time the process stops. This option can be specified more than once.', default=[])
-    parser.add_option('-c', '--crash-command', action='append', type='string', metavar='CMD', dest='crash_commands', help='LLDB command interpreter commands to run in case the process crashes. This option can be specified more than once.', default=[])
-    parser.add_option('-x', '--exit-command', action='append', type='string', metavar='CMD', dest='exit_commands', help='LLDB command interpreter commands to run once after the process has exited. This option can be specified more than once.', default=[])
-    parser.add_option('-T', '--no-threads', action='store_false', dest='show_threads', help="Don't show threads when process stops.", default=True)
-    parser.add_option('--ignore-errors', action='store_false', dest='stop_on_error', help="Don't stop executing LLDB commands if the command returns an error. This applies to all of the LLDB command interpreter commands that get run for launch, stop, crash and exit.", default=True)
-    parser.add_option('-n', '--run-count', type='int', dest='run_count', metavar='N', help='How many times to run the process in case the process exits.', default=1)
-    parser.add_option('-t', '--event-timeout', type='int', dest='event_timeout', metavar='SEC', help='Specify the timeout in seconds to wait for process state change events.', default=lldb.UINT32_MAX)
-    parser.add_option('-e', '--environment', action='append', type='string', metavar='ENV', dest='env_vars', help='Environment variables to set in the inferior process when launching a process.')
-    parser.add_option('-d', '--working-dir', type='string', metavar='DIR', dest='working_dir', help='The the current working directory when launching a process.', default=None)
-    parser.add_option('-p', '--attach-pid', type='int', dest='attach_pid', metavar='PID', help='Specify a process to attach to by process ID.', default=-1)
-    parser.add_option('-P', '--attach-name', type='string', dest='attach_name', metavar='PROCESSNAME', help='Specify a process to attach to by name.', default=None)
-    parser.add_option('-w', '--attach-wait', action='store_true', dest='attach_wait', help='Wait for the next process to launch when attaching to a process by name.', default=False)
+    parser = optparse.OptionParser(
+        description=description,
+        prog='process_events',
+        usage='usage: process_events [options] program [arg1 arg2]',
+        epilog=epilog)
+    parser.add_option(
+        '-v',
+        '--verbose',
+        action='store_true',
+        dest='verbose',
+        help="Enable verbose logging.",
+        default=False)
+    parser.add_option(
+        '-b',
+        '--breakpoint',
+        action='append',
+        type='string',
+        metavar='BPEXPR',
+        dest='breakpoints',
+        help='Breakpoint commands to create after the target has been created, the values will be sent to the "_regexp-break" command which supports breakpoints by name, file:line, and address.')
+    parser.add_option(
+        '-a',
+        '--arch',
+        type='string',
+        dest='arch',
+        help='The architecture to use when creating the debug target.',
+        default=None)
+    parser.add_option(
+        '--platform',
+        type='string',
+        metavar='platform',
+        dest='platform',
+        help='Specify the platform to use when creating the debug target. Valid values include "localhost", "darwin-kernel", "ios-simulator", "remote-freebsd", "remote-macosx", "remote-ios", "remote-linux".',
+        default=None)
+    parser.add_option(
+        '-l',
+        '--launch-command',
+        action='append',
+        type='string',
+        metavar='CMD',
+        dest='launch_commands',
+        help='LLDB command interpreter commands to run once after the process has launched. This option can be specified more than once.',
+        default=[])
+    parser.add_option(
+        '-s',
+        '--stop-command',
+        action='append',
+        type='string',
+        metavar='CMD',
+        dest='stop_commands',
+        help='LLDB command interpreter commands to run each time the process stops. This option can be specified more than once.',
+        default=[])
+    parser.add_option(
+        '-c',
+        '--crash-command',
+        action='append',
+        type='string',
+        metavar='CMD',
+        dest='crash_commands',
+        help='LLDB command interpreter commands to run in case the process crashes. This option can be specified more than once.',
+        default=[])
+    parser.add_option(
+        '-x',
+        '--exit-command',
+        action='append',
+        type='string',
+        metavar='CMD',
+        dest='exit_commands',
+        help='LLDB command interpreter commands to run once after the process has exited. This option can be specified more than once.',
+        default=[])
+    parser.add_option(
+        '-T',
+        '--no-threads',
+        action='store_false',
+        dest='show_threads',
+        help="Don't show threads when process stops.",
+        default=True)
+    parser.add_option(
+        '--ignore-errors',
+        action='store_false',
+        dest='stop_on_error',
+        help="Don't stop executing LLDB commands if the command returns an error. This applies to all of the LLDB command interpreter commands that get run for launch, stop, crash and exit.",
+        default=True)
+    parser.add_option(
+        '-n',
+        '--run-count',
+        type='int',
+        dest='run_count',
+        metavar='N',
+        help='How many times to run the process in case the process exits.',
+        default=1)
+    parser.add_option(
+        '-t',
+        '--event-timeout',
+        type='int',
+        dest='event_timeout',
+        metavar='SEC',
+        help='Specify the timeout in seconds to wait for process state change events.',
+        default=lldb.UINT32_MAX)
+    parser.add_option(
+        '-e',
+        '--environment',
+        action='append',
+        type='string',
+        metavar='ENV',
+        dest='env_vars',
+        help='Environment variables to set in the inferior process when launching a process.')
+    parser.add_option(
+        '-d',
+        '--working-dir',
+        type='string',
+        metavar='DIR',
+        dest='working_dir',
+        help='The the current working directory when launching a process.',
+        default=None)
+    parser.add_option(
+        '-p',
+        '--attach-pid',
+        type='int',
+        dest='attach_pid',
+        metavar='PID',
+        help='Specify a process to attach to by process ID.',
+        default=-1)
+    parser.add_option(
+        '-P',
+        '--attach-name',
+        type='string',
+        dest='attach_name',
+        metavar='PROCESSNAME',
+        help='Specify a process to attach to by name.',
+        default=None)
+    parser.add_option(
+        '-w',
+        '--attach-wait',
+        action='store_true',
+        dest='attach_wait',
+        help='Wait for the next process to launch when attaching to a process by name.',
+        default=False)
     try:
         (options, args) = parser.parse_args(argv)
     except:
         return
-        
+
     attach_info = None
     launch_info = None
     exe = None
     if args:
         exe = args.pop(0)
-        launch_info = lldb.SBLaunchInfo (args)
+        launch_info = lldb.SBLaunchInfo(args)
         if options.env_vars:
             launch_info.SetEnvironmentEntries(options.env_vars, True)
         if options.working_dir:
             launch_info.SetWorkingDirectory(options.working_dir)
     elif options.attach_pid != -1:
         if options.run_count == 1:
-            attach_info = lldb.SBAttachInfo (options.attach_pid)
+            attach_info = lldb.SBAttachInfo(options.attach_pid)
         else:
             print "error: --run-count can't be used with the --attach-pid option"
             sys.exit(1)
     elif not options.attach_name is None:
         if options.run_count == 1:
-            attach_info = lldb.SBAttachInfo (options.attach_name, options.attach_wait)
+            attach_info = lldb.SBAttachInfo(
+                options.attach_name, options.attach_wait)
         else:
             print "error: --run-count can't be used with the --attach-name option"
             sys.exit(1)
     else:
         print 'error: a program path for a program to debug and its arguments are required'
         sys.exit(1)
-        
-    
 
     # Create a new debugger instance
     debugger = lldb.SBDebugger.Create()
-    debugger.SetAsync (True)
+    debugger.SetAsync(True)
     command_interpreter = debugger.GetCommandInterpreter()
     # Create a target from a file and arch
-    
+
     if exe:
         print "Creating a target for '%s'" % exe
     error = lldb.SBError()
-    target = debugger.CreateTarget (exe, options.arch, options.platform, True, error)
-    
+    target = debugger.CreateTarget(
+        exe, options.arch, options.platform, True, error)
+
     if target:
-        
+
         # Set any breakpoints that were specified in the args if we are launching. We use the
-        # command line command to take advantage of the shorthand breakpoint creation
+        # command line command to take advantage of the shorthand breakpoint
+        # creation
         if launch_info and options.breakpoints:
             for bp in options.breakpoints:
-                debugger.HandleCommand( "_regexp-break %s" % (bp))
+                debugger.HandleCommand("_regexp-break %s" % (bp))
             run_commands(command_interpreter, ['breakpoint list'])
-        
+
         for run_idx in range(options.run_count):
             # Launch the process. Since we specified synchronous mode, we won't return
             # from this function until we hit the breakpoint at main
             error = lldb.SBError()
-            
+
             if launch_info:
                 if options.run_count == 1:
                     print 'Launching "%s"...' % (exe)
                 else:
                     print 'Launching "%s"... (launch %u of %u)' % (exe, run_idx + 1, options.run_count)
-            
-                process = target.Launch (launch_info, error)
+
+                process = target.Launch(launch_info, error)
             else:
                 if options.attach_pid != -1:
                     print 'Attaching to process %i...' % (options.attach_pid)
@@ -167,15 +296,16 @@ def main(argv):
                         print 'Waiting for next to process named "%s" to launch...' % (options.attach_name)
                     else:
                         print 'Attaching to existing process named "%s"...' % (options.attach_name)
-                process = target.Attach (attach_info, error)
-            
+                process = target.Attach(attach_info, error)
+
             # Make sure the launch went ok
             if process and process.GetProcessID() != lldb.LLDB_INVALID_PROCESS_ID:
-                
+
                 pid = process.GetProcessID()
                 print 'Process is %i' % (pid)
                 if attach_info:
-                    # continue process if we attached as we won't get an initial event
+                    # continue process if we attached as we won't get an
+                    # initial event
                     process.Continue()
 
                 listener = debugger.GetListener()
@@ -184,9 +314,9 @@ def main(argv):
                 done = False
                 while not done:
                     event = lldb.SBEvent()
-                    if listener.WaitForEvent (options.event_timeout, event):
+                    if listener.WaitForEvent(options.event_timeout, event):
                         if lldb.SBProcess.EventIsProcessEvent(event):
-                            state = lldb.SBProcess.GetStateFromEvent (event)
+                            state = lldb.SBProcess.GetStateFromEvent(event)
                             if state == lldb.eStateInvalid:
                                 # Not a state event
                                 print 'process event = %s' % (event)
@@ -196,42 +326,51 @@ def main(argv):
                                     if stop_idx == 0:
                                         if launch_info:
                                             print "process %u launched" % (pid)
-                                            run_commands(command_interpreter, ['breakpoint list'])
+                                            run_commands(
+                                                command_interpreter, ['breakpoint list'])
                                         else:
                                             print "attached to process %u" % (pid)
                                             for m in target.modules:
                                                 print m
                                             if options.breakpoints:
                                                 for bp in options.breakpoints:
-                                                    debugger.HandleCommand( "_regexp-break %s" % (bp))
-                                                run_commands(command_interpreter, ['breakpoint list'])
-                                        run_commands (command_interpreter, options.launch_commands)
+                                                    debugger.HandleCommand(
+                                                        "_regexp-break %s" % (bp))
+                                                run_commands(
+                                                    command_interpreter, ['breakpoint list'])
+                                        run_commands(
+                                            command_interpreter, options.launch_commands)
                                     else:
                                         if options.verbose:
                                             print "process %u stopped" % (pid)
-                                        run_commands (command_interpreter, options.stop_commands)
+                                        run_commands(
+                                            command_interpreter, options.stop_commands)
                                     stop_idx += 1
-                                    print_threads (process, options)
+                                    print_threads(process, options)
                                     print "continuing process %u" % (pid)
                                     process.Continue()
                                 elif state == lldb.eStateExited:
                                     exit_desc = process.GetExitDescription()
                                     if exit_desc:
-                                        print "process %u exited with status %u: %s" % (pid, process.GetExitStatus (), exit_desc)
+                                        print "process %u exited with status %u: %s" % (pid, process.GetExitStatus(), exit_desc)
                                     else:
-                                        print "process %u exited with status %u" % (pid, process.GetExitStatus ())
-                                    run_commands (command_interpreter, options.exit_commands)
+                                        print "process %u exited with status %u" % (pid, process.GetExitStatus())
+                                    run_commands(
+                                        command_interpreter, options.exit_commands)
                                     done = True
                                 elif state == lldb.eStateCrashed:
                                     print "process %u crashed" % (pid)
-                                    print_threads (process, options)
-                                    run_commands (command_interpreter, options.crash_commands)
+                                    print_threads(process, options)
+                                    run_commands(
+                                        command_interpreter, options.crash_commands)
                                     done = True
                                 elif state == lldb.eStateDetached:
                                     print "process %u detached" % (pid)
                                     done = True
                                 elif state == lldb.eStateRunning:
-                                    # process is running, don't say anything, we will always get one of these after resuming
+                                    # process is running, don't say anything,
+                                    # we will always get one of these after
+                                    # resuming
                                     if options.verbose:
                                         print "process %u resumed" % (pid)
                                 elif state == lldb.eStateUnloaded:
@@ -262,7 +401,7 @@ def main(argv):
                     while process_stderr:
                         process_stderr = process.GetSTDERR(1024)
                         print process_stderr
-                process.Kill() # kill the process
+                process.Kill()  # kill the process
             else:
                 if error:
                     print error
@@ -271,8 +410,8 @@ def main(argv):
                         print 'error: launch failed'
                     else:
                         print 'error: attach failed'
-    
+
     lldb.SBDebugger.Terminate()
 
 if __name__ == '__main__':
-    main(sys.argv[1:])
\ No newline at end of file
+    main(sys.argv[1:])

Modified: lldb/trunk/examples/python/pytracer.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/pytracer.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/examples/python/pytracer.py (original)
+++ lldb/trunk/examples/python/pytracer.py Tue Sep  6 15:57:50 2016
@@ -2,310 +2,342 @@ import sys
 import inspect
 from collections import OrderedDict
 
+
 class TracebackFancy:
-	def __init__(self,traceback):
-		self.t = traceback
 
-	def getFrame(self):
-		return FrameFancy(self.t.tb_frame)
+    def __init__(self, traceback):
+        self.t = traceback
+
+    def getFrame(self):
+        return FrameFancy(self.t.tb_frame)
+
+    def getLineNumber(self):
+        return self.t.tb_lineno if self.t is not None else None
 
-	def getLineNumber(self):
-		return self.t.tb_lineno if self.t != None else None
+    def getNext(self):
+        return TracebackFancy(self.t.tb_next)
+
+    def __str__(self):
+        if self.t is None:
+            return ""
+        str_self = "%s @ %s" % (
+            self.getFrame().getName(), self.getLineNumber())
+        return str_self + "\n" + self.getNext().__str__()
 
-	def getNext(self):
-		return TracebackFancy(self.t.tb_next)
-
-	def __str__(self):
-		if self.t == None:
-			return ""
-		str_self = "%s @ %s" % (self.getFrame().getName(), self.getLineNumber())
-		return str_self + "\n" + self.getNext().__str__()
 
 class ExceptionFancy:
-	def __init__(self,frame):
-		self.etraceback = frame.f_exc_traceback
-		self.etype = frame.exc_type
-		self.evalue = frame.f_exc_value
-
-	def __init__(self,tb,ty,va):
-		self.etraceback = tb
-		self.etype = ty
-		self.evalue = va
-
-	def getTraceback(self):
-		return TracebackFancy(self.etraceback)
 
-	def __nonzero__(self):
-		return self.etraceback != None or self.etype != None or self.evalue != None
+    def __init__(self, frame):
+        self.etraceback = frame.f_exc_traceback
+        self.etype = frame.exc_type
+        self.evalue = frame.f_exc_value
+
+    def __init__(self, tb, ty, va):
+        self.etraceback = tb
+        self.etype = ty
+        self.evalue = va
+
+    def getTraceback(self):
+        return TracebackFancy(self.etraceback)
 
-	def getType(self):
-		return str(self.etype)
+    def __nonzero__(self):
+        return self.etraceback is not None or self.etype is not None or self.evalue is not None
+
+    def getType(self):
+        return str(self.etype)
+
+    def getValue(self):
+        return self.evalue
 
-	def getValue(self):
-		return self.evalue
 
 class CodeFancy:
-	def __init__(self,code):
-		self.c = code
 
-	def getArgCount(self):
-		return self.c.co_argcount if self.c != None else 0
+    def __init__(self, code):
+        self.c = code
+
+    def getArgCount(self):
+        return self.c.co_argcount if self.c is not None else 0
 
-	def getFilename(self):
-		return self.c.co_filename if self.c != None else ""
+    def getFilename(self):
+        return self.c.co_filename if self.c is not None else ""
 
-	def getVariables(self):
-		return self.c.co_varnames if self.c != None else []
+    def getVariables(self):
+        return self.c.co_varnames if self.c is not None else []
 
-	def getName(self):
-		return self.c.co_name if self.c != None else ""
+    def getName(self):
+        return self.c.co_name if self.c is not None else ""
+
+    def getFileName(self):
+        return self.c.co_filename if self.c is not None else ""
 
-	def getFileName(self):
-		return self.c.co_filename if self.c != None else ""
 
 class ArgsFancy:
-	def __init__(self,frame,arginfo):
-		self.f = frame
-		self.a = arginfo
-
-	def __str__(self):
-		args, varargs, kwargs = self.getArgs(), self.getVarArgs(), self.getKWArgs()
-		ret = ""
-		count = 0
-		size = len(args)
-		for arg in args:
-			ret = ret + ("%s = %s" % (arg, args[arg]))
-			count = count + 1
-			if count < size:
-				ret = ret + ", "
-		if varargs:
-			if size > 0:
-				ret = ret + " "
-			ret = ret + "varargs are " + str(varargs)
-		if kwargs:
-			if size > 0:
-				ret = ret + " "
-			ret = ret + "kwargs are " + str(kwargs)
-		return ret
-
-	def getNumArgs(wantVarargs = False, wantKWArgs=False):
-		args, varargs, keywords, values = self.a
-		size = len(args)
-		if varargs and wantVarargs:
-			size = size+len(self.getVarArgs())
-		if keywords and wantKWArgs:
-			size = size+len(self.getKWArgs())
-		return size
-
-	def getArgs(self):
-		args, _, _, values = self.a
-		argWValues = OrderedDict()
-		for arg in args:
-			argWValues[arg] = values[arg]
-		return argWValues
-
-	def getVarArgs(self):
-		_, vargs, _, _ = self.a
-		if vargs:
-			return self.f.f_locals[vargs]
-		return ()
-
-	def getKWArgs(self):
-		_, _, kwargs, _ = self.a
-		if kwargs:
-			return self.f.f_locals[kwargs]
-		return {}
+
+    def __init__(self, frame, arginfo):
+        self.f = frame
+        self.a = arginfo
+
+    def __str__(self):
+        args, varargs, kwargs = self.getArgs(), self.getVarArgs(), self.getKWArgs()
+        ret = ""
+        count = 0
+        size = len(args)
+        for arg in args:
+            ret = ret + ("%s = %s" % (arg, args[arg]))
+            count = count + 1
+            if count < size:
+                ret = ret + ", "
+        if varargs:
+            if size > 0:
+                ret = ret + " "
+            ret = ret + "varargs are " + str(varargs)
+        if kwargs:
+            if size > 0:
+                ret = ret + " "
+            ret = ret + "kwargs are " + str(kwargs)
+        return ret
+
+    def getNumArgs(wantVarargs=False, wantKWArgs=False):
+        args, varargs, keywords, values = self.a
+        size = len(args)
+        if varargs and wantVarargs:
+            size = size + len(self.getVarArgs())
+        if keywords and wantKWArgs:
+            size = size + len(self.getKWArgs())
+        return size
+
+    def getArgs(self):
+        args, _, _, values = self.a
+        argWValues = OrderedDict()
+        for arg in args:
+            argWValues[arg] = values[arg]
+        return argWValues
+
+    def getVarArgs(self):
+        _, vargs, _, _ = self.a
+        if vargs:
+            return self.f.f_locals[vargs]
+        return ()
+
+    def getKWArgs(self):
+        _, _, kwargs, _ = self.a
+        if kwargs:
+            return self.f.f_locals[kwargs]
+        return {}
+
 
 class FrameFancy:
-	def __init__(self,frame):
-		self.f = frame
 
-	def getCaller(self):
-		return FrameFancy(self.f.f_back)
+    def __init__(self, frame):
+        self.f = frame
+
+    def getCaller(self):
+        return FrameFancy(self.f.f_back)
+
+    def getLineNumber(self):
+        return self.f.f_lineno if self.f is not None else 0
+
+    def getCodeInformation(self):
+        return CodeFancy(self.f.f_code) if self.f is not None else None
 
-	def getLineNumber(self):
-		return self.f.f_lineno if self.f != None else 0
+    def getExceptionInfo(self):
+        return ExceptionFancy(self.f) if self.f is not None else None
 
-	def getCodeInformation(self):
-		return CodeFancy(self.f.f_code) if self.f != None else None
+    def getName(self):
+        return self.getCodeInformation().getName() if self.f is not None else ""
 
-	def getExceptionInfo(self):
-		return ExceptionFancy(self.f) if self.f != None else None
+    def getFileName(self):
+        return self.getCodeInformation().getFileName() if self.f is not None else ""
 
-	def getName(self):
-		return self.getCodeInformation().getName() if self.f != None else ""
+    def getLocals(self):
+        return self.f.f_locals if self.f is not None else {}
 
-	def getFileName(self):
-		return self.getCodeInformation().getFileName() if self.f != None else ""
+    def getArgumentInfo(self):
+        return ArgsFancy(
+            self.f, inspect.getargvalues(
+                self.f)) if self.f is not None else None
 
-	def getLocals(self):
-		return self.f.f_locals if self.f != None else {}
-		
-	def getArgumentInfo(self):
-		return ArgsFancy(self.f,inspect.getargvalues(self.f)) if self.f != None else None
 
 class TracerClass:
-	def callEvent(self,frame):
-		pass
 
-	def lineEvent(self,frame):
-		pass
+    def callEvent(self, frame):
+        pass
 
-	def returnEvent(self,frame,retval):
-		pass
+    def lineEvent(self, frame):
+        pass
 
-	def exceptionEvent(self,frame,exception,value,traceback):
-		pass
+    def returnEvent(self, frame, retval):
+        pass
 
-	def cCallEvent(self,frame,cfunct):
-		pass
+    def exceptionEvent(self, frame, exception, value, traceback):
+        pass
 
-	def cReturnEvent(self,frame,cfunct):
-		pass
+    def cCallEvent(self, frame, cfunct):
+        pass
 
-	def cExceptionEvent(self,frame,cfunct):
-		pass
+    def cReturnEvent(self, frame, cfunct):
+        pass
+
+    def cExceptionEvent(self, frame, cfunct):
+        pass
 
 tracer_impl = TracerClass()
 
 
-def the_tracer_entrypoint(frame,event,args):
-	if tracer_impl == None:
-		return None
-	if event == "call":
-		call_retval = tracer_impl.callEvent(FrameFancy(frame))
-		if call_retval == False:
-			return None
-		return the_tracer_entrypoint
-	elif event == "line":
-		line_retval = tracer_impl.lineEvent(FrameFancy(frame))
-		if line_retval == False:
-			return None
-		return the_tracer_entrypoint
-	elif event == "return":
-		tracer_impl.returnEvent(FrameFancy(frame),args)
-	elif event == "exception":
-		exty,exva,extb = args
-		exception_retval = tracer_impl.exceptionEvent(FrameFancy(frame),ExceptionFancy(extb,exty,exva))
-		if exception_retval == False:
-			return None
-		return the_tracer_entrypoint
-	elif event == "c_call":
-		tracer_impl.cCallEvent(FrameFancy(frame),args)
-	elif event == "c_return":
-		tracer_impl.cReturnEvent(FrameFancy(frame),args)
-	elif event == "c_exception":
-		tracer_impl.cExceptionEvent(FrameFancy(frame),args)
-	return None
+def the_tracer_entrypoint(frame, event, args):
+    if tracer_impl is None:
+        return None
+    if event == "call":
+        call_retval = tracer_impl.callEvent(FrameFancy(frame))
+        if not call_retval:
+            return None
+        return the_tracer_entrypoint
+    elif event == "line":
+        line_retval = tracer_impl.lineEvent(FrameFancy(frame))
+        if not line_retval:
+            return None
+        return the_tracer_entrypoint
+    elif event == "return":
+        tracer_impl.returnEvent(FrameFancy(frame), args)
+    elif event == "exception":
+        exty, exva, extb = args
+        exception_retval = tracer_impl.exceptionEvent(
+            FrameFancy(frame), ExceptionFancy(extb, exty, exva))
+        if not exception_retval:
+            return None
+        return the_tracer_entrypoint
+    elif event == "c_call":
+        tracer_impl.cCallEvent(FrameFancy(frame), args)
+    elif event == "c_return":
+        tracer_impl.cReturnEvent(FrameFancy(frame), args)
+    elif event == "c_exception":
+        tracer_impl.cExceptionEvent(FrameFancy(frame), args)
+    return None
+
 
 def enable(t=None):
-	global tracer_impl
-	if t:
-		tracer_impl = t
-	sys.settrace(the_tracer_entrypoint)
+    global tracer_impl
+    if t:
+        tracer_impl = t
+    sys.settrace(the_tracer_entrypoint)
+
 
 def disable():
-	sys.settrace(None)
+    sys.settrace(None)
+
 
 class LoggingTracer:
-	def callEvent(self,frame):
-		print "call " + frame.getName() + " from " + frame.getCaller().getName() + " @ " + str(frame.getCaller().getLineNumber()) + " args are " + str(frame.getArgumentInfo())
 
-	def lineEvent(self,frame):
-		print "running " + frame.getName() + " @ " + str(frame.getLineNumber()) + " locals are " + str(frame.getLocals()) + " in " + frame.getFileName()
+    def callEvent(self, frame):
+        print "call " + frame.getName() + " from " + frame.getCaller().getName() + " @ " + str(frame.getCaller().getLineNumber()) + " args are " + str(frame.getArgumentInfo())
+
+    def lineEvent(self, frame):
+        print "running " + frame.getName() + " @ " + str(frame.getLineNumber()) + " locals are " + str(frame.getLocals()) + " in " + frame.getFileName()
+
+    def returnEvent(self, frame, retval):
+        print "return from " + frame.getName() + " value is " + str(retval) + " locals are " + str(frame.getLocals())
 
-	def returnEvent(self,frame,retval):
-		print "return from " + frame.getName() + " value is " + str(retval) + " locals are " + str(frame.getLocals())
+    def exceptionEvent(self, frame, exception):
+        print "exception %s %s raised from %s @ %s" % (exception.getType(), str(exception.getValue()), frame.getName(), frame.getLineNumber())
+        print "tb: " + str(exception.getTraceback())
+
+# the same functionality as LoggingTracer, but with a little more
+# lldb-specific smarts
 
-	def exceptionEvent(self,frame,exception):
-		print "exception %s %s raised from %s @ %s" %  (exception.getType(), str(exception.getValue()), frame.getName(), frame.getLineNumber())
-		print "tb: " + str(exception.getTraceback())
 
-# the same functionality as LoggingTracer, but with a little more lldb-specific smarts
 class LLDBAwareTracer:
-	def callEvent(self,frame):
-		if frame.getName() == "<module>":
-			return
-		if frame.getName() == "run_one_line":
-			print "call run_one_line(%s)" % (frame.getArgumentInfo().getArgs()["input_string"])
-			return
-		if "Python.framework" in frame.getFileName():
-			print "call into Python at " + frame.getName()
-			return
-		if frame.getName() == "__init__" and frame.getCaller().getName() == "run_one_line" and frame.getCaller().getLineNumber() == 101:
-			return False
-		strout = "call " + frame.getName()
-		if (frame.getCaller().getFileName() == ""):
-			strout += " from LLDB - args are "
-			args = frame.getArgumentInfo().getArgs()
-			for arg in args:
-				if arg == "dict" or arg == "internal_dict":
-					continue
-				strout = strout + ("%s = %s " % (arg,args[arg]))
-		else:
-			strout += " from " + frame.getCaller().getName() + " @ " + str(frame.getCaller().getLineNumber()) + " args are " + str(frame.getArgumentInfo())
-		print strout
-
-	def lineEvent(self,frame):
-		if frame.getName() == "<module>":
-			return
-		if frame.getName() == "run_one_line":
-			print "running run_one_line(%s) @ %s" % (frame.getArgumentInfo().getArgs()["input_string"],frame.getLineNumber())
-			return
-		if "Python.framework" in frame.getFileName():
-			print "running into Python at " + frame.getName() + " @ " + str(frame.getLineNumber())
-			return
-		strout = "running " + frame.getName() + " @ " + str(frame.getLineNumber()) + " locals are " 
-		if (frame.getCaller().getFileName() == ""):
-			locals = frame.getLocals()
-			for local in locals:
-				if local == "dict" or local == "internal_dict":
-					continue
-				strout = strout + ("%s = %s " % (local,locals[local]))
-		else:
-			strout = strout + str(frame.getLocals())
-		strout = strout + " in " + frame.getFileName()
-		print strout
-
-	def returnEvent(self,frame,retval):
-		if frame.getName() == "<module>":
-			return
-		if frame.getName() == "run_one_line":
-			print "return from run_one_line(%s) return value is %s" % (frame.getArgumentInfo().getArgs()["input_string"],retval)
-			return
-		if "Python.framework" in frame.getFileName():
-			print "return from Python at " + frame.getName() + " return value is " + str(retval)
-			return
-		strout = "return from " + frame.getName() + " return value is " + str(retval) + " locals are "
-		if (frame.getCaller().getFileName() == ""):
-			locals = frame.getLocals()
-			for local in locals:
-				if local == "dict" or local == "internal_dict":
-					continue
-				strout = strout + ("%s = %s " % (local,locals[local]))
-		else:
-			strout = strout + str(frame.getLocals())
-		strout = strout + " in " + frame.getFileName()
-		print strout
-
-	def exceptionEvent(self,frame,exception):
-		if frame.getName() == "<module>":
-			return
-		print "exception %s %s raised from %s @ %s" %  (exception.getType(), str(exception.getValue()), frame.getName(), frame.getLineNumber())
-		print "tb: " + str(exception.getTraceback())
-
-def f(x,y=None):
-	if x > 0:
-		return 2 + f(x-2)
-	return 35
+
+    def callEvent(self, frame):
+        if frame.getName() == "<module>":
+            return
+        if frame.getName() == "run_one_line":
+            print "call run_one_line(%s)" % (frame.getArgumentInfo().getArgs()["input_string"])
+            return
+        if "Python.framework" in frame.getFileName():
+            print "call into Python at " + frame.getName()
+            return
+        if frame.getName() == "__init__" and frame.getCaller().getName(
+        ) == "run_one_line" and frame.getCaller().getLineNumber() == 101:
+            return False
+        strout = "call " + frame.getName()
+        if (frame.getCaller().getFileName() == ""):
+            strout += " from LLDB - args are "
+            args = frame.getArgumentInfo().getArgs()
+            for arg in args:
+                if arg == "dict" or arg == "internal_dict":
+                    continue
+                strout = strout + ("%s = %s " % (arg, args[arg]))
+        else:
+            strout += " from " + frame.getCaller().getName() + " @ " + \
+                str(frame.getCaller().getLineNumber()) + " args are " + str(frame.getArgumentInfo())
+        print strout
+
+    def lineEvent(self, frame):
+        if frame.getName() == "<module>":
+            return
+        if frame.getName() == "run_one_line":
+            print "running run_one_line(%s) @ %s" % (frame.getArgumentInfo().getArgs()["input_string"], frame.getLineNumber())
+            return
+        if "Python.framework" in frame.getFileName():
+            print "running into Python at " + frame.getName() + " @ " + str(frame.getLineNumber())
+            return
+        strout = "running " + frame.getName() + " @ " + str(frame.getLineNumber()) + \
+            " locals are "
+        if (frame.getCaller().getFileName() == ""):
+            locals = frame.getLocals()
+            for local in locals:
+                if local == "dict" or local == "internal_dict":
+                    continue
+                strout = strout + ("%s = %s " % (local, locals[local]))
+        else:
+            strout = strout + str(frame.getLocals())
+        strout = strout + " in " + frame.getFileName()
+        print strout
+
+    def returnEvent(self, frame, retval):
+        if frame.getName() == "<module>":
+            return
+        if frame.getName() == "run_one_line":
+            print "return from run_one_line(%s) return value is %s" % (frame.getArgumentInfo().getArgs()["input_string"], retval)
+            return
+        if "Python.framework" in frame.getFileName():
+            print "return from Python at " + frame.getName() + " return value is " + str(retval)
+            return
+        strout = "return from " + frame.getName() + " return value is " + \
+            str(retval) + " locals are "
+        if (frame.getCaller().getFileName() == ""):
+            locals = frame.getLocals()
+            for local in locals:
+                if local == "dict" or local == "internal_dict":
+                    continue
+                strout = strout + ("%s = %s " % (local, locals[local]))
+        else:
+            strout = strout + str(frame.getLocals())
+        strout = strout + " in " + frame.getFileName()
+        print strout
+
+    def exceptionEvent(self, frame, exception):
+        if frame.getName() == "<module>":
+            return
+        print "exception %s %s raised from %s @ %s" % (exception.getType(), str(exception.getValue()), frame.getName(), frame.getLineNumber())
+        print "tb: " + str(exception.getTraceback())
+
+
+def f(x, y=None):
+    if x > 0:
+        return 2 + f(x - 2)
+    return 35
+
 
 def g(x):
-	return 1.134 / x
+    return 1.134 / x
+
 
 def print_keyword_args(**kwargs):
-     # kwargs is a dict of the keyword args passed to the function
-     for key, value in kwargs.iteritems():
-         print "%s = %s" % (key, value)
+    # kwargs is a dict of the keyword args passed to the function
+    for key, value in kwargs.iteritems():
+        print "%s = %s" % (key, value)
+
 
 def total(initial=5, *numbers, **keywords):
     count = initial
@@ -316,13 +348,13 @@ def total(initial=5, *numbers, **keyword
     return count
 
 if __name__ == "__main__":
-	enable(LoggingTracer())
-	f(5)
-	f(5,1)
-	print_keyword_args(first_name="John", last_name="Doe")
-	total(10, 1, 2, 3, vegetables=50, fruits=100)
-	try:
-		g(0)
-	except:
-		pass
-	disable()
+    enable(LoggingTracer())
+    f(5)
+    f(5, 1)
+    print_keyword_args(first_name="John", last_name="Doe")
+    total(10, 1, 2, 3, vegetables=50, fruits=100)
+    try:
+        g(0)
+    except:
+        pass
+    disable()

Modified: lldb/trunk/examples/python/sbvalue.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/sbvalue.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/examples/python/sbvalue.py (original)
+++ lldb/trunk/examples/python/sbvalue.py Tue Sep  6 15:57:50 2016
@@ -2,6 +2,7 @@
 
 import lldb
 
+
 class value(object):
     '''A class that wraps an lldb.SBValue object and returns an object that
     can be used as an object with attribytes:\n
@@ -24,6 +25,7 @@ class value(object):
     argv.num_children - return the number of children this value has
     argv.children - return a list of sbvalue objects that represents all of the children of this value
     '''
+
     def __init__(self, sbvalue):
         self.sbvalue = sbvalue
 
@@ -37,10 +39,12 @@ class value(object):
         return self.sbvalue.__str__()
 
     def __getitem__(self, key):
-        if type(key) is int:
-            return value(self.sbvalue.GetChildAtIndex(key, lldb.eNoDynamicValues, True))
+        if isinstance(key, int):
+            return value(
+                self.sbvalue.GetChildAtIndex(
+                    key, lldb.eNoDynamicValues, True))
         raise TypeError
-    
+
     def __getattr__(self, name):
         if name == 'name':
             return self.sbvalue.GetName()
@@ -55,15 +59,15 @@ class value(object):
         if name == 'is_pointer':
             return self.sbvalue.TypeIsPointerType()
         if name == 'format':
-            return self.sbvalue.GetFormat ()
+            return self.sbvalue.GetFormat()
         if name == 'value':
-            return self.sbvalue.GetValue ()
+            return self.sbvalue.GetValue()
         if name == 'summary':
-            return self.sbvalue.GetSummary ()
+            return self.sbvalue.GetSummary()
         if name == 'description':
-            return self.sbvalue.GetObjectDescription ()
+            return self.sbvalue.GetObjectDescription()
         if name == 'location':
-            return self.sbvalue.GetLocation ()
+            return self.sbvalue.GetLocation()
         if name == 'target':
             return self.sbvalue.GetTarget()
         if name == 'process':
@@ -75,18 +79,25 @@ class value(object):
         if name == 'num_children':
             return self.sbvalue.GetNumChildren()
         if name == 'children':
-            # Returns an array of sbvalue objects, one for each child of 
+            # Returns an array of sbvalue objects, one for each child of
             # the value for the lldb.SBValue
             children = []
-            for i in range (self.sbvalue.GetNumChildren()):
-                children.append(value(self.sbvalue.GetChildAtIndex(i, lldb.eNoDynamicValues, True)))
+            for i in range(self.sbvalue.GetNumChildren()):
+                children.append(
+                    value(
+                        self.sbvalue.GetChildAtIndex(
+                            i,
+                            lldb.eNoDynamicValues,
+                            True)))
             return children
         raise AttributeError
-    
+
+
 class variable(object):
     '''A class that treats a lldb.SBValue and allows it to be used just as
-    a variable would be in code. So if you have a Point structure variable 
+    a variable would be in code. So if you have a Point structure variable
     in your code, you would be able to do: "pt.x + pt.y"'''
+
     def __init__(self, sbvalue):
         self.sbvalue = sbvalue
 
@@ -101,155 +112,157 @@ class variable(object):
 
     def __getitem__(self, key):
         # Allow array access if this value has children...
-        if type(key) is int:
-            return variable(self.sbvalue.GetValueForExpressionPath("[%i]" % key))
+        if isinstance(key, int):
+            return variable(
+                self.sbvalue.GetValueForExpressionPath(
+                    "[%i]" %
+                    key))
         raise TypeError
 
     def __getattr__(self, name):
-        child_sbvalue = self.sbvalue.GetChildMemberWithName (name)
+        child_sbvalue = self.sbvalue.GetChildMemberWithName(name)
         if child_sbvalue:
             return variable(child_sbvalue)
         raise AttributeError
 
     def __add__(self, other):
         return int(self) + int(other)
-        
+
     def __sub__(self, other):
         return int(self) - int(other)
-        
+
     def __mul__(self, other):
         return int(self) * int(other)
-        
+
     def __floordiv__(self, other):
         return int(self) // int(other)
-        
+
     def __mod__(self, other):
         return int(self) % int(other)
-        
+
     def __divmod__(self, other):
         return int(self) % int(other)
-        
+
     def __pow__(self, other):
         return int(self) ** int(other)
-        
+
     def __lshift__(self, other):
         return int(self) << int(other)
-        
+
     def __rshift__(self, other):
         return int(self) >> int(other)
-        
+
     def __and__(self, other):
         return int(self) & int(other)
-        
+
     def __xor__(self, other):
         return int(self) ^ int(other)
-        
+
     def __or__(self, other):
         return int(self) | int(other)
-        
+
     def __div__(self, other):
         return int(self) / int(other)
-        
+
     def __truediv__(self, other):
         return int(self) / int(other)
-        
+
     def __iadd__(self, other):
         result = self.__add__(other)
-        self.sbvalue.SetValueFromCString (str(result))
+        self.sbvalue.SetValueFromCString(str(result))
         return result
-        
+
     def __isub__(self, other):
         result = self.__sub__(other)
-        self.sbvalue.SetValueFromCString (str(result))
+        self.sbvalue.SetValueFromCString(str(result))
         return result
-        
+
     def __imul__(self, other):
         result = self.__mul__(other)
-        self.sbvalue.SetValueFromCString (str(result))
+        self.sbvalue.SetValueFromCString(str(result))
         return result
-        
+
     def __idiv__(self, other):
         result = self.__div__(other)
-        self.sbvalue.SetValueFromCString (str(result))
+        self.sbvalue.SetValueFromCString(str(result))
         return result
-        
+
     def __itruediv__(self, other):
         result = self.__truediv__(other)
-        self.sbvalue.SetValueFromCString (str(result))
+        self.sbvalue.SetValueFromCString(str(result))
         return result
-        
+
     def __ifloordiv__(self, other):
-        result =  self.__floordiv__(self, other)
-        self.sbvalue.SetValueFromCString (str(result))
+        result = self.__floordiv__(self, other)
+        self.sbvalue.SetValueFromCString(str(result))
         return result
-        
+
     def __imod__(self, other):
-        result =  self.__and__(self, other)
-        self.sbvalue.SetValueFromCString (str(result))
+        result = self.__and__(self, other)
+        self.sbvalue.SetValueFromCString(str(result))
         return result
-        
+
     def __ipow__(self, other):
         result = self.__pow__(self, other)
-        self.sbvalue.SetValueFromCString (str(result))
+        self.sbvalue.SetValueFromCString(str(result))
         return result
-        
+
     def __ipow__(self, other, modulo):
         result = self.__pow__(self, other, modulo)
-        self.sbvalue.SetValueFromCString (str(result))
+        self.sbvalue.SetValueFromCString(str(result))
         return result
-        
+
     def __ilshift__(self, other):
         result = self.__lshift__(self, other)
-        self.sbvalue.SetValueFromCString (str(result))
+        self.sbvalue.SetValueFromCString(str(result))
         return result
-        
+
     def __irshift__(self, other):
-        result =  self.__rshift__(self, other)
-        self.sbvalue.SetValueFromCString (str(result))
+        result = self.__rshift__(self, other)
+        self.sbvalue.SetValueFromCString(str(result))
         return result
-        
+
     def __iand__(self, other):
-        result =  self.__and__(self, other)
-        self.sbvalue.SetValueFromCString (str(result))
+        result = self.__and__(self, other)
+        self.sbvalue.SetValueFromCString(str(result))
         return result
-        
+
     def __ixor__(self, other):
-        result =  self.__xor__(self, other)
-        self.sbvalue.SetValueFromCString (str(result))
+        result = self.__xor__(self, other)
+        self.sbvalue.SetValueFromCString(str(result))
         return result
-        
+
     def __ior__(self, other):
-        result =  self.__ior__(self, other)
-        self.sbvalue.SetValueFromCString (str(result))
+        result = self.__ior__(self, other)
+        self.sbvalue.SetValueFromCString(str(result))
         return result
-        
+
     def __neg__(self):
         return -int(self)
-        
+
     def __pos__(self):
         return +int(self)
-        
+
     def __abs__(self):
         return abs(int(self))
-        
+
     def __invert__(self):
         return ~int(self)
-        
+
     def __complex__(self):
-        return complex (int(self))
-        
+        return complex(int(self))
+
     def __int__(self):
         return self.sbvalue.GetValueAsSigned()
-        
+
     def __long__(self):
         return self.sbvalue.GetValueAsSigned()
-        
+
     def __float__(self):
-        return float (self.sbvalue.GetValueAsSigned())
-        
+        return float(self.sbvalue.GetValueAsSigned())
+
     def __oct__(self):
         return '0%o' % self.sbvalue.GetValueAsSigned()
-        
+
     def __hex__(self):
         return '0x%x' % self.sbvalue.GetValueAsSigned()
-    
\ No newline at end of file

Modified: lldb/trunk/examples/python/scripted_step.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/scripted_step.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/examples/python/scripted_step.py (original)
+++ lldb/trunk/examples/python/scripted_step.py Tue Sep  6 15:57:50 2016
@@ -5,15 +5,15 @@
 # interface is a reduced version of the full internal mechanism, but captures
 # most of the power with a much simpler interface.
 #
-# But I'll attempt a brief summary here.  
+# But I'll attempt a brief summary here.
 # Stepping in lldb is done independently for each thread.  Moreover, the stepping
-# operations are stackable.  So for instance if you did a "step over", and in 
+# operations are stackable.  So for instance if you did a "step over", and in
 # the course of stepping over you hit a breakpoint, stopped and stepped again,
 # the first "step-over" would be suspended, and the new step operation would
 # be enqueued.  Then if that step over caused the program to hit another breakpoint,
 # lldb would again suspend the second step and return control to the user, so
-# now there are two pending step overs.  Etc. with all the other stepping 
-# operations.  Then if you hit "continue" the bottom-most step-over would complete, 
+# now there are two pending step overs.  Etc. with all the other stepping
+# operations.  Then if you hit "continue" the bottom-most step-over would complete,
 # and another continue would complete the first "step-over".
 #
 # lldb represents this system with a stack of "Thread Plans".  Each time a new
@@ -26,16 +26,16 @@
 # the current thread.  In the scripted interface, you indicate this by returning
 # False or True respectively from the should_step method.
 #
-# Each time the process stops the thread plan stack for each thread that stopped 
+# Each time the process stops the thread plan stack for each thread that stopped
 # "for a reason", Ii.e. a single-step completed on that thread, or a breakpoint
-# was hit), is queried to determine how to proceed, starting from the most 
+# was hit), is queried to determine how to proceed, starting from the most
 # recently pushed plan, in two stages:
 #
 # 1) Each plan is asked if it "explains" the stop.  The first plan to claim the
 #    stop wins.  In scripted Thread Plans, this is done by returning True from
 #    the "explains_stop method.  This is how, for instance, control is returned
-#    to the User when the "step-over" plan hits a breakpoint.  The step-over 
-#    plan doesn't explain the breakpoint stop, so it returns false, and the 
+#    to the User when the "step-over" plan hits a breakpoint.  The step-over
+#    plan doesn't explain the breakpoint stop, so it returns false, and the
 #    breakpoint hit is propagated up the stack to the "base" thread plan, which
 #    is the one that handles random breakpoint hits.
 #
@@ -50,10 +50,10 @@
 #         the next time the thread continues.
 #
 #    Note that deciding to return control to the user, and deciding your plan
-#    is done, are orthgonal operations.  You could set up the next phase of 
+#    is done, are orthgonal operations.  You could set up the next phase of
 #    stepping, and then return True from should_stop, and when the user next
 #    "continued" the process your plan would resume control.  Of course, the
-#    user might also "step-over" or some other operation that would push a 
+#    user might also "step-over" or some other operation that would push a
 #    different plan, which would take control till it was done.
 #
 #    One other detail you should be aware of, if the plan below you on the
@@ -71,8 +71,8 @@
 #    This is useful, for instance, in the FinishPrintAndContinue plan.  What might
 #    happen here is that after continuing but before the finish is done, the program
 #    could hit another breakpoint and stop.  Then the user could use the step
-#    command repeatedly until they leave the frame of interest by stepping.  
-#    In that case, the step plan is the one that will be responsible for stopping, 
+#    command repeatedly until they leave the frame of interest by stepping.
+#    In that case, the step plan is the one that will be responsible for stopping,
 #    and the finish plan won't be asked should_stop, it will just be asked if it
 #    is stale.  In this case, if the step_out plan that the FinishPrintAndContinue
 #    plan is driving is stale, so is ours, and it is time to do our printing.
@@ -80,7 +80,7 @@
 # Both examples show stepping through an address range for 20 bytes from the
 # current PC.  The first one does it by single stepping and checking a condition.
 # It doesn't, however handle the case where you step into another frame while
-# still in the current range in the starting frame.  
+# still in the current range in the starting frame.
 #
 # That is better handled in the second example by using the built-in StepOverRange
 # thread plan.
@@ -95,76 +95,84 @@
 
 import lldb
 
+
 class SimpleStep:
-    def __init__ (self, thread_plan, dict):
+
+    def __init__(self, thread_plan, dict):
         self.thread_plan = thread_plan
         self.start_address = thread_plan.GetThread().GetFrameAtIndex(0).GetPC()
-        
-    def explains_stop (self, event):
+
+    def explains_stop(self, event):
         # We are stepping, so if we stop for any other reason, it isn't
         # because of us.
-        if self.thread_plan.GetThread().GetStopReason()== lldb.eStopReasonTrace:
+        if self.thread_plan.GetThread().GetStopReason() == lldb.eStopReasonTrace:
             return True
         else:
             return False
-        
-    def should_stop (self, event):
+
+    def should_stop(self, event):
         cur_pc = self.thread_plan.GetThread().GetFrameAtIndex(0).GetPC()
-        
+
         if cur_pc < self.start_address or cur_pc >= self.start_address + 20:
             self.thread_plan.SetPlanComplete(True)
             return True
         else:
             return False
 
-    def should_step (self):
+    def should_step(self):
         return True
 
+
 class StepWithPlan:
-    def __init__ (self, thread_plan, dict):
+
+    def __init__(self, thread_plan, dict):
         self.thread_plan = thread_plan
         self.start_address = thread_plan.GetThread().GetFrameAtIndex(0).GetPCAddress()
-        self.step_thread_plan =thread_plan.QueueThreadPlanForStepOverRange(self.start_address, 20);
+        self.step_thread_plan = thread_plan.QueueThreadPlanForStepOverRange(
+            self.start_address, 20)
 
-    def explains_stop (self, event):
+    def explains_stop(self, event):
         # Since all I'm doing is running a plan, I will only ever get askedthis
         # if myplan doesn't explain the stop, and in that caseI don'teither.
         return False
 
-    def should_stop (self, event):
+    def should_stop(self, event):
         if self.step_thread_plan.IsPlanComplete():
             self.thread_plan.SetPlanComplete(True)
             return True
         else:
             return False
 
-    def should_step (self):
+    def should_step(self):
         return False
 
 # Here's another example which does "step over" through the current function,
 # and when it stops at each line, it checks some condition (in this example the
 # value of a variable) and stops if that condition is true.
 
+
 class StepCheckingCondition:
-    def __init__ (self, thread_plan, dict):
+
+    def __init__(self, thread_plan, dict):
         self.thread_plan = thread_plan
         self.start_frame = thread_plan.GetThread().GetFrameAtIndex(0)
         self.queue_next_plan()
 
-    def queue_next_plan (self):
+    def queue_next_plan(self):
         cur_frame = self.thread_plan.GetThread().GetFrameAtIndex(0)
         cur_line_entry = cur_frame.GetLineEntry()
         start_address = cur_line_entry.GetStartAddress()
         end_address = cur_line_entry.GetEndAddress()
         line_range = end_address.GetFileAddress() - start_address.GetFileAddress()
-        self.step_thread_plan = self.thread_plan.QueueThreadPlanForStepOverRange(start_address, line_range)
+        self.step_thread_plan = self.thread_plan.QueueThreadPlanForStepOverRange(
+            start_address, line_range)
 
-    def explains_stop (self, event):
+    def explains_stop(self, event):
         # We are stepping, so if we stop for any other reason, it isn't
         # because of us.
         return False
-        
-    def should_stop (self, event):
+
+    def should_stop(self, event):
         if not self.step_thread_plan.IsPlanComplete():
             return False
 
@@ -182,7 +190,7 @@ class StepCheckingCondition:
             return True
 
         error = lldb.SBError()
-        a_value = a_var.GetValueAsSigned (error)
+        a_value = a_var.GetValueAsSigned(error)
         if not error.Success():
             print "A value was not good."
             return True
@@ -194,7 +202,7 @@ class StepCheckingCondition:
             self.queue_next_plan()
             return False
 
-    def should_step (self):
+    def should_step(self):
         return True
 
 # Here's an example that steps out of the current frame, gathers some information
@@ -202,29 +210,32 @@ class StepCheckingCondition:
 # plans are not a safe place to call lldb command-line commands, so the information
 # is gathered through SB API calls.
 
+
 class FinishPrintAndContinue:
-    def __init__ (self, thread_plan, dict):
+
+    def __init__(self, thread_plan, dict):
         self.thread_plan = thread_plan
-        self.step_out_thread_plan = thread_plan.QueueThreadPlanForStepOut(0, True)
+        self.step_out_thread_plan = thread_plan.QueueThreadPlanForStepOut(
+            0, True)
         self.thread = self.thread_plan.GetThread()
 
-    def is_stale (self):
+    def is_stale(self):
         if self.step_out_thread_plan.IsPlanStale():
             self.do_print()
             return True
         else:
             return False
 
-    def explains_stop (self, event):
+    def explains_stop(self, event):
         return False
 
-    def should_stop (self, event):
-        if  self.step_out_thread_plan.IsPlanComplete():
+    def should_stop(self, event):
+        if self.step_out_thread_plan.IsPlanComplete():
             self.do_print()
             self.thread_plan.SetPlanComplete(True)
         return False
 
-    def do_print (self):
+    def do_print(self):
         frame_0 = self.thread.frames[0]
         rax_value = frame_0.FindRegister("rax")
         if rax_value.GetError().Success():

Modified: lldb/trunk/examples/python/shadow.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/shadow.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/examples/python/shadow.py (original)
+++ lldb/trunk/examples/python/shadow.py Tue Sep  6 15:57:50 2016
@@ -3,14 +3,16 @@
 import lldb
 import shlex
 
+
 @lldb.command("shadow")
 def check_shadow_command(debugger, command, exe_ctx, result, dict):
     '''Check the currently selected stack frame for shadowed variables'''
     process = exe_ctx.GetProcess()
     state = process.GetState()
     if state != lldb.eStateStopped:
-        print >>result, "process must be stopped, state is %s" % lldb.SBDebugger.StateAsCString(state)
-        return        
+        print >>result, "process must be stopped, state is %s" % lldb.SBDebugger.StateAsCString(
+            state)
+        return
     frame = exe_ctx.GetFrame()
     if not frame:
         print >>result, "invalid frame"
@@ -18,10 +20,10 @@ def check_shadow_command(debugger, comma
     # Parse command line args
     command_args = shlex.split(command)
     # TODO: add support for using arguments that are passed to this command...
-    
+
     # Make a dictionary of variable name to "SBBlock and SBValue"
     shadow_dict = {}
-    
+
     num_shadowed_variables = 0
     # Get the deepest most block from the current frame
     block = frame.GetBlock()
@@ -40,7 +42,7 @@ def check_shadow_command(debugger, comma
                 shadow_dict[block_var_name].append(block_var)
             else:
                 shadow_dict[block_var_name] = [block_var]
-        # Get the parent block and continue 
+        # Get the parent block and continue
         block = block.GetParent()
 
     num_shadowed_variables = 0
@@ -54,4 +56,3 @@ def check_shadow_command(debugger, comma
                     print >>result, str(shadow_var.GetDeclaration())
     if num_shadowed_variables == 0:
         print >>result, 'no variables are shadowed'
-

Modified: lldb/trunk/examples/python/sources.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/sources.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/examples/python/sources.py (original)
+++ lldb/trunk/examples/python/sources.py Tue Sep  6 15:57:50 2016
@@ -3,15 +3,17 @@
 import lldb
 import shlex
 
+
 def dump_module_sources(module, result):
     if module:
         print >> result, "Module: %s" % (module.file)
         for compile_unit in module.compile_units:
             if compile_unit.file:
                 print >> result, "  %s" % (compile_unit.file)
-    
+
+
 def info_sources(debugger, command, result, dict):
-    description='''This command will dump all compile units in any modules that are listed as arguments, or for all modules if no arguments are supplied.'''
+    description = '''This command will dump all compile units in any modules that are listed as arguments, or for all modules if no arguments are supplied.'''
     module_names = shlex.split(command)
     target = debugger.GetSelectedTarget()
     if module_names:
@@ -20,9 +22,10 @@ def info_sources(debugger, command, resu
     else:
         for module in target.modules:
             dump_module_sources(module, result)
-        
-        
-def __lldb_init_module (debugger, dict):
+
+
+def __lldb_init_module(debugger, dict):
     # Add any commands contained in this module to LLDB
-    debugger.HandleCommand('command script add -f sources.info_sources info_sources')
+    debugger.HandleCommand(
+        'command script add -f sources.info_sources info_sources')
     print 'The "info_sources" command has been installed, type "help info_sources" or "info_sources --help" for detailed help.'

Modified: lldb/trunk/examples/python/stacks.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/stacks.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/examples/python/stacks.py (original)
+++ lldb/trunk/examples/python/stacks.py Tue Sep  6 15:57:50 2016
@@ -5,20 +5,28 @@ import commands
 import optparse
 import shlex
 
+
 def stack_frames(debugger, command, result, dict):
     command_args = shlex.split(command)
     usage = "usage: %prog [options] <PATH> [PATH ...]"
-    description='''This command will enumerate all stack frames, print the stack size for each, and print an aggregation of which functions have the largest stack frame sizes at the end.'''
-    parser = optparse.OptionParser(description=description, prog='ls',usage=usage)
-    parser.add_option('-v', '--verbose', action='store_true', dest='verbose', help='display verbose debug info', default=False)
+    description = '''This command will enumerate all stack frames, print the stack size for each, and print an aggregation of which functions have the largest stack frame sizes at the end.'''
+    parser = optparse.OptionParser(
+        description=description, prog='ls', usage=usage)
+    parser.add_option(
+        '-v',
+        '--verbose',
+        action='store_true',
+        dest='verbose',
+        help='display verbose debug info',
+        default=False)
     try:
         (options, args) = parser.parse_args(command_args)
     except:
         return
-    
+
     target = debugger.GetSelectedTarget()
     process = target.GetProcess()
-    
+
     frame_info = {}
     for thread in process:
         last_frame = None
@@ -28,12 +36,13 @@ def stack_frames(debugger, command, resu
                 frame_size = 0
                 if frame.idx == 1:
                     if frame.fp == last_frame.fp:
-                        # No frame one the first frame (might be right at the entry point)
+                        # No frame one the first frame (might be right at the
+                        # entry point)
                         first_frame_size = 0
                         frame_size = frame.fp - frame.sp
                     else:
                         # First frame that has a valid size
-                        first_frame_size = last_frame.fp - last_frame.sp 
+                        first_frame_size = last_frame.fp - last_frame.sp
                     print "<%#7x> %s" % (first_frame_size, last_frame)
                     if first_frame_size:
                         name = last_frame.name
@@ -43,7 +52,7 @@ def stack_frames(debugger, command, resu
                             frame_info[name] += first_frame_size
                 else:
                     # Second or higher frame
-                    frame_size = frame.fp - last_frame.fp 
+                    frame_size = frame.fp - last_frame.fp
                 print "<%#7x> %s" % (frame_size, frame)
                 if frame_size > 0:
                     name = frame.name
@@ -53,7 +62,8 @@ def stack_frames(debugger, command, resu
                         frame_info[name] += frame_size
             last_frame = frame
     print frame_info
-    
 
-lldb.debugger.HandleCommand("command script add -f stacks.stack_frames stack_frames")
-print "A new command called 'stack_frames' was added, type 'stack_frames --help' for more information."
\ No newline at end of file
+
+lldb.debugger.HandleCommand(
+    "command script add -f stacks.stack_frames stack_frames")
+print "A new command called 'stack_frames' was added, type 'stack_frames --help' for more information."

Modified: lldb/trunk/examples/python/symbolication.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/symbolication.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/examples/python/symbolication.py (original)
+++ lldb/trunk/examples/python/symbolication.py Tue Sep  6 15:57:50 2016
@@ -11,13 +11,13 @@
 #   "crashlog" command installed, type "crashlog --help" for detailed help
 #   (lldb) crashlog ~/Library/Logs/DiagnosticReports/a.crash
 #
-# The benefit of running the crashlog command inside lldb in the 
-# embedded python interpreter is when the command completes, there 
+# The benefit of running the crashlog command inside lldb in the
+# embedded python interpreter is when the command completes, there
 # will be a target with all of the files loaded at the locations
 # described in the crash log. Only the files that have stack frames
 # in the backtrace will be loaded unless the "--load-all" option
 # has been specified. This allows users to explore the program in the
-# state it was in right at crash time. 
+# state it was in right at crash time.
 #
 # On MacOSX csh, tcsh:
 #   ( setenv PYTHONPATH /path/to/LLDB.framework/Resources/Python ; ./crashlog.py ~/Library/Logs/DiagnosticReports/a.crash )
@@ -37,16 +37,23 @@ import sys
 import time
 import uuid
 
+
 class Address:
     """Class that represents an address that will be symbolicated"""
+
     def __init__(self, target, load_addr):
         self.target = target
-        self.load_addr = load_addr # The load address that this object represents
-        self.so_addr = None # the resolved lldb.SBAddress (if any), named so_addr for section/offset address
-        self.sym_ctx = None # The cached symbol context for this address
-        self.description = None # Any original textual description of this address to be used as a backup in case symbolication fails
-        self.symbolication = None # The cached symbolicated string that describes this address
+        self.load_addr = load_addr  # The load address that this object represents
+        # the resolved lldb.SBAddress (if any), named so_addr for
+        # section/offset address
+        self.so_addr = None
+        self.sym_ctx = None  # The cached symbol context for this address
+        # Any original textual description of this address to be used as a
+        # backup in case symbolication fails
+        self.description = None
+        self.symbolication = None  # The cached symbolicated string that describes this address
         self.inlined = False
+
     def __str__(self):
         s = "%#16.16x" % (self.load_addr)
         if self.symbolication:
@@ -58,18 +65,19 @@ class Address:
         return s
 
     def resolve_addr(self):
-        if self.so_addr == None:
-            self.so_addr = self.target.ResolveLoadAddress (self.load_addr)
+        if self.so_addr is None:
+            self.so_addr = self.target.ResolveLoadAddress(self.load_addr)
         return self.so_addr
 
     def is_inlined(self):
         return self.inlined
-    
+
     def get_symbol_context(self):
-        if self.sym_ctx == None:
+        if self.sym_ctx is None:
             sb_addr = self.resolve_addr()
             if sb_addr:
-                self.sym_ctx = self.target.ResolveSymbolContextForAddress (sb_addr, lldb.eSymbolContextEverything)
+                self.sym_ctx = self.target.ResolveSymbolContextForAddress(
+                    sb_addr, lldb.eSymbolContextEverything)
             else:
                 self.sym_ctx = lldb.SBSymbolContext()
         return self.sym_ctx
@@ -82,9 +90,9 @@ class Address:
                 return function.GetInstructions(self.target)
             return sym_ctx.GetSymbol().GetInstructions(self.target)
         return None
-    
-    def symbolicate(self, verbose = False):
-        if self.symbolication == None:
+
+    def symbolicate(self, verbose=False):
+        if self.symbolication is None:
             self.symbolication = ''
             self.inlined = False
             sym_ctx = self.get_symbol_context()
@@ -101,27 +109,32 @@ class Address:
                     block = sym_ctx.GetBlock()
                     line_entry = sym_ctx.GetLineEntry()
                     symbol = sym_ctx.GetSymbol()
-                    inlined_block = block.GetContainingInlinedBlock();
+                    inlined_block = block.GetContainingInlinedBlock()
                     if function:
                         self.symbolication += function.GetName()
 
                         if inlined_block:
                             self.inlined = True
-                            self.symbolication += ' [inlined] ' + inlined_block.GetInlinedName();
-                            block_range_idx = inlined_block.GetRangeIndexForBlockAddress (self.so_addr)
+                            self.symbolication += ' [inlined] ' + \
+                                inlined_block.GetInlinedName()
+                            block_range_idx = inlined_block.GetRangeIndexForBlockAddress(
+                                self.so_addr)
                             if block_range_idx < lldb.UINT32_MAX:
-                                block_range_start_addr = inlined_block.GetRangeStartAddress (block_range_idx)
-                                function_start_load_addr = block_range_start_addr.GetLoadAddress (self.target)
+                                block_range_start_addr = inlined_block.GetRangeStartAddress(
+                                    block_range_idx)
+                                function_start_load_addr = block_range_start_addr.GetLoadAddress(
+                                    self.target)
                         if function_start_load_addr == -1:
-                            function_start_load_addr = function.GetStartAddress().GetLoadAddress (self.target)
+                            function_start_load_addr = function.GetStartAddress().GetLoadAddress(self.target)
                     elif symbol:
                         self.symbolication += symbol.GetName()
-                        function_start_load_addr = symbol.GetStartAddress().GetLoadAddress (self.target)
+                        function_start_load_addr = symbol.GetStartAddress().GetLoadAddress(self.target)
                     else:
                         self.symbolication = ''
                         return False
 
-                    # Dump the offset from the current function or symbol if it is non zero
+                    # Dump the offset from the current function or symbol if it
+                    # is non zero
                     function_offset = self.load_addr - function_start_load_addr
                     if function_offset > 0:
                         self.symbolication += " + %u" % (function_offset)
@@ -135,38 +148,44 @@ class Address:
                             self.symbolication += ' at %s' % line_entry.GetFileSpec()
                         else:
                             self.symbolication += ' at %s' % line_entry.GetFileSpec().GetFilename()
-                        self.symbolication += ':%u' % line_entry.GetLine ()
+                        self.symbolication += ':%u' % line_entry.GetLine()
                         column = line_entry.GetColumn()
                         if column > 0:
                             self.symbolication += ':%u' % column
                     return True
         return False
 
+
 class Section:
     """Class that represents an load address range"""
     sect_info_regex = re.compile('(?P<name>[^=]+)=(?P<range>.*)')
     addr_regex = re.compile('^\s*(?P<start>0x[0-9A-Fa-f]+)\s*$')
-    range_regex = re.compile('^\s*(?P<start>0x[0-9A-Fa-f]+)\s*(?P<op>[-+])\s*(?P<end>0x[0-9A-Fa-f]+)\s*$')
+    range_regex = re.compile(
+        '^\s*(?P<start>0x[0-9A-Fa-f]+)\s*(?P<op>[-+])\s*(?P<end>0x[0-9A-Fa-f]+)\s*$')
 
-    def __init__(self, start_addr = None, end_addr = None, name = None):
+    def __init__(self, start_addr=None, end_addr=None, name=None):
         self.start_addr = start_addr
         self.end_addr = end_addr
         self.name = name
-    
+
     @classmethod
     def InitWithSBTargetAndSBSection(cls, target, section):
         sect_load_addr = section.GetLoadAddress(target)
         if sect_load_addr != lldb.LLDB_INVALID_ADDRESS:
-            obj = cls(sect_load_addr, sect_load_addr + section.size, section.name)
+            obj = cls(
+                sect_load_addr,
+                sect_load_addr +
+                section.size,
+                section.name)
             return obj
         else:
             return None
-        
+
     def contains(self, addr):
-        return self.start_addr <= addr and addr < self.end_addr;
-    
+        return self.start_addr <= addr and addr < self.end_addr
+
     def set_from_string(self, s):
-        match = self.sect_info_regex.match (s)
+        match = self.sect_info_regex.match(s)
         if match:
             self.name = match.group('name')
             range_str = match.group('range')
@@ -192,22 +211,24 @@ class Section:
         print '<name>=<base>-<end>  __TEXT=0x123000-0x124000    Section from base address and end address'
         print '<name>=<base>+<size> __TEXT=0x123000+0x1000      Section from base address and size'
         return False
-        
+
     def __str__(self):
         if self.name:
-            if self.end_addr != None:
-                if self.start_addr != None:
-                    return "%s=[0x%16.16x - 0x%16.16x)" % (self.name, self.start_addr, self.end_addr)
+            if self.end_addr is not None:
+                if self.start_addr is not None:
+                    return "%s=[0x%16.16x - 0x%16.16x)" % (
+                        self.name, self.start_addr, self.end_addr)
             else:
-                if self.start_addr != None:
+                if self.start_addr is not None:
                     return "%s=0x%16.16x" % (self.name, self.start_addr)
             return self.name
         return "<invalid>"
-            
+
+
 class Image:
     """A class that represents an executable image and any associated data"""
-    
-    def __init__(self, path, uuid = None):
+
+    def __init__(self, path, uuid=None):
         self.path = path
         self.resolved_path = None
         self.resolved = False
@@ -220,7 +241,7 @@ class Image:
         self.module = None
         self.symfile = None
         self.slide = None
-        
+
     @classmethod
     def InitWithSBTargetAndSBModule(cls, target, module):
         '''Initialize this Image object with a module from a target.'''
@@ -229,15 +250,16 @@ class Image:
         obj.resolved = True
         obj.arch = module.triple
         for section in module.sections:
-            symb_section = Section.InitWithSBTargetAndSBSection(target, section)
+            symb_section = Section.InitWithSBTargetAndSBSection(
+                target, section)
             if symb_section:
-                obj.section_infos.append (symb_section)
+                obj.section_infos.append(symb_section)
         obj.arch = module.triple
         obj.module = module
         obj.symfile = None
         obj.slide = None
         return obj
-        
+
     def dump(self, prefix):
         print "%s%s" % (prefix, self)
 
@@ -254,7 +276,7 @@ class Image:
         print 'module = %s' % (self.module)
         print 'symfile = "%s"' % (self.symfile)
         print 'slide = %i (0x%x)' % (self.slide, self.slide)
-        
+
     def __str__(self):
         s = ''
         if self.uuid:
@@ -268,15 +290,15 @@ class Image:
             s += "%s " % (resolved_path)
         for section_info in self.section_infos:
             s += ", %s" % (section_info)
-        if self.slide != None:
+        if self.slide is not None:
             s += ', slide = 0x%16.16x' % self.slide
-        return s        
-    
+        return s
+
     def add_section(self, section):
-        #print "added '%s' to '%s'" % (section, self.path)
-        self.section_infos.append (section)
-        
-    def get_section_containing_load_addr (self, load_addr):
+        # print "added '%s' to '%s'" % (section, self.path)
+        self.section_infos.append(section)
+
+    def get_section_containing_load_addr(self, load_addr):
         for section_info in self.section_infos:
             if section_info.contains(load_addr):
                 return section_info
@@ -299,13 +321,13 @@ class Image:
         if self.symfile:
             return os.path.basename(self.symfile)
         return None
-    
+
     def has_section_load_info(self):
-        return self.section_infos or self.slide != None
-    
+        return self.section_infos or self.slide is not None
+
     def load_module(self, target):
         if self.unavailable:
-            return None # We already warned that we couldn't find this module, so don't return an error string
+            return None  # We already warned that we couldn't find this module, so don't return an error string
         # Load this module into "target" using the section infos to
         # set the section load addresses
         if self.has_section_load_info():
@@ -315,9 +337,11 @@ class Image:
                         num_sections_loaded = 0
                         for section_info in self.section_infos:
                             if section_info.name:
-                                section = self.module.FindSection (section_info.name)
+                                section = self.module.FindSection(
+                                    section_info.name)
                                 if section:
-                                    error = target.SetSectionLoadAddress (section, section_info.start_addr)
+                                    error = target.SetSectionLoadAddress(
+                                        section, section_info.start_addr)
                                     if error.Success():
                                         num_sections_loaded += 1
                                     else:
@@ -325,11 +349,13 @@ class Image:
                                 else:
                                     return 'error: unable to find the section named "%s"' % section_info.name
                             else:
-                                return 'error: unable to find "%s" section in "%s"' % (range.name, self.get_resolved_path())
+                                return 'error: unable to find "%s" section in "%s"' % (
+                                    range.name, self.get_resolved_path())
                         if num_sections_loaded == 0:
                             return 'error: no sections were successfully loaded'
                     else:
-                        err = target.SetModuleLoadAddress(self.module, self.slide)
+                        err = target.SetModuleLoadAddress(
+                            self.module, self.slide)
                         if err.Fail():
                             return err.GetCString()
                     return None
@@ -339,30 +365,33 @@ class Image:
                 return 'error: invalid target'
         else:
             return 'error: no section infos'
-        
+
     def add_module(self, target):
         '''Add the Image described in this object to "target" and load the sections if "load" is True.'''
         if target:
-            # Try and find using UUID only first so that paths need not match up
+            # Try and find using UUID only first so that paths need not match
+            # up
             uuid_str = self.get_normalized_uuid_string()
             if uuid_str:
-                self.module = target.AddModule (None, None, uuid_str)
+                self.module = target.AddModule(None, None, uuid_str)
             if not self.module:
-                self.locate_module_and_debug_symbols ()
+                self.locate_module_and_debug_symbols()
                 if self.unavailable:
                     return None
                 resolved_path = self.get_resolved_path()
-                self.module = target.AddModule (resolved_path, self.arch, uuid_str, self.symfile)
+                self.module = target.AddModule(
+                    resolved_path, self.arch, uuid_str, self.symfile)
             if not self.module:
-                return 'error: unable to get module for (%s) "%s"' % (self.arch, self.get_resolved_path())
+                return 'error: unable to get module for (%s) "%s"' % (
+                    self.arch, self.get_resolved_path())
             if self.has_section_load_info():
                 return self.load_module(target)
             else:
-                return None # No sections, the module was added to the target, so success
+                return None  # No sections, the module was added to the target, so success
         else:
             return 'error: invalid target'
-    
-    def locate_module_and_debug_symbols (self):
+
+    def locate_module_and_debug_symbols(self):
         # By default, just use the paths that were supplied in:
         # self.path
         # self.resolved_path
@@ -371,7 +400,7 @@ class Image:
         # Subclasses can inherit from this class and override this function
         self.resolved = True
         return True
-    
+
     def get_uuid(self):
         if not self.uuid and self.module:
             self.uuid = uuid.UUID(self.module.GetUUIDString())
@@ -387,12 +416,13 @@ class Image:
         if self.unavailable:
             return None
 
-        if self.locate_module_and_debug_symbols ():
-            resolved_path = self.get_resolved_path();
-            path_spec = lldb.SBFileSpec (resolved_path)
+        if self.locate_module_and_debug_symbols():
+            resolved_path = self.get_resolved_path()
+            path_spec = lldb.SBFileSpec(resolved_path)
             #result.PutCString ('plist[%s] = %s' % (uuid, self.plist))
             error = lldb.SBError()
-            target = lldb.debugger.CreateTarget (resolved_path, self.arch, None, False, error);
+            target = lldb.debugger.CreateTarget(
+                resolved_path, self.arch, None, False, error)
             if target:
                 self.module = target.FindModule(path_spec)
                 if self.has_section_load_info():
@@ -405,20 +435,21 @@ class Image:
         else:
             print 'error: unable to locate main executable (%s) "%s"' % (self.arch, self.path)
         return None
-    
+
+
 class Symbolicator:
 
     def __init__(self):
         """A class the represents the information needed to symbolicate addresses in a program"""
         self.target = None
-        self.images = list() # a list of images to be used when symbolicating
+        self.images = list()  # a list of images to be used when symbolicating
         self.addr_mask = 0xffffffffffffffff
-    
+
     @classmethod
     def InitWithSBTarget(cls, target):
         obj = cls()
         obj.target = target
-        obj.images = list();
+        obj.images = list()
         triple = target.triple
         if triple:
             arch = triple.split('-')[0]
@@ -429,7 +460,7 @@ class Symbolicator:
             image = Image.InitWithSBTargetAndSBModule(target, module)
             obj.images.append(image)
         return obj
-        
+
     def __str__(self):
         s = "Symbolicator:\n"
         if self.target:
@@ -441,7 +472,7 @@ class Symbolicator:
         for image in self.images:
             s += '    %s\n' % (image)
         return s
-    
+
     def find_images_with_identifier(self, identifier):
         images = list()
         for image in self.images:
@@ -454,20 +485,20 @@ class Symbolicator:
                 if regex.match(image.identifier):
                     images.append(image)
         return images
-        
+
     def find_image_containing_load_addr(self, load_addr):
         for image in self.images:
-            if image.get_section_containing_load_addr (load_addr):
+            if image.get_section_containing_load_addr(load_addr):
                 return image
         return None
-    
+
     def create_target(self):
         if self.target:
             return self.target
 
         if self.images:
             for image in self.images:
-                self.target = image.create_target ()
+                self.target = image.create_target()
                 if self.target:
                     if self.target.GetAddressByteSize() == 4:
                         triple = self.target.triple
@@ -477,9 +508,8 @@ class Symbolicator:
                                 self.addr_mask = 0xfffffffffffffffe
                     return self.target
         return None
-    
-            
-    def symbolicate(self, load_addr, verbose = False):
+
+    def symbolicate(self, load_addr, verbose=False):
         if not self.target:
             self.create_target()
         if self.target:
@@ -493,51 +523,60 @@ class Symbolicator:
             # that a load address belongs to and lazily load its module in the
             # target, but we shouldn't do any of this if we have a live process
             if not live_process:
-                image = self.find_image_containing_load_addr (load_addr)
+                image = self.find_image_containing_load_addr(load_addr)
                 if image:
-                    image.add_module (self.target)
+                    image.add_module(self.target)
             symbolicated_address = Address(self.target, load_addr)
-            if symbolicated_address.symbolicate (verbose):
+            if symbolicated_address.symbolicate(verbose):
                 if symbolicated_address.so_addr:
                     symbolicated_addresses = list()
                     symbolicated_addresses.append(symbolicated_address)
                     # See if we were able to reconstruct anything?
-                    while 1:
+                    while True:
                         inlined_parent_so_addr = lldb.SBAddress()
-                        inlined_parent_sym_ctx = symbolicated_address.sym_ctx.GetParentOfInlinedScope (symbolicated_address.so_addr, inlined_parent_so_addr)
+                        inlined_parent_sym_ctx = symbolicated_address.sym_ctx.GetParentOfInlinedScope(
+                            symbolicated_address.so_addr, inlined_parent_so_addr)
                         if not inlined_parent_sym_ctx:
                             break
                         if not inlined_parent_so_addr:
                             break
 
-                        symbolicated_address = Address(self.target, inlined_parent_so_addr.GetLoadAddress(self.target))
+                        symbolicated_address = Address(
+                            self.target, inlined_parent_so_addr.GetLoadAddress(
+                                self.target))
                         symbolicated_address.sym_ctx = inlined_parent_sym_ctx
                         symbolicated_address.so_addr = inlined_parent_so_addr
-                        symbolicated_address.symbolicate (verbose)
-            
+                        symbolicated_address.symbolicate(verbose)
+
                         # push the new frame onto the new frame stack
-                        symbolicated_addresses.append (symbolicated_address)
-        
+                        symbolicated_addresses.append(symbolicated_address)
+
                     if symbolicated_addresses:
                         return symbolicated_addresses
         else:
             print 'error: no target in Symbolicator'
         return None
-            
-        
-def disassemble_instructions (target, instructions, pc, insts_before_pc, insts_after_pc, non_zeroeth_frame):
+
+
+def disassemble_instructions(
+        target,
+        instructions,
+        pc,
+        insts_before_pc,
+        insts_after_pc,
+        non_zeroeth_frame):
     lines = list()
     pc_index = -1
     comment_column = 50
     for inst_idx, inst in enumerate(instructions):
-        inst_pc = inst.GetAddress().GetLoadAddress(target);
+        inst_pc = inst.GetAddress().GetLoadAddress(target)
         if pc == inst_pc:
             pc_index = inst_idx
-        mnemonic = inst.GetMnemonic (target)
-        operands =  inst.GetOperands (target)
-        comment =  inst.GetComment (target)
+        mnemonic = inst.GetMnemonic(target)
+        operands = inst.GetOperands(target)
+        comment = inst.GetComment(target)
         #data = inst.GetData (target)
-        lines.append ("%#16.16x: %8s %s" % (inst_pc, mnemonic, operands))
+        lines.append("%#16.16x: %8s %s" % (inst_pc, mnemonic, operands))
         if comment:
             line_len = len(lines[-1])
             if line_len < comment_column:
@@ -545,7 +584,8 @@ def disassemble_instructions (target, in
                 lines[-1] += "; %s" % comment
 
     if pc_index >= 0:
-        # If we are disassembling the non-zeroeth frame, we need to backup the PC by 1
+        # If we are disassembling the non-zeroeth frame, we need to backup the
+        # PC by 1
         if non_zeroeth_frame and pc_index > 0:
             pc_index = pc_index - 1
         if insts_before_pc == -1:
@@ -560,81 +600,128 @@ def disassemble_instructions (target, in
             end_idx = pc_index + insts_after_pc
         if end_idx > inst_idx:
             end_idx = inst_idx
-        for i in range(start_idx, end_idx+1):
+        for i in range(start_idx, end_idx + 1):
             if i == pc_index:
                 print ' -> ', lines[i]
             else:
                 print '    ', lines[i]
 
-def print_module_section_data (section):
+
+def print_module_section_data(section):
     print section
     section_data = section.GetSectionData()
     if section_data:
         ostream = lldb.SBStream()
-        section_data.GetDescription (ostream, section.GetFileAddress())
+        section_data.GetDescription(ostream, section.GetFileAddress())
         print ostream.GetData()
 
-def print_module_section (section, depth):
+
+def print_module_section(section, depth):
     print section
     if depth > 0:
         num_sub_sections = section.GetNumSubSections()
         for sect_idx in range(num_sub_sections):
-            print_module_section (section.GetSubSectionAtIndex(sect_idx), depth - 1)
+            print_module_section(
+                section.GetSubSectionAtIndex(sect_idx), depth - 1)
+
 
-def print_module_sections (module, depth):
+def print_module_sections(module, depth):
     for sect in module.section_iter():
-        print_module_section (sect, depth)
+        print_module_section(sect, depth)
 
-def print_module_symbols (module):
+
+def print_module_symbols(module):
     for sym in module:
         print sym
 
+
 def Symbolicate(command_args):
-    
+
     usage = "usage: %prog [options] <addr1> [addr2 ...]"
-    description='''Symbolicate one or more addresses using LLDB's python scripting API..'''
-    parser = optparse.OptionParser(description=description, prog='crashlog.py',usage=usage)
-    parser.add_option('-v', '--verbose', action='store_true', dest='verbose', help='display verbose debug info', default=False)
-    parser.add_option('-p', '--platform', type='string', metavar='platform', dest='platform', help='Specify the platform to use when creating the debug target. Valid values include "localhost", "darwin-kernel", "ios-simulator", "remote-freebsd", "remote-macosx", "remote-ios", "remote-linux".')
-    parser.add_option('-f', '--file', type='string', metavar='file', dest='file', help='Specify a file to use when symbolicating')
-    parser.add_option('-a', '--arch', type='string', metavar='arch', dest='arch', help='Specify a architecture to use when symbolicating')
-    parser.add_option('-s', '--slide', type='int', metavar='slide', dest='slide', help='Specify the slide to use on the file specified with the --file option', default=None)
-    parser.add_option('--section', type='string', action='append', dest='section_strings', help='specify <sect-name>=<start-addr> or <sect-name>=<start-addr>-<end-addr>')
+    description = '''Symbolicate one or more addresses using LLDB's python scripting API..'''
+    parser = optparse.OptionParser(
+        description=description,
+        prog='crashlog.py',
+        usage=usage)
+    parser.add_option(
+        '-v',
+        '--verbose',
+        action='store_true',
+        dest='verbose',
+        help='display verbose debug info',
+        default=False)
+    parser.add_option(
+        '-p',
+        '--platform',
+        type='string',
+        metavar='platform',
+        dest='platform',
+        help='Specify the platform to use when creating the debug target. Valid values include "localhost", "darwin-kernel", "ios-simulator", "remote-freebsd", "remote-macosx", "remote-ios", "remote-linux".')
+    parser.add_option(
+        '-f',
+        '--file',
+        type='string',
+        metavar='file',
+        dest='file',
+        help='Specify a file to use when symbolicating')
+    parser.add_option(
+        '-a',
+        '--arch',
+        type='string',
+        metavar='arch',
+        dest='arch',
+        help='Specify a architecture to use when symbolicating')
+    parser.add_option(
+        '-s',
+        '--slide',
+        type='int',
+        metavar='slide',
+        dest='slide',
+        help='Specify the slide to use on the file specified with the --file option',
+        default=None)
+    parser.add_option(
+        '--section',
+        type='string',
+        action='append',
+        dest='section_strings',
+        help='specify <sect-name>=<start-addr> or <sect-name>=<start-addr>-<end-addr>')
     try:
         (options, args) = parser.parse_args(command_args)
     except:
         return
     symbolicator = Symbolicator()
-    images = list();
+    images = list()
     if options.file:
-        image = Image(options.file);
+        image = Image(options.file)
         image.arch = options.arch
-        # Add any sections that were specified with one or more --section options
+        # Add any sections that were specified with one or more --section
+        # options
         if options.section_strings:
             for section_str in options.section_strings:
                 section = Section()
-                if section.set_from_string (section_str):
-                    image.add_section (section)
+                if section.set_from_string(section_str):
+                    image.add_section(section)
                 else:
                     sys.exit(1)
-        if options.slide != None:
+        if options.slide is not None:
             image.slide = options.slide
         symbolicator.images.append(image)
-    
+
     target = symbolicator.create_target()
     if options.verbose:
         print symbolicator
     if target:
         for addr_str in args:
             addr = int(addr_str, 0)
-            symbolicated_addrs = symbolicator.symbolicate(addr, options.verbose)
+            symbolicated_addrs = symbolicator.symbolicate(
+                addr, options.verbose)
             for symbolicated_addr in symbolicated_addrs:
                 print symbolicated_addr
             print
     else:
         print 'error: no target for %s' % (symbolicator)
-        
+
 if __name__ == '__main__':
     # Create a new debugger instance
     lldb.debugger = lldb.SBDebugger.Create()
-    Symbolicate (sys.argv[1:])
+    Symbolicate(sys.argv[1:])

Modified: lldb/trunk/examples/python/types.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/types.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/examples/python/types.py (original)
+++ lldb/trunk/examples/python/types.py Tue Sep  6 15:57:50 2016
@@ -4,7 +4,7 @@
 # Be sure to add the python path that points to the LLDB shared library.
 #
 # # To use this in the embedded python interpreter using "lldb" just
-# import it with the full path using the "command script import" 
+# import it with the full path using the "command script import"
 # command
 #   (lldb) command script import /path/to/cmdtemplate.py
 #----------------------------------------------------------------------
@@ -16,7 +16,7 @@ import re
 import signal
 import sys
 
-try: 
+try:
     # Just try for LLDB in case PYTHONPATH is already correctly setup
     import lldb
 except ImportError:
@@ -27,15 +27,20 @@ except ImportError:
         # On Darwin, try the currently selected Xcode directory
         xcode_dir = commands.getoutput("xcode-select --print-path")
         if xcode_dir:
-            lldb_python_dirs.append(os.path.realpath(xcode_dir + '/../SharedFrameworks/LLDB.framework/Resources/Python'))
-            lldb_python_dirs.append(xcode_dir + '/Library/PrivateFrameworks/LLDB.framework/Resources/Python')
-        lldb_python_dirs.append('/System/Library/PrivateFrameworks/LLDB.framework/Resources/Python')
+            lldb_python_dirs.append(
+                os.path.realpath(
+                    xcode_dir +
+                    '/../SharedFrameworks/LLDB.framework/Resources/Python'))
+            lldb_python_dirs.append(
+                xcode_dir + '/Library/PrivateFrameworks/LLDB.framework/Resources/Python')
+        lldb_python_dirs.append(
+            '/System/Library/PrivateFrameworks/LLDB.framework/Resources/Python')
     success = False
     for lldb_python_dir in lldb_python_dirs:
         if os.path.exists(lldb_python_dir):
             if not (sys.path.__contains__(lldb_python_dir)):
                 sys.path.append(lldb_python_dir)
-                try: 
+                try:
                     import lldb
                 except ImportError:
                     pass
@@ -52,48 +57,111 @@ import optparse
 import shlex
 import time
 
+
 def regex_option_callback(option, opt_str, value, parser):
     if opt_str == "--std":
         value = '^std::'
     regex = re.compile(value)
-    parser.values.skip_type_regexes.append (regex)
+    parser.values.skip_type_regexes.append(regex)
+
 
 def create_types_options(for_lldb_command):
     if for_lldb_command:
         usage = "usage: %prog [options]"
-        description='''This command will help check for padding in between
+        description = '''This command will help check for padding in between
 base classes and members in structs and classes. It will summarize the types
 and how much padding was found. If no types are specified with the --types TYPENAME
-option, all structure and class types will be verified. If no modules are 
+option, all structure and class types will be verified. If no modules are
 specified with the --module option, only the target's main executable will be
 searched.
 '''
     else:
         usage = "usage: %prog [options] EXEPATH [EXEPATH ...]"
-        description='''This command will help check for padding in between
+        description = '''This command will help check for padding in between
 base classes and members in structures and classes. It will summarize the types
 and how much padding was found. One or more paths to executable files must be
-specified and targets will be created with these modules. If no types are 
+specified and targets will be created with these modules. If no types are
 specified with the --types TYPENAME option, all structure and class types will
 be verified in all specified modules.
 '''
-    parser = optparse.OptionParser(description=description, prog='framestats',usage=usage)
+    parser = optparse.OptionParser(
+        description=description,
+        prog='framestats',
+        usage=usage)
     if not for_lldb_command:
-        parser.add_option('-a', '--arch', type='string', dest='arch', help='The architecture to use when creating the debug target.', default=None)
-        parser.add_option('-p', '--platform', type='string', metavar='platform', dest='platform', help='Specify the platform to use when creating the debug target. Valid values include "localhost", "darwin-kernel", "ios-simulator", "remote-freebsd", "remote-macosx", "remote-ios", "remote-linux".')
-    parser.add_option('-m', '--module', action='append', type='string', metavar='MODULE', dest='modules', help='Specify one or more modules which will be used to verify the types.', default=[])
-    parser.add_option('-d', '--debug', action='store_true', dest='debug', help='Pause 10 seconds to wait for a debugger to attach.', default=False)
-    parser.add_option('-t', '--type', action='append', type='string', metavar='TYPENAME', dest='typenames', help='Specify one or more type names which should be verified. If no type names are specified, all class and struct types will be verified.', default=[])
-    parser.add_option('-v', '--verbose', action='store_true', dest='verbose', help='Enable verbose logging and information.', default=False)
-    parser.add_option('-s', '--skip-type-regex', action="callback", callback=regex_option_callback, type='string', metavar='REGEX', dest='skip_type_regexes', help='Regular expressions that, if they match the current member typename, will cause the type to no be recursively displayed.', default=[])
-    parser.add_option('--std', action="callback", callback=regex_option_callback, metavar='REGEX', dest='skip_type_regexes', help="Don't' recurse into types in the std namespace.", default=[])
+        parser.add_option(
+            '-a',
+            '--arch',
+            type='string',
+            dest='arch',
+            help='The architecture to use when creating the debug target.',
+            default=None)
+        parser.add_option(
+            '-p',
+            '--platform',
+            type='string',
+            metavar='platform',
+            dest='platform',
+            help='Specify the platform to use when creating the debug target. Valid values include "localhost", "darwin-kernel", "ios-simulator", "remote-freebsd", "remote-macosx", "remote-ios", "remote-linux".')
+    parser.add_option(
+        '-m',
+        '--module',
+        action='append',
+        type='string',
+        metavar='MODULE',
+        dest='modules',
+        help='Specify one or more modules which will be used to verify the types.',
+        default=[])
+    parser.add_option(
+        '-d',
+        '--debug',
+        action='store_true',
+        dest='debug',
+        help='Pause 10 seconds to wait for a debugger to attach.',
+        default=False)
+    parser.add_option(
+        '-t',
+        '--type',
+        action='append',
+        type='string',
+        metavar='TYPENAME',
+        dest='typenames',
+        help='Specify one or more type names which should be verified. If no type names are specified, all class and struct types will be verified.',
+        default=[])
+    parser.add_option(
+        '-v',
+        '--verbose',
+        action='store_true',
+        dest='verbose',
+        help='Enable verbose logging and information.',
+        default=False)
+    parser.add_option(
+        '-s',
+        '--skip-type-regex',
+        action="callback",
+        callback=regex_option_callback,
+        type='string',
+        metavar='REGEX',
+        dest='skip_type_regexes',
+        help='Regular expressions that, if they match the current member typename, will cause the type to no be recursively displayed.',
+        default=[])
+    parser.add_option(
+        '--std',
+        action="callback",
+        callback=regex_option_callback,
+        metavar='REGEX',
+        dest='skip_type_regexes',
+        help="Don't' recurse into types in the std namespace.",
+        default=[])
     return parser
 
-def verify_type (target, options, type):
+
+def verify_type(target, options, type):
     print type
     typename = type.GetName()
     # print 'type: %s' % (typename)
-    (end_offset, padding) = verify_type_recursive (target, options, type, None, 0, 0, 0)
+    (end_offset, padding) = verify_type_recursive(
+        target, options, type, None, 0, 0, 0)
     byte_size = type.GetByteSize()
     # if end_offset < byte_size:
     #     last_member_padding = byte_size - end_offset
@@ -105,7 +173,15 @@ def verify_type (target, options, type):
         print 'Padding percentage: %2.2f %%' % ((float(padding) / float(byte_size)) * 100.0)
     print
 
-def verify_type_recursive (target, options, type, member_name, depth, base_offset, padding):
+
+def verify_type_recursive(
+        target,
+        options,
+        type,
+        member_name,
+        depth,
+        base_offset,
+        padding):
     prev_end_offset = base_offset
     typename = type.GetName()
     byte_size = type.GetByteSize()
@@ -113,12 +189,12 @@ def verify_type_recursive (target, optio
         print '%+4u <%3u> %s%s %s;' % (base_offset, byte_size, '    ' * depth, typename, member_name)
     else:
         print '%+4u {%3u} %s%s' % (base_offset, byte_size, '    ' * depth, typename)
-    
+
     for type_regex in options.skip_type_regexes:
-        match = type_regex.match (typename)
+        match = type_regex.match(typename)
         if match:
             return (base_offset + byte_size, padding)
-                
+
     members = type.members
     if members:
         for member_idx, member in enumerate(members):
@@ -132,7 +208,8 @@ def verify_type_recursive (target, optio
             member_is_class_or_struct = False
             if member_type_class == lldb.eTypeClassStruct or member_type_class == lldb.eTypeClassClass:
                 member_is_class_or_struct = True
-            if member_idx == 0 and member_offset == target.GetAddressByteSize() and type.IsPolymorphicClass():
+            if member_idx == 0 and member_offset == target.GetAddressByteSize(
+            ) and type.IsPolymorphicClass():
                 ptr_size = target.GetAddressByteSize()
                 print '%+4u <%3u> %s__vtbl_ptr_type * _vptr;' % (prev_end_offset, ptr_size, '    ' * (depth + 1))
                 prev_end_offset = ptr_size
@@ -141,9 +218,16 @@ def verify_type_recursive (target, optio
                     member_padding = member_total_offset - prev_end_offset
                     padding = padding + member_padding
                     print '%+4u <%3u> %s<PADDING>' % (prev_end_offset, member_padding, '    ' * (depth + 1))
-        
+
             if member_is_class_or_struct:
-                (prev_end_offset, padding) = verify_type_recursive (target, options, member_canonical_type, member_name, depth + 1, member_total_offset, padding)
+                (prev_end_offset,
+                 padding) = verify_type_recursive(target,
+                                                  options,
+                                                  member_canonical_type,
+                                                  member_name,
+                                                  depth + 1,
+                                                  member_total_offset,
+                                                  padding)
             else:
                 prev_end_offset = member_total_offset + member_byte_size
                 member_typename = member_type.GetName()
@@ -151,7 +235,7 @@ def verify_type_recursive (target, optio
                     print '%+4u <%3u> %s%s:%u %s;' % (member_total_offset, member_byte_size, '    ' * (depth + 1), member_typename, member.GetBitfieldSizeInBits(), member_name)
                 else:
                     print '%+4u <%3u> %s%s %s;' % (member_total_offset, member_byte_size, '    ' * (depth + 1), member_typename, member_name)
-    
+
         if prev_end_offset < byte_size:
             last_member_padding = byte_size - prev_end_offset
             print '%+4u <%3u> %s<PADDING>' % (prev_end_offset, last_member_padding, '    ' * (depth + 1))
@@ -162,11 +246,12 @@ def verify_type_recursive (target, optio
             print '%+4u <%3u> %s__vtbl_ptr_type * _vptr;' % (prev_end_offset, ptr_size, '    ' * (depth + 1))
             prev_end_offset = ptr_size
         prev_end_offset = base_offset + byte_size
-    
+
     return (prev_end_offset, padding)
-    
-def check_padding_command (debugger, command, result, dict):
-    # Use the Shell Lexer to properly parse up command options just like a 
+
+
+def check_padding_command(debugger, command, result, dict):
+    # Use the Shell Lexer to properly parse up command options just like a
     # shell would
     command_args = shlex.split(command)
     parser = create_types_options(True)
@@ -175,30 +260,33 @@ def check_padding_command (debugger, com
     except:
         # if you don't handle exceptions, passing an incorrect argument to the OptionParser will cause LLDB to exit
         # (courtesy of OptParse dealing with argument errors by throwing SystemExit)
-        result.SetStatus (lldb.eReturnStatusFailed)
-        return "option parsing failed" # returning a string is the same as returning an error whose description is the string
+        result.SetStatus(lldb.eReturnStatusFailed)
+        # returning a string is the same as returning an error whose
+        # description is the string
+        return "option parsing failed"
     verify_types(debugger.GetSelectedTarget(), options)
 
+
 @lldb.command("parse_all_struct_class_types")
-def parse_all_struct_class_types (debugger, command, result, dict):
+def parse_all_struct_class_types(debugger, command, result, dict):
     command_args = shlex.split(command)
     for f in command_args:
         error = lldb.SBError()
-        target = debugger.CreateTarget (f, None, None, False, error)
+        target = debugger.CreateTarget(f, None, None, False, error)
         module = target.GetModuleAtIndex(0)
         print "Parsing all types in '%s'" % (module)
         types = module.GetTypes(lldb.eTypeClassClass | lldb.eTypeClassStruct)
         for t in types:
             print t
         print ""
-        
-    
-def verify_types (target, options):
+
+
+def verify_types(target, options):
 
     if not target:
         print 'error: invalid target'
         return
-    
+
     modules = list()
     if len(options.modules) == 0:
         # Append just the main executable if nothing was specified
@@ -210,7 +298,7 @@ def verify_types (target, options):
             module = lldb.target.module[module_name]
             if module:
                 modules.append(module)
-    
+
     if modules:
         for module in modules:
             print 'module: %s' % (module.file)
@@ -220,46 +308,49 @@ def verify_types (target, options):
                     if types.GetSize():
                         print 'Found %u types matching "%s" in "%s"' % (len(types), typename, module.file)
                         for type in types:
-                            verify_type (target, options, type)
+                            verify_type(target, options, type)
                     else:
                         print 'error: no type matches "%s" in "%s"' % (typename, module.file)
             else:
-                types = module.GetTypes(lldb.eTypeClassClass | lldb.eTypeClassStruct)
+                types = module.GetTypes(
+                    lldb.eTypeClassClass | lldb.eTypeClassStruct)
                 print 'Found %u types in "%s"' % (len(types), module.file)
                 for type in types:
-                    verify_type (target, options, type)
+                    verify_type(target, options, type)
     else:
         print 'error: no modules'
 
 if __name__ == '__main__':
     debugger = lldb.SBDebugger.Create()
     parser = create_types_options(False)
-    
+
     # try:
     (options, args) = parser.parse_args(sys.argv[1:])
     # except:
-    #     print "error: option parsing failed" 
+    #     print "error: option parsing failed"
     #     sys.exit(1)
-    
+
     if options.debug:
         print "Waiting for debugger to attach to process %d" % os.getpid()
         os.kill(os.getpid(), signal.SIGSTOP)
-        
+
     for path in args:
-    # in a command - the lldb.* convenience variables are not to be used
-    # and their values (if any) are undefined
-    # this is the best practice to access those objects from within a command
+        # in a command - the lldb.* convenience variables are not to be used
+        # and their values (if any) are undefined
+        # this is the best practice to access those objects from within a
+        # command
         error = lldb.SBError()
-        target = debugger.CreateTarget (path,
-                                        options.arch,
-                                        options.platform,
-                                        True,
-                                        error)
+        target = debugger.CreateTarget(path,
+                                       options.arch,
+                                       options.platform,
+                                       True,
+                                       error)
         if error.Fail():
             print error.GetCString()
             continue
-        verify_types (target, options)
-    
+        verify_types(target, options)
+
 elif getattr(lldb, 'debugger', None):
-    lldb.debugger.HandleCommand('command script add -f types.check_padding_command check_padding')
-    print '"check_padding" command installed, use the "--help" option for detailed help'
\ No newline at end of file
+    lldb.debugger.HandleCommand(
+        'command script add -f types.check_padding_command check_padding')
+    print '"check_padding" command installed, use the "--help" option for detailed help'

Modified: lldb/trunk/examples/python/x86_64_linux_target_definition.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/x86_64_linux_target_definition.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/examples/python/x86_64_linux_target_definition.py (original)
+++ lldb/trunk/examples/python/x86_64_linux_target_definition.py Tue Sep  6 15:57:50 2016
@@ -13,27 +13,27 @@
 #
 # This file can be used with the following setting:
 #   plugin.process.gdb-remote.target-definition-file
-# This setting should be used when you are trying to connect to a 
+# This setting should be used when you are trying to connect to a
 # remote GDB server that doesn't support any of the register discovery
-# packets that LLDB normally uses. 
+# packets that LLDB normally uses.
 #
 # Why is this necessary? LLDB doesn't require a new build of LLDB that
 # targets each new architecture you will debug with. Instead, all
-# architectures are supported and LLDB relies on extra GDB server 
+# architectures are supported and LLDB relies on extra GDB server
 # packets to discover the target we are connecting to so that is can
 # show the right registers for each target. This allows the GDB server
 # to change and add new registers without requiring a new LLDB build
 # just so we can see new registers.
 #
 # This file implements the x86_64 registers for the darwin version of
-# GDB and allows you to connect to servers that use this register set. 
-# 
+# GDB and allows you to connect to servers that use this register set.
+#
 # USAGE
 #
 # (lldb) settings set plugin.process.gdb-remote.target-definition-file /path/to/x86_64_linux_target_definition.py
 # (lldb) gdb-remote other.baz.com:1234
 #
-# The target definition file will get used if and only if the 
+# The target definition file will get used if and only if the
 # qRegisterInfo packets are not supported when connecting to a remote
 # GDB server.
 #----------------------------------------------------------------------
@@ -41,313 +41,735 @@ from lldb import *
 
 # Compiler and DWARF register numbers
 name_to_gcc_dwarf_regnum = {
-    'rax'   : 0 ,     
-    'rdx'   : 1 ,
-    'rcx'   : 2 ,
-    'rbx'   : 3 ,
-    'rsi'   : 4 ,
-    'rdi'   : 5 ,
-    'rbp'   : 6 ,
-    'rsp'   : 7 ,
-    'r8'    : 8 ,
-    'r9'    : 9 ,
-    'r10'   : 10,
-    'r11'   : 11,
-    'r12'   : 12,
-    'r13'   : 13,
-    'r14'   : 14,
-    'r15'   : 15,
-    'rip'   : 16,
-    'xmm0'  : 17,
-    'xmm1'  : 18,
-    'xmm2'  : 19,
-    'xmm3'  : 20,
-    'xmm4'  : 21,
-    'xmm5'  : 22,
-    'xmm6'  : 23,
-    'xmm7'  : 24,
-    'xmm8'  : 25,
-    'xmm9'  : 26,
-    'xmm10' : 27,
-    'xmm11' : 28,
-    'xmm12' : 29,
-    'xmm13' : 30,
-    'xmm14' : 31,
-    'xmm15' : 32,
-    'stmm0' : 33,
-    'stmm1' : 34,
-    'stmm2' : 35,
-    'stmm3' : 36,
-    'stmm4' : 37,
-    'stmm5' : 38,
-    'stmm6' : 39,
-    'stmm7' : 30,
-    'ymm0'  : 41,
-    'ymm1'  : 42,
-    'ymm2'  : 43,
-    'ymm3'  : 44,
-    'ymm4'  : 45,
-    'ymm5'  : 46,
-    'ymm6'  : 47,
-    'ymm7'  : 48,
-    'ymm8'  : 49,
-    'ymm9'  : 40,
-    'ymm10' : 41,
-    'ymm11' : 42,
-    'ymm12' : 43,
-    'ymm13' : 44,
-    'ymm14' : 45,
-    'ymm15' : 46
-};
+    'rax': 0,
+    'rdx': 1,
+    'rcx': 2,
+    'rbx': 3,
+    'rsi': 4,
+    'rdi': 5,
+    'rbp': 6,
+    'rsp': 7,
+    'r8': 8,
+    'r9': 9,
+    'r10': 10,
+    'r11': 11,
+    'r12': 12,
+    'r13': 13,
+    'r14': 14,
+    'r15': 15,
+    'rip': 16,
+    'xmm0': 17,
+    'xmm1': 18,
+    'xmm2': 19,
+    'xmm3': 20,
+    'xmm4': 21,
+    'xmm5': 22,
+    'xmm6': 23,
+    'xmm7': 24,
+    'xmm8': 25,
+    'xmm9': 26,
+    'xmm10': 27,
+    'xmm11': 28,
+    'xmm12': 29,
+    'xmm13': 30,
+    'xmm14': 31,
+    'xmm15': 32,
+    'stmm0': 33,
+    'stmm1': 34,
+    'stmm2': 35,
+    'stmm3': 36,
+    'stmm4': 37,
+    'stmm5': 38,
+    'stmm6': 39,
+    'stmm7': 30,
+    'ymm0': 41,
+    'ymm1': 42,
+    'ymm2': 43,
+    'ymm3': 44,
+    'ymm4': 45,
+    'ymm5': 46,
+    'ymm6': 47,
+    'ymm7': 48,
+    'ymm8': 49,
+    'ymm9': 40,
+    'ymm10': 41,
+    'ymm11': 42,
+    'ymm12': 43,
+    'ymm13': 44,
+    'ymm14': 45,
+    'ymm15': 46
+}
 
 name_to_gdb_regnum = {
-    'rax'   :   0,
-    'rbx'   :   1,
-    'rcx'   :   2,
-    'rdx'   :   3,
-    'rsi'   :   4,
-    'rdi'   :   5,
-    'rbp'   :   6,
-    'rsp'   :   7,
-    'r8'    :   8,
-    'r9'    :   9,
-    'r10'   :  10,
-    'r11'   :  11,
-    'r12'   :  12,
-    'r13'   :  13,
-    'r14'   :  14,
-    'r15'   :  15,
-    'rip'   :  16,
-    'rflags':  17,
-    'cs'    :  18,
-    'ss'    :  19,
-    'ds'    :  20,
-    'es'    :  21,
-    'fs'    :  22,
-    'gs'    :  23,
-    'stmm0' :  24,
-    'stmm1' :  25,
-    'stmm2' :  26,
-    'stmm3' :  27,
-    'stmm4' :  28,
-    'stmm5' :  29,
-    'stmm6' :  30,
-    'stmm7' :  31,
-    'fctrl' :  32,
-    'fstat' :  33,
-    'ftag'  :  34,
-    'fiseg' :  35,
-    'fioff' :  36,
-    'foseg' :  37,
-    'fooff' :  38,
-    'fop'   :  39,
-    'xmm0'  :  40,
-    'xmm1'  :  41,
-    'xmm2'  :  42,
-    'xmm3'  :  43,
-    'xmm4'  :  44,
-    'xmm5'  :  45,
-    'xmm6'  :  46,
-    'xmm7'  :  47,
-    'xmm8'  :  48,
-    'xmm9'  :  49,
-    'xmm10' :  50,
-    'xmm11' :  51,
-    'xmm12' :  52,
-    'xmm13' :  53,
-    'xmm14' :  54,
-    'xmm15' :  55,
-    'mxcsr' :  56,
-    'ymm0'  :  57,
-    'ymm1'  :  58,
-    'ymm2'  :  59,
-    'ymm3'  :  60,
-    'ymm4'  :  61,
-    'ymm5'  :  62,
-    'ymm6'  :  63,
-    'ymm7'  :  64,
-    'ymm8'  :  65,
-    'ymm9'  :  66,
-    'ymm10' :  67,
-    'ymm11' :  68,
-    'ymm12' :  69,
-    'ymm13' :  70,
-    'ymm14' :  71,
-    'ymm15' :  72
-};
+    'rax': 0,
+    'rbx': 1,
+    'rcx': 2,
+    'rdx': 3,
+    'rsi': 4,
+    'rdi': 5,
+    'rbp': 6,
+    'rsp': 7,
+    'r8': 8,
+    'r9': 9,
+    'r10': 10,
+    'r11': 11,
+    'r12': 12,
+    'r13': 13,
+    'r14': 14,
+    'r15': 15,
+    'rip': 16,
+    'rflags': 17,
+    'cs': 18,
+    'ss': 19,
+    'ds': 20,
+    'es': 21,
+    'fs': 22,
+    'gs': 23,
+    'stmm0': 24,
+    'stmm1': 25,
+    'stmm2': 26,
+    'stmm3': 27,
+    'stmm4': 28,
+    'stmm5': 29,
+    'stmm6': 30,
+    'stmm7': 31,
+    'fctrl': 32,
+    'fstat': 33,
+    'ftag': 34,
+    'fiseg': 35,
+    'fioff': 36,
+    'foseg': 37,
+    'fooff': 38,
+    'fop': 39,
+    'xmm0': 40,
+    'xmm1': 41,
+    'xmm2': 42,
+    'xmm3': 43,
+    'xmm4': 44,
+    'xmm5': 45,
+    'xmm6': 46,
+    'xmm7': 47,
+    'xmm8': 48,
+    'xmm9': 49,
+    'xmm10': 50,
+    'xmm11': 51,
+    'xmm12': 52,
+    'xmm13': 53,
+    'xmm14': 54,
+    'xmm15': 55,
+    'mxcsr': 56,
+    'ymm0': 57,
+    'ymm1': 58,
+    'ymm2': 59,
+    'ymm3': 60,
+    'ymm4': 61,
+    'ymm5': 62,
+    'ymm6': 63,
+    'ymm7': 64,
+    'ymm8': 65,
+    'ymm9': 66,
+    'ymm10': 67,
+    'ymm11': 68,
+    'ymm12': 69,
+    'ymm13': 70,
+    'ymm14': 71,
+    'ymm15': 72
+}
 
 name_to_generic_regnum = {
-    'rip' : LLDB_REGNUM_GENERIC_PC,
-    'rsp' : LLDB_REGNUM_GENERIC_SP,
-    'rbp' : LLDB_REGNUM_GENERIC_FP,
-    'rdi' : LLDB_REGNUM_GENERIC_ARG1,
-    'rsi' : LLDB_REGNUM_GENERIC_ARG2,
-    'rdx' : LLDB_REGNUM_GENERIC_ARG3,
-    'rcx' : LLDB_REGNUM_GENERIC_ARG4,
-    'r8'  : LLDB_REGNUM_GENERIC_ARG5,
-    'r9'  : LLDB_REGNUM_GENERIC_ARG6
-};
+    'rip': LLDB_REGNUM_GENERIC_PC,
+    'rsp': LLDB_REGNUM_GENERIC_SP,
+    'rbp': LLDB_REGNUM_GENERIC_FP,
+    'rdi': LLDB_REGNUM_GENERIC_ARG1,
+    'rsi': LLDB_REGNUM_GENERIC_ARG2,
+    'rdx': LLDB_REGNUM_GENERIC_ARG3,
+    'rcx': LLDB_REGNUM_GENERIC_ARG4,
+    'r8': LLDB_REGNUM_GENERIC_ARG5,
+    'r9': LLDB_REGNUM_GENERIC_ARG6
+}
+
 
-def get_reg_num (reg_num_dict, reg_name):
+def get_reg_num(reg_num_dict, reg_name):
     if reg_name in reg_num_dict:
         return reg_num_dict[reg_name]
     return LLDB_INVALID_REGNUM
-    
+
 x86_64_register_infos = [
-{ 'name':'rax'   , 'set':0, 'bitsize':64 , 'encoding':eEncodingUint  , 'format':eFormatAddressInfo   },
-{ 'name':'rbx'   , 'set':0, 'bitsize':64 , 'encoding':eEncodingUint  , 'format':eFormatAddressInfo   },
-{ 'name':'rcx'   , 'set':0, 'bitsize':64 , 'encoding':eEncodingUint  , 'format':eFormatAddressInfo, 'alt-name':'arg4' },
-{ 'name':'rdx'   , 'set':0, 'bitsize':64 , 'encoding':eEncodingUint  , 'format':eFormatAddressInfo, 'alt-name':'arg3' },
-{ 'name':'rsi'   , 'set':0, 'bitsize':64 , 'encoding':eEncodingUint  , 'format':eFormatAddressInfo, 'alt-name':'arg2' },
-{ 'name':'rdi'   , 'set':0, 'bitsize':64 , 'encoding':eEncodingUint  , 'format':eFormatAddressInfo, 'alt-name':'arg1' },
-{ 'name':'rbp'   , 'set':0, 'bitsize':64 , 'encoding':eEncodingUint  , 'format':eFormatAddressInfo, 'alt-name':'fp' },
-{ 'name':'rsp'   , 'set':0, 'bitsize':64 , 'encoding':eEncodingUint  , 'format':eFormatAddressInfo, 'alt-name':'sp' },
-{ 'name':'r8'    , 'set':0, 'bitsize':64 , 'encoding':eEncodingUint  , 'format':eFormatAddressInfo, 'alt-name':'arg5' },
-{ 'name':'r9'    , 'set':0, 'bitsize':64 , 'encoding':eEncodingUint  , 'format':eFormatAddressInfo, 'alt-name':'arg6' },
-{ 'name':'r10'   , 'set':0, 'bitsize':64 , 'encoding':eEncodingUint  , 'format':eFormatAddressInfo   },
-{ 'name':'r11'   , 'set':0, 'bitsize':64 , 'encoding':eEncodingUint  , 'format':eFormatAddressInfo   },
-{ 'name':'r12'   , 'set':0, 'bitsize':64 , 'encoding':eEncodingUint  , 'format':eFormatAddressInfo   },
-{ 'name':'r13'   , 'set':0, 'bitsize':64 , 'encoding':eEncodingUint  , 'format':eFormatAddressInfo   },
-{ 'name':'r14'   , 'set':0, 'bitsize':64 , 'encoding':eEncodingUint  , 'format':eFormatAddressInfo   },
-{ 'name':'r15'   , 'set':0, 'bitsize':64 , 'encoding':eEncodingUint  , 'format':eFormatAddressInfo   },
-{ 'name':'rip'   , 'set':0, 'bitsize':64 , 'encoding':eEncodingUint  , 'format':eFormatAddressInfo, 'alt-name':'pc' },
-{ 'name':'rflags', 'set':0, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex           },
-{ 'name':'cs'    , 'set':0, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex           },
-{ 'name':'ss'    , 'set':0, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex           },
-{ 'name':'ds'    , 'set':0, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex           },
-{ 'name':'es'    , 'set':0, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex           },
-{ 'name':'fs'    , 'set':0, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex           },
-{ 'name':'gs'    , 'set':0, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex           },
-{ 'name':'stmm0' , 'set':1, 'bitsize':80 , 'encoding':eEncodingVector, 'format':eFormatVectorOfUInt8 },
-{ 'name':'stmm1' , 'set':1, 'bitsize':80 , 'encoding':eEncodingVector, 'format':eFormatVectorOfUInt8 },
-{ 'name':'stmm2' , 'set':1, 'bitsize':80 , 'encoding':eEncodingVector, 'format':eFormatVectorOfUInt8 },
-{ 'name':'stmm3' , 'set':1, 'bitsize':80 , 'encoding':eEncodingVector, 'format':eFormatVectorOfUInt8 },
-{ 'name':'stmm4' , 'set':1, 'bitsize':80 , 'encoding':eEncodingVector, 'format':eFormatVectorOfUInt8 },
-{ 'name':'stmm5' , 'set':1, 'bitsize':80 , 'encoding':eEncodingVector, 'format':eFormatVectorOfUInt8 },
-{ 'name':'stmm6' , 'set':1, 'bitsize':80 , 'encoding':eEncodingVector, 'format':eFormatVectorOfUInt8 },
-{ 'name':'stmm7' , 'set':1, 'bitsize':80 , 'encoding':eEncodingVector, 'format':eFormatVectorOfUInt8 },
-{ 'name':'fctrl' , 'set':1, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex           },
-{ 'name':'fstat' , 'set':1, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex           },
-{ 'name':'ftag'  , 'set':1, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex           },
-{ 'name':'fiseg' , 'set':1, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex           },
-{ 'name':'fioff' , 'set':1, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex           },
-{ 'name':'foseg' , 'set':1, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex           },
-{ 'name':'fooff' , 'set':1, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex           },
-{ 'name':'fop'   , 'set':1, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex           },
-{ 'name':'xmm0'  , 'set':1, 'bitsize':128, 'encoding':eEncodingVector, 'format':eFormatVectorOfUInt8 },
-{ 'name':'xmm1'  , 'set':1, 'bitsize':128, 'encoding':eEncodingVector, 'format':eFormatVectorOfUInt8 },
-{ 'name':'xmm2'  , 'set':1, 'bitsize':128, 'encoding':eEncodingVector, 'format':eFormatVectorOfUInt8 },
-{ 'name':'xmm3'  , 'set':1, 'bitsize':128, 'encoding':eEncodingVector, 'format':eFormatVectorOfUInt8 },
-{ 'name':'xmm4'  , 'set':1, 'bitsize':128, 'encoding':eEncodingVector, 'format':eFormatVectorOfUInt8 },
-{ 'name':'xmm5'  , 'set':1, 'bitsize':128, 'encoding':eEncodingVector, 'format':eFormatVectorOfUInt8 },
-{ 'name':'xmm6'  , 'set':1, 'bitsize':128, 'encoding':eEncodingVector, 'format':eFormatVectorOfUInt8 },
-{ 'name':'xmm7'  , 'set':1, 'bitsize':128, 'encoding':eEncodingVector, 'format':eFormatVectorOfUInt8 },
-{ 'name':'xmm8'  , 'set':1, 'bitsize':128, 'encoding':eEncodingVector, 'format':eFormatVectorOfUInt8 },
-{ 'name':'xmm9'  , 'set':1, 'bitsize':128, 'encoding':eEncodingVector, 'format':eFormatVectorOfUInt8 },
-{ 'name':'xmm10' , 'set':1, 'bitsize':128, 'encoding':eEncodingVector, 'format':eFormatVectorOfUInt8 },
-{ 'name':'xmm11' , 'set':1, 'bitsize':128, 'encoding':eEncodingVector, 'format':eFormatVectorOfUInt8 },
-{ 'name':'xmm12' , 'set':1, 'bitsize':128, 'encoding':eEncodingVector, 'format':eFormatVectorOfUInt8 },
-{ 'name':'xmm13' , 'set':1, 'bitsize':128, 'encoding':eEncodingVector, 'format':eFormatVectorOfUInt8 },
-{ 'name':'xmm14' , 'set':1, 'bitsize':128, 'encoding':eEncodingVector, 'format':eFormatVectorOfUInt8 },
-{ 'name':'xmm15' , 'set':1, 'bitsize':128, 'encoding':eEncodingVector, 'format':eFormatVectorOfUInt8 },
-{ 'name':'mxcsr' , 'set':1, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex           },
-{ 'name':'orig_rax' , 'set':1, 'bitsize':64 , 'encoding':eEncodingUint  , 'format':eFormatHex           },
-# Registers that are contained in or composed of one of more other registers
-{ 'name':'eax'   , 'set':0, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rax[31:0]' },
-{ 'name':'ebx'   , 'set':0, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rbx[31:0]' },
-{ 'name':'ecx'   , 'set':0, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rcx[31:0]' },
-{ 'name':'edx'   , 'set':0, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rdx[31:0]' },
-{ 'name':'edi'   , 'set':0, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rdi[31:0]' },
-{ 'name':'esi'   , 'set':0, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rsi[31:0]' },
-{ 'name':'ebp'   , 'set':0, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rbp[31:0]' },
-{ 'name':'esp'   , 'set':0, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rsp[31:0]' },
-{ 'name':'r8d'   , 'set':0, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice':  'r8[31:0]' },
-{ 'name':'r9d'   , 'set':0, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice':  'r9[31:0]' },
-{ 'name':'r10d'  , 'set':0, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'r10[31:0]' },
-{ 'name':'r11d'  , 'set':0, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'r11[31:0]' },
-{ 'name':'r12d'  , 'set':0, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'r12[31:0]' },
-{ 'name':'r13d'  , 'set':0, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'r13[31:0]' },
-{ 'name':'r14d'  , 'set':0, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'r14[31:0]' },
-{ 'name':'r15d'  , 'set':0, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'r15[31:0]' },
-                                                                                                    
-{ 'name':'ax'    , 'set':0, 'bitsize':16 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rax[15:0]' },
-{ 'name':'bx'    , 'set':0, 'bitsize':16 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rbx[15:0]' },
-{ 'name':'cx'    , 'set':0, 'bitsize':16 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rcx[15:0]' },
-{ 'name':'dx'    , 'set':0, 'bitsize':16 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rdx[15:0]' },
-{ 'name':'di'    , 'set':0, 'bitsize':16 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rdi[15:0]' },
-{ 'name':'si'    , 'set':0, 'bitsize':16 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rsi[15:0]' },
-{ 'name':'bp'    , 'set':0, 'bitsize':16 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rbp[15:0]' },
-{ 'name':'sp'    , 'set':0, 'bitsize':16 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rsp[15:0]' },
-{ 'name':'r8w'   , 'set':0, 'bitsize':16 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice':  'r8[15:0]' },
-{ 'name':'r9w'   , 'set':0, 'bitsize':16 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice':  'r9[15:0]' },
-{ 'name':'r10w'  , 'set':0, 'bitsize':16 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'r10[15:0]' },
-{ 'name':'r11w'  , 'set':0, 'bitsize':16 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'r11[15:0]' },
-{ 'name':'r12w'  , 'set':0, 'bitsize':16 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'r12[15:0]' },
-{ 'name':'r13w'  , 'set':0, 'bitsize':16 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'r13[15:0]' },
-{ 'name':'r14w'  , 'set':0, 'bitsize':16 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'r14[15:0]' },
-{ 'name':'r15w'  , 'set':0, 'bitsize':16 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'r15[15:0]' },
-                                                                                                    
-{ 'name':'ah'    , 'set':0, 'bitsize':8  , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rax[15:8]' },
-{ 'name':'bh'    , 'set':0, 'bitsize':8  , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rbx[15:8]' },
-{ 'name':'ch'    , 'set':0, 'bitsize':8  , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rcx[15:8]' },
-{ 'name':'dh'    , 'set':0, 'bitsize':8  , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rdx[15:8]' },
-                                                                                                    
-{ 'name':'al'    , 'set':0, 'bitsize':8  , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rax[7:0]'  },
-{ 'name':'bl'    , 'set':0, 'bitsize':8  , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rbx[7:0]'  },
-{ 'name':'cl'    , 'set':0, 'bitsize':8  , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rcx[7:0]'  },
-{ 'name':'dl'    , 'set':0, 'bitsize':8  , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rdx[7:0]'  },
-{ 'name':'dil'   , 'set':0, 'bitsize':8  , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rdi[7:0]'  },
-{ 'name':'sil'   , 'set':0, 'bitsize':8  , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rsi[7:0]'  },
-{ 'name':'bpl'   , 'set':0, 'bitsize':8  , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rbp[7:0]'  },
-{ 'name':'spl'   , 'set':0, 'bitsize':8  , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rsp[7:0]'  },
-{ 'name':'r8l'   , 'set':0, 'bitsize':8  , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice':  'r8[7:0]'  },
-{ 'name':'r9l'   , 'set':0, 'bitsize':8  , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice':  'r9[7:0]'  },
-{ 'name':'r10l'  , 'set':0, 'bitsize':8  , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'r10[7:0]'  },
-{ 'name':'r11l'  , 'set':0, 'bitsize':8  , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'r11[7:0]'  },
-{ 'name':'r12l'  , 'set':0, 'bitsize':8  , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'r12[7:0]'  },
-{ 'name':'r13l'  , 'set':0, 'bitsize':8  , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'r13[7:0]'  },
-{ 'name':'r14l'  , 'set':0, 'bitsize':8  , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'r14[7:0]'  },
-{ 'name':'r15l'  , 'set':0, 'bitsize':8  , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'r15[7:0]'  },
-];
+    {'name': 'rax',
+     'set': 0,
+     'bitsize': 64,
+     'encoding': eEncodingUint,
+     'format': eFormatAddressInfo},
+    {'name': 'rbx',
+     'set': 0,
+     'bitsize': 64,
+     'encoding': eEncodingUint,
+     'format': eFormatAddressInfo},
+    {'name': 'rcx', 'set': 0, 'bitsize': 64, 'encoding': eEncodingUint,
+        'format': eFormatAddressInfo, 'alt-name': 'arg4'},
+    {'name': 'rdx', 'set': 0, 'bitsize': 64, 'encoding': eEncodingUint,
+        'format': eFormatAddressInfo, 'alt-name': 'arg3'},
+    {'name': 'rsi', 'set': 0, 'bitsize': 64, 'encoding': eEncodingUint,
+        'format': eFormatAddressInfo, 'alt-name': 'arg2'},
+    {'name': 'rdi', 'set': 0, 'bitsize': 64, 'encoding': eEncodingUint,
+        'format': eFormatAddressInfo, 'alt-name': 'arg1'},
+    {'name': 'rbp', 'set': 0, 'bitsize': 64, 'encoding': eEncodingUint,
+        'format': eFormatAddressInfo, 'alt-name': 'fp'},
+    {'name': 'rsp', 'set': 0, 'bitsize': 64, 'encoding': eEncodingUint,
+        'format': eFormatAddressInfo, 'alt-name': 'sp'},
+    {'name': 'r8', 'set': 0, 'bitsize': 64, 'encoding': eEncodingUint,
+        'format': eFormatAddressInfo, 'alt-name': 'arg5'},
+    {'name': 'r9', 'set': 0, 'bitsize': 64, 'encoding': eEncodingUint,
+        'format': eFormatAddressInfo, 'alt-name': 'arg6'},
+    {'name': 'r10',
+     'set': 0,
+     'bitsize': 64,
+     'encoding': eEncodingUint,
+     'format': eFormatAddressInfo},
+    {'name': 'r11',
+     'set': 0,
+     'bitsize': 64,
+     'encoding': eEncodingUint,
+     'format': eFormatAddressInfo},
+    {'name': 'r12',
+     'set': 0,
+     'bitsize': 64,
+     'encoding': eEncodingUint,
+     'format': eFormatAddressInfo},
+    {'name': 'r13',
+     'set': 0,
+     'bitsize': 64,
+     'encoding': eEncodingUint,
+     'format': eFormatAddressInfo},
+    {'name': 'r14',
+     'set': 0,
+     'bitsize': 64,
+     'encoding': eEncodingUint,
+     'format': eFormatAddressInfo},
+    {'name': 'r15',
+     'set': 0,
+     'bitsize': 64,
+     'encoding': eEncodingUint,
+     'format': eFormatAddressInfo},
+    {'name': 'rip', 'set': 0, 'bitsize': 64, 'encoding': eEncodingUint,
+        'format': eFormatAddressInfo, 'alt-name': 'pc'},
+    {'name': 'rflags', 'set': 0, 'bitsize': 32,
+        'encoding': eEncodingUint, 'format': eFormatHex},
+    {'name': 'cs', 'set': 0, 'bitsize': 32,
+        'encoding': eEncodingUint, 'format': eFormatHex},
+    {'name': 'ss', 'set': 0, 'bitsize': 32,
+        'encoding': eEncodingUint, 'format': eFormatHex},
+    {'name': 'ds', 'set': 0, 'bitsize': 32,
+        'encoding': eEncodingUint, 'format': eFormatHex},
+    {'name': 'es', 'set': 0, 'bitsize': 32,
+        'encoding': eEncodingUint, 'format': eFormatHex},
+    {'name': 'fs', 'set': 0, 'bitsize': 32,
+        'encoding': eEncodingUint, 'format': eFormatHex},
+    {'name': 'gs', 'set': 0, 'bitsize': 32,
+        'encoding': eEncodingUint, 'format': eFormatHex},
+    {'name': 'stmm0',
+     'set': 1,
+     'bitsize': 80,
+     'encoding': eEncodingVector,
+     'format': eFormatVectorOfUInt8},
+    {'name': 'stmm1',
+     'set': 1,
+     'bitsize': 80,
+     'encoding': eEncodingVector,
+     'format': eFormatVectorOfUInt8},
+    {'name': 'stmm2',
+     'set': 1,
+     'bitsize': 80,
+     'encoding': eEncodingVector,
+     'format': eFormatVectorOfUInt8},
+    {'name': 'stmm3',
+     'set': 1,
+     'bitsize': 80,
+     'encoding': eEncodingVector,
+     'format': eFormatVectorOfUInt8},
+    {'name': 'stmm4',
+     'set': 1,
+     'bitsize': 80,
+     'encoding': eEncodingVector,
+     'format': eFormatVectorOfUInt8},
+    {'name': 'stmm5',
+     'set': 1,
+     'bitsize': 80,
+     'encoding': eEncodingVector,
+     'format': eFormatVectorOfUInt8},
+    {'name': 'stmm6',
+     'set': 1,
+     'bitsize': 80,
+     'encoding': eEncodingVector,
+     'format': eFormatVectorOfUInt8},
+    {'name': 'stmm7',
+     'set': 1,
+     'bitsize': 80,
+     'encoding': eEncodingVector,
+     'format': eFormatVectorOfUInt8},
+    {'name': 'fctrl', 'set': 1, 'bitsize': 32,
+        'encoding': eEncodingUint, 'format': eFormatHex},
+    {'name': 'fstat', 'set': 1, 'bitsize': 32,
+        'encoding': eEncodingUint, 'format': eFormatHex},
+    {'name': 'ftag', 'set': 1, 'bitsize': 32,
+        'encoding': eEncodingUint, 'format': eFormatHex},
+    {'name': 'fiseg', 'set': 1, 'bitsize': 32,
+        'encoding': eEncodingUint, 'format': eFormatHex},
+    {'name': 'fioff', 'set': 1, 'bitsize': 32,
+        'encoding': eEncodingUint, 'format': eFormatHex},
+    {'name': 'foseg', 'set': 1, 'bitsize': 32,
+        'encoding': eEncodingUint, 'format': eFormatHex},
+    {'name': 'fooff', 'set': 1, 'bitsize': 32,
+        'encoding': eEncodingUint, 'format': eFormatHex},
+    {'name': 'fop', 'set': 1, 'bitsize': 32,
+        'encoding': eEncodingUint, 'format': eFormatHex},
+    {'name': 'xmm0',
+     'set': 1,
+     'bitsize': 128,
+     'encoding': eEncodingVector,
+     'format': eFormatVectorOfUInt8},
+    {'name': 'xmm1',
+     'set': 1,
+     'bitsize': 128,
+     'encoding': eEncodingVector,
+     'format': eFormatVectorOfUInt8},
+    {'name': 'xmm2',
+     'set': 1,
+     'bitsize': 128,
+     'encoding': eEncodingVector,
+     'format': eFormatVectorOfUInt8},
+    {'name': 'xmm3',
+     'set': 1,
+     'bitsize': 128,
+     'encoding': eEncodingVector,
+     'format': eFormatVectorOfUInt8},
+    {'name': 'xmm4',
+     'set': 1,
+     'bitsize': 128,
+     'encoding': eEncodingVector,
+     'format': eFormatVectorOfUInt8},
+    {'name': 'xmm5',
+     'set': 1,
+     'bitsize': 128,
+     'encoding': eEncodingVector,
+     'format': eFormatVectorOfUInt8},
+    {'name': 'xmm6',
+     'set': 1,
+     'bitsize': 128,
+     'encoding': eEncodingVector,
+     'format': eFormatVectorOfUInt8},
+    {'name': 'xmm7',
+     'set': 1,
+     'bitsize': 128,
+     'encoding': eEncodingVector,
+     'format': eFormatVectorOfUInt8},
+    {'name': 'xmm8',
+     'set': 1,
+     'bitsize': 128,
+     'encoding': eEncodingVector,
+     'format': eFormatVectorOfUInt8},
+    {'name': 'xmm9',
+     'set': 1,
+     'bitsize': 128,
+     'encoding': eEncodingVector,
+     'format': eFormatVectorOfUInt8},
+    {'name': 'xmm10',
+     'set': 1,
+     'bitsize': 128,
+     'encoding': eEncodingVector,
+     'format': eFormatVectorOfUInt8},
+    {'name': 'xmm11',
+     'set': 1,
+     'bitsize': 128,
+     'encoding': eEncodingVector,
+     'format': eFormatVectorOfUInt8},
+    {'name': 'xmm12',
+     'set': 1,
+     'bitsize': 128,
+     'encoding': eEncodingVector,
+     'format': eFormatVectorOfUInt8},
+    {'name': 'xmm13',
+     'set': 1,
+     'bitsize': 128,
+     'encoding': eEncodingVector,
+     'format': eFormatVectorOfUInt8},
+    {'name': 'xmm14',
+     'set': 1,
+     'bitsize': 128,
+     'encoding': eEncodingVector,
+     'format': eFormatVectorOfUInt8},
+    {'name': 'xmm15',
+     'set': 1,
+     'bitsize': 128,
+     'encoding': eEncodingVector,
+     'format': eFormatVectorOfUInt8},
+    {'name': 'mxcsr', 'set': 1, 'bitsize': 32,
+        'encoding': eEncodingUint, 'format': eFormatHex},
+    {'name': 'orig_rax', 'set': 1, 'bitsize': 64,
+        'encoding': eEncodingUint, 'format': eFormatHex},
+    # Registers that are contained in or composed of one of more other
+    # registers
+    {'name': 'eax',
+     'set': 0,
+     'bitsize': 32,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rax[31:0]'},
+    {'name': 'ebx',
+     'set': 0,
+     'bitsize': 32,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rbx[31:0]'},
+    {'name': 'ecx',
+     'set': 0,
+     'bitsize': 32,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rcx[31:0]'},
+    {'name': 'edx',
+     'set': 0,
+     'bitsize': 32,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rdx[31:0]'},
+    {'name': 'edi',
+     'set': 0,
+     'bitsize': 32,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rdi[31:0]'},
+    {'name': 'esi',
+     'set': 0,
+     'bitsize': 32,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rsi[31:0]'},
+    {'name': 'ebp',
+     'set': 0,
+     'bitsize': 32,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rbp[31:0]'},
+    {'name': 'esp',
+     'set': 0,
+     'bitsize': 32,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rsp[31:0]'},
+    {'name': 'r8d',
+     'set': 0,
+     'bitsize': 32,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'r8[31:0]'},
+    {'name': 'r9d',
+     'set': 0,
+     'bitsize': 32,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'r9[31:0]'},
+    {'name': 'r10d',
+     'set': 0,
+     'bitsize': 32,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'r10[31:0]'},
+    {'name': 'r11d',
+     'set': 0,
+     'bitsize': 32,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'r11[31:0]'},
+    {'name': 'r12d',
+     'set': 0,
+     'bitsize': 32,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'r12[31:0]'},
+    {'name': 'r13d',
+     'set': 0,
+     'bitsize': 32,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'r13[31:0]'},
+    {'name': 'r14d',
+     'set': 0,
+     'bitsize': 32,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'r14[31:0]'},
+    {'name': 'r15d',
+     'set': 0,
+     'bitsize': 32,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'r15[31:0]'},
+
+    {'name': 'ax',
+     'set': 0,
+     'bitsize': 16,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rax[15:0]'},
+    {'name': 'bx',
+     'set': 0,
+     'bitsize': 16,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rbx[15:0]'},
+    {'name': 'cx',
+     'set': 0,
+     'bitsize': 16,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rcx[15:0]'},
+    {'name': 'dx',
+     'set': 0,
+     'bitsize': 16,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rdx[15:0]'},
+    {'name': 'di',
+     'set': 0,
+     'bitsize': 16,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rdi[15:0]'},
+    {'name': 'si',
+     'set': 0,
+     'bitsize': 16,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rsi[15:0]'},
+    {'name': 'bp',
+     'set': 0,
+     'bitsize': 16,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rbp[15:0]'},
+    {'name': 'sp',
+     'set': 0,
+     'bitsize': 16,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rsp[15:0]'},
+    {'name': 'r8w',
+     'set': 0,
+     'bitsize': 16,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'r8[15:0]'},
+    {'name': 'r9w',
+     'set': 0,
+     'bitsize': 16,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'r9[15:0]'},
+    {'name': 'r10w',
+     'set': 0,
+     'bitsize': 16,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'r10[15:0]'},
+    {'name': 'r11w',
+     'set': 0,
+     'bitsize': 16,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'r11[15:0]'},
+    {'name': 'r12w',
+     'set': 0,
+     'bitsize': 16,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'r12[15:0]'},
+    {'name': 'r13w',
+     'set': 0,
+     'bitsize': 16,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'r13[15:0]'},
+    {'name': 'r14w',
+     'set': 0,
+     'bitsize': 16,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'r14[15:0]'},
+    {'name': 'r15w',
+     'set': 0,
+     'bitsize': 16,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'r15[15:0]'},
+
+    {'name': 'ah',
+     'set': 0,
+     'bitsize': 8,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rax[15:8]'},
+    {'name': 'bh',
+     'set': 0,
+     'bitsize': 8,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rbx[15:8]'},
+    {'name': 'ch',
+     'set': 0,
+     'bitsize': 8,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rcx[15:8]'},
+    {'name': 'dh',
+     'set': 0,
+     'bitsize': 8,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rdx[15:8]'},
+
+    {'name': 'al',
+     'set': 0,
+     'bitsize': 8,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rax[7:0]'},
+    {'name': 'bl',
+     'set': 0,
+     'bitsize': 8,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rbx[7:0]'},
+    {'name': 'cl',
+     'set': 0,
+     'bitsize': 8,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rcx[7:0]'},
+    {'name': 'dl',
+     'set': 0,
+     'bitsize': 8,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rdx[7:0]'},
+    {'name': 'dil',
+     'set': 0,
+     'bitsize': 8,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rdi[7:0]'},
+    {'name': 'sil',
+     'set': 0,
+     'bitsize': 8,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rsi[7:0]'},
+    {'name': 'bpl',
+     'set': 0,
+     'bitsize': 8,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rbp[7:0]'},
+    {'name': 'spl',
+     'set': 0,
+     'bitsize': 8,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rsp[7:0]'},
+    {'name': 'r8l',
+     'set': 0,
+     'bitsize': 8,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'r8[7:0]'},
+    {'name': 'r9l',
+     'set': 0,
+     'bitsize': 8,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'r9[7:0]'},
+    {'name': 'r10l',
+     'set': 0,
+     'bitsize': 8,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'r10[7:0]'},
+    {'name': 'r11l',
+     'set': 0,
+     'bitsize': 8,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'r11[7:0]'},
+    {'name': 'r12l',
+     'set': 0,
+     'bitsize': 8,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'r12[7:0]'},
+    {'name': 'r13l',
+     'set': 0,
+     'bitsize': 8,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'r13[7:0]'},
+    {'name': 'r14l',
+     'set': 0,
+     'bitsize': 8,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'r14[7:0]'},
+    {'name': 'r15l',
+     'set': 0,
+     'bitsize': 8,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'r15[7:0]'},
+]
 
 g_target_definition = None
 
-def get_target_definition ():
+
+def get_target_definition():
     global g_target_definition
-    if g_target_definition == None:
+    if g_target_definition is None:
         g_target_definition = {}
         offset = 0
         for reg_info in x86_64_register_infos:
             reg_name = reg_info['name']
-            
-            # Only fill in the offset if there is no 'slice' in the register info
+
+            # Only fill in the offset if there is no 'slice' in the register
+            # info
             if 'slice' not in reg_info and 'composite' not in reg_info:
                 reg_info['offset'] = offset
-                offset += reg_info['bitsize']/8
-            
-            # Set the GCC/DWARF register number for this register if it has one    
+                offset += reg_info['bitsize'] / 8
+
+            # Set the GCC/DWARF register number for this register if it has one
             reg_num = get_reg_num(name_to_gcc_dwarf_regnum, reg_name)
             if reg_num != LLDB_INVALID_REGNUM:
                 reg_info['gcc'] = reg_num
                 reg_info['dwarf'] = reg_num
-            
-            # Set the generic register number for this register if it has one    
+
+            # Set the generic register number for this register if it has one
             reg_num = get_reg_num(name_to_generic_regnum, reg_name)
             if reg_num != LLDB_INVALID_REGNUM:
                 reg_info['generic'] = reg_num
 
-            # Set the GDB register number for this register if it has one    
+            # Set the GDB register number for this register if it has one
             reg_num = get_reg_num(name_to_gdb_regnum, reg_name)
             if reg_num != LLDB_INVALID_REGNUM:
                 reg_info['gdb'] = reg_num
 
-        g_target_definition['sets'] = ['General Purpose Registers', 'Floating Point Registers']
+        g_target_definition['sets'] = [
+            'General Purpose Registers',
+            'Floating Point Registers']
         g_target_definition['registers'] = x86_64_register_infos
-        g_target_definition['host-info'] = { 'triple'   : 'x86_64-*-linux', 'endian': eByteOrderLittle }
+        g_target_definition[
+            'host-info'] = {'triple': 'x86_64-*-linux', 'endian': eByteOrderLittle}
         g_target_definition['g-packet-size'] = offset
         g_target_definition['breakpoint-pc-offset'] = -1
     return g_target_definition
 
+
 def get_dynamic_setting(target, setting_name):
     if setting_name == 'gdb-server-target-definition':
-        return get_target_definition()
\ No newline at end of file
+        return get_target_definition()

Modified: lldb/trunk/examples/python/x86_64_qemu_target_definition.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/x86_64_qemu_target_definition.py?rev=280751&r1=280750&r2=280751&view=diff
==============================================================================
--- lldb/trunk/examples/python/x86_64_qemu_target_definition.py (original)
+++ lldb/trunk/examples/python/x86_64_qemu_target_definition.py Tue Sep  6 15:57:50 2016
@@ -13,13 +13,13 @@
 #
 # This file can be used with the following setting:
 #   plugin.process.gdb-remote.target-definition-file
-# This setting should be used when you are trying to connect to a 
+# This setting should be used when you are trying to connect to a
 # remote GDB server that doesn't support any of the register discovery
-# packets that LLDB normally uses. 
+# packets that LLDB normally uses.
 #
 # Why is this necessary? LLDB doesn't require a new build of LLDB that
 # targets each new architecture you will debug with. Instead, all
-# architectures are supported and LLDB relies on extra GDB server 
+# architectures are supported and LLDB relies on extra GDB server
 # packets to discover the target we are connecting to so that is can
 # show the right registers for each target. This allows the remote stub
 # to change and add new registers without requiring a new LLDB build
@@ -27,13 +27,13 @@
 #
 # This file implements the x86_64 registers for the user mode qemu on linux.
 # The only difference with the Linux file is the absense of orig_rax register.
-# 
+#
 # USAGE
 #
 # (lldb) settings set plugin.process.gdb-remote.target-definition-file /path/to/x86_64_qemu_target_definition.py
 # (lldb) gdb-remote other.baz.com:1234
 #
-# The target definition file will get used if and only if the 
+# The target definition file will get used if and only if the
 # qRegisterInfo packets are not supported when connecting to a remote
 # GDB stub.
 #----------------------------------------------------------------------
@@ -41,312 +41,733 @@ from lldb import *
 
 # Compiler and DWARF register numbers
 name_to_gcc_dwarf_regnum = {
-    'rax'   : 0 ,     
-    'rdx'   : 1 ,
-    'rcx'   : 2 ,
-    'rbx'   : 3 ,
-    'rsi'   : 4 ,
-    'rdi'   : 5 ,
-    'rbp'   : 6 ,
-    'rsp'   : 7 ,
-    'r8'    : 8 ,
-    'r9'    : 9 ,
-    'r10'   : 10,
-    'r11'   : 11,
-    'r12'   : 12,
-    'r13'   : 13,
-    'r14'   : 14,
-    'r15'   : 15,
-    'rip'   : 16,
-    'xmm0'  : 17,
-    'xmm1'  : 18,
-    'xmm2'  : 19,
-    'xmm3'  : 20,
-    'xmm4'  : 21,
-    'xmm5'  : 22,
-    'xmm6'  : 23,
-    'xmm7'  : 24,
-    'xmm8'  : 25,
-    'xmm9'  : 26,
-    'xmm10' : 27,
-    'xmm11' : 28,
-    'xmm12' : 29,
-    'xmm13' : 30,
-    'xmm14' : 31,
-    'xmm15' : 32,
-    'stmm0' : 33,
-    'stmm1' : 34,
-    'stmm2' : 35,
-    'stmm3' : 36,
-    'stmm4' : 37,
-    'stmm5' : 38,
-    'stmm6' : 39,
-    'stmm7' : 30,
-    'ymm0'  : 41,
-    'ymm1'  : 42,
-    'ymm2'  : 43,
-    'ymm3'  : 44,
-    'ymm4'  : 45,
-    'ymm5'  : 46,
-    'ymm6'  : 47,
-    'ymm7'  : 48,
-    'ymm8'  : 49,
-    'ymm9'  : 40,
-    'ymm10' : 41,
-    'ymm11' : 42,
-    'ymm12' : 43,
-    'ymm13' : 44,
-    'ymm14' : 45,
-    'ymm15' : 46
-};
+    'rax': 0,
+    'rdx': 1,
+    'rcx': 2,
+    'rbx': 3,
+    'rsi': 4,
+    'rdi': 5,
+    'rbp': 6,
+    'rsp': 7,
+    'r8': 8,
+    'r9': 9,
+    'r10': 10,
+    'r11': 11,
+    'r12': 12,
+    'r13': 13,
+    'r14': 14,
+    'r15': 15,
+    'rip': 16,
+    'xmm0': 17,
+    'xmm1': 18,
+    'xmm2': 19,
+    'xmm3': 20,
+    'xmm4': 21,
+    'xmm5': 22,
+    'xmm6': 23,
+    'xmm7': 24,
+    'xmm8': 25,
+    'xmm9': 26,
+    'xmm10': 27,
+    'xmm11': 28,
+    'xmm12': 29,
+    'xmm13': 30,
+    'xmm14': 31,
+    'xmm15': 32,
+    'stmm0': 33,
+    'stmm1': 34,
+    'stmm2': 35,
+    'stmm3': 36,
+    'stmm4': 37,
+    'stmm5': 38,
+    'stmm6': 39,
+    'stmm7': 30,
+    'ymm0': 41,
+    'ymm1': 42,
+    'ymm2': 43,
+    'ymm3': 44,
+    'ymm4': 45,
+    'ymm5': 46,
+    'ymm6': 47,
+    'ymm7': 48,
+    'ymm8': 49,
+    'ymm9': 40,
+    'ymm10': 41,
+    'ymm11': 42,
+    'ymm12': 43,
+    'ymm13': 44,
+    'ymm14': 45,
+    'ymm15': 46
+}
 
 name_to_gdb_regnum = {
-    'rax'   :   0,
-    'rbx'   :   1,
-    'rcx'   :   2,
-    'rdx'   :   3,
-    'rsi'   :   4,
-    'rdi'   :   5,
-    'rbp'   :   6,
-    'rsp'   :   7,
-    'r8'    :   8,
-    'r9'    :   9,
-    'r10'   :  10,
-    'r11'   :  11,
-    'r12'   :  12,
-    'r13'   :  13,
-    'r14'   :  14,
-    'r15'   :  15,
-    'rip'   :  16,
-    'rflags':  17,
-    'cs'    :  18,
-    'ss'    :  19,
-    'ds'    :  20,
-    'es'    :  21,
-    'fs'    :  22,
-    'gs'    :  23,
-    'stmm0' :  24,
-    'stmm1' :  25,
-    'stmm2' :  26,
-    'stmm3' :  27,
-    'stmm4' :  28,
-    'stmm5' :  29,
-    'stmm6' :  30,
-    'stmm7' :  31,
-    'fctrl' :  32,
-    'fstat' :  33,
-    'ftag'  :  34,
-    'fiseg' :  35,
-    'fioff' :  36,
-    'foseg' :  37,
-    'fooff' :  38,
-    'fop'   :  39,
-    'xmm0'  :  40,
-    'xmm1'  :  41,
-    'xmm2'  :  42,
-    'xmm3'  :  43,
-    'xmm4'  :  44,
-    'xmm5'  :  45,
-    'xmm6'  :  46,
-    'xmm7'  :  47,
-    'xmm8'  :  48,
-    'xmm9'  :  49,
-    'xmm10' :  50,
-    'xmm11' :  51,
-    'xmm12' :  52,
-    'xmm13' :  53,
-    'xmm14' :  54,
-    'xmm15' :  55,
-    'mxcsr' :  56,
-    'ymm0'  :  57,
-    'ymm1'  :  58,
-    'ymm2'  :  59,
-    'ymm3'  :  60,
-    'ymm4'  :  61,
-    'ymm5'  :  62,
-    'ymm6'  :  63,
-    'ymm7'  :  64,
-    'ymm8'  :  65,
-    'ymm9'  :  66,
-    'ymm10' :  67,
-    'ymm11' :  68,
-    'ymm12' :  69,
-    'ymm13' :  70,
-    'ymm14' :  71,
-    'ymm15' :  72
-};
+    'rax': 0,
+    'rbx': 1,
+    'rcx': 2,
+    'rdx': 3,
+    'rsi': 4,
+    'rdi': 5,
+    'rbp': 6,
+    'rsp': 7,
+    'r8': 8,
+    'r9': 9,
+    'r10': 10,
+    'r11': 11,
+    'r12': 12,
+    'r13': 13,
+    'r14': 14,
+    'r15': 15,
+    'rip': 16,
+    'rflags': 17,
+    'cs': 18,
+    'ss': 19,
+    'ds': 20,
+    'es': 21,
+    'fs': 22,
+    'gs': 23,
+    'stmm0': 24,
+    'stmm1': 25,
+    'stmm2': 26,
+    'stmm3': 27,
+    'stmm4': 28,
+    'stmm5': 29,
+    'stmm6': 30,
+    'stmm7': 31,
+    'fctrl': 32,
+    'fstat': 33,
+    'ftag': 34,
+    'fiseg': 35,
+    'fioff': 36,
+    'foseg': 37,
+    'fooff': 38,
+    'fop': 39,
+    'xmm0': 40,
+    'xmm1': 41,
+    'xmm2': 42,
+    'xmm3': 43,
+    'xmm4': 44,
+    'xmm5': 45,
+    'xmm6': 46,
+    'xmm7': 47,
+    'xmm8': 48,
+    'xmm9': 49,
+    'xmm10': 50,
+    'xmm11': 51,
+    'xmm12': 52,
+    'xmm13': 53,
+    'xmm14': 54,
+    'xmm15': 55,
+    'mxcsr': 56,
+    'ymm0': 57,
+    'ymm1': 58,
+    'ymm2': 59,
+    'ymm3': 60,
+    'ymm4': 61,
+    'ymm5': 62,
+    'ymm6': 63,
+    'ymm7': 64,
+    'ymm8': 65,
+    'ymm9': 66,
+    'ymm10': 67,
+    'ymm11': 68,
+    'ymm12': 69,
+    'ymm13': 70,
+    'ymm14': 71,
+    'ymm15': 72
+}
 
 name_to_generic_regnum = {
-    'rip' : LLDB_REGNUM_GENERIC_PC,
-    'rsp' : LLDB_REGNUM_GENERIC_SP,
-    'rbp' : LLDB_REGNUM_GENERIC_FP,
-    'rdi' : LLDB_REGNUM_GENERIC_ARG1,
-    'rsi' : LLDB_REGNUM_GENERIC_ARG2,
-    'rdx' : LLDB_REGNUM_GENERIC_ARG3,
-    'rcx' : LLDB_REGNUM_GENERIC_ARG4,
-    'r8'  : LLDB_REGNUM_GENERIC_ARG5,
-    'r9'  : LLDB_REGNUM_GENERIC_ARG6
-};
+    'rip': LLDB_REGNUM_GENERIC_PC,
+    'rsp': LLDB_REGNUM_GENERIC_SP,
+    'rbp': LLDB_REGNUM_GENERIC_FP,
+    'rdi': LLDB_REGNUM_GENERIC_ARG1,
+    'rsi': LLDB_REGNUM_GENERIC_ARG2,
+    'rdx': LLDB_REGNUM_GENERIC_ARG3,
+    'rcx': LLDB_REGNUM_GENERIC_ARG4,
+    'r8': LLDB_REGNUM_GENERIC_ARG5,
+    'r9': LLDB_REGNUM_GENERIC_ARG6
+}
+
 
-def get_reg_num (reg_num_dict, reg_name):
+def get_reg_num(reg_num_dict, reg_name):
     if reg_name in reg_num_dict:
         return reg_num_dict[reg_name]
     return LLDB_INVALID_REGNUM
-    
+
 x86_64_register_infos = [
-{ 'name':'rax'   , 'set':0, 'bitsize':64 , 'encoding':eEncodingUint  , 'format':eFormatAddressInfo   },
-{ 'name':'rbx'   , 'set':0, 'bitsize':64 , 'encoding':eEncodingUint  , 'format':eFormatAddressInfo   },
-{ 'name':'rcx'   , 'set':0, 'bitsize':64 , 'encoding':eEncodingUint  , 'format':eFormatAddressInfo, 'alt-name':'arg4' },
-{ 'name':'rdx'   , 'set':0, 'bitsize':64 , 'encoding':eEncodingUint  , 'format':eFormatAddressInfo, 'alt-name':'arg3' },
-{ 'name':'rsi'   , 'set':0, 'bitsize':64 , 'encoding':eEncodingUint  , 'format':eFormatAddressInfo, 'alt-name':'arg2' },
-{ 'name':'rdi'   , 'set':0, 'bitsize':64 , 'encoding':eEncodingUint  , 'format':eFormatAddressInfo, 'alt-name':'arg1' },
-{ 'name':'rbp'   , 'set':0, 'bitsize':64 , 'encoding':eEncodingUint  , 'format':eFormatAddressInfo, 'alt-name':'fp' },
-{ 'name':'rsp'   , 'set':0, 'bitsize':64 , 'encoding':eEncodingUint  , 'format':eFormatAddressInfo, 'alt-name':'sp' },
-{ 'name':'r8'    , 'set':0, 'bitsize':64 , 'encoding':eEncodingUint  , 'format':eFormatAddressInfo, 'alt-name':'arg5' },
-{ 'name':'r9'    , 'set':0, 'bitsize':64 , 'encoding':eEncodingUint  , 'format':eFormatAddressInfo, 'alt-name':'arg6' },
-{ 'name':'r10'   , 'set':0, 'bitsize':64 , 'encoding':eEncodingUint  , 'format':eFormatAddressInfo   },
-{ 'name':'r11'   , 'set':0, 'bitsize':64 , 'encoding':eEncodingUint  , 'format':eFormatAddressInfo   },
-{ 'name':'r12'   , 'set':0, 'bitsize':64 , 'encoding':eEncodingUint  , 'format':eFormatAddressInfo   },
-{ 'name':'r13'   , 'set':0, 'bitsize':64 , 'encoding':eEncodingUint  , 'format':eFormatAddressInfo   },
-{ 'name':'r14'   , 'set':0, 'bitsize':64 , 'encoding':eEncodingUint  , 'format':eFormatAddressInfo   },
-{ 'name':'r15'   , 'set':0, 'bitsize':64 , 'encoding':eEncodingUint  , 'format':eFormatAddressInfo   },
-{ 'name':'rip'   , 'set':0, 'bitsize':64 , 'encoding':eEncodingUint  , 'format':eFormatAddressInfo, 'alt-name':'pc' },
-{ 'name':'rflags', 'set':0, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex           },
-{ 'name':'cs'    , 'set':0, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex           },
-{ 'name':'ss'    , 'set':0, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex           },
-{ 'name':'ds'    , 'set':0, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex           },
-{ 'name':'es'    , 'set':0, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex           },
-{ 'name':'fs'    , 'set':0, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex           },
-{ 'name':'gs'    , 'set':0, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex           },
-{ 'name':'stmm0' , 'set':1, 'bitsize':80 , 'encoding':eEncodingVector, 'format':eFormatVectorOfUInt8 },
-{ 'name':'stmm1' , 'set':1, 'bitsize':80 , 'encoding':eEncodingVector, 'format':eFormatVectorOfUInt8 },
-{ 'name':'stmm2' , 'set':1, 'bitsize':80 , 'encoding':eEncodingVector, 'format':eFormatVectorOfUInt8 },
-{ 'name':'stmm3' , 'set':1, 'bitsize':80 , 'encoding':eEncodingVector, 'format':eFormatVectorOfUInt8 },
-{ 'name':'stmm4' , 'set':1, 'bitsize':80 , 'encoding':eEncodingVector, 'format':eFormatVectorOfUInt8 },
-{ 'name':'stmm5' , 'set':1, 'bitsize':80 , 'encoding':eEncodingVector, 'format':eFormatVectorOfUInt8 },
-{ 'name':'stmm6' , 'set':1, 'bitsize':80 , 'encoding':eEncodingVector, 'format':eFormatVectorOfUInt8 },
-{ 'name':'stmm7' , 'set':1, 'bitsize':80 , 'encoding':eEncodingVector, 'format':eFormatVectorOfUInt8 },
-{ 'name':'fctrl' , 'set':1, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex           },
-{ 'name':'fstat' , 'set':1, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex           },
-{ 'name':'ftag'  , 'set':1, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex           },
-{ 'name':'fiseg' , 'set':1, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex           },
-{ 'name':'fioff' , 'set':1, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex           },
-{ 'name':'foseg' , 'set':1, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex           },
-{ 'name':'fooff' , 'set':1, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex           },
-{ 'name':'fop'   , 'set':1, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex           },
-{ 'name':'xmm0'  , 'set':1, 'bitsize':128, 'encoding':eEncodingVector, 'format':eFormatVectorOfUInt8 },
-{ 'name':'xmm1'  , 'set':1, 'bitsize':128, 'encoding':eEncodingVector, 'format':eFormatVectorOfUInt8 },
-{ 'name':'xmm2'  , 'set':1, 'bitsize':128, 'encoding':eEncodingVector, 'format':eFormatVectorOfUInt8 },
-{ 'name':'xmm3'  , 'set':1, 'bitsize':128, 'encoding':eEncodingVector, 'format':eFormatVectorOfUInt8 },
-{ 'name':'xmm4'  , 'set':1, 'bitsize':128, 'encoding':eEncodingVector, 'format':eFormatVectorOfUInt8 },
-{ 'name':'xmm5'  , 'set':1, 'bitsize':128, 'encoding':eEncodingVector, 'format':eFormatVectorOfUInt8 },
-{ 'name':'xmm6'  , 'set':1, 'bitsize':128, 'encoding':eEncodingVector, 'format':eFormatVectorOfUInt8 },
-{ 'name':'xmm7'  , 'set':1, 'bitsize':128, 'encoding':eEncodingVector, 'format':eFormatVectorOfUInt8 },
-{ 'name':'xmm8'  , 'set':1, 'bitsize':128, 'encoding':eEncodingVector, 'format':eFormatVectorOfUInt8 },
-{ 'name':'xmm9'  , 'set':1, 'bitsize':128, 'encoding':eEncodingVector, 'format':eFormatVectorOfUInt8 },
-{ 'name':'xmm10' , 'set':1, 'bitsize':128, 'encoding':eEncodingVector, 'format':eFormatVectorOfUInt8 },
-{ 'name':'xmm11' , 'set':1, 'bitsize':128, 'encoding':eEncodingVector, 'format':eFormatVectorOfUInt8 },
-{ 'name':'xmm12' , 'set':1, 'bitsize':128, 'encoding':eEncodingVector, 'format':eFormatVectorOfUInt8 },
-{ 'name':'xmm13' , 'set':1, 'bitsize':128, 'encoding':eEncodingVector, 'format':eFormatVectorOfUInt8 },
-{ 'name':'xmm14' , 'set':1, 'bitsize':128, 'encoding':eEncodingVector, 'format':eFormatVectorOfUInt8 },
-{ 'name':'xmm15' , 'set':1, 'bitsize':128, 'encoding':eEncodingVector, 'format':eFormatVectorOfUInt8 },
-{ 'name':'mxcsr' , 'set':1, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex           },
-# Registers that are contained in or composed of one of more other registers
-{ 'name':'eax'   , 'set':0, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rax[31:0]' },
-{ 'name':'ebx'   , 'set':0, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rbx[31:0]' },
-{ 'name':'ecx'   , 'set':0, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rcx[31:0]' },
-{ 'name':'edx'   , 'set':0, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rdx[31:0]' },
-{ 'name':'edi'   , 'set':0, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rdi[31:0]' },
-{ 'name':'esi'   , 'set':0, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rsi[31:0]' },
-{ 'name':'ebp'   , 'set':0, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rbp[31:0]' },
-{ 'name':'esp'   , 'set':0, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rsp[31:0]' },
-{ 'name':'r8d'   , 'set':0, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice':  'r8[31:0]' },
-{ 'name':'r9d'   , 'set':0, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice':  'r9[31:0]' },
-{ 'name':'r10d'  , 'set':0, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'r10[31:0]' },
-{ 'name':'r11d'  , 'set':0, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'r11[31:0]' },
-{ 'name':'r12d'  , 'set':0, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'r12[31:0]' },
-{ 'name':'r13d'  , 'set':0, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'r13[31:0]' },
-{ 'name':'r14d'  , 'set':0, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'r14[31:0]' },
-{ 'name':'r15d'  , 'set':0, 'bitsize':32 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'r15[31:0]' },
-                                                                                                    
-{ 'name':'ax'    , 'set':0, 'bitsize':16 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rax[15:0]' },
-{ 'name':'bx'    , 'set':0, 'bitsize':16 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rbx[15:0]' },
-{ 'name':'cx'    , 'set':0, 'bitsize':16 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rcx[15:0]' },
-{ 'name':'dx'    , 'set':0, 'bitsize':16 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rdx[15:0]' },
-{ 'name':'di'    , 'set':0, 'bitsize':16 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rdi[15:0]' },
-{ 'name':'si'    , 'set':0, 'bitsize':16 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rsi[15:0]' },
-{ 'name':'bp'    , 'set':0, 'bitsize':16 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rbp[15:0]' },
-{ 'name':'sp'    , 'set':0, 'bitsize':16 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rsp[15:0]' },
-{ 'name':'r8w'   , 'set':0, 'bitsize':16 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice':  'r8[15:0]' },
-{ 'name':'r9w'   , 'set':0, 'bitsize':16 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice':  'r9[15:0]' },
-{ 'name':'r10w'  , 'set':0, 'bitsize':16 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'r10[15:0]' },
-{ 'name':'r11w'  , 'set':0, 'bitsize':16 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'r11[15:0]' },
-{ 'name':'r12w'  , 'set':0, 'bitsize':16 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'r12[15:0]' },
-{ 'name':'r13w'  , 'set':0, 'bitsize':16 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'r13[15:0]' },
-{ 'name':'r14w'  , 'set':0, 'bitsize':16 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'r14[15:0]' },
-{ 'name':'r15w'  , 'set':0, 'bitsize':16 , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'r15[15:0]' },
-                                                                                                    
-{ 'name':'ah'    , 'set':0, 'bitsize':8  , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rax[15:8]' },
-{ 'name':'bh'    , 'set':0, 'bitsize':8  , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rbx[15:8]' },
-{ 'name':'ch'    , 'set':0, 'bitsize':8  , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rcx[15:8]' },
-{ 'name':'dh'    , 'set':0, 'bitsize':8  , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rdx[15:8]' },
-                                                                                                    
-{ 'name':'al'    , 'set':0, 'bitsize':8  , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rax[7:0]'  },
-{ 'name':'bl'    , 'set':0, 'bitsize':8  , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rbx[7:0]'  },
-{ 'name':'cl'    , 'set':0, 'bitsize':8  , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rcx[7:0]'  },
-{ 'name':'dl'    , 'set':0, 'bitsize':8  , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rdx[7:0]'  },
-{ 'name':'dil'   , 'set':0, 'bitsize':8  , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rdi[7:0]'  },
-{ 'name':'sil'   , 'set':0, 'bitsize':8  , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rsi[7:0]'  },
-{ 'name':'bpl'   , 'set':0, 'bitsize':8  , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rbp[7:0]'  },
-{ 'name':'spl'   , 'set':0, 'bitsize':8  , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'rsp[7:0]'  },
-{ 'name':'r8l'   , 'set':0, 'bitsize':8  , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice':  'r8[7:0]'  },
-{ 'name':'r9l'   , 'set':0, 'bitsize':8  , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice':  'r9[7:0]'  },
-{ 'name':'r10l'  , 'set':0, 'bitsize':8  , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'r10[7:0]'  },
-{ 'name':'r11l'  , 'set':0, 'bitsize':8  , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'r11[7:0]'  },
-{ 'name':'r12l'  , 'set':0, 'bitsize':8  , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'r12[7:0]'  },
-{ 'name':'r13l'  , 'set':0, 'bitsize':8  , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'r13[7:0]'  },
-{ 'name':'r14l'  , 'set':0, 'bitsize':8  , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'r14[7:0]'  },
-{ 'name':'r15l'  , 'set':0, 'bitsize':8  , 'encoding':eEncodingUint  , 'format':eFormatHex          , 'slice': 'r15[7:0]'  },
-];
+    {'name': 'rax',
+     'set': 0,
+     'bitsize': 64,
+     'encoding': eEncodingUint,
+     'format': eFormatAddressInfo},
+    {'name': 'rbx',
+     'set': 0,
+     'bitsize': 64,
+     'encoding': eEncodingUint,
+     'format': eFormatAddressInfo},
+    {'name': 'rcx', 'set': 0, 'bitsize': 64, 'encoding': eEncodingUint,
+        'format': eFormatAddressInfo, 'alt-name': 'arg4'},
+    {'name': 'rdx', 'set': 0, 'bitsize': 64, 'encoding': eEncodingUint,
+        'format': eFormatAddressInfo, 'alt-name': 'arg3'},
+    {'name': 'rsi', 'set': 0, 'bitsize': 64, 'encoding': eEncodingUint,
+        'format': eFormatAddressInfo, 'alt-name': 'arg2'},
+    {'name': 'rdi', 'set': 0, 'bitsize': 64, 'encoding': eEncodingUint,
+        'format': eFormatAddressInfo, 'alt-name': 'arg1'},
+    {'name': 'rbp', 'set': 0, 'bitsize': 64, 'encoding': eEncodingUint,
+        'format': eFormatAddressInfo, 'alt-name': 'fp'},
+    {'name': 'rsp', 'set': 0, 'bitsize': 64, 'encoding': eEncodingUint,
+        'format': eFormatAddressInfo, 'alt-name': 'sp'},
+    {'name': 'r8', 'set': 0, 'bitsize': 64, 'encoding': eEncodingUint,
+        'format': eFormatAddressInfo, 'alt-name': 'arg5'},
+    {'name': 'r9', 'set': 0, 'bitsize': 64, 'encoding': eEncodingUint,
+        'format': eFormatAddressInfo, 'alt-name': 'arg6'},
+    {'name': 'r10',
+     'set': 0,
+     'bitsize': 64,
+     'encoding': eEncodingUint,
+     'format': eFormatAddressInfo},
+    {'name': 'r11',
+     'set': 0,
+     'bitsize': 64,
+     'encoding': eEncodingUint,
+     'format': eFormatAddressInfo},
+    {'name': 'r12',
+     'set': 0,
+     'bitsize': 64,
+     'encoding': eEncodingUint,
+     'format': eFormatAddressInfo},
+    {'name': 'r13',
+     'set': 0,
+     'bitsize': 64,
+     'encoding': eEncodingUint,
+     'format': eFormatAddressInfo},
+    {'name': 'r14',
+     'set': 0,
+     'bitsize': 64,
+     'encoding': eEncodingUint,
+     'format': eFormatAddressInfo},
+    {'name': 'r15',
+     'set': 0,
+     'bitsize': 64,
+     'encoding': eEncodingUint,
+     'format': eFormatAddressInfo},
+    {'name': 'rip', 'set': 0, 'bitsize': 64, 'encoding': eEncodingUint,
+        'format': eFormatAddressInfo, 'alt-name': 'pc'},
+    {'name': 'rflags', 'set': 0, 'bitsize': 32,
+        'encoding': eEncodingUint, 'format': eFormatHex},
+    {'name': 'cs', 'set': 0, 'bitsize': 32,
+        'encoding': eEncodingUint, 'format': eFormatHex},
+    {'name': 'ss', 'set': 0, 'bitsize': 32,
+        'encoding': eEncodingUint, 'format': eFormatHex},
+    {'name': 'ds', 'set': 0, 'bitsize': 32,
+        'encoding': eEncodingUint, 'format': eFormatHex},
+    {'name': 'es', 'set': 0, 'bitsize': 32,
+        'encoding': eEncodingUint, 'format': eFormatHex},
+    {'name': 'fs', 'set': 0, 'bitsize': 32,
+        'encoding': eEncodingUint, 'format': eFormatHex},
+    {'name': 'gs', 'set': 0, 'bitsize': 32,
+        'encoding': eEncodingUint, 'format': eFormatHex},
+    {'name': 'stmm0',
+     'set': 1,
+     'bitsize': 80,
+     'encoding': eEncodingVector,
+     'format': eFormatVectorOfUInt8},
+    {'name': 'stmm1',
+     'set': 1,
+     'bitsize': 80,
+     'encoding': eEncodingVector,
+     'format': eFormatVectorOfUInt8},
+    {'name': 'stmm2',
+     'set': 1,
+     'bitsize': 80,
+     'encoding': eEncodingVector,
+     'format': eFormatVectorOfUInt8},
+    {'name': 'stmm3',
+     'set': 1,
+     'bitsize': 80,
+     'encoding': eEncodingVector,
+     'format': eFormatVectorOfUInt8},
+    {'name': 'stmm4',
+     'set': 1,
+     'bitsize': 80,
+     'encoding': eEncodingVector,
+     'format': eFormatVectorOfUInt8},
+    {'name': 'stmm5',
+     'set': 1,
+     'bitsize': 80,
+     'encoding': eEncodingVector,
+     'format': eFormatVectorOfUInt8},
+    {'name': 'stmm6',
+     'set': 1,
+     'bitsize': 80,
+     'encoding': eEncodingVector,
+     'format': eFormatVectorOfUInt8},
+    {'name': 'stmm7',
+     'set': 1,
+     'bitsize': 80,
+     'encoding': eEncodingVector,
+     'format': eFormatVectorOfUInt8},
+    {'name': 'fctrl', 'set': 1, 'bitsize': 32,
+        'encoding': eEncodingUint, 'format': eFormatHex},
+    {'name': 'fstat', 'set': 1, 'bitsize': 32,
+        'encoding': eEncodingUint, 'format': eFormatHex},
+    {'name': 'ftag', 'set': 1, 'bitsize': 32,
+        'encoding': eEncodingUint, 'format': eFormatHex},
+    {'name': 'fiseg', 'set': 1, 'bitsize': 32,
+        'encoding': eEncodingUint, 'format': eFormatHex},
+    {'name': 'fioff', 'set': 1, 'bitsize': 32,
+        'encoding': eEncodingUint, 'format': eFormatHex},
+    {'name': 'foseg', 'set': 1, 'bitsize': 32,
+        'encoding': eEncodingUint, 'format': eFormatHex},
+    {'name': 'fooff', 'set': 1, 'bitsize': 32,
+        'encoding': eEncodingUint, 'format': eFormatHex},
+    {'name': 'fop', 'set': 1, 'bitsize': 32,
+        'encoding': eEncodingUint, 'format': eFormatHex},
+    {'name': 'xmm0',
+     'set': 1,
+     'bitsize': 128,
+     'encoding': eEncodingVector,
+     'format': eFormatVectorOfUInt8},
+    {'name': 'xmm1',
+     'set': 1,
+     'bitsize': 128,
+     'encoding': eEncodingVector,
+     'format': eFormatVectorOfUInt8},
+    {'name': 'xmm2',
+     'set': 1,
+     'bitsize': 128,
+     'encoding': eEncodingVector,
+     'format': eFormatVectorOfUInt8},
+    {'name': 'xmm3',
+     'set': 1,
+     'bitsize': 128,
+     'encoding': eEncodingVector,
+     'format': eFormatVectorOfUInt8},
+    {'name': 'xmm4',
+     'set': 1,
+     'bitsize': 128,
+     'encoding': eEncodingVector,
+     'format': eFormatVectorOfUInt8},
+    {'name': 'xmm5',
+     'set': 1,
+     'bitsize': 128,
+     'encoding': eEncodingVector,
+     'format': eFormatVectorOfUInt8},
+    {'name': 'xmm6',
+     'set': 1,
+     'bitsize': 128,
+     'encoding': eEncodingVector,
+     'format': eFormatVectorOfUInt8},
+    {'name': 'xmm7',
+     'set': 1,
+     'bitsize': 128,
+     'encoding': eEncodingVector,
+     'format': eFormatVectorOfUInt8},
+    {'name': 'xmm8',
+     'set': 1,
+     'bitsize': 128,
+     'encoding': eEncodingVector,
+     'format': eFormatVectorOfUInt8},
+    {'name': 'xmm9',
+     'set': 1,
+     'bitsize': 128,
+     'encoding': eEncodingVector,
+     'format': eFormatVectorOfUInt8},
+    {'name': 'xmm10',
+     'set': 1,
+     'bitsize': 128,
+     'encoding': eEncodingVector,
+     'format': eFormatVectorOfUInt8},
+    {'name': 'xmm11',
+     'set': 1,
+     'bitsize': 128,
+     'encoding': eEncodingVector,
+     'format': eFormatVectorOfUInt8},
+    {'name': 'xmm12',
+     'set': 1,
+     'bitsize': 128,
+     'encoding': eEncodingVector,
+     'format': eFormatVectorOfUInt8},
+    {'name': 'xmm13',
+     'set': 1,
+     'bitsize': 128,
+     'encoding': eEncodingVector,
+     'format': eFormatVectorOfUInt8},
+    {'name': 'xmm14',
+     'set': 1,
+     'bitsize': 128,
+     'encoding': eEncodingVector,
+     'format': eFormatVectorOfUInt8},
+    {'name': 'xmm15',
+     'set': 1,
+     'bitsize': 128,
+     'encoding': eEncodingVector,
+     'format': eFormatVectorOfUInt8},
+    {'name': 'mxcsr', 'set': 1, 'bitsize': 32,
+        'encoding': eEncodingUint, 'format': eFormatHex},
+    # Registers that are contained in or composed of one of more other
+    # registers
+    {'name': 'eax',
+     'set': 0,
+     'bitsize': 32,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rax[31:0]'},
+    {'name': 'ebx',
+     'set': 0,
+     'bitsize': 32,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rbx[31:0]'},
+    {'name': 'ecx',
+     'set': 0,
+     'bitsize': 32,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rcx[31:0]'},
+    {'name': 'edx',
+     'set': 0,
+     'bitsize': 32,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rdx[31:0]'},
+    {'name': 'edi',
+     'set': 0,
+     'bitsize': 32,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rdi[31:0]'},
+    {'name': 'esi',
+     'set': 0,
+     'bitsize': 32,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rsi[31:0]'},
+    {'name': 'ebp',
+     'set': 0,
+     'bitsize': 32,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rbp[31:0]'},
+    {'name': 'esp',
+     'set': 0,
+     'bitsize': 32,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rsp[31:0]'},
+    {'name': 'r8d',
+     'set': 0,
+     'bitsize': 32,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'r8[31:0]'},
+    {'name': 'r9d',
+     'set': 0,
+     'bitsize': 32,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'r9[31:0]'},
+    {'name': 'r10d',
+     'set': 0,
+     'bitsize': 32,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'r10[31:0]'},
+    {'name': 'r11d',
+     'set': 0,
+     'bitsize': 32,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'r11[31:0]'},
+    {'name': 'r12d',
+     'set': 0,
+     'bitsize': 32,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'r12[31:0]'},
+    {'name': 'r13d',
+     'set': 0,
+     'bitsize': 32,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'r13[31:0]'},
+    {'name': 'r14d',
+     'set': 0,
+     'bitsize': 32,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'r14[31:0]'},
+    {'name': 'r15d',
+     'set': 0,
+     'bitsize': 32,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'r15[31:0]'},
+
+    {'name': 'ax',
+     'set': 0,
+     'bitsize': 16,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rax[15:0]'},
+    {'name': 'bx',
+     'set': 0,
+     'bitsize': 16,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rbx[15:0]'},
+    {'name': 'cx',
+     'set': 0,
+     'bitsize': 16,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rcx[15:0]'},
+    {'name': 'dx',
+     'set': 0,
+     'bitsize': 16,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rdx[15:0]'},
+    {'name': 'di',
+     'set': 0,
+     'bitsize': 16,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rdi[15:0]'},
+    {'name': 'si',
+     'set': 0,
+     'bitsize': 16,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rsi[15:0]'},
+    {'name': 'bp',
+     'set': 0,
+     'bitsize': 16,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rbp[15:0]'},
+    {'name': 'sp',
+     'set': 0,
+     'bitsize': 16,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rsp[15:0]'},
+    {'name': 'r8w',
+     'set': 0,
+     'bitsize': 16,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'r8[15:0]'},
+    {'name': 'r9w',
+     'set': 0,
+     'bitsize': 16,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'r9[15:0]'},
+    {'name': 'r10w',
+     'set': 0,
+     'bitsize': 16,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'r10[15:0]'},
+    {'name': 'r11w',
+     'set': 0,
+     'bitsize': 16,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'r11[15:0]'},
+    {'name': 'r12w',
+     'set': 0,
+     'bitsize': 16,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'r12[15:0]'},
+    {'name': 'r13w',
+     'set': 0,
+     'bitsize': 16,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'r13[15:0]'},
+    {'name': 'r14w',
+     'set': 0,
+     'bitsize': 16,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'r14[15:0]'},
+    {'name': 'r15w',
+     'set': 0,
+     'bitsize': 16,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'r15[15:0]'},
+
+    {'name': 'ah',
+     'set': 0,
+     'bitsize': 8,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rax[15:8]'},
+    {'name': 'bh',
+     'set': 0,
+     'bitsize': 8,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rbx[15:8]'},
+    {'name': 'ch',
+     'set': 0,
+     'bitsize': 8,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rcx[15:8]'},
+    {'name': 'dh',
+     'set': 0,
+     'bitsize': 8,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rdx[15:8]'},
+
+    {'name': 'al',
+     'set': 0,
+     'bitsize': 8,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rax[7:0]'},
+    {'name': 'bl',
+     'set': 0,
+     'bitsize': 8,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rbx[7:0]'},
+    {'name': 'cl',
+     'set': 0,
+     'bitsize': 8,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rcx[7:0]'},
+    {'name': 'dl',
+     'set': 0,
+     'bitsize': 8,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rdx[7:0]'},
+    {'name': 'dil',
+     'set': 0,
+     'bitsize': 8,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rdi[7:0]'},
+    {'name': 'sil',
+     'set': 0,
+     'bitsize': 8,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rsi[7:0]'},
+    {'name': 'bpl',
+     'set': 0,
+     'bitsize': 8,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rbp[7:0]'},
+    {'name': 'spl',
+     'set': 0,
+     'bitsize': 8,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'rsp[7:0]'},
+    {'name': 'r8l',
+     'set': 0,
+     'bitsize': 8,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'r8[7:0]'},
+    {'name': 'r9l',
+     'set': 0,
+     'bitsize': 8,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'r9[7:0]'},
+    {'name': 'r10l',
+     'set': 0,
+     'bitsize': 8,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'r10[7:0]'},
+    {'name': 'r11l',
+     'set': 0,
+     'bitsize': 8,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'r11[7:0]'},
+    {'name': 'r12l',
+     'set': 0,
+     'bitsize': 8,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'r12[7:0]'},
+    {'name': 'r13l',
+     'set': 0,
+     'bitsize': 8,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'r13[7:0]'},
+    {'name': 'r14l',
+     'set': 0,
+     'bitsize': 8,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'r14[7:0]'},
+    {'name': 'r15l',
+     'set': 0,
+     'bitsize': 8,
+     'encoding': eEncodingUint,
+     'format': eFormatHex,
+     'slice': 'r15[7:0]'},
+]
 
 g_target_definition = None
 
-def get_target_definition ():
+
+def get_target_definition():
     global g_target_definition
-    if g_target_definition == None:
+    if g_target_definition is None:
         g_target_definition = {}
         offset = 0
         for reg_info in x86_64_register_infos:
             reg_name = reg_info['name']
-            
-            # Only fill in the offset if there is no 'slice' in the register info
+
+            # Only fill in the offset if there is no 'slice' in the register
+            # info
             if 'slice' not in reg_info and 'composite' not in reg_info:
                 reg_info['offset'] = offset
-                offset += reg_info['bitsize']/8
-            
-            # Set the GCC/DWARF register number for this register if it has one    
+                offset += reg_info['bitsize'] / 8
+
+            # Set the GCC/DWARF register number for this register if it has one
             reg_num = get_reg_num(name_to_gcc_dwarf_regnum, reg_name)
             if reg_num != LLDB_INVALID_REGNUM:
                 reg_info['gcc'] = reg_num
                 reg_info['dwarf'] = reg_num
-            
-            # Set the generic register number for this register if it has one    
+
+            # Set the generic register number for this register if it has one
             reg_num = get_reg_num(name_to_generic_regnum, reg_name)
             if reg_num != LLDB_INVALID_REGNUM:
                 reg_info['generic'] = reg_num
 
-            # Set the GDB register number for this register if it has one    
+            # Set the GDB register number for this register if it has one
             reg_num = get_reg_num(name_to_gdb_regnum, reg_name)
             if reg_num != LLDB_INVALID_REGNUM:
                 reg_info['gdb'] = reg_num
 
-        g_target_definition['sets'] = ['General Purpose Registers', 'Floating Point Registers']
+        g_target_definition['sets'] = [
+            'General Purpose Registers',
+            'Floating Point Registers']
         g_target_definition['registers'] = x86_64_register_infos
-        g_target_definition['host-info'] = { 'triple'   : 'x86_64-*-linux', 'endian': eByteOrderLittle }
+        g_target_definition[
+            'host-info'] = {'triple': 'x86_64-*-linux', 'endian': eByteOrderLittle}
         g_target_definition['g-packet-size'] = offset
         g_target_definition['breakpoint-pc-offset'] = -1
     return g_target_definition
 
+
 def get_dynamic_setting(target, setting_name):
     if setting_name == 'gdb-server-target-definition':
         return get_target_definition()




More information about the lldb-commits mailing list