[Lldb-commits] [lldb] r171849 [1/2] - in /lldb/branches/windows: ./ docs/ examples/summaries/cocoa/ examples/synthetic/ include/lldb/ include/lldb/API/ include/lldb/Breakpoint/ include/lldb/Core/ include/lldb/Expression/ include/lldb/Host/ include/lldb/Interpreter/ include/lldb/Symbol/ include/lldb/Target/ lib/ lldb.xcodeproj/ resources/ scripts/ scripts/Python/ scripts/Python/interface/ source/ source/API/ source/Breakpoint/ source/Commands/ source/Core/ source/Expression/ source/Host/common/ source/Host/linux/ source...

Carlo Kok ck at remobjects.com
Tue Jan 8 04:51:56 PST 2013


Author: carlokok
Date: Tue Jan  8 06:51:53 2013
New Revision: 171849

URL: http://llvm.org/viewvc/llvm-project?rev=171849&view=rev
Log:
Upmerge trunk to the Windows branch

Added:
    lldb/branches/windows/include/lldb/lldb-python.h
      - copied unchanged from r171846, lldb/trunk/include/lldb/lldb-python.h
    lldb/branches/windows/test/functionalities/watchpoint/watchpoint_events/
      - copied from r171846, lldb/trunk/test/functionalities/watchpoint/watchpoint_events/
    lldb/branches/windows/www/symbolication.html
      - copied unchanged from r171846, lldb/trunk/www/symbolication.html
Removed:
    lldb/branches/windows/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp
    lldb/branches/windows/source/Plugins/Disassembler/llvm/DisassemblerLLVM.h
Modified:
    lldb/branches/windows/   (props changed)
    lldb/branches/windows/docs/lldb-gdb-remote.txt
    lldb/branches/windows/examples/summaries/cocoa/NSNumber.py
    lldb/branches/windows/examples/summaries/cocoa/NSURL.py
    lldb/branches/windows/examples/synthetic/gnu_libstdcpp.py
    lldb/branches/windows/examples/synthetic/libcxx.py
    lldb/branches/windows/include/lldb/API/SBDebugger.h
    lldb/branches/windows/include/lldb/API/SBEvent.h
    lldb/branches/windows/include/lldb/API/SBExpressionOptions.h
    lldb/branches/windows/include/lldb/API/SBFrame.h
    lldb/branches/windows/include/lldb/API/SBHostOS.h
    lldb/branches/windows/include/lldb/API/SBModule.h
    lldb/branches/windows/include/lldb/API/SBTarget.h
    lldb/branches/windows/include/lldb/API/SBThread.h
    lldb/branches/windows/include/lldb/API/SBType.h
    lldb/branches/windows/include/lldb/API/SBValue.h
    lldb/branches/windows/include/lldb/API/SBWatchpoint.h
    lldb/branches/windows/include/lldb/Breakpoint/Watchpoint.h
    lldb/branches/windows/include/lldb/Breakpoint/WatchpointList.h
    lldb/branches/windows/include/lldb/Core/ArchSpec.h
    lldb/branches/windows/include/lldb/Core/CXXFormatterFunctions.h
    lldb/branches/windows/include/lldb/Core/Debugger.h
    lldb/branches/windows/include/lldb/Core/Module.h
    lldb/branches/windows/include/lldb/Core/ValueObject.h
    lldb/branches/windows/include/lldb/Expression/ClangExpressionDeclMap.h
    lldb/branches/windows/include/lldb/Expression/ClangExpressionVariable.h
    lldb/branches/windows/include/lldb/Expression/IRInterpreter.h
    lldb/branches/windows/include/lldb/Host/Mutex.h
    lldb/branches/windows/include/lldb/Host/Terminal.h
    lldb/branches/windows/include/lldb/Interpreter/Args.h
    lldb/branches/windows/include/lldb/Interpreter/CommandInterpreter.h
    lldb/branches/windows/include/lldb/Interpreter/CommandReturnObject.h
    lldb/branches/windows/include/lldb/Interpreter/OptionGroupBoolean.h
    lldb/branches/windows/include/lldb/Interpreter/OptionGroupFile.h
    lldb/branches/windows/include/lldb/Interpreter/OptionGroupFormat.h
    lldb/branches/windows/include/lldb/Interpreter/OptionGroupString.h
    lldb/branches/windows/include/lldb/Interpreter/OptionGroupUInt64.h
    lldb/branches/windows/include/lldb/Interpreter/OptionValueString.h
    lldb/branches/windows/include/lldb/Interpreter/Options.h
    lldb/branches/windows/include/lldb/Interpreter/ScriptInterpreter.h
    lldb/branches/windows/include/lldb/Interpreter/ScriptInterpreterPython.h
    lldb/branches/windows/include/lldb/Symbol/ClangASTContext.h
    lldb/branches/windows/include/lldb/Symbol/ClangASTType.h
    lldb/branches/windows/include/lldb/Symbol/LineTable.h
    lldb/branches/windows/include/lldb/Symbol/Symbol.h
    lldb/branches/windows/include/lldb/Symbol/SymbolVendor.h
    lldb/branches/windows/include/lldb/Symbol/Symtab.h
    lldb/branches/windows/include/lldb/Symbol/TypeVendor.h
    lldb/branches/windows/include/lldb/Symbol/VariableList.h
    lldb/branches/windows/include/lldb/Target/DynamicLoader.h
    lldb/branches/windows/include/lldb/Target/Process.h
    lldb/branches/windows/include/lldb/Target/StopInfo.h
    lldb/branches/windows/include/lldb/Target/Target.h
    lldb/branches/windows/include/lldb/Target/Thread.h
    lldb/branches/windows/include/lldb/Target/ThreadList.h
    lldb/branches/windows/include/lldb/Target/ThreadPlan.h
    lldb/branches/windows/include/lldb/Target/ThreadPlanCallFunction.h
    lldb/branches/windows/include/lldb/Target/ThreadPlanStepInRange.h
    lldb/branches/windows/include/lldb/Target/ThreadPlanStepOverRange.h
    lldb/branches/windows/include/lldb/lldb-enumerations.h
    lldb/branches/windows/include/lldb/lldb-forward.h
    lldb/branches/windows/include/lldb/lldb-private-interfaces.h
    lldb/branches/windows/include/lldb/lldb-private-log.h
    lldb/branches/windows/include/lldb/lldb-private-types.h
    lldb/branches/windows/lib/Makefile
    lldb/branches/windows/lldb.xcodeproj/project.pbxproj
    lldb/branches/windows/resources/LLDB-Info.plist
    lldb/branches/windows/scripts/Python/interface/SBModule.i
    lldb/branches/windows/scripts/Python/interface/SBTarget.i
    lldb/branches/windows/scripts/Python/interface/SBThread.i
    lldb/branches/windows/scripts/Python/interface/SBType.i
    lldb/branches/windows/scripts/Python/interface/SBWatchpoint.i
    lldb/branches/windows/scripts/Python/modify-python-lldb.py
    lldb/branches/windows/scripts/Python/python-wrapper.swig
    lldb/branches/windows/scripts/build-swig-wrapper-classes.sh
    lldb/branches/windows/source/API/SBAddress.cpp
    lldb/branches/windows/source/API/SBBlock.cpp
    lldb/branches/windows/source/API/SBBreakpoint.cpp
    lldb/branches/windows/source/API/SBCommandInterpreter.cpp
    lldb/branches/windows/source/API/SBCommandReturnObject.cpp
    lldb/branches/windows/source/API/SBCommunication.cpp
    lldb/branches/windows/source/API/SBData.cpp
    lldb/branches/windows/source/API/SBDebugger.cpp
    lldb/branches/windows/source/API/SBEvent.cpp
    lldb/branches/windows/source/API/SBFileSpec.cpp
    lldb/branches/windows/source/API/SBFrame.cpp
    lldb/branches/windows/source/API/SBFunction.cpp
    lldb/branches/windows/source/API/SBHostOS.cpp
    lldb/branches/windows/source/API/SBListener.cpp
    lldb/branches/windows/source/API/SBModule.cpp
    lldb/branches/windows/source/API/SBProcess.cpp
    lldb/branches/windows/source/API/SBSection.cpp
    lldb/branches/windows/source/API/SBSourceManager.cpp
    lldb/branches/windows/source/API/SBTarget.cpp
    lldb/branches/windows/source/API/SBThread.cpp
    lldb/branches/windows/source/API/SBType.cpp
    lldb/branches/windows/source/API/SBTypeCategory.cpp
    lldb/branches/windows/source/API/SBTypeFilter.cpp
    lldb/branches/windows/source/API/SBTypeFormat.cpp
    lldb/branches/windows/source/API/SBTypeNameSpecifier.cpp
    lldb/branches/windows/source/API/SBTypeSummary.cpp
    lldb/branches/windows/source/API/SBTypeSynthetic.cpp
    lldb/branches/windows/source/API/SBValue.cpp
    lldb/branches/windows/source/API/SBWatchpoint.cpp
    lldb/branches/windows/source/Breakpoint/Breakpoint.cpp
    lldb/branches/windows/source/Breakpoint/BreakpointList.cpp
    lldb/branches/windows/source/Breakpoint/BreakpointLocation.cpp
    lldb/branches/windows/source/Breakpoint/BreakpointLocationList.cpp
    lldb/branches/windows/source/Breakpoint/BreakpointResolverFileLine.cpp
    lldb/branches/windows/source/Breakpoint/BreakpointResolverFileRegex.cpp
    lldb/branches/windows/source/Breakpoint/BreakpointResolverName.cpp
    lldb/branches/windows/source/Breakpoint/BreakpointSite.cpp
    lldb/branches/windows/source/Breakpoint/BreakpointSiteList.cpp
    lldb/branches/windows/source/Breakpoint/Watchpoint.cpp
    lldb/branches/windows/source/Breakpoint/WatchpointList.cpp
    lldb/branches/windows/source/Commands/CommandCompletions.cpp
    lldb/branches/windows/source/Commands/CommandObjectApropos.cpp
    lldb/branches/windows/source/Commands/CommandObjectArgs.cpp
    lldb/branches/windows/source/Commands/CommandObjectBreakpoint.cpp
    lldb/branches/windows/source/Commands/CommandObjectBreakpointCommand.cpp
    lldb/branches/windows/source/Commands/CommandObjectCommands.cpp
    lldb/branches/windows/source/Commands/CommandObjectDisassemble.cpp
    lldb/branches/windows/source/Commands/CommandObjectDisassemble.h
    lldb/branches/windows/source/Commands/CommandObjectExpression.cpp
    lldb/branches/windows/source/Commands/CommandObjectFrame.cpp
    lldb/branches/windows/source/Commands/CommandObjectHelp.cpp
    lldb/branches/windows/source/Commands/CommandObjectHelp.h
    lldb/branches/windows/source/Commands/CommandObjectLog.cpp
    lldb/branches/windows/source/Commands/CommandObjectMemory.cpp
    lldb/branches/windows/source/Commands/CommandObjectMultiword.cpp
    lldb/branches/windows/source/Commands/CommandObjectPlatform.cpp
    lldb/branches/windows/source/Commands/CommandObjectPlugin.cpp
    lldb/branches/windows/source/Commands/CommandObjectProcess.cpp
    lldb/branches/windows/source/Commands/CommandObjectQuit.cpp
    lldb/branches/windows/source/Commands/CommandObjectRegister.cpp
    lldb/branches/windows/source/Commands/CommandObjectSettings.cpp
    lldb/branches/windows/source/Commands/CommandObjectSource.cpp
    lldb/branches/windows/source/Commands/CommandObjectSyntax.cpp
    lldb/branches/windows/source/Commands/CommandObjectTarget.cpp
    lldb/branches/windows/source/Commands/CommandObjectThread.cpp
    lldb/branches/windows/source/Commands/CommandObjectType.cpp
    lldb/branches/windows/source/Commands/CommandObjectVersion.cpp
    lldb/branches/windows/source/Commands/CommandObjectWatchpoint.cpp
    lldb/branches/windows/source/Commands/CommandObjectWatchpointCommand.cpp
    lldb/branches/windows/source/Commands/Makefile
    lldb/branches/windows/source/Core/Address.cpp
    lldb/branches/windows/source/Core/AddressRange.cpp
    lldb/branches/windows/source/Core/AddressResolverFileLine.cpp
    lldb/branches/windows/source/Core/ArchSpec.cpp
    lldb/branches/windows/source/Core/CXXFormatterFunctions.cpp
    lldb/branches/windows/source/Core/Communication.cpp
    lldb/branches/windows/source/Core/ConnectionFileDescriptor.cpp
    lldb/branches/windows/source/Core/ConstString.cpp
    lldb/branches/windows/source/Core/DataBufferMemoryMap.cpp
    lldb/branches/windows/source/Core/DataExtractor.cpp
    lldb/branches/windows/source/Core/DataVisualization.cpp
    lldb/branches/windows/source/Core/Debugger.cpp
    lldb/branches/windows/source/Core/Disassembler.cpp
    lldb/branches/windows/source/Core/EmulateInstruction.cpp
    lldb/branches/windows/source/Core/FormatClasses.cpp
    lldb/branches/windows/source/Core/FormatManager.cpp
    lldb/branches/windows/source/Core/History.cpp
    lldb/branches/windows/source/Core/InputReader.cpp
    lldb/branches/windows/source/Core/Log.cpp
    lldb/branches/windows/source/Core/Makefile
    lldb/branches/windows/source/Core/Module.cpp
    lldb/branches/windows/source/Core/Opcode.cpp
    lldb/branches/windows/source/Core/PluginManager.cpp
    lldb/branches/windows/source/Core/RegisterValue.cpp
    lldb/branches/windows/source/Core/Scalar.cpp
    lldb/branches/windows/source/Core/Section.cpp
    lldb/branches/windows/source/Core/SourceManager.cpp
    lldb/branches/windows/source/Core/State.cpp
    lldb/branches/windows/source/Core/Stream.cpp
    lldb/branches/windows/source/Core/UserID.cpp
    lldb/branches/windows/source/Core/UserSettingsController.cpp
    lldb/branches/windows/source/Core/Value.cpp
    lldb/branches/windows/source/Core/ValueObject.cpp
    lldb/branches/windows/source/Core/ValueObjectChild.cpp
    lldb/branches/windows/source/Core/ValueObjectConstResult.cpp
    lldb/branches/windows/source/Core/ValueObjectDynamicValue.cpp
    lldb/branches/windows/source/Core/ValueObjectSyntheticFilter.cpp
    lldb/branches/windows/source/Core/cxa_demangle.cpp
    lldb/branches/windows/source/Expression/ASTResultSynthesizer.cpp
    lldb/branches/windows/source/Expression/ClangASTSource.cpp
    lldb/branches/windows/source/Expression/ClangExpressionDeclMap.cpp
    lldb/branches/windows/source/Expression/ClangExpressionParser.cpp
    lldb/branches/windows/source/Expression/ClangFunction.cpp
    lldb/branches/windows/source/Expression/ClangUserExpression.cpp
    lldb/branches/windows/source/Expression/ClangUtilityFunction.cpp
    lldb/branches/windows/source/Expression/DWARFExpression.cpp
    lldb/branches/windows/source/Expression/IRDynamicChecks.cpp
    lldb/branches/windows/source/Expression/IRForTarget.cpp
    lldb/branches/windows/source/Expression/IRInterpreter.cpp
    lldb/branches/windows/source/Expression/RecordingMemoryManager.cpp
    lldb/branches/windows/source/Host/common/FileSpec.cpp
    lldb/branches/windows/source/Host/common/Host.cpp
    lldb/branches/windows/source/Host/common/Mutex.cpp
    lldb/branches/windows/source/Host/common/Terminal.cpp
    lldb/branches/windows/source/Host/linux/Host.cpp
    lldb/branches/windows/source/Host/macosx/Host.mm
    lldb/branches/windows/source/Host/macosx/Symbols.cpp
    lldb/branches/windows/source/Interpreter/Args.cpp
    lldb/branches/windows/source/Interpreter/CommandInterpreter.cpp
    lldb/branches/windows/source/Interpreter/CommandObject.cpp
    lldb/branches/windows/source/Interpreter/CommandObjectRegexCommand.cpp
    lldb/branches/windows/source/Interpreter/CommandObjectScript.cpp
    lldb/branches/windows/source/Interpreter/CommandObjectScript.h
    lldb/branches/windows/source/Interpreter/CommandReturnObject.cpp
    lldb/branches/windows/source/Interpreter/Makefile
    lldb/branches/windows/source/Interpreter/OptionGroupArchitecture.cpp
    lldb/branches/windows/source/Interpreter/OptionGroupBoolean.cpp
    lldb/branches/windows/source/Interpreter/OptionGroupFile.cpp
    lldb/branches/windows/source/Interpreter/OptionGroupFormat.cpp
    lldb/branches/windows/source/Interpreter/OptionGroupOutputFile.cpp
    lldb/branches/windows/source/Interpreter/OptionGroupPlatform.cpp
    lldb/branches/windows/source/Interpreter/OptionGroupString.cpp
    lldb/branches/windows/source/Interpreter/OptionGroupUInt64.cpp
    lldb/branches/windows/source/Interpreter/OptionGroupUUID.cpp
    lldb/branches/windows/source/Interpreter/OptionGroupValueObjectDisplay.cpp
    lldb/branches/windows/source/Interpreter/OptionGroupVariable.cpp
    lldb/branches/windows/source/Interpreter/OptionGroupWatchpoint.cpp
    lldb/branches/windows/source/Interpreter/OptionValueArch.cpp
    lldb/branches/windows/source/Interpreter/OptionValueArray.cpp
    lldb/branches/windows/source/Interpreter/OptionValueDictionary.cpp
    lldb/branches/windows/source/Interpreter/OptionValueEnumeration.cpp
    lldb/branches/windows/source/Interpreter/OptionValueFileSpec.cpp
    lldb/branches/windows/source/Interpreter/OptionValueFormat.cpp
    lldb/branches/windows/source/Interpreter/OptionValueSInt64.cpp
    lldb/branches/windows/source/Interpreter/OptionValueString.cpp
    lldb/branches/windows/source/Interpreter/OptionValueUInt64.cpp
    lldb/branches/windows/source/Interpreter/OptionValueUUID.cpp
    lldb/branches/windows/source/Interpreter/Options.cpp
    lldb/branches/windows/source/Interpreter/Property.cpp
    lldb/branches/windows/source/Interpreter/ScriptInterpreter.cpp
    lldb/branches/windows/source/Interpreter/ScriptInterpreterNone.cpp
    lldb/branches/windows/source/Interpreter/ScriptInterpreterPython.cpp
    lldb/branches/windows/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp
    lldb/branches/windows/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp
    lldb/branches/windows/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp
    lldb/branches/windows/source/Plugins/Disassembler/llvm/CMakeLists.txt
    lldb/branches/windows/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
    lldb/branches/windows/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
    lldb/branches/windows/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
    lldb/branches/windows/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h
    lldb/branches/windows/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.cpp
    lldb/branches/windows/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
    lldb/branches/windows/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
    lldb/branches/windows/source/Plugins/Instruction/ARM/EmulateInstructionARM.h
    lldb/branches/windows/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
    lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp
    lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h
    lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
    lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
    lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeVendor.cpp
    lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeVendor.h
    lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp
    lldb/branches/windows/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
    lldb/branches/windows/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
    lldb/branches/windows/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
    lldb/branches/windows/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
    lldb/branches/windows/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp
    lldb/branches/windows/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
    lldb/branches/windows/source/Plugins/Platform/Linux/PlatformLinux.cpp
    lldb/branches/windows/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
    lldb/branches/windows/source/Plugins/Platform/Windows/PlatformWindows.cpp
    lldb/branches/windows/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
    lldb/branches/windows/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp
    lldb/branches/windows/source/Plugins/Process/FreeBSD/ProcessMonitor.h
    lldb/branches/windows/source/Plugins/Process/Linux/ProcessLinux.cpp
    lldb/branches/windows/source/Plugins/Process/Linux/ProcessMonitor.cpp
    lldb/branches/windows/source/Plugins/Process/Linux/ProcessMonitor.h
    lldb/branches/windows/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp
    lldb/branches/windows/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
    lldb/branches/windows/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h
    lldb/branches/windows/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp
    lldb/branches/windows/source/Plugins/Process/POSIX/Makefile
    lldb/branches/windows/source/Plugins/Process/POSIX/POSIXStopInfo.cpp
    lldb/branches/windows/source/Plugins/Process/POSIX/POSIXThread.cpp
    lldb/branches/windows/source/Plugins/Process/POSIX/ProcessMessage.cpp
    lldb/branches/windows/source/Plugins/Process/POSIX/ProcessPOSIX.cpp
    lldb/branches/windows/source/Plugins/Process/POSIX/RegisterContext_i386.cpp
    lldb/branches/windows/source/Plugins/Process/POSIX/RegisterContext_x86_64.cpp
    lldb/branches/windows/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
    lldb/branches/windows/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp
    lldb/branches/windows/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
    lldb/branches/windows/source/Plugins/Process/Utility/StopInfoMachException.cpp
    lldb/branches/windows/source/Plugins/Process/Utility/UnwindLLDB.cpp
    lldb/branches/windows/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.cpp
    lldb/branches/windows/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
    lldb/branches/windows/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
    lldb/branches/windows/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
    lldb/branches/windows/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
    lldb/branches/windows/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
    lldb/branches/windows/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
    lldb/branches/windows/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
    lldb/branches/windows/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp
    lldb/branches/windows/source/Plugins/Process/mach-core/ProcessMachCore.cpp
    lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
    lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h
    lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp
    lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp
    lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
    lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp
    lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp
    lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
    lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFLocationDescription.cpp
    lldb/branches/windows/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
    lldb/branches/windows/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
    lldb/branches/windows/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
    lldb/branches/windows/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp
    lldb/branches/windows/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp
    lldb/branches/windows/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.h
    lldb/branches/windows/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
    lldb/branches/windows/source/Symbol/Block.cpp
    lldb/branches/windows/source/Symbol/ClangASTContext.cpp
    lldb/branches/windows/source/Symbol/ClangASTImporter.cpp
    lldb/branches/windows/source/Symbol/ClangASTType.cpp
    lldb/branches/windows/source/Symbol/CompileUnit.cpp
    lldb/branches/windows/source/Symbol/Function.cpp
    lldb/branches/windows/source/Symbol/LineTable.cpp
    lldb/branches/windows/source/Symbol/ObjectFile.cpp
    lldb/branches/windows/source/Symbol/Symbol.cpp
    lldb/branches/windows/source/Symbol/SymbolContext.cpp
    lldb/branches/windows/source/Symbol/SymbolVendor.cpp
    lldb/branches/windows/source/Symbol/Symtab.cpp
    lldb/branches/windows/source/Symbol/Type.cpp
    lldb/branches/windows/source/Symbol/UnwindPlan.cpp
    lldb/branches/windows/source/Symbol/UnwindTable.cpp
    lldb/branches/windows/source/Symbol/VariableList.cpp
    lldb/branches/windows/source/Target/Memory.cpp
    lldb/branches/windows/source/Target/ObjCLanguageRuntime.cpp
    lldb/branches/windows/source/Target/Platform.cpp
    lldb/branches/windows/source/Target/Process.cpp
    lldb/branches/windows/source/Target/SectionLoadList.cpp
    lldb/branches/windows/source/Target/StackFrame.cpp
    lldb/branches/windows/source/Target/StackFrameList.cpp
    lldb/branches/windows/source/Target/StackID.cpp
    lldb/branches/windows/source/Target/StopInfo.cpp
    lldb/branches/windows/source/Target/Target.cpp
    lldb/branches/windows/source/Target/TargetList.cpp
    lldb/branches/windows/source/Target/Thread.cpp
    lldb/branches/windows/source/Target/ThreadList.cpp
    lldb/branches/windows/source/Target/ThreadPlan.cpp
    lldb/branches/windows/source/Target/ThreadPlanBase.cpp
    lldb/branches/windows/source/Target/ThreadPlanCallFunction.cpp
    lldb/branches/windows/source/Target/ThreadPlanShouldStopHere.cpp
    lldb/branches/windows/source/Target/ThreadPlanStepInRange.cpp
    lldb/branches/windows/source/Target/ThreadPlanStepOut.cpp
    lldb/branches/windows/source/Target/ThreadPlanStepOverBreakpoint.cpp
    lldb/branches/windows/source/Target/ThreadPlanStepOverRange.cpp
    lldb/branches/windows/source/Target/ThreadPlanStepRange.cpp
    lldb/branches/windows/source/Target/ThreadPlanStepThrough.cpp
    lldb/branches/windows/source/Target/ThreadPlanStepUntil.cpp
    lldb/branches/windows/source/Target/ThreadPlanTracer.cpp
    lldb/branches/windows/source/Target/ThreadSpec.cpp
    lldb/branches/windows/source/Utility/Makefile
    lldb/branches/windows/source/Utility/StringExtractor.cpp
    lldb/branches/windows/source/lldb-log.cpp
    lldb/branches/windows/source/lldb.cpp
    lldb/branches/windows/test/dotest.py
    lldb/branches/windows/test/expression_command/call-function/TestCallStdStringFunction.py
    lldb/branches/windows/test/expression_command/formatters/TestFormatters.py
    lldb/branches/windows/test/expression_command/issue_11588/Test11588.py
    lldb/branches/windows/test/expression_command/radar_9673664/TestExprHelpExamples.py
    lldb/branches/windows/test/expression_command/two-files/TestObjCTypeQueryFromOtherCompileUnit.py
    lldb/branches/windows/test/functionalities/abbreviation/TestAbbreviations.py
    lldb/branches/windows/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
    lldb/branches/windows/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py
    lldb/branches/windows/test/functionalities/completion/TestCompletion.py
    lldb/branches/windows/test/functionalities/connect_remote/TestConnectRemote.py
    lldb/branches/windows/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
    lldb/branches/windows/test/functionalities/data-formatter/data-formatter-named-summaries/TestDataFormatterNamedSummaries.py
    lldb/branches/windows/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py
    lldb/branches/windows/test/functionalities/data-formatter/data-formatter-objc/main.m
    lldb/branches/windows/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py
    lldb/branches/windows/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py
    lldb/branches/windows/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py
    lldb/branches/windows/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py
    lldb/branches/windows/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py
    lldb/branches/windows/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py
    lldb/branches/windows/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py
    lldb/branches/windows/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py
    lldb/branches/windows/test/functionalities/data-formatter/rdar-11988289/TestRdar 11988289.py
    lldb/branches/windows/test/functionalities/data-formatter/rdar-11988289/main.m
    lldb/branches/windows/test/functionalities/data-formatter/rdar-12437442/TestRdar12437442.py
    lldb/branches/windows/test/functionalities/dead-strip/TestDeadStrip.py
    lldb/branches/windows/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py
    lldb/branches/windows/test/functionalities/inferior-changed/TestInferiorChanged.py
    lldb/branches/windows/test/functionalities/inferior-crashing/TestInferiorCrashing.py
    lldb/branches/windows/test/functionalities/load_unload/TestLoadUnload.py
    lldb/branches/windows/test/functionalities/platform/TestPlatformCommand.py
    lldb/branches/windows/test/functionalities/process_launch/TestProcessLaunch.py
    lldb/branches/windows/test/functionalities/register/TestRegisters.py
    lldb/branches/windows/test/functionalities/stop-hook/multiple_threads/TestStopHookMultipleThreads.py
    lldb/branches/windows/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py
    lldb/branches/windows/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py
    lldb/branches/windows/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py
    lldb/branches/windows/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py
    lldb/branches/windows/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandLLDB.py
    lldb/branches/windows/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py
    lldb/branches/windows/test/functionalities/watchpoint/watchpoint_commands/condition/TestWatchpointConditionCmd.py
    lldb/branches/windows/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py
    lldb/branches/windows/test/lang/c/array_types/TestArrayTypes.py
    lldb/branches/windows/test/lang/c/bitfields/TestBitfields.py
    lldb/branches/windows/test/lang/c/bitfields/main.c
    lldb/branches/windows/test/lang/c/forward/TestForwardDeclaration.py
    lldb/branches/windows/test/lang/c/function_types/TestFunctionTypes.py
    lldb/branches/windows/test/lang/c/global_variables/TestGlobalVariables.py
    lldb/branches/windows/test/lang/c/set_values/TestSetValues.py
    lldb/branches/windows/test/lang/c/shared_lib/TestSharedLib.py
    lldb/branches/windows/test/lang/c/stepping/TestStepAndBreakpoints.py
    lldb/branches/windows/test/lang/c/stepping/main.c
    lldb/branches/windows/test/lang/c/strings/TestCStrings.py
    lldb/branches/windows/test/lang/c/struct_types/TestStructTypes.py
    lldb/branches/windows/test/lang/c/struct_types/main.c
    lldb/branches/windows/test/lang/cpp/class_types/TestClassTypes.py
    lldb/branches/windows/test/lang/cpp/class_types/TestClassTypesDisassembly.py
    lldb/branches/windows/test/lang/cpp/namespace/TestNamespace.py
    lldb/branches/windows/test/lang/cpp/signed_types/TestSignedTypes.py
    lldb/branches/windows/test/lang/cpp/unique-types/TestUniqueTypes.py
    lldb/branches/windows/test/lang/cpp/unsigned_types/TestUnsignedTypes.py
    lldb/branches/windows/test/lang/objc/blocks/TestObjCIvarsInBlocks.py
    lldb/branches/windows/test/lang/objc/foundation/TestFoundationDisassembly.py
    lldb/branches/windows/test/lang/objc/foundation/TestObjCMethods.py
    lldb/branches/windows/test/lang/objc/foundation/TestObjCMethods2.py
    lldb/branches/windows/test/lang/objc/foundation/TestObjectDescriptionAPI.py
    lldb/branches/windows/test/lang/objc/objc++/TestObjCXX.py
    lldb/branches/windows/test/lang/objc/objc-builtin-types/TestObjCBuiltinTypes.py
    lldb/branches/windows/test/lang/objc/objc-checker/TestObjCCheckers.py
    lldb/branches/windows/test/lang/objc/objc-class-method/TestObjCClassMethod.py
    lldb/branches/windows/test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py
    lldb/branches/windows/test/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py
    lldb/branches/windows/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py
    lldb/branches/windows/test/lang/objc/objc-optimized/TestObjcOptimized.py
    lldb/branches/windows/test/lang/objc/objc-property/TestObjCProperty.py
    lldb/branches/windows/test/lang/objc/objc-property/main.m
    lldb/branches/windows/test/lang/objc/objc-static-method/TestObjCStaticMethod.py
    lldb/branches/windows/test/lang/objc/objc-stepping/TestObjCStepping.py
    lldb/branches/windows/test/lang/objc/rdar-11355592/TestRdar11355592.py
    lldb/branches/windows/test/lang/objc/self/TestObjCSelf.py
    lldb/branches/windows/test/lldbtest.py
    lldb/branches/windows/test/lldbutil.py
    lldb/branches/windows/test/logging/TestLogging.py
    lldb/branches/windows/test/python_api/event/TestEvents.py
    lldb/branches/windows/test/python_api/hello_world/TestHelloWorld.py
    lldb/branches/windows/test/python_api/lldbutil/iter/TestLLDBIterator.py
    lldb/branches/windows/test/python_api/lldbutil/process/TestPrintStackTraces.py
    lldb/branches/windows/test/python_api/thread/TestThreadAPI.py
    lldb/branches/windows/test/python_api/type/TestTypeList.py
    lldb/branches/windows/test/python_api/watchpoint/TestSetWatchpoint.py
    lldb/branches/windows/test/python_api/watchpoint/TestWatchpointIgnoreCount.py
    lldb/branches/windows/test/python_api/watchpoint/TestWatchpointIter.py
    lldb/branches/windows/test/python_api/watchpoint/condition/TestWatchpointConditionAPI.py
    lldb/branches/windows/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py
    lldb/branches/windows/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py
    lldb/branches/windows/test/types/AbstractBase.py
    lldb/branches/windows/test/warnings/uuid/TestAddDsymCommand.py
    lldb/branches/windows/tools/debugserver/debugserver.xcodeproj/project.pbxproj
    lldb/branches/windows/tools/debugserver/source/DNB.cpp
    lldb/branches/windows/tools/debugserver/source/DNB.h
    lldb/branches/windows/tools/debugserver/source/MacOSX/MachProcess.cpp
    lldb/branches/windows/tools/debugserver/source/MacOSX/MachProcess.h
    lldb/branches/windows/tools/debugserver/source/MacOSX/MachTask.cpp
    lldb/branches/windows/tools/debugserver/source/MacOSX/MachTask.h
    lldb/branches/windows/tools/debugserver/source/MacOSX/MachVMMemory.cpp
    lldb/branches/windows/tools/debugserver/source/MacOSX/MachVMMemory.h
    lldb/branches/windows/tools/debugserver/source/RNBRemote.cpp
    lldb/branches/windows/tools/debugserver/source/RNBRemote.h
    lldb/branches/windows/tools/debugserver/source/com.apple.debugserver.posix.plist
    lldb/branches/windows/tools/driver/Driver.cpp
    lldb/branches/windows/tools/driver/Driver.h
    lldb/branches/windows/tools/driver/DriverEvents.cpp
    lldb/branches/windows/tools/driver/DriverOptions.cpp
    lldb/branches/windows/tools/driver/DriverPosix.cpp
    lldb/branches/windows/tools/driver/IOChannel.cpp
    lldb/branches/windows/tools/driver/Makefile
    lldb/branches/windows/tools/lldb-platform/lldb-platform.cpp
    lldb/branches/windows/www/build.html
    lldb/branches/windows/www/lldb-gdb.html
    lldb/branches/windows/www/python-reference.html
    lldb/branches/windows/www/sidebar.incl
    lldb/branches/windows/www/tutorial.html

Propchange: lldb/branches/windows/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan  8 06:51:53 2013
@@ -1,2 +1,2 @@
 /lldb/branches/apple/python-GIL:156467-162159
-/lldb/trunk:163223-168491
+/lldb/trunk:163223-171846

Modified: lldb/branches/windows/docs/lldb-gdb-remote.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/docs/lldb-gdb-remote.txt?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/docs/lldb-gdb-remote.txt (original)
+++ lldb/branches/windows/docs/lldb-gdb-remote.txt Tue Jan  8 06:51:53 2013
@@ -398,6 +398,50 @@
 ptrsize: is a number that represents how big pointers are in bytes on the debug target
 
 //----------------------------------------------------------------------
+// "qProcessInfo"
+//
+// BRIEF
+//  Get information about the process we are currently debugging.
+//
+// PRIORITY TO IMPLEMENT
+//  Medium.  On systems which can launch multiple different architecture processes,
+//  the qHostInfo may not disambiguate sufficiently to know what kind of 
+//  process is being debugged.
+//  e.g. on a 64-bit x86 Mac system both 32-bit and 64-bit user processes are possible,
+//  and with Mach-O univeral files, the executable file may contain both 32- and 
+//  64-bit slices so it may be impossible to know until you're attached to a real
+//  process to know what you're working with.
+//
+//  All numeric fields return base-16 numbers without any "0x" prefix.
+//----------------------------------------------------------------------
+
+An i386 process:
+
+send packet: $qProcessInfo#00
+read packet: $pid:42a8;parent-pid:42bf;real-uid:ecf;real-gid:b;effective-uid:ecf;effective-gid:b;cputype:7;cpusubtype:3;ostype:macosx;vendor:apple;endian:little;ptrsize:4;#00
+
+An x86_64 process:
+
+send packet: $qProcessInfo#00
+read packet: $pid:d22c;parent-pid:d34d;real-uid:ecf;real-gid:b;effective-uid:ecf;effective-gid:b;cputype:1000007;cpusubtype:3;ostype:macosx;vendor:apple;endian:little;ptrsize:8;#00
+
+Key value pairs include:
+
+pid: the process id
+parent-pid: the process of the parent process (often debugserver will become the parent when attaching)
+real-uid: the real user id of the process
+real-gid: the real group id of the process
+effective-uid: the effective user id of the process
+effective-gid: the effective group id of the process
+cputype: the Mach-O CPU type of the process
+cpusubtype: the Mach-O CPU subtype of the process
+ostype: is a string the represents the OS being debugged (darwin, lunix, freebsd)
+vendor: is a string that represents the vendor (apple)
+endian: is one of "little", "big", or "pdp"
+ptrsize: is a number that represents how big pointers are in bytes
+
+
+//----------------------------------------------------------------------
 // "qShlibInfoAddr"
 //
 // BRIEF

Modified: lldb/branches/windows/examples/summaries/cocoa/NSNumber.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/examples/summaries/cocoa/NSNumber.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/examples/summaries/cocoa/NSNumber.py (original)
+++ lldb/branches/windows/examples/summaries/cocoa/NSNumber.py Tue Jan  8 06:51:53 2013
@@ -54,7 +54,7 @@
 		if self.info_bits == 12:
 			return '(long)' + str(ctypes.c_long(self.data).value)
 		else:
-			return 'absurd value:(info=' + str(self.info_bits) + ", value = " + str(self.data) + ')'
+			return 'unexpected value:(info=' + str(self.info_bits) + ", value = " + str(self.data) + ')'
 
 
 class NSUntaggedNumber_SummaryProvider:
@@ -158,7 +158,7 @@
 			statistics.metric_hit('code_notrun',self.valobj)
 			return '(double)' + str(data_double)
 		statistics.metric_hit('unknown_class',str(valobj.GetName()) + " had unknown data_type " + str(data_type))
-		return 'absurd: dt = ' + str(data_type)
+		return 'unexpected: dt = ' + str(data_type)
 
 
 class NSUnknownNumber_SummaryProvider:

Modified: lldb/branches/windows/examples/summaries/cocoa/NSURL.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/examples/summaries/cocoa/NSURL.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/examples/summaries/cocoa/NSURL.py (original)
+++ lldb/branches/windows/examples/summaries/cocoa/NSURL.py Tue Jan  8 06:51:53 2013
@@ -43,7 +43,10 @@
 	# one pointer is the ISA
 	# then there is one more pointer and 8 bytes of plain data
 	# (which are also present on a 32-bit system)
-	# plus another pointer, and then the real data
+	# then there is a pointer to an NSString which is the url text
+	# optionally, the next pointer is another NSURL which is the "base"
+	# of this one when doing NSURLs composition (incidentally, NSURLs can
+	# recurse the base+text mechanism to any desired depth)
 	def offset_text(self):
 		logger = lldb.formatters.Logger.Logger()
 		return 24 if self.sys_params.is_64_bit else 16

Modified: lldb/branches/windows/examples/synthetic/gnu_libstdcpp.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/examples/synthetic/gnu_libstdcpp.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/examples/synthetic/gnu_libstdcpp.py (original)
+++ lldb/branches/windows/examples/synthetic/gnu_libstdcpp.py Tue Jan  8 06:51:53 2013
@@ -133,24 +133,6 @@
 			pass
 
 	def has_children(self):
-		logger = lldb.formatters.Logger.Logger()
-		if self.count == None:
-			self.update ()
-			try:
-				next_val = self.next.GetValueAsUnsigned(0)
-				prev_val = self.prev.GetValueAsUnsigned(0)
-				if next_val == 0 or prev_val == 0:
-					return False
-				if next_val == self.node_address:
-					return False
-				# skip all the advanced logic to detect the exact count of children
-				# in the interest of speed from this point on, we MIGHT have children
-				# our loop detection logic will still make nothing show up :)
-				return True
-			except:
-				return False
-		if self.count == 0:
-			return False
 		return True
 
 class StdVectorSynthProvider:
@@ -249,7 +231,7 @@
 			
 
 	def has_children(self):
-		return self.num_children() > 0
+		return True
 
 
 class StdMapSynthProvider:
@@ -434,7 +416,7 @@
 			return x;
 
 	def has_children(self):
-		return self.num_children() > 0
+		return True
 
 _map_capping_size = 255
 _list_capping_size = 255

Modified: lldb/branches/windows/examples/synthetic/libcxx.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/examples/synthetic/libcxx.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/examples/synthetic/libcxx.py (original)
+++ lldb/branches/windows/examples/synthetic/libcxx.py Tue Jan  8 06:51:53 2013
@@ -125,8 +125,7 @@
 			pass
 
 	def has_children(self):
-		# retrieving the count is quick enough on a std::vector
-		return self.num_children() > 0
+		return True
 
 # Just an example: the actual summary is produced by a summary string: size=${svar%#}
 def stdvector_SummaryProvider(valobj,dict):
@@ -322,24 +321,6 @@
 			pass
 
 	def has_children(self):
-		logger = lldb.formatters.Logger.Logger()
-		if self.count == None:
-			self.update()
-			try:
-				next_val = self.head.GetValueAsUnsigned(0)
-				prev_val = self.tail.GetValueAsUnsigned(0)
-				if next_val == 0 or prev_val == 0:
-					return False
-				if next_val == self.node_address:
-					return False
-				# skip all the advanced logic to detect the exact count of children
-				# in the interest of speed from this point on, we MIGHT have children
-				# our loop detection logic will still make nothing show up :)
-				return True
-			except:
-				return 0;
-		if self.count == 0:
-			return False
 		return True
 
 
@@ -504,7 +485,7 @@
 			return 0;
 
 	def has_children(self):
-		return self.num_children_impl() > 0
+		return True
 
 	def get_data_type(self):
 		logger = lldb.formatters.Logger.Logger()
@@ -629,9 +610,7 @@
         return min(self.count, _deque_capping_size)
 
     def has_children(self):
-        if self.cont is None:
-            self.update()
-        return self.count > 0
+        return True
 
     def get_child_index(self,name):
         logger = lldb.formatters.Logger.Logger()

Modified: lldb/branches/windows/include/lldb/API/SBDebugger.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/API/SBDebugger.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/API/SBDebugger.h (original)
+++ lldb/branches/windows/include/lldb/API/SBDebugger.h Tue Jan  8 06:51:53 2013
@@ -78,7 +78,7 @@
 
     void
     SetErrorFileHandle (FILE *f, bool transfer_ownership);
-
+    
     FILE *
     GetInputFileHandle ();
 
@@ -88,6 +88,12 @@
     FILE *
     GetErrorFileHandle ();
 
+    void
+    SaveInputTerminalState();
+    
+    void
+    RestoreInputTerminalState();
+
     lldb::SBCommandInterpreter
     GetCommandInterpreter ();
 

Modified: lldb/branches/windows/include/lldb/API/SBEvent.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/API/SBEvent.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/API/SBEvent.h (original)
+++ lldb/branches/windows/include/lldb/API/SBEvent.h Tue Jan  8 06:51:53 2013
@@ -75,6 +75,7 @@
     friend class SBDebugger;
     friend class SBProcess;
     friend class SBThread;
+    friend class SBWatchpoint;
 
     SBEvent (lldb::EventSP &event_sp);
 

Modified: lldb/branches/windows/include/lldb/API/SBExpressionOptions.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/API/SBExpressionOptions.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/API/SBExpressionOptions.h (original)
+++ lldb/branches/windows/include/lldb/API/SBExpressionOptions.h Tue Jan  8 06:51:53 2013
@@ -20,9 +20,6 @@
 
 class SBExpressionOptions
 {
-friend class SBFrame;
-friend class SBValue;
-
 public:
     SBExpressionOptions();
 
@@ -73,6 +70,10 @@
     lldb_private::EvaluateExpressionOptions &
     ref () const;
 
+    friend class SBFrame;
+    friend class SBValue;
+    friend class SBTarget;
+
 private:
     // This auto_pointer is made in the constructor and is always valid.
     mutable std::auto_ptr<lldb_private::EvaluateExpressionOptions> m_opaque_ap;

Modified: lldb/branches/windows/include/lldb/API/SBFrame.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/API/SBFrame.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/API/SBFrame.h (original)
+++ lldb/branches/windows/include/lldb/API/SBFrame.h Tue Jan  8 06:51:53 2013
@@ -12,7 +12,6 @@
 
 #include "lldb/API/SBDefines.h"
 #include "lldb/API/SBValueList.h"
-#include "lldb/API/SBWatchpoint.h"
 
 namespace lldb {
 

Modified: lldb/branches/windows/include/lldb/API/SBHostOS.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/API/SBHostOS.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/API/SBHostOS.h (original)
+++ lldb/branches/windows/include/lldb/API/SBHostOS.h Tue Jan  8 06:51:53 2013
@@ -21,6 +21,9 @@
 
     static lldb::SBFileSpec
     GetProgramFileSpec ();
+    
+    static lldb::SBFileSpec
+    GetLLDBPythonPath ();
 
     static void
     ThreadCreated (const char *name);

Modified: lldb/branches/windows/include/lldb/API/SBModule.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/API/SBModule.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/API/SBModule.h (original)
+++ lldb/branches/windows/include/lldb/API/SBModule.h Tue Jan  8 06:51:53 2013
@@ -120,6 +120,14 @@
     lldb::SBSymbol
     GetSymbolAtIndex (size_t idx);
 
+    lldb::SBSymbol
+    FindSymbol (const char *name,
+                lldb::SymbolType type = eSymbolTypeAny);
+
+    lldb::SBSymbolContextList
+    FindSymbols (const char *name,
+                 lldb::SymbolType type = eSymbolTypeAny);
+
     size_t
     GetNumSections ();
     
@@ -173,6 +181,8 @@
     lldb::SBTypeList
     FindTypes (const char* type);
     
+    lldb::SBType
+    GetBasicType(lldb::BasicType type);
     
     //------------------------------------------------------------------
     /// Get the module version numbers.

Modified: lldb/branches/windows/include/lldb/API/SBTarget.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/API/SBTarget.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/API/SBTarget.h (original)
+++ lldb/branches/windows/include/lldb/API/SBTarget.h Tue Jan  8 06:51:53 2013
@@ -17,6 +17,7 @@
 #include "lldb/API/SBFileSpecList.h"
 #include "lldb/API/SBSymbolContextList.h"
 #include "lldb/API/SBType.h"
+#include "lldb/API/SBValue.h"
 #include "lldb/API/SBWatchpoint.h"
 
 namespace lldb {
@@ -235,7 +236,8 @@
     {
         eBroadcastBitBreakpointChanged  = (1 << 0),
         eBroadcastBitModulesLoaded      = (1 << 1),
-        eBroadcastBitModulesUnloaded    = (1 << 2)
+        eBroadcastBitModulesUnloaded    = (1 << 2),
+        eBroadcastBitWatchpointChanged  = (1 << 3)
     };
 
     //------------------------------------------------------------------
@@ -719,6 +721,9 @@
     lldb::SBTypeList
     FindTypes (const char* type);
     
+    lldb::SBType
+    GetBasicType(lldb::BasicType type);
+    
     SBSourceManager
     GetSourceManager();
     
@@ -731,6 +736,10 @@
     lldb::SBInstructionList
     GetInstructions (lldb::addr_t base_addr, const void *buf, size_t size);
 
+    lldb::SBSymbolContextList
+    FindSymbols (const char *name,
+                 lldb::SymbolType type = eSymbolTypeAny);
+
     bool
     operator == (const lldb::SBTarget &rhs) const;
 
@@ -740,6 +749,9 @@
     bool
     GetDescription (lldb::SBStream &description, lldb::DescriptionLevel description_level);
 
+    lldb::SBValue
+    EvaluateExpression (const char *expr, const SBExpressionOptions &options);
+
 protected:
     friend class SBAddress;
     friend class SBBlock;

Modified: lldb/branches/windows/include/lldb/API/SBThread.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/API/SBThread.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/API/SBThread.h (original)
+++ lldb/branches/windows/include/lldb/API/SBThread.h Tue Jan  8 06:51:53 2013
@@ -26,7 +26,8 @@
         eBroadcastBitStackChanged           = (1 << 0),
         eBroadcastBitThreadSuspended        = (1 << 1),
         eBroadcastBitThreadResumed          = (1 << 2),
-        eBroadcastBitSelectedFrameChanged  = (1 << 3)
+        eBroadcastBitSelectedFrameChanged   = (1 << 3),
+        eBroadcastBitThreadSelected         = (1 << 4)
     };
 
     static const char *
@@ -67,6 +68,7 @@
     /// eStopReasonWatchpoint    1     watchpoint id
     /// eStopReasonSignal        1     unix signal number
     /// eStopReasonException     N     exception data
+    /// eStopReasonExec          0
     /// eStopReasonPlanComplete  0
     //--------------------------------------------------------------------------
     uint64_t
@@ -97,6 +99,9 @@
     StepInto (lldb::RunMode stop_other_threads = lldb::eOnlyDuringStepping);
 
     void
+    StepInto (const char *target_name, lldb::RunMode stop_other_threads = lldb::eOnlyDuringStepping);
+    
+    void
     StepOut ();
 
     void

Modified: lldb/branches/windows/include/lldb/API/SBType.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/API/SBType.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/API/SBType.h (original)
+++ lldb/branches/windows/include/lldb/API/SBType.h Tue Jan  8 06:51:53 2013
@@ -108,6 +108,8 @@
     lldb::SBType
     GetUnqualifiedType();
 
+    lldb::SBType
+    GetCanonicalType();
     // Get the "lldb::BasicType" enumeration for a type. If a type is not a basic
     // type eBasicTypeInvalid will be returned
     lldb::BasicType

Modified: lldb/branches/windows/include/lldb/API/SBValue.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/API/SBValue.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/API/SBValue.h (original)
+++ lldb/branches/windows/include/lldb/API/SBValue.h Tue Jan  8 06:51:53 2013
@@ -419,6 +419,7 @@
 protected:
     friend class SBBlock;
     friend class SBFrame;
+    friend class SBTarget;
     friend class SBThread;
     friend class SBValueList;
 

Modified: lldb/branches/windows/include/lldb/API/SBWatchpoint.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/API/SBWatchpoint.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/API/SBWatchpoint.h (original)
+++ lldb/branches/windows/include/lldb/API/SBWatchpoint.h Tue Jan  8 06:51:53 2013
@@ -81,6 +81,15 @@
     void
     SetSP (const lldb::WatchpointSP &sp);
 
+    static bool
+    EventIsWatchpointEvent (const lldb::SBEvent &event);
+    
+    static lldb::WatchpointEventType
+    GetWatchpointEventTypeFromEvent (const lldb::SBEvent& event);
+
+    static lldb::SBWatchpoint
+    GetWatchpointFromEvent (const lldb::SBEvent& event);
+
 private:
     friend class SBTarget;
     friend class SBValue;

Modified: lldb/branches/windows/include/lldb/Breakpoint/Watchpoint.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Breakpoint/Watchpoint.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Breakpoint/Watchpoint.h (original)
+++ lldb/branches/windows/include/lldb/Breakpoint/Watchpoint.h Tue Jan  8 06:51:53 2013
@@ -28,10 +28,54 @@
 namespace lldb_private {
 
 class Watchpoint :
+    public STD_ENABLE_SHARED_FROM_THIS(Watchpoint),
     public StoppointLocation
 {
 public:
 
+    class WatchpointEventData :
+        public EventData
+    {
+    public:
+
+        static const ConstString &
+        GetFlavorString ();
+
+        virtual const ConstString &
+        GetFlavor () const;
+
+        WatchpointEventData (lldb::WatchpointEventType sub_type,
+                             const lldb::WatchpointSP &new_watchpoint_sp);
+
+        virtual
+        ~WatchpointEventData();
+
+        lldb::WatchpointEventType
+        GetWatchpointEventType () const;
+
+        lldb::WatchpointSP &
+        GetWatchpoint ();
+        
+        virtual void
+        Dump (Stream *s) const;
+
+        static lldb::WatchpointEventType
+        GetWatchpointEventTypeFromEvent (const lldb::EventSP &event_sp);
+
+        static lldb::WatchpointSP
+        GetWatchpointFromEvent (const lldb::EventSP &event_sp);
+
+        static const WatchpointEventData *
+        GetEventDataFromEvent (const Event *event_sp);
+
+    private:
+
+        lldb::WatchpointEventType m_watchpoint_event;
+        lldb::WatchpointSP m_new_watchpoint_sp;
+
+        DISALLOW_COPY_AND_ASSIGN (WatchpointEventData);
+    };
+
     Watchpoint (Target& target, lldb::addr_t addr, size_t size, const ClangASTType *type, bool hardware = true);
     ~Watchpoint ();
 
@@ -42,7 +86,7 @@
     IsEnabled () const;
 
     void
-    SetEnabled (bool enabled);
+    SetEnabled (bool enabled, bool notify = true);
 
     virtual bool
     IsHardware () const;
@@ -54,7 +98,7 @@
     bool        WatchpointWrite () const;
     uint32_t    GetIgnoreCount () const;
     void        SetIgnoreCount (uint32_t n);
-    void        SetWatchpointType (uint32_t type);
+    void        SetWatchpointType (uint32_t type, bool notify = true);
     void        SetDeclInfo (const std::string &str);
     std::string GetWatchSpec();
     void        SetWatchSpec (const std::string &str);
@@ -188,10 +232,17 @@
     Error       m_error;               // An error object describing errors associated with this watchpoint.
     WatchpointOptions m_options;       // Settable watchpoint options, which is a delegate to handle
                                        // the callback machinery.
+    bool        m_being_created;
 
     std::auto_ptr<ClangUserExpression> m_condition_ap;  // The condition to test.
 
     void SetID(lldb::watch_id_t id) { m_loc_id = id; }
+    
+    void
+    SendWatchpointChangedEvent (lldb::WatchpointEventType eventKind);
+
+    void
+    SendWatchpointChangedEvent (WatchpointEventData *data);
 
     DISALLOW_COPY_AND_ASSIGN (Watchpoint);
 };

Modified: lldb/branches/windows/include/lldb/Breakpoint/WatchpointList.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Breakpoint/WatchpointList.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Breakpoint/WatchpointList.h (original)
+++ lldb/branches/windows/include/lldb/Breakpoint/WatchpointList.h Tue Jan  8 06:51:53 2013
@@ -58,7 +58,7 @@
     ///    The ID of the Watchpoint in the list.
     //------------------------------------------------------------------
     lldb::watch_id_t
-    Add (const lldb::WatchpointSP& wp_sp);
+    Add (const lldb::WatchpointSP& wp_sp, bool notify);
 
     //------------------------------------------------------------------
     /// Standard "Dump" method.
@@ -180,7 +180,7 @@
     ///   \b true if the watchpoint \a watchID was in the list.
     //------------------------------------------------------------------
     bool
-    Remove (lldb::watch_id_t watchID);
+    Remove (lldb::watch_id_t watchID, bool notify);
 
     //------------------------------------------------------------------
     /// Returns the number hit count of all watchpoints in this list.
@@ -241,7 +241,7 @@
     SetEnabledAll (bool enabled);
 
     void
-    RemoveAll ();
+    RemoveAll (bool notify);
     
     //------------------------------------------------------------------
     /// Sets the passed in Locker to hold the Watchpoint List mutex.

Modified: lldb/branches/windows/include/lldb/Core/ArchSpec.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Core/ArchSpec.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Core/ArchSpec.h (original)
+++ lldb/branches/windows/include/lldb/Core/ArchSpec.h Tue Jan  8 06:51:53 2013
@@ -389,7 +389,7 @@
 
 protected:
     bool
-    Compare (const ArchSpec& rhs, bool exact_match) const;
+    IsEqualTo (const ArchSpec& rhs, bool exact_match) const;
 
     llvm::Triple m_triple;
     Core m_core;
@@ -401,35 +401,6 @@
     CoreUpdated (bool update_triple);
 };
 
-
-//------------------------------------------------------------------
-/// @fn bool operator== (const ArchSpec& lhs, const ArchSpec& rhs)
-/// @brief Equal to operator.
-///
-/// Tests two ArchSpec objects to see if they are equal.
-///
-/// @param[in] lhs The Left Hand Side ArchSpec object to compare.
-/// @param[in] rhs The Left Hand Side ArchSpec object to compare.
-///
-/// Uses the IsExactMatch() method for comparing the cpu types.
-///
-/// @return true if \a lhs is equal to \a rhs
-//------------------------------------------------------------------
-bool operator==(const ArchSpec& lhs, const ArchSpec& rhs);
-
-//------------------------------------------------------------------
-/// @fn bool operator!= (const ArchSpec& lhs, const ArchSpec& rhs)
-/// @brief Not equal to operator.
-///
-/// Tests two ArchSpec objects to see if they are not equal.
-///
-/// @param[in] lhs The Left Hand Side ArchSpec object to compare.
-/// @param[in] rhs The Left Hand Side ArchSpec object to compare.
-///
-/// @return true if \a lhs is not equal to \a rhs
-//------------------------------------------------------------------
-bool operator!=(const ArchSpec& lhs, const ArchSpec& rhs);
-
 //------------------------------------------------------------------
 /// @fn bool operator< (const ArchSpec& lhs, const ArchSpec& rhs)
 /// @brief Less than operator.

Modified: lldb/branches/windows/include/lldb/Core/CXXFormatterFunctions.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Core/CXXFormatterFunctions.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Core/CXXFormatterFunctions.h (original)
+++ lldb/branches/windows/include/lldb/Core/CXXFormatterFunctions.h Tue Jan  8 06:51:53 2013
@@ -297,7 +297,6 @@
         private:
             ExecutionContextRef m_exe_ctx_ref;
             uint8_t m_ptr_size;
-            uint64_t m_items;
             DataDescriptor_32 *m_data_32;
             DataDescriptor_64 *m_data_64;
             std::vector<DictionaryItemDescriptor> m_children;

Modified: lldb/branches/windows/include/lldb/Core/Debugger.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Core/Debugger.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Core/Debugger.h (original)
+++ lldb/branches/windows/include/lldb/Core/Debugger.h Tue Jan  8 06:51:53 2013
@@ -29,6 +29,7 @@
 #include "lldb/Core/SourceManager.h"
 #include "lldb/Core/UserID.h"
 #include "lldb/Core/UserSettingsController.h"
+#include "lldb/Host/Terminal.h"
 #include "lldb/Interpreter/OptionValueProperties.h"
 #include "lldb/Target/ExecutionContext.h"
 #include "lldb/Target/Platform.h"
@@ -115,6 +116,12 @@
 
     void
     SetErrorFileHandle (FILE *fh, bool tranfer_ownership);
+    
+    void
+    SaveInputTerminalState();
+    
+    void
+    RestoreInputTerminalState();
 
     Stream&
     GetOutputStream ()
@@ -350,6 +357,7 @@
     StreamFile m_input_file;
     StreamFile m_output_file;
     StreamFile m_error_file;
+    TerminalState m_terminal_state;
     TargetList m_target_list;
     PlatformList m_platform_list;
     Listener m_listener;
@@ -360,7 +368,7 @@
 
     InputReaderStack m_input_reader_stack;
     std::string m_input_reader_data;
-    typedef std::map<std::string, lldb::StreamSP> LogStreamMap;
+    typedef std::map<std::string, lldb::StreamWP> LogStreamMap;
     LogStreamMap m_log_streams;
     lldb::StreamSP m_log_callback_stream_sp;
     ConstString m_instance_name;

Modified: lldb/branches/windows/include/lldb/Core/Module.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Core/Module.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Core/Module.h (original)
+++ lldb/branches/windows/include/lldb/Core/Module.h Tue Jan  8 06:51:53 2013
@@ -173,8 +173,9 @@
     virtual void
     DumpSymbolContext (Stream *s);
 
+    
     //------------------------------------------------------------------
-    /// Find a symbol in the object files symbol table.
+    /// Find a symbol in the object file's symbol table.
     ///
     /// @param[in] name
     ///     The name of the symbol that we are looking for.
@@ -204,6 +205,28 @@
                                      SymbolContextList &sc_list);
 
     //------------------------------------------------------------------
+    /// Find a funciton symbols in the object file's symbol table.
+    ///
+    /// @param[in] name
+    ///     The name of the symbol that we are looking for.
+    ///
+    /// @param[in] name_type_mask
+    ///     A mask that has one or more bitwise OR'ed values from the
+    ///     lldb::FunctionNameType enumeration type that indicate what
+    ///     kind of names we are looking for.
+    ///
+    /// @param[out] sc_list
+    ///     A list to append any matching symbol contexts to.
+    ///
+    /// @return
+    ///     The number of symbol contexts that were added to \a sc_list
+    //------------------------------------------------------------------
+    size_t
+    FindFunctionSymbols (const ConstString &name,
+                         uint32_t name_type_mask,
+                         SymbolContextList& sc_list);
+
+    //------------------------------------------------------------------
     /// Find compile units by partial or full path.
     ///
     /// Finds all compile units that match \a path in all of the modules
@@ -408,6 +431,11 @@
                uint32_t max_matches,
                TypeList& types);
 
+    lldb::TypeSP
+    FindFirstType (const SymbolContext& sc,
+                   const ConstString &type_name,
+                   bool exact_match);
+
     //------------------------------------------------------------------
     /// Find types by name that are in a namespace. This function is
     /// used by the expression parser when searches need to happen in
@@ -598,7 +626,8 @@
     ///     object and remains valid as long as the object is around.
     //------------------------------------------------------------------
     virtual SymbolVendor*
-    GetSymbolVendor(bool can_create = true);
+    GetSymbolVendor(bool can_create = true,
+                    lldb_private::Stream *feedback_strm = NULL);
 
     //------------------------------------------------------------------
     /// Get accessor the type list for this module.

Modified: lldb/branches/windows/include/lldb/Core/ValueObject.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Core/ValueObject.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Core/ValueObject.h (original)
+++ lldb/branches/windows/include/lldb/Core/ValueObject.h Tue Jan  8 06:51:53 2013
@@ -613,6 +613,9 @@
     IsPossibleDynamicType ();
 
     virtual bool
+    IsObjCNil ();
+    
+    virtual bool
     IsBaseClass ()
     {
         return false;

Modified: lldb/branches/windows/include/lldb/Expression/ClangExpressionDeclMap.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Expression/ClangExpressionDeclMap.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Expression/ClangExpressionDeclMap.h (original)
+++ lldb/branches/windows/include/lldb/Expression/ClangExpressionDeclMap.h Tue Jan  8 06:51:53 2013
@@ -840,7 +840,7 @@
     /// @return
     ///     The LLDB Symbol found, or NULL if none was found.
     //---------------------------------------------------------
-    Symbol *
+    const Symbol *
     FindGlobalDataSymbol (Target &target,
                           const ConstString &name);
     
@@ -958,7 +958,7 @@
     //------------------------------------------------------------------
     void
     AddOneGenericVariable (NameSearchContext &context,
-                           Symbol &symbol,
+                           const Symbol &symbol,
                            unsigned int current_id);
     
     //------------------------------------------------------------------

Modified: lldb/branches/windows/include/lldb/Expression/ClangExpressionVariable.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Expression/ClangExpressionVariable.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Expression/ClangExpressionVariable.h (original)
+++ lldb/branches/windows/include/lldb/Expression/ClangExpressionVariable.h Tue Jan  8 06:51:53 2013
@@ -108,7 +108,7 @@
         llvm::Value            *m_llvm_value;   ///< The IR value corresponding to this variable; usually a GlobalValue
         lldb_private::Value    *m_lldb_value;   ///< The value found in LLDB for this variable
         lldb::VariableSP        m_lldb_var;     ///< The original variable for this variable
-        lldb_private::Symbol   *m_lldb_sym;     ///< The original symbol for this variable, if it was a symbol
+        const lldb_private::Symbol *m_lldb_sym; ///< The original symbol for this variable, if it was a symbol
 
     private:
         DISALLOW_COPY_AND_ASSIGN (ParserVars);

Modified: lldb/branches/windows/include/lldb/Expression/IRInterpreter.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Expression/IRInterpreter.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Expression/IRInterpreter.h (original)
+++ lldb/branches/windows/include/lldb/Expression/IRInterpreter.h Tue Jan  8 06:51:53 2013
@@ -95,7 +95,6 @@
 private:
     /// Flags
     lldb_private::ClangExpressionDeclMap &m_decl_map;       ///< The DeclMap containing the Decls 
-    lldb_private::Stream *m_error_stream;
     
     bool
     supportsFunction (llvm::Function &llvm_function,

Modified: lldb/branches/windows/include/lldb/Host/Mutex.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Host/Mutex.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Host/Mutex.h (original)
+++ lldb/branches/windows/include/lldb/Host/Mutex.h Tue Jan  8 06:51:53 2013
@@ -204,6 +204,9 @@
     /// @return
     ///     The error code from \c pthread_mutex_lock().
     //------------------------------------------------------------------
+#ifdef LLDB_CONFIGURATION_DEBUG
+    virtual
+#endif
     int
     Lock();
 
@@ -303,6 +306,27 @@
     pthread_t m_thread_that_tried;
     std::string m_failure_message;
 };
+
+class LoggingMutex : public Mutex
+{
+public:
+    LoggingMutex() : Mutex(),m_locked(false)  {}
+    LoggingMutex(Mutex::Type type) : Mutex (type),m_locked(false) {}
+    
+    virtual
+    ~LoggingMutex() {}
+    
+    virtual int
+    Lock ();
+    
+    virtual int
+    Unlock ();
+    
+    virtual int
+    TryLock (const char *failure_message = NULL);
+protected:
+    bool m_locked;
+};
 #endif
 
 } // namespace lldb_private

Modified: lldb/branches/windows/include/lldb/Host/Terminal.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Host/Terminal.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Host/Terminal.h (original)
+++ lldb/branches/windows/include/lldb/Host/Terminal.h Tue Jan  8 06:51:53 2013
@@ -132,6 +132,9 @@
     //------------------------------------------------------------------
     bool
     IsValid() const;
+    
+    void
+    Clear ();
 
 protected:
 

Modified: lldb/branches/windows/include/lldb/Interpreter/Args.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Interpreter/Args.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Interpreter/Args.h (original)
+++ lldb/branches/windows/include/lldb/Interpreter/Args.h Tue Jan  8 06:51:53 2013
@@ -379,7 +379,10 @@
     }
 
     static lldb::addr_t
-    StringToAddress (const char *s, lldb::addr_t fail_value = LLDB_INVALID_ADDRESS, bool *success_ptr = NULL);
+    StringToAddress (const ExecutionContext *exe_ctx,
+                     const char *s,
+                     lldb::addr_t fail_value,
+                     Error *error);
 
     static bool
     StringToBoolean (const char *s, bool fail_value, bool *success_ptr);

Modified: lldb/branches/windows/include/lldb/Interpreter/CommandInterpreter.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Interpreter/CommandInterpreter.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Interpreter/CommandInterpreter.h (original)
+++ lldb/branches/windows/include/lldb/Interpreter/CommandInterpreter.h Tue Jan  8 06:51:53 2013
@@ -391,20 +391,6 @@
     const char *
     FindHistoryString (const char *input_str) const;
 
-
-#ifndef SWIG
-    void
-    AddLogChannel (const char *name, 
-                   const Log::Callbacks &log_callbacks);
-
-    bool
-    GetLogChannelCallbacks (const char *channel, 
-                            Log::Callbacks &log_callbacks);
-
-    bool
-    RemoveLogChannel (const char *name);
-#endif
-
     size_t
     FindLongestCommandWord (CommandObject::CommandMap &dict);
 

Modified: lldb/branches/windows/include/lldb/Interpreter/CommandReturnObject.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Interpreter/CommandReturnObject.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Interpreter/CommandReturnObject.h (original)
+++ lldb/branches/windows/include/lldb/Interpreter/CommandReturnObject.h Tue Jan  8 06:51:53 2013
@@ -118,7 +118,7 @@
     Clear();
 
     void
-    AppendMessage (const char *in_string, int len = -1);
+    AppendMessage (const char *in_string);
 
     void
     AppendMessageWithFormat (const char *format, ...)  LLDB_ATTR(__attribute__ ((format (printf, 2, 3))));
@@ -127,13 +127,13 @@
     AppendRawWarning (const char *in_string, int len = -1);
 
     void
-    AppendWarning (const char *in_string, int len = -1);
+    AppendWarning (const char *in_string);
 
     void
     AppendWarningWithFormat (const char *format, ...)  LLDB_ATTR(__attribute__ ((format (printf, 2, 3))));
 
     void
-    AppendError (const char *in_string, int len = -1);
+    AppendError (const char *in_string);
 
     void
     AppendRawError (const char *in_string, int len = -1);

Modified: lldb/branches/windows/include/lldb/Interpreter/OptionGroupBoolean.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Interpreter/OptionGroupBoolean.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Interpreter/OptionGroupBoolean.h (original)
+++ lldb/branches/windows/include/lldb/Interpreter/OptionGroupBoolean.h Tue Jan  8 06:51:53 2013
@@ -31,7 +31,7 @@
         OptionGroupBoolean (uint32_t usage_mask,
                             bool required,
                             const char *long_option, 
-                            char short_option,
+                            int short_option,
                             const char *usage_text,
                             bool default_value,
                             bool no_argument_toggle_default);

Modified: lldb/branches/windows/include/lldb/Interpreter/OptionGroupFile.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Interpreter/OptionGroupFile.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Interpreter/OptionGroupFile.h (original)
+++ lldb/branches/windows/include/lldb/Interpreter/OptionGroupFile.h Tue Jan  8 06:51:53 2013
@@ -31,7 +31,7 @@
     OptionGroupFile (uint32_t usage_mask,
                      bool required,
                      const char *long_option, 
-                     char short_option,
+                     int short_option,
                      uint32_t completion_type,
                      lldb::CommandArgumentType argument_type,
                      const char *usage_text);
@@ -89,7 +89,7 @@
     OptionGroupFileList (uint32_t usage_mask,
                          bool required,
                          const char *long_option, 
-                         char short_option,
+                         int short_option,
                          uint32_t completion_type,
                          lldb::CommandArgumentType argument_type,
                          const char *usage_text);

Modified: lldb/branches/windows/include/lldb/Interpreter/OptionGroupFormat.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Interpreter/OptionGroupFormat.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Interpreter/OptionGroupFormat.h (original)
+++ lldb/branches/windows/include/lldb/Interpreter/OptionGroupFormat.h Tue Jan  8 06:51:53 2013
@@ -109,7 +109,10 @@
 protected:
 
     bool
-    ParserGDBFormatLetter (char format_letter, lldb::Format &format, uint32_t &byte_size);
+    ParserGDBFormatLetter (CommandInterpreter &interpreter,
+                           char format_letter,
+                           lldb::Format &format,
+                           uint32_t &byte_size);
 
     OptionValueFormat m_format;
     OptionValueUInt64 m_byte_size;

Modified: lldb/branches/windows/include/lldb/Interpreter/OptionGroupString.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Interpreter/OptionGroupString.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Interpreter/OptionGroupString.h (original)
+++ lldb/branches/windows/include/lldb/Interpreter/OptionGroupString.h Tue Jan  8 06:51:53 2013
@@ -29,7 +29,7 @@
         OptionGroupString (uint32_t usage_mask,
                            bool required,
                            const char *long_option, 
-                           char short_option,
+                           int short_option,
                            uint32_t completion_type,
                            lldb::CommandArgumentType argument_type,
                            const char *usage_text,

Modified: lldb/branches/windows/include/lldb/Interpreter/OptionGroupUInt64.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Interpreter/OptionGroupUInt64.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Interpreter/OptionGroupUInt64.h (original)
+++ lldb/branches/windows/include/lldb/Interpreter/OptionGroupUInt64.h Tue Jan  8 06:51:53 2013
@@ -29,7 +29,7 @@
         OptionGroupUInt64 (uint32_t usage_mask,
                            bool required,
                            const char *long_option, 
-                           char short_option,
+                           int short_option,
                            uint32_t completion_type,
                            lldb::CommandArgumentType argument_type,
                            const char *usage_text,

Modified: lldb/branches/windows/include/lldb/Interpreter/OptionValueString.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Interpreter/OptionValueString.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Interpreter/OptionValueString.h (original)
+++ lldb/branches/windows/include/lldb/Interpreter/OptionValueString.h Tue Jan  8 06:51:53 2013
@@ -24,6 +24,10 @@
 class OptionValueString : public OptionValue
 {
 public:
+    
+    typedef Error (*ValidatorCallback) (const char* string,
+                                        void* baton);
+    
     enum Options
     {
         eOptionEncodeCharacterEscapeSequences = (1u << 0)
@@ -33,7 +37,20 @@
         OptionValue(),
         m_current_value (),
         m_default_value (),
-        m_options()
+        m_options(),
+        m_validator(),
+        m_validator_baton()
+    {
+    }
+    
+    OptionValueString (ValidatorCallback validator,
+                       void* baton = NULL) :
+        OptionValue(),
+        m_current_value (),
+        m_default_value (),
+        m_options(),
+        m_validator(validator),
+        m_validator_baton(baton)
     {
     }
 
@@ -41,7 +58,9 @@
         OptionValue(),
         m_current_value (),
         m_default_value (),
-        m_options()
+        m_options(),
+        m_validator(),
+        m_validator_baton()
     {
         if  (value && value[0])
         {
@@ -55,7 +74,9 @@
         OptionValue(),
         m_current_value (),
         m_default_value (),
-        m_options()
+        m_options(),
+        m_validator(),
+        m_validator_baton()
     {
         if  (current_value && current_value[0])
             m_current_value.assign (current_value);
@@ -63,7 +84,41 @@
             m_default_value.assign (default_value);
     }
     
-    virtual 
+    OptionValueString (const char *value,
+                       ValidatorCallback validator,
+                       void* baton = NULL) :
+    OptionValue(),
+    m_current_value (),
+    m_default_value (),
+    m_options(),
+    m_validator(validator),
+    m_validator_baton(baton)
+    {
+        if  (value && value[0])
+        {
+            m_current_value.assign (value);
+            m_default_value.assign (value);
+        }
+    }
+    
+    OptionValueString (const char *current_value,
+                       const char *default_value,
+                       ValidatorCallback validator,
+                       void* baton = NULL) :
+    OptionValue(),
+    m_current_value (),
+    m_default_value (),
+    m_options(),
+    m_validator(validator),
+    m_validator_baton(baton)
+    {
+        if  (current_value && current_value[0])
+            m_current_value.assign (current_value);
+        if  (default_value && default_value[0])
+            m_default_value.assign (default_value);
+    }
+    
+    virtual
     ~OptionValueString()
     {
     }
@@ -115,10 +170,7 @@
     const char *
     operator = (const char *value)
     {
-        if (value && value[0])
-            m_current_value.assign (value);
-        else
-            m_current_value.clear();
+        SetCurrentValue(value);
         return m_current_value.c_str();
     }
 
@@ -134,21 +186,11 @@
         return m_default_value.c_str();
     }
     
-    void
-    SetCurrentValue (const char *value)
-    {
-        if (value && value[0])
-            m_current_value.assign (value);
-        else
-            m_current_value.clear();
-    }
-
-    void
-    AppendToCurrentValue (const char *value)
-    {
-        if (value && value[0])
-            m_current_value.append (value);
-    }
+    Error
+    SetCurrentValue (const char *value);
+    
+    Error
+    AppendToCurrentValue (const char *value);
 
     void
     SetDefaultValue (const char *value)
@@ -176,6 +218,8 @@
     std::string m_current_value;
     std::string m_default_value;
     Flags m_options;
+    ValidatorCallback m_validator;
+    void* m_validator_baton;
 };
 
 } // namespace lldb_private

Modified: lldb/branches/windows/include/lldb/Interpreter/Options.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Interpreter/Options.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Interpreter/Options.h (original)
+++ lldb/branches/windows/include/lldb/Interpreter/Options.h Tue Jan  8 06:51:53 2013
@@ -27,6 +27,15 @@
 
 namespace lldb_private {
 
+  static inline bool
+  isprint8 (int ch)
+  {
+      if (ch & 0xffffff00u)
+          return false;
+      return isprint(ch);
+  }
+
+
 //----------------------------------------------------------------------
 /// @class Options Options.h "lldb/Interpreter/Options.h"
 /// @brief A command line option parsing protocol class.
@@ -298,7 +307,7 @@
     
 protected:
     // This is a set of options expressed as indexes into the options table for this Option.
-    typedef std::set<char> OptionSet;
+    typedef std::set<int> OptionSet;
     typedef std::vector<OptionSet> OptionSetVector;
 
     CommandInterpreter &m_interpreter;

Modified: lldb/branches/windows/include/lldb/Interpreter/ScriptInterpreter.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Interpreter/ScriptInterpreter.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Interpreter/ScriptInterpreter.h (original)
+++ lldb/branches/windows/include/lldb/Interpreter/ScriptInterpreter.h Tue Jan  8 06:51:53 2013
@@ -41,6 +41,11 @@
         return m_object;
     }
     
+    operator bool ()
+    {
+        return m_object != NULL;
+    }
+    
     ScriptInterpreterObject&
     operator = (const ScriptInterpreterObject& rhs)
     {
@@ -373,6 +378,12 @@
 		dest.clear();
         return false;
     }
+    
+    virtual bool
+    CheckObjectExists (const char* name)
+    {
+        return false;
+    }
 
     virtual bool
     LoadScriptingModule (const char* filename,

Modified: lldb/branches/windows/include/lldb/Interpreter/ScriptInterpreterPython.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Interpreter/ScriptInterpreterPython.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Interpreter/ScriptInterpreterPython.h (original)
+++ lldb/branches/windows/include/lldb/Interpreter/ScriptInterpreterPython.h Tue Jan  8 06:51:53 2013
@@ -159,6 +159,15 @@
     GetDocumentationForItem (const char* item, std::string& dest);
     
     virtual bool
+    CheckObjectExists (const char* name)
+    {
+        if (!name || !name[0])
+            return false;
+        std::string temp;
+        return GetDocumentationForItem (name,temp);
+    }
+    
+    virtual bool
     LoadScriptingModule (const char* filename,
                          bool can_reload,
                          bool init_session,
@@ -203,7 +212,7 @@
 protected:
 
     void
-    EnterSession ();
+    EnterSession (bool init_lldb_globals);
     
     void
     LeaveSession ();
@@ -241,6 +250,12 @@
             Py_XINCREF(m_object);
         }
         
+        operator bool ()
+        {
+            return m_object && m_object != Py_None;
+        }
+        
+        
         virtual
         ~ScriptInterpreterPythonObject()
         {
@@ -258,7 +273,8 @@
         enum OnEntry
         {
             AcquireLock         = 0x0001,
-            InitSession         = 0x0002
+            InitSession         = 0x0002,
+            InitGlobals         = 0x0004
         };
         
         enum OnLeave
@@ -281,7 +297,7 @@
         DoAcquireLock ();
         
         bool
-        DoInitSession ();
+        DoInitSession (bool init_lldb_globals);
         
         bool
         DoFreeLock ();
@@ -350,6 +366,7 @@
     bool m_session_is_active;
     bool m_pty_slave_is_open;
     bool m_valid_session;
+    PyThreadState *m_command_thread_state;
 };
 } // namespace lldb_private
 

Modified: lldb/branches/windows/include/lldb/Symbol/ClangASTContext.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Symbol/ClangASTContext.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Symbol/ClangASTContext.h (original)
+++ lldb/branches/windows/include/lldb/Symbol/ClangASTContext.h Tue Jan  8 06:51:53 2013
@@ -785,9 +785,8 @@
     //------------------------------------------------------------------
 
     lldb::clang_type_t
-    CreateArrayType (lldb::clang_type_t  element_type,
-                     size_t element_count,
-                     uint32_t bit_stride);
+    CreateArrayType (lldb::clang_type_t element_type,
+                     size_t element_count);
 
     //------------------------------------------------------------------
     // Tag Declarations
@@ -887,15 +886,17 @@
     
     static lldb::clang_type_t
     GetAsArrayType (lldb::clang_type_t clang_type, 
-                    lldb::clang_type_t *member_type = NULL, 
-                    uint64_t *size = NULL);
+                    lldb::clang_type_t *member_type,
+                    uint64_t *size,
+                    bool *is_incomplete);
     
     static bool
     IsArrayType (lldb::clang_type_t clang_type,
-                 lldb::clang_type_t *member_type = NULL,
-                 uint64_t *size = NULL)
+                 lldb::clang_type_t *member_type,
+                 uint64_t *size,
+                 bool *is_incomplete)
     {
-        return GetAsArrayType(clang_type, member_type, size) != 0;
+        return GetAsArrayType(clang_type, member_type, size, is_incomplete) != 0;
     }
 
     //------------------------------------------------------------------

Modified: lldb/branches/windows/include/lldb/Symbol/ClangASTType.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Symbol/ClangASTType.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Symbol/ClangASTType.h (original)
+++ lldb/branches/windows/include/lldb/Symbol/ClangASTType.h Tue Jan  8 06:51:53 2013
@@ -82,6 +82,15 @@
     ConstString
     GetConstQualifiedTypeName ();
 
+    static lldb::BasicType
+    GetBasicTypeEnumeration (const ConstString &name);
+
+    static ClangASTType
+    GetBasicType (clang::ASTContext *ast, lldb::BasicType type);
+
+    static ClangASTType
+    GetBasicType (clang::ASTContext *ast, const ConstString &name);
+
     static ConstString
     GetConstTypeName (clang::ASTContext *ast,
                       lldb::clang_type_t clang_type);

Modified: lldb/branches/windows/include/lldb/Symbol/LineTable.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Symbol/LineTable.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Symbol/LineTable.h (original)
+++ lldb/branches/windows/include/lldb/Symbol/LineTable.h Tue Jan  8 06:51:53 2013
@@ -16,10 +16,30 @@
 #include "lldb/Symbol/LineEntry.h"
 #include "lldb/Core/ModuleChild.h"
 #include "lldb/Core/Section.h"
+#include "lldb/Core/RangeMap.h"
 
 namespace lldb_private {
 
 //----------------------------------------------------------------------
+/// @class LineSequence LineTable.h "lldb/Symbol/LineTable.h"
+/// @brief An abstract base class used during symbol table creation.
+//----------------------------------------------------------------------
+class LineSequence
+{
+public:
+    LineSequence ();
+
+    virtual
+    ~LineSequence() {}
+
+    virtual void
+    Clear() = 0;
+
+private:
+    DISALLOW_COPY_AND_ASSIGN (LineSequence);
+};
+
+//----------------------------------------------------------------------
 /// @class LineTable LineTable.h "lldb/Symbol/LineTable.h"
 /// @brief A line table class.
 //----------------------------------------------------------------------
@@ -53,19 +73,6 @@
 //  void
 //  AddLineEntry (const LineEntry& line_entry);
 
-    // Called when you can guarantee the addresses are in increasing order
-    void
-    AppendLineEntry (const lldb::SectionSP& section_sp,
-                     lldb::addr_t section_offset,
-                     uint32_t line,
-                     uint16_t column,
-                     uint16_t file_idx,
-                     bool is_start_of_statement,
-                     bool is_start_of_basic_block,
-                     bool is_prologue_end,
-                     bool is_epilogue_begin,
-                     bool is_terminal_entry);
-
     // Called when you can't guarantee the addresses are in increasing order
     void
     InsertLineEntry (const lldb::SectionSP& section_sp,
@@ -79,6 +86,29 @@
                      bool is_epilogue_begin,
                      bool is_terminal_entry);
 
+    // Used to instantiate the LineSequence helper classw
+    LineSequence*
+    CreateLineSequenceContainer ();
+
+    // Append an entry to a caller-provided collection that will later be
+    // inserted in this line table.
+    void
+    AppendLineEntryToSequence (LineSequence* sequence,
+                               const lldb::SectionSP& section_sp,
+                               lldb::addr_t section_offset,
+                               uint32_t line,
+                               uint16_t column,
+                               uint16_t file_idx,
+                               bool is_start_of_statement,
+                               bool is_start_of_basic_block,
+                               bool is_prologue_end,
+                               bool is_epilogue_begin,
+                               bool is_terminal_entry);
+
+    // Insert a sequence of entries into this line table.
+    void
+    InsertSequence (LineSequence* sequence);
+
     //------------------------------------------------------------------
     /// Dump all line entries in this line table to the stream \a s.
     ///
@@ -204,6 +234,25 @@
     uint32_t
     GetSize () const;
 
+    typedef lldb_private::RangeArray<lldb::addr_t, lldb::addr_t, 32> FileAddressRanges;
+    
+    //------------------------------------------------------------------
+    /// Gets all contiguous file address ranges for the entire line table.
+    ///
+    /// @param[out] file_ranges
+    ///     A collection of file address ranges that will be filled in
+    ///     by this function.
+    ///
+    /// @param[out] append
+    ///     If \b true, then append to \a file_ranges, otherwise clear
+    ///     \a file_ranges prior to adding any ranges. 
+    ///
+    /// @return
+    ///     The number of address ranges added to \a file_ranges
+    //------------------------------------------------------------------
+    size_t
+    GetContiguousFileAddressRanges (FileAddressRanges &file_ranges, bool append);
+
 protected:
 
     struct Entry
@@ -331,15 +380,35 @@
     //------------------------------------------------------------------
     // Types
     //------------------------------------------------------------------
-    typedef std::vector<lldb_private::Section*> section_collection; ///< The collection type for the line entries.
-    typedef std::vector<Entry> entry_collection;    ///< The collection type for the line entries.
+    typedef std::vector<lldb_private::Section*> section_collection; ///< The collection type for the sections.
+    typedef std::vector<Entry>                  entry_collection;   ///< The collection type for the line entries.
     //------------------------------------------------------------------
     // Member variables.
     //------------------------------------------------------------------
-    CompileUnit* m_comp_unit;       ///< The compile unit that this line table belongs to.
+    CompileUnit* m_comp_unit;   ///< The compile unit that this line table belongs to.
     SectionList m_section_list; ///< The list of sections that at least one of the line entries exists in.
     entry_collection m_entries; ///< The collection of line entries in this line table.
 
+    //------------------------------------------------------------------
+    // Helper class
+    //------------------------------------------------------------------
+    class LineSequenceImpl : public LineSequence
+    {
+    public:
+        LineSequenceImpl() :
+            LineSequence()
+        {}
+
+        virtual
+        ~LineSequenceImpl()
+        {}
+
+        virtual void
+        Clear();
+
+        entry_collection m_seq_entries; ///< The collection of line entries in this sequence.
+    };
+
     bool
     ConvertEntryAtIndexToLineEntry (uint32_t idx, LineEntry &line_entry);
 

Modified: lldb/branches/windows/include/lldb/Symbol/Symbol.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Symbol/Symbol.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Symbol/Symbol.h (original)
+++ lldb/branches/windows/include/lldb/Symbol/Symbol.h Tue Jan  8 06:51:53 2013
@@ -250,6 +250,17 @@
     uint32_t
     GetPrologueByteSize ();
 
+    bool
+    GetDemangledNameIsSynthesized() const
+    {
+        return m_demangled_is_synthesized;
+    }
+    void
+    SetDemangledNameIsSynthesized(bool b)
+    {
+        m_demangled_is_synthesized = b;
+    }
+
     //------------------------------------------------------------------
     /// @copydoc SymbolContextScope::CalculateSymbolContext(SymbolContext*)
     ///
@@ -284,6 +295,7 @@
                     m_size_is_sibling:1,    // m_size contains the index of this symbol's sibling
                     m_size_is_synthesized:1,// non-zero if this symbol's size was calculated using a delta between this symbol and the next
                     m_calculated_size:1,
+                    m_demangled_is_synthesized:1, // The demangled name was created should not be used for expressions or other lookups
                     m_type:8;
     uint32_t        m_flags;                // A copy of the flags from the original symbol table, the ObjectFile plug-in can interpret these
     AddressRange    m_addr_range;           // Contains the value, or the section offset address when the value is an address in a section, and the size (if any)

Modified: lldb/branches/windows/include/lldb/Symbol/SymbolVendor.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Symbol/SymbolVendor.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Symbol/SymbolVendor.h (original)
+++ lldb/branches/windows/include/lldb/Symbol/SymbolVendor.h Tue Jan  8 06:51:53 2013
@@ -46,7 +46,8 @@
 
 
     static SymbolVendor*
-    FindPlugin (const lldb::ModuleSP &module_sp);
+    FindPlugin (const lldb::ModuleSP &module_sp,
+                lldb_private::Stream *feedback_strm);
 
     //------------------------------------------------------------------
     // Constructors and Destructors

Modified: lldb/branches/windows/include/lldb/Symbol/Symtab.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Symbol/Symtab.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Symbol/Symtab.h (original)
+++ lldb/branches/windows/include/lldb/Symbol/Symtab.h Tue Jan  8 06:51:53 2013
@@ -56,7 +56,6 @@
             Symbol *    SymbolAtIndex (uint32_t idx);
     const   Symbol *    SymbolAtIndex (uint32_t idx) const;
             Symbol *    FindSymbolWithType (lldb::SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility, uint32_t &start_idx);
-//    const   Symbol *    FindSymbolWithType (lldb::SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility, uint32_t &start_idx) const;
             uint32_t    AppendSymbolIndexesWithType (lldb::SymbolType symbol_type, std::vector<uint32_t>& indexes, uint32_t start_idx = 0, uint32_t end_index = UINT32_MAX) const;
             uint32_t    AppendSymbolIndexesWithTypeAndFlagsValue (lldb::SymbolType symbol_type, uint32_t flags_value, std::vector<uint32_t>& indexes, uint32_t start_idx = 0, uint32_t end_index = UINT32_MAX) const;
             uint32_t    AppendSymbolIndexesWithType (lldb::SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility, std::vector<uint32_t>& matches, uint32_t start_idx = 0, uint32_t end_index = UINT32_MAX) const;
@@ -71,10 +70,9 @@
             size_t      FindAllSymbolsMatchingRexExAndType (const RegularExpression &regex, lldb::SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility, std::vector<uint32_t>& symbol_indexes);
             Symbol *    FindFirstSymbolWithNameAndType (const ConstString &name, lldb::SymbolType symbol_type, Debug symbol_debug_type, Visibility symbol_visibility);
             Symbol *    FindSymbolWithFileAddress (lldb::addr_t file_addr);
-//            Symbol *    FindSymbolContainingAddress (const Address& value, const uint32_t* indexes, uint32_t num_indexes);
-//            Symbol *    FindSymbolContainingAddress (const Address& value);
             Symbol *    FindSymbolContainingFileAddress (lldb::addr_t file_addr, const uint32_t* indexes, uint32_t num_indexes);
             Symbol *    FindSymbolContainingFileAddress (lldb::addr_t file_addr);
+            size_t      FindFunctionSymbols (const ConstString &name, uint32_t name_type_mask, SymbolContextList& sc_list);
             size_t      CalculateSymbolSize (Symbol *symbol);
 
             void        SortSymbolIndexesByValue (std::vector<uint32_t>& indexes, bool remove_duplicates) const;
@@ -109,6 +107,7 @@
     collection          m_symbols;
     std::vector<uint32_t> m_addr_indexes;
     UniqueCStringMap<uint32_t> m_name_to_index;
+    UniqueCStringMap<uint32_t> m_selector_to_index;
     mutable Mutex       m_mutex; // Provide thread safety for this symbol table
     bool                m_addr_indexes_computed:1,
                         m_name_indexes_computed:1;
@@ -147,6 +146,9 @@
         return false;
     }
 
+    void
+    SymbolIndicesToSymbolContextList (std::vector<uint32_t> &symbol_indexes,
+                                      SymbolContextList &sc_list);
 
     DISALLOW_COPY_AND_ASSIGN (Symtab);
 };

Modified: lldb/branches/windows/include/lldb/Symbol/TypeVendor.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Symbol/TypeVendor.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Symbol/TypeVendor.h (original)
+++ lldb/branches/windows/include/lldb/Symbol/TypeVendor.h Tue Jan  8 06:51:53 2013
@@ -10,6 +10,8 @@
 #ifndef liblldb_TypeVendor_h_
 #define liblldb_TypeVendor_h_
 
+#include "lldb/Core/ClangForward.h"
+
 namespace lldb_private {
     
 //----------------------------------------------------------------------
@@ -37,6 +39,9 @@
                bool append,
                uint32_t max_matches,
                std::vector <ClangASTType> &types) = 0;
+    
+    virtual clang::ASTContext *
+    GetClangASTContext () = 0;
 
 protected:
     //------------------------------------------------------------------

Modified: lldb/branches/windows/include/lldb/Symbol/VariableList.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Symbol/VariableList.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Symbol/VariableList.h (original)
+++ lldb/branches/windows/include/lldb/Symbol/VariableList.h Tue Jan  8 06:51:53 2013
@@ -42,7 +42,7 @@
     Dump(Stream *s, bool show_context) const;
 
     lldb::VariableSP
-    GetVariableAtIndex(uint32_t idx);
+    GetVariableAtIndex(uint32_t idx) const;
 
     lldb::VariableSP
     RemoveVariableAtIndex (uint32_t idx);

Modified: lldb/branches/windows/include/lldb/Target/DynamicLoader.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Target/DynamicLoader.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Target/DynamicLoader.h (original)
+++ lldb/branches/windows/include/lldb/Target/DynamicLoader.h Tue Jan  8 06:51:53 2013
@@ -93,7 +93,20 @@
     DidLaunch () = 0;
     
     
-
+    //------------------------------------------------------------------
+    /// Helper function that can be used to detect when a process has
+    /// called exec and is now a new and different process. This can
+    /// be called when necessary to try and detect the exec. The process
+    /// might be able to answer this question, but sometimes it might
+    /// not be able and the dynamic loader often knows what the program
+    /// entry point is. So the process and the dynamic loader can work
+    /// together to detect this.
+    //------------------------------------------------------------------
+    virtual bool
+    ProcessDidExec ()
+    {
+        return false;
+    }
     //------------------------------------------------------------------
     /// Get whether the process should stop when images change.
     ///

Modified: lldb/branches/windows/include/lldb/Target/Process.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Target/Process.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Target/Process.h (original)
+++ lldb/branches/windows/include/lldb/Target/Process.h Tue Jan  8 06:51:53 2013
@@ -2061,6 +2061,27 @@
 
 
     //------------------------------------------------------------------
+    /// Called after a process re-execs itself.
+    ///
+    /// Allow Process plug-ins to execute some code after a process has
+    /// exec'ed itself. Subclasses typically should override DoDidExec()
+    /// as the lldb_private::Process class needs to remove its dynamic
+    /// loader, runtime, ABI and other plug-ins, as well as unload all
+    /// shared libraries.
+    //------------------------------------------------------------------
+    virtual void
+    DidExec ();
+
+    //------------------------------------------------------------------
+    /// Subclasses of Process should implement this function if they
+    /// need to do anything after a process exec's itself.
+    //------------------------------------------------------------------
+    virtual void
+    DoDidExec ()
+    {
+    }
+
+    //------------------------------------------------------------------
     /// Called before launching to a process.
     ///
     /// Allow Process plug-ins to execute some code before launching a
@@ -3098,10 +3119,10 @@
     // Process Watchpoints (optional)
     //----------------------------------------------------------------------
     virtual Error
-    EnableWatchpoint (Watchpoint *wp);
+    EnableWatchpoint (Watchpoint *wp, bool notify = true);
 
     virtual Error
-    DisableWatchpoint (Watchpoint *wp);
+    DisableWatchpoint (Watchpoint *wp, bool notify = true);
 
     //------------------------------------------------------------------
     // Thread Queries
@@ -3467,7 +3488,7 @@
     std::string                 m_stdout_data;
     std::string                 m_stderr_data;
     Mutex                       m_profile_data_comm_mutex;
-    std::string                 m_profile_data;
+    std::vector<std::string>    m_profile_data;
     MemoryCache                 m_memory_cache;
     AllocatedMemoryCache        m_allocated_memory_cache;
     bool                        m_should_detach;   /// Should we detach if the process object goes away with an explicit call to Kill or Detach?

Modified: lldb/branches/windows/include/lldb/Target/StopInfo.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Target/StopInfo.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Target/StopInfo.h (original)
+++ lldb/branches/windows/include/lldb/Target/StopInfo.h Tue Jan  8 06:51:53 2013
@@ -23,7 +23,7 @@
 
 class StopInfo
 {
-    friend Process::ProcessEventData;
+    friend class Process::ProcessEventData;
     friend class ThreadPlanBase;
     
 public:
@@ -129,6 +129,9 @@
     static lldb::StopInfoSP
     CreateStopReasonWithException (Thread &thread, const char *description);
     
+    static lldb::StopInfoSP
+    CreateStopReasonWithExec (Thread &thread);
+
     static lldb::ValueObjectSP
     GetReturnValueObject (lldb::StopInfoSP &stop_info_sp);
 

Modified: lldb/branches/windows/include/lldb/Target/Target.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Target/Target.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Target/Target.h (original)
+++ lldb/branches/windows/include/lldb/Target/Target.h Tue Jan  8 06:51:53 2013
@@ -278,7 +278,8 @@
     {
         eBroadcastBitBreakpointChanged  = (1 << 0),
         eBroadcastBitModulesLoaded      = (1 << 1),
-        eBroadcastBitModulesUnloaded    = (1 << 2)
+        eBroadcastBitModulesUnloaded    = (1 << 2),
+        eBroadcastBitWatchpointChanged  = (1 << 3)
     };
     
     // These two functions fill out the Broadcaster interface:
@@ -390,6 +391,8 @@
     void
     DeleteCurrentProcess ();
 
+    void
+    CleanupProcess ();
     //------------------------------------------------------------------
     /// Dump a description of this object to a Stream.
     ///

Modified: lldb/branches/windows/include/lldb/Target/Thread.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Target/Thread.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Target/Thread.h (original)
+++ lldb/branches/windows/include/lldb/Target/Thread.h Tue Jan  8 06:51:53 2013
@@ -57,6 +57,7 @@
     public Broadcaster
 {
 friend class ThreadEventData;
+friend class ThreadList;
 
 public:
     //------------------------------------------------------------------
@@ -67,7 +68,8 @@
         eBroadcastBitStackChanged           = (1 << 0),
         eBroadcastBitThreadSuspended        = (1 << 1),
         eBroadcastBitThreadResumed          = (1 << 2),
-        eBroadcastBitSelectedFrameChanged  = (1 << 3)
+        eBroadcastBitSelectedFrameChanged   = (1 << 3),
+        eBroadcastBitThreadSelected         = (1 << 4)
     };
 
     static ConstString &GetStaticBroadcasterClass ();
@@ -478,8 +480,8 @@
                                              bool stop_other_threads);
 
     //------------------------------------------------------------------
-    /// Queues the plan used to step through an address range, stepping into or over
-    /// function calls depending on the value of StepType.
+    /// Queues the plan used to step through an address range, stepping  over
+    /// function calls.
     ///
     /// @param[in] abort_other_plans
     ///    \b true if we discard the currently queued plans and replace them with this one.
@@ -505,10 +507,48 @@
     ///     A pointer to the newly queued thread plan, or NULL if the plan could not be queued.
     //------------------------------------------------------------------
     virtual ThreadPlan *
-    QueueThreadPlanForStepRange (bool abort_other_plans,
-                                 StepType type,
+    QueueThreadPlanForStepOverRange (bool abort_other_plans,
                                  const AddressRange &range,
                                  const SymbolContext &addr_context,
+                                 lldb::RunMode stop_other_threads);
+
+    //------------------------------------------------------------------
+    /// Queues the plan used to step through an address range, stepping into functions.
+    ///
+    /// @param[in] abort_other_plans
+    ///    \b true if we discard the currently queued plans and replace them with this one.
+    ///    Otherwise this plan will go on the end of the plan stack.
+    ///
+    /// @param[in] type
+    ///    Type of step to do, only eStepTypeInto and eStepTypeOver are supported by this plan.
+    ///
+    /// @param[in] range
+    ///    The address range to step through.
+    ///
+    /// @param[in] addr_context
+    ///    When dealing with stepping through inlined functions the current PC is not enough information to know
+    ///    what "step" means.  For instance a series of nested inline functions might start at the same address.
+    //     The \a addr_context provides the current symbol context the step
+    ///    is supposed to be out of.
+    //   FIXME: Currently unused.
+    ///
+    /// @param[in] step_in_target
+    ///    Name if function we are trying to step into.  We will step out if we don't land in that function.
+    ///
+    /// @param[in] stop_other_threads
+    ///    \b true if we will stop other threads while we single step this one.
+    ///
+    /// @param[in] avoid_code_without_debug_info
+    ///    If \b true we will step out if we step into code with no debug info.
+    ///
+    /// @return
+    ///     A pointer to the newly queued thread plan, or NULL if the plan could not be queued.
+    //------------------------------------------------------------------
+    virtual ThreadPlan *
+    QueueThreadPlanForStepInRange (bool abort_other_plans,
+                                 const AddressRange &range,
+                                 const SymbolContext &addr_context,
+                                 const char *step_in_target,
                                  lldb::RunMode stop_other_threads,
                                  bool avoid_code_without_debug_info);
 
@@ -732,6 +772,9 @@
     CheckpointThreadState (ThreadStateCheckpoint &saved_state);
     
     virtual bool
+    RestoreRegisterStateFromCheckpoint (ThreadStateCheckpoint &saved_state);
+    
+    virtual bool
     RestoreThreadStateFromCheckpoint (ThreadStateCheckpoint &saved_state);
     
     void

Modified: lldb/branches/windows/include/lldb/Target/ThreadList.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Target/ThreadList.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Target/ThreadList.h (original)
+++ lldb/branches/windows/include/lldb/Target/ThreadList.h Tue Jan  8 06:51:53 2013
@@ -51,10 +51,10 @@
     GetSelectedThread ();
 
     bool
-    SetSelectedThreadByID (lldb::tid_t tid);
+    SetSelectedThreadByID (lldb::tid_t tid, bool notify = false);
 
     bool
-    SetSelectedThreadByIndexID (uint32_t index_id);
+    SetSelectedThreadByIndexID (uint32_t index_id, bool notify = false);
 
     void
     Clear();
@@ -131,6 +131,9 @@
     
 protected:
 
+    void
+    NotifySelectedThreadChanged (lldb::tid_t tid);
+
     typedef std::vector<lldb::ThreadSP> collection;
     //------------------------------------------------------------------
     // Classes that inherit from Process can see and modify these

Modified: lldb/branches/windows/include/lldb/Target/ThreadPlan.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Target/ThreadPlan.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Target/ThreadPlan.h (original)
+++ lldb/branches/windows/include/lldb/Target/ThreadPlan.h Tue Jan  8 06:51:53 2013
@@ -494,6 +494,17 @@
         return lldb::ValueObjectSP();
     }
     
+    // If a thread plan stores the state before it was run, then you might
+    // want to restore the state when it is done.  This will do that job.
+    // This is mostly useful for artificial plans like CallFunction plans.
+    
+    virtual bool
+    RestoreThreadState()
+    {
+        // Nothing to do in general.
+        return true;
+    }
+    
 protected:
     //------------------------------------------------------------------
     // Classes that inherit from ThreadPlan can see and modify these

Modified: lldb/branches/windows/include/lldb/Target/ThreadPlanCallFunction.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Target/ThreadPlanCallFunction.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Target/ThreadPlanCallFunction.h (original)
+++ lldb/branches/windows/include/lldb/Target/ThreadPlanCallFunction.h Tue Jan  8 06:51:53 2013
@@ -127,6 +127,9 @@
         return m_stop_address;
     }
 
+    virtual bool
+    RestoreThreadState();
+
 protected:
     void ReportRegisterState (const char *message);
 private:
@@ -154,8 +157,6 @@
     Address                                         m_function_addr;
     Address                                         m_start_addr;
     lldb::addr_t                                    m_function_sp;
-//    Process                                        &m_process;
-//    Thread                                         &m_thread;
     Thread::RegisterCheckpoint                      m_register_backup;
     lldb::ThreadPlanSP                              m_subplan_sp;
     LanguageRuntime                                *m_cxx_language_runtime;

Modified: lldb/branches/windows/include/lldb/Target/ThreadPlanStepInRange.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Target/ThreadPlanStepInRange.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Target/ThreadPlanStepInRange.h (original)
+++ lldb/branches/windows/include/lldb/Target/ThreadPlanStepInRange.h Tue Jan  8 06:51:53 2013
@@ -32,6 +32,12 @@
                            const SymbolContext &addr_context,
                            lldb::RunMode stop_others);
 
+    ThreadPlanStepInRange (Thread &thread,
+                           const AddressRange &range,
+                           const SymbolContext &addr_context,
+                           const char *step_into_function_name,
+                           lldb::RunMode stop_others);
+
     virtual
     ~ThreadPlanStepInRange ();
 
@@ -43,6 +49,11 @@
 
     void SetAvoidRegexp(const char *name);
     
+    void SetStepInTarget (const char *target)
+    {
+        m_step_into_target.SetCString(target);
+    }
+    
     static ThreadPlan *
     DefaultShouldStopHereCallback (ThreadPlan *current_plan, Flags &flags, void *baton);
 
@@ -65,10 +76,15 @@
 private:
 
     friend ThreadPlan *
-    Thread::QueueThreadPlanForStepRange (bool abort_other_plans,
-                                         StepType type,
+    Thread::QueueThreadPlanForStepOverRange (bool abort_other_plans,
                                          const AddressRange &range,
                                          const SymbolContext &addr_context,
+                                         lldb::RunMode stop_others);
+    friend ThreadPlan *
+    Thread::QueueThreadPlanForStepInRange (bool abort_other_plans,
+                                         const AddressRange &range,
+                                         const SymbolContext &addr_context,
+                                         const char *step_in_target,
                                          lldb::RunMode stop_others,
                                          bool avoid_code_without_debug_info);
 
@@ -81,7 +97,7 @@
     bool m_step_past_prologue;  // FIXME: For now hard-coded to true, we could put a switch in for this if there's
                                 // demand for that.
     bool m_virtual_step;        // true if we've just done a "virtual step", i.e. just moved the inline stack depth.
-
+    ConstString m_step_into_target;
     DISALLOW_COPY_AND_ASSIGN (ThreadPlanStepInRange);
 
 };

Modified: lldb/branches/windows/include/lldb/Target/ThreadPlanStepOverRange.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/Target/ThreadPlanStepOverRange.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/Target/ThreadPlanStepOverRange.h (original)
+++ lldb/branches/windows/include/lldb/Target/ThreadPlanStepOverRange.h Tue Jan  8 06:51:53 2013
@@ -41,13 +41,6 @@
 
 private:
 
-    friend ThreadPlan *
-    Thread::QueueThreadPlanForStepRange (bool abort_other_plans,
-                                         StepType type,
-                                         const AddressRange &range,
-                                         const SymbolContext &addr_context,
-                                         lldb::RunMode stop_others,
-                                         bool avoid_code_without_debug_info);
     bool m_first_resume;
 
     DISALLOW_COPY_AND_ASSIGN (ThreadPlanStepOverRange);

Modified: lldb/branches/windows/include/lldb/lldb-enumerations.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/lldb-enumerations.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/lldb-enumerations.h (original)
+++ lldb/branches/windows/include/lldb/lldb-enumerations.h Tue Jan  8 06:51:53 2013
@@ -176,7 +176,9 @@
         eStopReasonWatchpoint,
         eStopReasonSignal,
         eStopReasonException,
-        eStopReasonPlanComplete
+        eStopReasonExec,        // Program was re-exec'ed
+        eStopReasonPlanComplete,
+        eStopReasonThreadExiting
     } StopReason;
 
     //----------------------------------------------------------------------
@@ -299,6 +301,20 @@
         eBreakpointEventTypeThreadChanged       = (1u << 11)
     } BreakpointEventType;
 
+    typedef enum WatchpointEventType
+    {
+        eWatchpointEventTypeInvalidType         = (1u << 0),
+        eWatchpointEventTypeAdded               = (1u << 1),
+        eWatchpointEventTypeRemoved             = (1u << 2),
+        eWatchpointEventTypeEnabled             = (1u << 6),
+        eWatchpointEventTypeDisabled            = (1u << 7),
+        eWatchpointEventTypeCommandChanged      = (1u << 8),
+        eWatchpointEventTypeConditionChanged    = (1u << 9),
+        eWatchpointEventTypeIgnoreChanged       = (1u << 10),
+        eWatchpointEventTypeThreadChanged       = (1u << 11),
+        eWatchpointEventTypeTypeChanged         = (1u << 12)
+    } WatchpointEventType;
+
 
     //----------------------------------------------------------------------
     /// Programming language type.

Modified: lldb/branches/windows/include/lldb/lldb-forward.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/lldb-forward.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/lldb-forward.h (original)
+++ lldb/branches/windows/include/lldb/lldb-forward.h Tue Jan  8 06:51:53 2013
@@ -350,6 +350,7 @@
     typedef STD_SHARED_PTR(lldb_private::StopInfo) StopInfoSP;
     typedef STD_SHARED_PTR(lldb_private::StoppointLocation) StoppointLocationSP;
     typedef STD_SHARED_PTR(lldb_private::Stream) StreamSP;
+    typedef STD_WEAK_PTR  (lldb_private::Stream) StreamWP;
     typedef STD_SHARED_PTR(lldb_private::StringSummaryFormat) StringTypeSummaryImplSP;
     typedef STD_SHARED_PTR(lldb_private::SymbolFile) SymbolFileSP;
     typedef STD_SHARED_PTR(lldb_private::SymbolFileType) SymbolFileTypeSP;

Modified: lldb/branches/windows/include/lldb/lldb-private-interfaces.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/lldb-private-interfaces.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/lldb-private-interfaces.h (original)
+++ lldb/branches/windows/include/lldb/lldb-private-interfaces.h Tue Jan  8 06:51:53 2013
@@ -29,7 +29,7 @@
     typedef Platform* (*PlatformCreateInstance) (bool force, const ArchSpec *arch);
     typedef lldb::ProcessSP (*ProcessCreateInstance) (Target &target, Listener &listener, const FileSpec *crash_file_path);
     typedef SymbolFile* (*SymbolFileCreateInstance) (ObjectFile* obj_file);
-    typedef SymbolVendor* (*SymbolVendorCreateInstance) (const lldb::ModuleSP &module_sp);   // Module can be NULL for default system symbol vendor
+    typedef SymbolVendor* (*SymbolVendorCreateInstance) (const lldb::ModuleSP &module_sp, lldb_private::Stream *feedback_strm);   // Module can be NULL for default system symbol vendor
     typedef bool (*BreakpointHitCallback) (void *baton, StoppointCallbackContext *context, lldb::user_id_t break_id, lldb::user_id_t break_loc_id);
     typedef bool (*WatchpointHitCallback) (void *baton, StoppointCallbackContext *context, lldb::user_id_t watch_id);
     typedef ThreadPlan * (*ThreadPlanShouldStopHereCallback) (ThreadPlan *current_plan, Flags &flags, void *baton);

Modified: lldb/branches/windows/include/lldb/lldb-private-log.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/lldb-private-log.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/lldb-private-log.h (original)
+++ lldb/branches/windows/include/lldb/lldb-private-log.h Tue Jan  8 06:51:53 2013
@@ -41,6 +41,7 @@
 #define LIBLLDB_LOG_TYPES               (1u << 19)
 #define LIBLLDB_LOG_SYMBOLS             (1u << 20)
 #define LIBLLDB_LOG_MODULES             (1u << 21)
+#define LIBLLDB_LOG_TARGET              (1u << 22)
 #define LIBLLDB_LOG_ALL                 (UINT32_MAX)
 #define LIBLLDB_LOG_DEFAULT             (LIBLLDB_LOG_PROCESS              |\
                                          LIBLLDB_LOG_THREAD               |\
@@ -50,6 +51,7 @@
                                          LIBLLDB_LOG_STEP                 |\
                                          LIBLLDB_LOG_STATE                |\
                                          LIBLLDB_LOG_SYMBOLS              |\
+                                         LIBLLDB_LOG_TARGET               |\
                                          LIBLLDB_LOG_COMMANDS)
 
 namespace lldb_private {

Modified: lldb/branches/windows/include/lldb/lldb-private-types.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/include/lldb/lldb-private-types.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/include/lldb/lldb-private-types.h (original)
+++ lldb/branches/windows/include/lldb/lldb-private-types.h Tue Jan  8 06:51:53 2013
@@ -58,7 +58,7 @@
                                                  // then this option belongs to option set n.
         bool required;                           // This option is required (in the current usage level)
         const char *long_option;                 // Full name for this option.
-        char short_option;                       // Single character for this option.
+        int short_option;                        // Single character for this option.
         int option_has_arg;                      // no_argument, required_argument or optional_argument
         OptionEnumValueElement *enum_values;     // If non-NULL an array of enum values.
         uint32_t completion_type;                // Cookie the option class can use to do define the argument completion.

Modified: lldb/branches/windows/lib/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/lib/Makefile?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/lib/Makefile (original)
+++ lldb/branches/windows/lib/Makefile Tue Jan  8 06:51:53 2013
@@ -67,6 +67,14 @@
 	lldbPluginPlatformLinux.a \
 	lldbPluginPlatformFreeBSD.a
 
+# Because GCC requires RTTI enabled for lldbCore (see source/Core/Makefile) it is
+# necessary to also link the clang rewriter libraries so vtable references can
+# be resolved correctly, if we are building with GCC.
+ifeq (g++,$(shell basename $(CXX)))
+  USEDLIBS += clangRewriteCore.a \
+              clangRewriteFrontend.a
+endif
+
 include $(LLDB_LEVEL)/../../Makefile.config
 
 LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader bitwriter codegen \

Modified: lldb/branches/windows/lldb.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/lldb.xcodeproj/project.pbxproj?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/branches/windows/lldb.xcodeproj/project.pbxproj Tue Jan  8 06:51:53 2013
@@ -283,7 +283,6 @@
 		2689008713353E2200698AC0 /* ScriptInterpreter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A82010B10FFB49800182560 /* ScriptInterpreter.cpp */; };
 		2689008813353E2200698AC0 /* ScriptInterpreterNone.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A2771FC1135A37500E6ADB6 /* ScriptInterpreterNone.cpp */; };
 		2689008913353E2200698AC0 /* ScriptInterpreterPython.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F0C10F1B8DD00F91463 /* ScriptInterpreterPython.cpp */; };
-		2689008C13353E4200698AC0 /* DisassemblerLLVM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C897410F57C5600BB2B04 /* DisassemblerLLVM.cpp */; };
 		2689008D13353E4200698AC0 /* DynamicLoaderMacOSXDYLD.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C897A10F57C5600BB2B04 /* DynamicLoaderMacOSXDYLD.cpp */; };
 		2689008E13353E4200698AC0 /* DynamicLoaderStatic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 268A683D1321B53B000E3FB8 /* DynamicLoaderStatic.cpp */; };
 		2689009613353E4200698AC0 /* ObjectContainerBSDArchive.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26A3B4AC1181454800381BC2 /* ObjectContainerBSDArchive.cpp */; };
@@ -735,8 +734,6 @@
 		260C848310F50F0A00BB2B04 /* ThreadPlanStepThrough.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadPlanStepThrough.h; path = include/lldb/Target/ThreadPlanStepThrough.h; sourceTree = "<group>"; };
 		260C848410F50F0A00BB2B04 /* ThreadPlanStepRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadPlanStepRange.h; path = include/lldb/Target/ThreadPlanStepRange.h; sourceTree = "<group>"; };
 		260C876910F538E700BB2B04 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
-		260C897410F57C5600BB2B04 /* DisassemblerLLVM.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DisassemblerLLVM.cpp; sourceTree = "<group>"; };
-		260C897510F57C5600BB2B04 /* DisassemblerLLVM.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DisassemblerLLVM.h; sourceTree = "<group>"; };
 		260C897A10F57C5600BB2B04 /* DynamicLoaderMacOSXDYLD.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DynamicLoaderMacOSXDYLD.cpp; sourceTree = "<group>"; };
 		260C897B10F57C5600BB2B04 /* DynamicLoaderMacOSXDYLD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DynamicLoaderMacOSXDYLD.h; sourceTree = "<group>"; };
 		260C898010F57C5600BB2B04 /* ObjectContainerUniversalMachO.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ObjectContainerUniversalMachO.cpp; sourceTree = "<group>"; };
@@ -977,9 +974,9 @@
 		2682F16B115EDA0D00CCFF99 /* PseudoTerminal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PseudoTerminal.h; path = include/lldb/Utility/PseudoTerminal.h; sourceTree = "<group>"; };
 		2682F284115EF3A700CCFF99 /* SBError.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBError.cpp; path = source/API/SBError.cpp; sourceTree = "<group>"; };
 		2682F286115EF3BD00CCFF99 /* SBError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBError.h; path = include/lldb/API/SBError.h; sourceTree = "<group>"; };
-		268648C116531BF800F04704 /* com.apple.debugserver.posix.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file; name = com.apple.debugserver.posix.plist; path = tools/debugserver/source/com.apple.debugserver.posix.plist; sourceTree = "<group>"; };
-		268648C216531BF800F04704 /* com.apple.debugserver.applist.internal.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file; name = com.apple.debugserver.applist.internal.plist; path = tools/debugserver/source/com.apple.debugserver.applist.internal.plist; sourceTree = "<group>"; };
-		268648C316531BF800F04704 /* com.apple.debugserver.internal.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file; name = com.apple.debugserver.internal.plist; path = tools/debugserver/source/com.apple.debugserver.internal.plist; sourceTree = "<group>"; };
+		268648C116531BF800F04704 /* com.apple.debugserver.posix.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = com.apple.debugserver.posix.plist; path = tools/debugserver/source/com.apple.debugserver.posix.plist; sourceTree = "<group>"; };
+		268648C216531BF800F04704 /* com.apple.debugserver.applist.internal.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = com.apple.debugserver.applist.internal.plist; path = tools/debugserver/source/com.apple.debugserver.applist.internal.plist; sourceTree = "<group>"; };
+		268648C316531BF800F04704 /* com.apple.debugserver.internal.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = com.apple.debugserver.internal.plist; path = tools/debugserver/source/com.apple.debugserver.internal.plist; sourceTree = "<group>"; };
 		2686536B1370ACB200D186A3 /* OptionGroupBoolean.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionGroupBoolean.cpp; path = source/Interpreter/OptionGroupBoolean.cpp; sourceTree = "<group>"; };
 		2686536D1370ACC600D186A3 /* OptionGroupBoolean.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionGroupBoolean.h; path = include/lldb/Interpreter/OptionGroupBoolean.h; sourceTree = "<group>"; };
 		2686536E1370AE5A00D186A3 /* OptionGroupUInt64.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionGroupUInt64.h; path = include/lldb/Interpreter/OptionGroupUInt64.h; sourceTree = "<group>"; };
@@ -1764,9 +1761,6 @@
 		08FB7794FE84155DC02AAC07 /* lldb */ = {
 			isa = PBXGroup;
 			children = (
-				268648C116531BF800F04704 /* com.apple.debugserver.posix.plist */,
-				268648C216531BF800F04704 /* com.apple.debugserver.applist.internal.plist */,
-				268648C316531BF800F04704 /* com.apple.debugserver.internal.plist */,
 				26F5C32810F3DF7D009D5894 /* Libraries */,
 				264E8576159BE51A00E9D7A2 /* Resources */,
 				08FB7795FE84155DC02AAC07 /* Source */,
@@ -1849,8 +1843,6 @@
 		260C897310F57C5600BB2B04 /* llvm */ = {
 			isa = PBXGroup;
 			children = (
-				260C897410F57C5600BB2B04 /* DisassemblerLLVM.cpp */,
-				260C897510F57C5600BB2B04 /* DisassemblerLLVM.h */,
 				B299580A14F2FA1400050A04 /* DisassemblerLLVMC.cpp */,
 				B299580C14F2FA1F00050A04 /* DisassemblerLLVMC.h */,
 			);
@@ -2241,6 +2233,9 @@
 			isa = PBXGroup;
 			children = (
 				AF90106315AB7C5700FF120D /* lldb.1 */,
+				268648C116531BF800F04704 /* com.apple.debugserver.posix.plist */,
+				268648C216531BF800F04704 /* com.apple.debugserver.applist.internal.plist */,
+				268648C316531BF800F04704 /* com.apple.debugserver.internal.plist */,
 				AFF87C8E150FF688000E1742 /* com.apple.debugserver.applist.plist */,
 				AFF87C8C150FF680000E1742 /* com.apple.debugserver.applist.plist */,
 				AFF87C8A150FF677000E1742 /* com.apple.debugserver.applist.plist */,
@@ -3948,7 +3943,6 @@
 				2689008713353E2200698AC0 /* ScriptInterpreter.cpp in Sources */,
 				2689008813353E2200698AC0 /* ScriptInterpreterNone.cpp in Sources */,
 				2689008913353E2200698AC0 /* ScriptInterpreterPython.cpp in Sources */,
-				2689008C13353E4200698AC0 /* DisassemblerLLVM.cpp in Sources */,
 				2689008D13353E4200698AC0 /* DynamicLoaderMacOSXDYLD.cpp in Sources */,
 				2689008E13353E4200698AC0 /* DynamicLoaderStatic.cpp in Sources */,
 				2689009613353E4200698AC0 /* ObjectContainerBSDArchive.cpp in Sources */,
@@ -4453,9 +4447,9 @@
 				CLANG_LINK_OBJC_RUNTIME = NO;
 				CLANG_OBJC_RUNTIME = NO;
 				COMBINE_HIDPI_IMAGES = YES;
-				CURRENT_PROJECT_VERSION = 168;
+				CURRENT_PROJECT_VERSION = 178;
 				DYLIB_COMPATIBILITY_VERSION = 1;
-				DYLIB_CURRENT_VERSION = 168;
+				DYLIB_CURRENT_VERSION = 178;
 				EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports";
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -4510,10 +4504,10 @@
 				CLANG_LINK_OBJC_RUNTIME = NO;
 				CLANG_OBJC_RUNTIME = NO;
 				COMBINE_HIDPI_IMAGES = YES;
-				CURRENT_PROJECT_VERSION = 168;
+				CURRENT_PROJECT_VERSION = 178;
 				DEAD_CODE_STRIPPING = YES;
 				DYLIB_COMPATIBILITY_VERSION = 1;
-				DYLIB_CURRENT_VERSION = 168;
+				DYLIB_CURRENT_VERSION = 178;
 				EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports";
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -4568,7 +4562,7 @@
 				ARCHS = "$(ARCHS_STANDARD_64_BIT)";
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COMBINE_HIDPI_IMAGES = YES;
-				CURRENT_PROJECT_VERSION = 168;
+				CURRENT_PROJECT_VERSION = 178;
 				DEBUGGING_SYMBOLS = YES;
 				GCC_DYNAMIC_NO_PIC = NO;
 				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
@@ -4594,7 +4588,7 @@
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COMBINE_HIDPI_IMAGES = YES;
 				COPY_PHASE_STRIP = YES;
-				CURRENT_PROJECT_VERSION = 168;
+				CURRENT_PROJECT_VERSION = 178;
 				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
 				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
 				OTHER_CFLAGS = "";
@@ -4611,7 +4605,7 @@
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COMBINE_HIDPI_IMAGES = YES;
 				COPY_PHASE_STRIP = YES;
-				CURRENT_PROJECT_VERSION = 168;
+				CURRENT_PROJECT_VERSION = 178;
 				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
 				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
 				OTHER_CFLAGS = "";
@@ -4625,8 +4619,8 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				COMBINE_HIDPI_IMAGES = YES;
-				CURRENT_PROJECT_VERSION = 168;
-				DYLIB_CURRENT_VERSION = 168;
+				CURRENT_PROJECT_VERSION = 178;
+				DYLIB_CURRENT_VERSION = 178;
 				EXECUTABLE_EXTENSION = a;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -4655,8 +4649,8 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				COMBINE_HIDPI_IMAGES = YES;
-				CURRENT_PROJECT_VERSION = 168;
-				DYLIB_CURRENT_VERSION = 168;
+				CURRENT_PROJECT_VERSION = 178;
+				DYLIB_CURRENT_VERSION = 178;
 				EXECUTABLE_EXTENSION = a;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -4685,8 +4679,8 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				COMBINE_HIDPI_IMAGES = YES;
-				CURRENT_PROJECT_VERSION = 168;
-				DYLIB_CURRENT_VERSION = 168;
+				CURRENT_PROJECT_VERSION = 178;
+				DYLIB_CURRENT_VERSION = 178;
 				EXECUTABLE_EXTENSION = a;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -4778,7 +4772,7 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				COPY_PHASE_STRIP = YES;
-				CURRENT_PROJECT_VERSION = 168;
+				CURRENT_PROJECT_VERSION = 178;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
 					"\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
@@ -4803,6 +4797,7 @@
 					"$(PROJECT_DIR)/tools/driver/lldb-Info.plist",
 					"-Wl,-rpath, at loader_path/../../../SharedFrameworks",
 					"-Wl,-rpath, at loader_path/../../System/Library/PrivateFrameworks",
+					"-Wl,-rpath, at loader_path/../../Library/PrivateFrameworks",
 				);
 				PRODUCT_NAME = lldb;
 				STRIP_INSTALLED_PRODUCT = YES;
@@ -4819,10 +4814,10 @@
 				CLANG_OBJC_RUNTIME = NO;
 				COMBINE_HIDPI_IMAGES = YES;
 				COPY_PHASE_STRIP = YES;
-				CURRENT_PROJECT_VERSION = 168;
+				CURRENT_PROJECT_VERSION = 178;
 				DEAD_CODE_STRIPPING = YES;
 				DYLIB_COMPATIBILITY_VERSION = 1;
-				DYLIB_CURRENT_VERSION = 168;
+				DYLIB_CURRENT_VERSION = 178;
 				EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports";
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -5140,7 +5135,7 @@
 		26F5C26C10F3D9A5009D5894 /* Debug */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
-				CURRENT_PROJECT_VERSION = 168;
+				CURRENT_PROJECT_VERSION = 178;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
 					"\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
@@ -5170,7 +5165,7 @@
 		26F5C26D10F3D9A5009D5894 /* Release */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
-				CURRENT_PROJECT_VERSION = 168;
+				CURRENT_PROJECT_VERSION = 178;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
 					"\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
@@ -5285,7 +5280,7 @@
 		49BB8F381611172B00BDD462 /* DebugClang */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
-				CURRENT_PROJECT_VERSION = 168;
+				CURRENT_PROJECT_VERSION = 178;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
 					"\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
@@ -5319,9 +5314,9 @@
 				CLANG_LINK_OBJC_RUNTIME = NO;
 				CLANG_OBJC_RUNTIME = NO;
 				COMBINE_HIDPI_IMAGES = YES;
-				CURRENT_PROJECT_VERSION = 168;
+				CURRENT_PROJECT_VERSION = 178;
 				DYLIB_COMPATIBILITY_VERSION = 1;
-				DYLIB_CURRENT_VERSION = 168;
+				DYLIB_CURRENT_VERSION = 178;
 				EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports";
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -5386,8 +5381,8 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				COMBINE_HIDPI_IMAGES = YES;
-				CURRENT_PROJECT_VERSION = 168;
-				DYLIB_CURRENT_VERSION = 168;
+				CURRENT_PROJECT_VERSION = 178;
+				DYLIB_CURRENT_VERSION = 178;
 				EXECUTABLE_EXTENSION = a;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -5554,7 +5549,7 @@
 				ARCHS = "$(ARCHS_STANDARD_64_BIT)";
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COMBINE_HIDPI_IMAGES = YES;
-				CURRENT_PROJECT_VERSION = 168;
+				CURRENT_PROJECT_VERSION = 178;
 				DEBUGGING_SYMBOLS = YES;
 				GCC_DYNAMIC_NO_PIC = NO;
 				GCC_ENABLE_OBJC_EXCEPTIONS = YES;

Modified: lldb/branches/windows/resources/LLDB-Info.plist
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/resources/LLDB-Info.plist?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/resources/LLDB-Info.plist (original)
+++ lldb/branches/windows/resources/LLDB-Info.plist Tue Jan  8 06:51:53 2013
@@ -17,7 +17,7 @@
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleVersion</key>
-	<string>168</string>
+	<string>178</string>
 	<key>CFBundleName</key>
 	<string>${EXECUTABLE_NAME}</string>
 </dict>

Modified: lldb/branches/windows/scripts/Python/interface/SBModule.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/scripts/Python/interface/SBModule.i?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/scripts/Python/interface/SBModule.i (original)
+++ lldb/branches/windows/scripts/Python/interface/SBModule.i Tue Jan  8 06:51:53 2013
@@ -177,6 +177,15 @@
     lldb::SBSymbol
     GetSymbolAtIndex (size_t idx);
 
+    lldb::SBSymbol
+    FindSymbol (const char *name,
+                lldb::SymbolType type = eSymbolTypeAny);
+
+    lldb::SBSymbolContextList
+    FindSymbols (const char *name,
+                 lldb::SymbolType type = eSymbolTypeAny);
+             
+
     size_t
     GetNumSections ();
 
@@ -213,6 +222,8 @@
     lldb::SBTypeList
     FindTypes (const char* type);
 
+    lldb::SBType
+    GetBasicType(lldb::BasicType type);
 
     %feature("docstring", "
     //------------------------------------------------------------------
@@ -269,9 +280,10 @@
                         return self.sbmodule.GetSymbolAtIndex(key)
                 elif type(key) is str:
                     matches = []
-                    for idx in range(count):
-                        symbol = self.sbmodule.GetSymbolAtIndex(idx)
-                        if symbol.name == key or symbol.mangled == key:
+                    sc_list = self.sbmodule.FindSymbols(key)
+                    for sc in sc_list:
+                        symbol = sc.symbol
+                        if symbol:
                             matches.append(symbol)
                     return matches
                 elif isinstance(key, self.re_compile_type):

Modified: lldb/branches/windows/scripts/Python/interface/SBTarget.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/scripts/Python/interface/SBTarget.i?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/scripts/Python/interface/SBTarget.i (original)
+++ lldb/branches/windows/scripts/Python/interface/SBTarget.i Tue Jan  8 06:51:53 2013
@@ -238,7 +238,8 @@
     {
         eBroadcastBitBreakpointChanged  = (1 << 0),
         eBroadcastBitModulesLoaded      = (1 << 1),
-        eBroadcastBitModulesUnloaded    = (1 << 2)
+        eBroadcastBitModulesUnloaded    = (1 << 2),
+        eBroadcastBitWatchpointChanged  = (1 << 3)
     };
 
     //------------------------------------------------------------------
@@ -560,6 +561,9 @@
     lldb::SBTypeList
     FindTypes (const char* type);
 
+    lldb::SBType
+    GetBasicType(lldb::BasicType type);
+
     lldb::SBSourceManager
     GetSourceManager ();
 
@@ -687,9 +691,14 @@
     lldb::SBInstructionList
     GetInstructions (lldb::SBAddress base_addr, const void *buf, size_t size);
     
+    lldb::SBSymbolContextList
+    FindSymbols (const char *name, lldb::SymbolType type = eSymbolTypeAny);
+
     bool
     GetDescription (lldb::SBStream &description, lldb::DescriptionLevel description_level);
     
+    lldb::SBValue
+    EvaluateExpression (const char *expr, const lldb::SBExpressionOptions &options);
     %pythoncode %{
         class modules_access(object):
             '''A helper object that will lazily hand out lldb.SBModule objects for a target when supplied an index, or by full or partial path.'''

Modified: lldb/branches/windows/scripts/Python/interface/SBThread.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/scripts/Python/interface/SBThread.i?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/scripts/Python/interface/SBThread.i (original)
+++ lldb/branches/windows/scripts/Python/interface/SBThread.i Tue Jan  8 06:51:53 2013
@@ -88,6 +88,7 @@
     /// eStopReasonWatchpoint    1     watchpoint id
     /// eStopReasonSignal        1     unix signal number
     /// eStopReasonException     N     exception data
+    /// eStopReasonExec          0
     /// eStopReasonPlanComplete  0
     //--------------------------------------------------------------------------
     ") GetStopReasonDataAtIndex;
@@ -123,6 +124,9 @@
     StepInto (lldb::RunMode stop_other_threads = lldb::eOnlyDuringStepping);
 
     void
+    StepInto (const char *target_name, lldb::RunMode stop_other_threads = lldb::eOnlyDuringStepping);
+
+    void
     StepOut ();
 
     void

Modified: lldb/branches/windows/scripts/Python/interface/SBType.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/scripts/Python/interface/SBType.i?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/scripts/Python/interface/SBType.i (original)
+++ lldb/branches/windows/scripts/Python/interface/SBType.i Tue Jan  8 06:51:53 2013
@@ -180,6 +180,9 @@
     lldb::SBType
     GetUnqualifiedType();
     
+    lldb::SBType
+    GetCanonicalType();
+
     lldb::BasicType
     GetBasicType();
 

Modified: lldb/branches/windows/scripts/Python/interface/SBWatchpoint.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/scripts/Python/interface/SBWatchpoint.i?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/scripts/Python/interface/SBWatchpoint.i (original)
+++ lldb/branches/windows/scripts/Python/interface/SBWatchpoint.i Tue Jan  8 06:51:53 2013
@@ -84,6 +84,16 @@
     
     bool
     GetDescription (lldb::SBStream &description, DescriptionLevel level);
+
+    static bool
+    EventIsWatchpointEvent (const lldb::SBEvent &event);
+    
+    static lldb::WatchpointEventType
+    GetWatchpointEventTypeFromEvent (const lldb::SBEvent& event);
+
+    static lldb::SBWatchpoint
+    GetWatchpointFromEvent (const lldb::SBEvent& event);
+
 };
 
 } // namespace lldb

Modified: lldb/branches/windows/scripts/Python/modify-python-lldb.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/scripts/Python/modify-python-lldb.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/scripts/Python/modify-python-lldb.py (original)
+++ lldb/branches/windows/scripts/Python/modify-python-lldb.py Tue Jan  8 06:51:53 2013
@@ -433,5 +433,11 @@
 
 with open(output_name, 'w') as f_out:
     f_out.write(new_content.getvalue())
-    f_out.write("debugger_unique_id = 0\n")
-    f_out.write("SBDebugger.Initialize()\n")
+    f_out.write('''debugger_unique_id = 0
+SBDebugger.Initialize()
+debugger = None
+target = SBTarget()
+process = SBProcess()
+thread = SBThread()
+frame = SBFrame()''')
+

Modified: lldb/branches/windows/scripts/Python/python-wrapper.swig
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/scripts/Python/python-wrapper.swig?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/scripts/Python/python-wrapper.swig (original)
+++ lldb/branches/windows/scripts/Python/python-wrapper.swig Tue Jan  8 06:51:53 2013
@@ -964,6 +964,10 @@
 #include "lldb/API/SBInputReader.h"
 #include "lldb/API/SBDebugger.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 size_t
 LLDBSwigPythonCallSBInputReaderCallback(void *baton,
                                         lldb::SBInputReader *reader,
@@ -972,6 +976,10 @@
                                         size_t bytes_len);
 
 void LLDBSwigPythonCallPythonLogOutputCallback(const char *str, void *baton);
+
+#ifdef __cplusplus
+}
+#endif
 %}
 
 %wrapper %{

Modified: lldb/branches/windows/scripts/build-swig-wrapper-classes.sh
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/scripts/build-swig-wrapper-classes.sh?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/scripts/build-swig-wrapper-classes.sh (original)
+++ lldb/branches/windows/scripts/build-swig-wrapper-classes.sh Tue Jan  8 06:51:53 2013
@@ -83,8 +83,8 @@
 # Next look for swig
 #
 
-SWIG=
-if [ -f /usr/bin/swig ]
+SWIG=`which swig`
+if [ ! -x "$SWIG" -a -f /usr/bin/swig ]
 then
     SWIG=/usr/bin/swig
 else

Modified: lldb/branches/windows/source/API/SBAddress.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/API/SBAddress.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/API/SBAddress.cpp (original)
+++ lldb/branches/windows/source/API/SBAddress.cpp Tue Jan  8 06:51:53 2013
@@ -133,7 +133,7 @@
         if (addr == LLDB_INVALID_ADDRESS)
             log->Printf ("SBAddress::GetLoadAddress (SBTarget(%p)) => LLDB_INVALID_ADDRESS", target_sp.get());
         else
-            log->Printf ("SBAddress::GetLoadAddress (SBTarget(%p)) => 0x%llx", target_sp.get(), addr);
+            log->Printf ("SBAddress::GetLoadAddress (SBTarget(%p)) => 0x%" PRIx64, target_sp.get(), addr);
     }
 
     return addr;

Modified: lldb/branches/windows/source/API/SBBlock.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/API/SBBlock.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/API/SBBlock.cpp (original)
+++ lldb/branches/windows/source/API/SBBlock.cpp Tue Jan  8 06:51:53 2013
@@ -183,7 +183,7 @@
     if (m_opaque_ptr)
     {
         lldb::user_id_t id = m_opaque_ptr->GetID();
-        strm.Printf ("Block: {id: %llu} ", id);
+        strm.Printf ("Block: {id: %" PRIu64 "} ", id);
         if (IsInlined())
         {
             strm.Printf (" (inlined, '%s') ", GetInlinedName());

Modified: lldb/branches/windows/source/API/SBBreakpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/API/SBBreakpoint.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/API/SBBreakpoint.cpp (original)
+++ lldb/branches/windows/source/API/SBBreakpoint.cpp Tue Jan  8 06:51:53 2013
@@ -353,7 +353,7 @@
     }
     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log)
-        log->Printf ("SBBreakpoint(%p)::SetThreadID (tid=0x%4.4llx)", m_opaque_sp.get(), tid);
+        log->Printf ("SBBreakpoint(%p)::SetThreadID (tid=0x%4.4" PRIx64 ")", m_opaque_sp.get(), tid);
 
 }
 
@@ -369,7 +369,7 @@
 
     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log)
-        log->Printf ("SBBreakpoint(%p)::GetThreadID () => 0x%4.4llx", m_opaque_sp.get(), tid);
+        log->Printf ("SBBreakpoint(%p)::GetThreadID () => 0x%4.4" PRIx64, m_opaque_sp.get(), tid);
     return tid;
 }
 
@@ -479,7 +479,7 @@
     }
     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log)
-        log->Printf ("SBBreakpoint(%p)::GetNumResolvedLocations () => %llu", m_opaque_sp.get(), (uint64_t)num_resolved);
+        log->Printf ("SBBreakpoint(%p)::GetNumResolvedLocations () => %" PRIu64, m_opaque_sp.get(), (uint64_t)num_resolved);
     return num_resolved;
 }
 
@@ -494,7 +494,7 @@
     }
     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log)
-        log->Printf ("SBBreakpoint(%p)::GetNumLocations () => %llu", m_opaque_sp.get(), (uint64_t)num_locs);
+        log->Printf ("SBBreakpoint(%p)::GetNumLocations () => %" PRIu64, m_opaque_sp.get(), (uint64_t)num_locs);
     return num_locs;
 }
 
@@ -508,7 +508,7 @@
         m_opaque_sp->GetResolverDescription (s.get());
         m_opaque_sp->GetFilterDescription (s.get());
         const size_t num_locations = m_opaque_sp->GetNumLocations ();
-        s.Printf(", locations = %llu", (uint64_t)num_locations);
+        s.Printf(", locations = %" PRIu64, (uint64_t)num_locations);
         return true;
     }
     s.Printf ("No value");

Modified: lldb/branches/windows/source/API/SBCommandInterpreter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/API/SBCommandInterpreter.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/API/SBCommandInterpreter.cpp (original)
+++ lldb/branches/windows/source/API/SBCommandInterpreter.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/lldb-types.h"
 #include "lldb/Core/SourceManager.h"
 #include "lldb/Core/Listener.h"
@@ -170,7 +172,7 @@
         return 0;
         
     if (log)
-        log->Printf ("SBCommandInterpreter(%p)::HandleCompletion (current_line=\"%s\", cursor at: %lld, last char at: %lld, match_start_point: %d, max_return_elements: %d)",
+        log->Printf ("SBCommandInterpreter(%p)::HandleCompletion (current_line=\"%s\", cursor at: %" PRId64 ", last char at: %" PRId64 ", match_start_point: %d, max_return_elements: %d)",
                      m_opaque_ptr, current_line, (uint64_t) (cursor - current_line), (uint64_t) (last_char - current_line), match_start_point, max_return_elements);
                      
     if (m_opaque_ptr)

Modified: lldb/branches/windows/source/API/SBCommandReturnObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/API/SBCommandReturnObject.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/API/SBCommandReturnObject.cpp (original)
+++ lldb/branches/windows/source/API/SBCommandReturnObject.cpp Tue Jan  8 06:51:53 2013
@@ -281,7 +281,17 @@
 {
     if (m_opaque_ap.get())
     {
-        m_opaque_ap->AppendMessage(string, len);
+        if (len == 0)
+        {
+            return;
+        }
+        else if (len > 0)
+        {
+            std::string buffer(string, len);
+            m_opaque_ap->AppendMessage(buffer.c_str());
+        }
+        else
+            m_opaque_ap->AppendMessage(string);
     }
 }
 

Modified: lldb/branches/windows/source/API/SBCommunication.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/API/SBCommunication.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/API/SBCommunication.cpp (original)
+++ lldb/branches/windows/source/API/SBCommunication.cpp Tue Jan  8 06:51:53 2013
@@ -139,7 +139,7 @@
 {
     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log)
-        log->Printf ("SBCommunication(%p)::Read (dst=%p, dst_len=%llu, timeout_usec=%u, &status)...", 
+        log->Printf ("SBCommunication(%p)::Read (dst=%p, dst_len=%" PRIu64 ", timeout_usec=%u, &status)...",
                      m_opaque,
                      dst,
                      (uint64_t)dst_len,
@@ -151,7 +151,7 @@
         status = eConnectionStatusNoConnection;
 
     if (log)
-        log->Printf ("SBCommunication(%p)::Read (dst=%p, dst_len=%llu, timeout_usec=%u, &status=%s) => %llu", 
+        log->Printf ("SBCommunication(%p)::Read (dst=%p, dst_len=%" PRIu64 ", timeout_usec=%u, &status=%s) => %" PRIu64,
                      m_opaque,
                      dst,
                      (uint64_t)dst_len,
@@ -173,7 +173,7 @@
 
     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log)
-        log->Printf ("SBCommunication(%p)::Write (src=%p, src_len=%llu, &status=%s) => %llu", 
+        log->Printf ("SBCommunication(%p)::Write (src=%p, src_len=%" PRIu64 ", &status=%s) => %" PRIu64,
                      m_opaque, src, (uint64_t)src_len, Communication::ConnectionStatusAsCString (status), (uint64_t)bytes_written);
 
     return 0;

Modified: lldb/branches/windows/source/API/SBData.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/API/SBData.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/API/SBData.cpp (original)
+++ lldb/branches/windows/source/API/SBData.cpp Tue Jan  8 06:51:53 2013
@@ -322,7 +322,7 @@
     }
     if (log)
         log->Printf ("SBData::GetUnsignedInt64 (error=%p,offset=%d) => "
-                     "(%lld)", error.get(), offset, value);
+                     "(%" PRId64 ")", error.get(), offset, value);
     return value;
 }
 
@@ -410,7 +410,7 @@
     }
     if (log)
         log->Printf ("SBData::GetSignedInt64 (error=%p,offset=%d) => "
-                     "(%lld)", error.get(), offset, value);
+                     "(%" PRId64 ")", error.get(), offset, value);
     return value;
 }
 

Modified: lldb/branches/windows/source/API/SBDebugger.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/API/SBDebugger.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/API/SBDebugger.cpp (original)
+++ lldb/branches/windows/source/API/SBDebugger.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/API/SBDebugger.h"
 
 #include "lldb/lldb-private.h"
@@ -291,6 +293,20 @@
     return NULL;
 }
 
+void
+SBDebugger::SaveInputTerminalState()
+{
+    if (m_opaque_sp)
+        m_opaque_sp->SaveInputTerminalState();
+}
+
+void
+SBDebugger::RestoreInputTerminalState()
+{
+    if (m_opaque_sp)
+        m_opaque_sp->RestoreInputTerminalState();
+
+}
 SBCommandInterpreter
 SBDebugger::GetCommandInterpreter ()
 {
@@ -800,7 +816,7 @@
     LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     if (log)
-        log->Printf ("SBDebugger(%p)::DispatchInput (data=\"%.*s\", size_t=%llu)",
+        log->Printf ("SBDebugger(%p)::DispatchInput (data=\"%.*s\", size_t=%" PRIu64 ")",
                      m_opaque_sp.get(),
                      (int) data_len,
                      (const char *) data,
@@ -1049,7 +1065,7 @@
     {
         const char *name = m_opaque_sp->GetInstanceName().AsCString();
         user_id_t id = m_opaque_sp->GetID();
-        strm.Printf ("Debugger (instance: \"%s\", id: %llu)", name, id);
+        strm.Printf ("Debugger (instance: \"%s\", id: %" PRIu64 ")", name, id);
     }
     else
         strm.PutCString ("No value");

Modified: lldb/branches/windows/source/API/SBEvent.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/API/SBEvent.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/API/SBEvent.cpp (original)
+++ lldb/branches/windows/source/API/SBEvent.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/API/SBEvent.h"
 #include "lldb/API/SBBroadcaster.h"
 #include "lldb/API/SBStream.h"

Modified: lldb/branches/windows/source/API/SBFileSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/API/SBFileSpec.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/API/SBFileSpec.cpp (original)
+++ lldb/branches/windows/source/API/SBFileSpec.cpp Tue Jan  8 06:51:53 2013
@@ -154,7 +154,7 @@
         result = m_opaque_ap->GetPath (dst_path, dst_len);
 
     if (log)
-        log->Printf ("SBFileSpec(%p)::GetPath (dst_path=\"%.*s\", dst_len=%llu) => %u", 
+        log->Printf ("SBFileSpec(%p)::GetPath (dst_path=\"%.*s\", dst_len=%" PRIu64 ") => %u",
                      m_opaque_ap.get(), result, dst_path, (uint64_t)dst_len, result);
 
     if (result == 0 && dst_path && dst_len > 0)

Modified: lldb/branches/windows/source/API/SBFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/API/SBFrame.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/API/SBFrame.cpp (original)
+++ lldb/branches/windows/source/API/SBFrame.cpp Tue Jan  8 06:51:53 2013
@@ -114,19 +114,29 @@
     Mutex::Locker api_locker;
     ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
 
-    StackFrame *frame = exe_ctx.GetFramePtr();
+    StackFrame *frame = NULL;
     Target *target = exe_ctx.GetTargetPtr();
-    if (frame && target)
+    Process *process = exe_ctx.GetProcessPtr();
+    if (target && process)
     {
         Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
+        if (stop_locker.TryLock(&process->GetRunLock()))
         {
-            sb_sym_ctx.SetSymbolContext(&frame->GetSymbolContext (resolve_scope));
+            frame = exe_ctx.GetFramePtr();
+            if (frame)
+            {
+                sb_sym_ctx.SetSymbolContext(&frame->GetSymbolContext (resolve_scope));
+            }
+            else
+            {
+                if (log)
+                    log->Printf ("SBFrame::GetVariables () => error: could not reconstruct frame object for this SBFrame.");
+            }
         }
         else
         {
             if (log)
-                log->Printf ("SBFrame(%p)::GetSymbolContext () => error: process is running", frame);
+                log->Printf ("SBFrame::GetSymbolContext () => error: process is running");
         }
     }
 
@@ -146,20 +156,30 @@
     Mutex::Locker api_locker;
     ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
 
-    StackFrame *frame = exe_ctx.GetFramePtr();
+    StackFrame *frame = NULL;
     Target *target = exe_ctx.GetTargetPtr();
-    if (frame && target)
+    Process *process = exe_ctx.GetProcessPtr();
+    if (target && process)
     {
         Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
+        if (stop_locker.TryLock(&process->GetRunLock()))
         {
-            module_sp = frame->GetSymbolContext (eSymbolContextModule).module_sp;
-            sb_module.SetSP (module_sp);
+            frame = exe_ctx.GetFramePtr();
+            if (frame)
+            {
+                module_sp = frame->GetSymbolContext (eSymbolContextModule).module_sp;
+                sb_module.SetSP (module_sp);
+            }
+            else
+            {
+                if (log)
+                    log->Printf ("SBFrame::GetModule () => error: could not reconstruct frame object for this SBFrame.");
+            }
         }
         else
         {
             if (log)
-                log->Printf ("SBFrame(%p)::GetModule () => error: process is running", frame);
+                log->Printf ("SBFrame::GetModule () => error: process is running");
         }
     }
 
@@ -178,19 +198,29 @@
     Mutex::Locker api_locker;
     ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
 
-    StackFrame *frame = exe_ctx.GetFramePtr();
+    StackFrame *frame = NULL;
     Target *target = exe_ctx.GetTargetPtr();
-    if (frame && target)
+    Process *process = exe_ctx.GetProcessPtr();
+    if (target && process)
     {
         Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
+        if (stop_locker.TryLock(&process->GetRunLock()))
         {
-            sb_comp_unit.reset (frame->GetSymbolContext (eSymbolContextCompUnit).comp_unit);
+            frame = exe_ctx.GetFramePtr();
+            if (frame)
+            {
+                sb_comp_unit.reset (frame->GetSymbolContext (eSymbolContextCompUnit).comp_unit);
+            }
+            else
+            {
+                if (log)
+                    log->Printf ("SBFrame::GetCompileUnit () => error: could not reconstruct frame object for this SBFrame.");
+            }
         }
         else
         {
             if (log)
-                log->Printf ("SBFrame(%p)::GetCompileUnit () => error: process is running", frame);
+                log->Printf ("SBFrame::GetCompileUnit () => error: process is running");
         }
     }
     if (log)
@@ -208,19 +238,29 @@
     Mutex::Locker api_locker;
     ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
 
-    StackFrame *frame = exe_ctx.GetFramePtr();
+    StackFrame *frame = NULL;
     Target *target = exe_ctx.GetTargetPtr();
-    if (frame && target)
+    Process *process = exe_ctx.GetProcessPtr();
+    if (target && process)
     {
         Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
+        if (stop_locker.TryLock(&process->GetRunLock()))
         {
-            sb_function.reset(frame->GetSymbolContext (eSymbolContextFunction).function);
+            frame = exe_ctx.GetFramePtr();
+            if (frame)
+            {
+                sb_function.reset(frame->GetSymbolContext (eSymbolContextFunction).function);
+            }
+            else
+            {
+                if (log)
+                    log->Printf ("SBFrame::GetFunction () => error: could not reconstruct frame object for this SBFrame.");
+            }
         }
         else
         {
             if (log)
-                log->Printf ("SBFrame(%p)::GetFunction () => error: process is running", frame);
+                log->Printf ("SBFrame::GetFunction () => error: process is running");
         }
     }
     if (log)
@@ -238,19 +278,29 @@
     Mutex::Locker api_locker;
     ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
 
-    StackFrame *frame = exe_ctx.GetFramePtr();
+    StackFrame *frame = NULL;
     Target *target = exe_ctx.GetTargetPtr();
-    if (frame && target)
+    Process *process = exe_ctx.GetProcessPtr();
+    if (target && process)
     {
         Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
+        if (stop_locker.TryLock(&process->GetRunLock()))
         {
-            sb_symbol.reset(frame->GetSymbolContext (eSymbolContextSymbol).symbol);
+            frame = exe_ctx.GetFramePtr();
+            if (frame)
+            {
+                sb_symbol.reset(frame->GetSymbolContext (eSymbolContextSymbol).symbol);
+            }
+            else
+            {
+                if (log)
+                    log->Printf ("SBFrame::GetSymbol () => error: could not reconstruct frame object for this SBFrame.");
+            }
         }
         else
         {
             if (log)
-                log->Printf ("SBFrame(%p)::GetSymbol () => error: process is running", frame);
+                log->Printf ("SBFrame::GetSymbol () => error: process is running");
         }
     }
     if (log)
@@ -267,14 +317,24 @@
     Mutex::Locker api_locker;
     ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
 
-    StackFrame *frame = exe_ctx.GetFramePtr();
+    StackFrame *frame = NULL;
     Target *target = exe_ctx.GetTargetPtr();
-    if (frame && target)
+    Process *process = exe_ctx.GetProcessPtr();
+    if (target && process)
     {
         Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
+        if (stop_locker.TryLock(&process->GetRunLock()))
         {
-            sb_block.SetPtr (frame->GetSymbolContext (eSymbolContextBlock).block);
+            frame = exe_ctx.GetFramePtr();
+            if (frame)
+            {
+                sb_block.SetPtr (frame->GetSymbolContext (eSymbolContextBlock).block);
+            }
+            else
+            {
+                if (log)
+                    log->Printf ("SBFrame::GetBlock () => error: could not reconstruct frame object for this SBFrame.");
+            }
         }
         else
         {
@@ -295,20 +355,30 @@
     Mutex::Locker api_locker;
     ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
 
-    StackFrame *frame = exe_ctx.GetFramePtr();
+    StackFrame *frame = NULL;
     Target *target = exe_ctx.GetTargetPtr();
     LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
-    if (frame && target)
+    Process *process = exe_ctx.GetProcessPtr();
+    if (target && process)
     {
         Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
+        if (stop_locker.TryLock(&process->GetRunLock()))
         {
-            sb_block.SetPtr(frame->GetFrameBlock ());
+            frame = exe_ctx.GetFramePtr();
+            if (frame)
+            {
+                sb_block.SetPtr(frame->GetFrameBlock ());
+            }
+            else
+            {
+                if (log)
+                    log->Printf ("SBFrame::GetFrameBlock () => error: could not reconstruct frame object for this SBFrame.");
+            }
         }
         else
         {
             if (log)
-                log->Printf ("SBFrame(%p)::GetFrameBlock () => error: process is running", frame);
+                log->Printf ("SBFrame::GetFrameBlock () => error: process is running");
         }
     }
     if (log)
@@ -325,19 +395,29 @@
     Mutex::Locker api_locker;
     ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
 
-    StackFrame *frame = exe_ctx.GetFramePtr();
+    StackFrame *frame = NULL;
     Target *target = exe_ctx.GetTargetPtr();
-    if (frame && target)
+    Process *process = exe_ctx.GetProcessPtr();
+    if (target && process)
     {
         Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
+        if (stop_locker.TryLock(&process->GetRunLock()))
         {
-            sb_line_entry.SetLineEntry (frame->GetSymbolContext (eSymbolContextLineEntry).line_entry);
+            frame = exe_ctx.GetFramePtr();
+            if (frame)
+            {
+                sb_line_entry.SetLineEntry (frame->GetSymbolContext (eSymbolContextLineEntry).line_entry);
+            }
+            else
+            {
+                if (log)
+                    log->Printf ("SBFrame::GetLineEntry () => error: could not reconstruct frame object for this SBFrame.");
+            }
         }
         else
         {
             if (log)
-                log->Printf ("SBFrame(%p)::GetLineEntry () => error: process is running", frame);
+                log->Printf ("SBFrame::GetLineEntry () => error: process is running");
         }
     }
     if (log)
@@ -371,24 +451,34 @@
     Mutex::Locker api_locker;
     ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
 
-    StackFrame *frame = exe_ctx.GetFramePtr();
+    StackFrame *frame = NULL;
     Target *target = exe_ctx.GetTargetPtr();
-    if (frame && target)
+    Process *process = exe_ctx.GetProcessPtr();
+    if (target && process)
     {
         Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
+        if (stop_locker.TryLock(&process->GetRunLock()))
         {
-            addr = frame->GetFrameCodeAddress().GetOpcodeLoadAddress (target);
+            frame = exe_ctx.GetFramePtr();
+            if (frame)
+            {
+                addr = frame->GetFrameCodeAddress().GetOpcodeLoadAddress (target);
+            }
+            else
+            {
+                if (log)
+                    log->Printf ("SBFrame::GetPC () => error: could not reconstruct frame object for this SBFrame.");
+            }
         }
         else
         {
             if (log)
-                log->Printf ("SBFrame(%p)::GetPC () => error: process is running", frame);
+                log->Printf ("SBFrame::GetPC () => error: process is running");
         }
     }
 
     if (log)
-        log->Printf ("SBFrame(%p)::GetPC () => 0x%llx", frame, addr);
+        log->Printf ("SBFrame(%p)::GetPC () => 0x%" PRIx64, frame, addr);
 
     return addr;
 }
@@ -401,24 +491,34 @@
     Mutex::Locker api_locker;
     ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
 
-    StackFrame *frame = exe_ctx.GetFramePtr();
+    StackFrame *frame = NULL;
     Target *target = exe_ctx.GetTargetPtr();
-    if (frame && target)
+    Process *process = exe_ctx.GetProcessPtr();
+    if (target && process)
     {
         Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
+        if (stop_locker.TryLock(&process->GetRunLock()))
         {
-            ret_val = frame->GetRegisterContext()->SetPC (new_pc);
+            frame = exe_ctx.GetFramePtr();
+            if (frame)
+            {
+                ret_val = frame->GetRegisterContext()->SetPC (new_pc);
+            }
+            else
+            {
+                if (log)
+                    log->Printf ("SBFrame::SetPC () => error: could not reconstruct frame object for this SBFrame.");
+            }
         }
         else
         {
             if (log)
-                log->Printf ("SBFrame(%p)::SetPC () => error: process is running", frame);
+                log->Printf ("SBFrame::SetPC () => error: process is running");
         }
     }
 
     if (log)
-        log->Printf ("SBFrame(%p)::SetPC (new_pc=0x%llx) => %i", 
+        log->Printf ("SBFrame(%p)::SetPC (new_pc=0x%" PRIx64 ") => %i",
                      frame, new_pc, ret_val);
 
     return ret_val;
@@ -432,23 +532,33 @@
     Mutex::Locker api_locker;
     ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
 
-    StackFrame *frame = exe_ctx.GetFramePtr();
+    StackFrame *frame = NULL;
     Target *target = exe_ctx.GetTargetPtr();
-    if (frame && target)
+    Process *process = exe_ctx.GetProcessPtr();
+    if (target && process)
     {
         Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
+        if (stop_locker.TryLock(&process->GetRunLock()))
         {
-            addr = frame->GetRegisterContext()->GetSP();
+            frame = exe_ctx.GetFramePtr();
+            if (frame)
+            {
+                addr = frame->GetRegisterContext()->GetSP();
+            }
+            else
+            {
+                if (log)
+                    log->Printf ("SBFrame::GetSP () => error: could not reconstruct frame object for this SBFrame.");
+            }
         }
         else
         {
             if (log)
-                log->Printf ("SBFrame(%p)::GetSP () => error: process is running", frame);
+                log->Printf ("SBFrame::GetSP () => error: process is running");
         }
     }
     if (log)
-        log->Printf ("SBFrame(%p)::GetSP () => 0x%llx", frame, addr);
+        log->Printf ("SBFrame(%p)::GetSP () => 0x%" PRIx64, frame, addr);
 
     return addr;
 }
@@ -462,24 +572,34 @@
     Mutex::Locker api_locker;
     ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
 
-    StackFrame *frame = exe_ctx.GetFramePtr();
+    StackFrame *frame = NULL;
     Target *target = exe_ctx.GetTargetPtr();
-    if (frame && target)
+    Process *process = exe_ctx.GetProcessPtr();
+    if (target && process)
     {
         Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
+        if (stop_locker.TryLock(&process->GetRunLock()))
         {
-            addr = frame->GetRegisterContext()->GetFP();
+            frame = exe_ctx.GetFramePtr();
+            if (frame)
+            {
+                addr = frame->GetRegisterContext()->GetFP();
+            }
+            else
+            {
+                if (log)
+                    log->Printf ("SBFrame::GetFP () => error: could not reconstruct frame object for this SBFrame.");
+            }
         }
         else
         {
             if (log)
-                log->Printf ("SBFrame(%p)::GetFP () => error: process is running", frame);
+                log->Printf ("SBFrame::GetFP () => error: process is running");
         }
     }
 
     if (log)
-        log->Printf ("SBFrame(%p)::GetFP () => 0x%llx", frame, addr);
+        log->Printf ("SBFrame(%p)::GetFP () => 0x%" PRIx64, frame, addr);
     return addr;
 }
 
@@ -494,17 +614,27 @@
 
     StackFrame *frame = exe_ctx.GetFramePtr();
     Target *target = exe_ctx.GetTargetPtr();
-    if (frame && target)
+    Process *process = exe_ctx.GetProcessPtr();
+    if (target && process)
     {
         Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
+        if (stop_locker.TryLock(&process->GetRunLock()))
         {
-            sb_addr.SetAddress (&frame->GetFrameCodeAddress());
+            frame = exe_ctx.GetFramePtr();
+            if (frame)
+            {
+                sb_addr.SetAddress (&frame->GetFrameCodeAddress());
+            }
+            else
+            {
+                if (log)
+                    log->Printf ("SBFrame::GetPCAddress () => error: could not reconstruct frame object for this SBFrame.");
+            }
         }
         else
         {
             if (log)
-                log->Printf ("SBFrame(%p)::GetPCAddress () => error: process is running", frame);
+                log->Printf ("SBFrame::GetPCAddress () => error: process is running");
         }
     }
     if (log)
@@ -538,29 +668,46 @@
 {
     SBValue sb_value;
     Mutex::Locker api_locker;
+    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    if (var_path == NULL || var_path[0] == '\0')
+    {
+        if (log)
+            log->Printf ("SBFrame::GetValueForVariablePath called with empty variable path.");
+        return sb_value;
+    }
+    
     ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
 
     StackFrame *frame = exe_ctx.GetFramePtr();
     Target *target = exe_ctx.GetTargetPtr();
-    if (frame && target && var_path && var_path[0])
+    Process *process = exe_ctx.GetProcessPtr();
+    if (target && process)
     {
         Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
+        if (stop_locker.TryLock(&process->GetRunLock()))
         {
-            VariableSP var_sp;
-            Error error;
-            ValueObjectSP value_sp (frame->GetValueForVariableExpressionPath (var_path,
-                                                                              eNoDynamicValues,
-                                                                              StackFrame::eExpressionPathOptionCheckPtrVsMember | StackFrame::eExpressionPathOptionsAllowDirectIVarAccess,
-                                                                              var_sp,
-                                                                              error));
-            sb_value.SetSP(value_sp, use_dynamic);
+            frame = exe_ctx.GetFramePtr();
+            if (frame)
+            {
+                VariableSP var_sp;
+                Error error;
+                ValueObjectSP value_sp (frame->GetValueForVariableExpressionPath (var_path,
+                                                                                  eNoDynamicValues,
+                                                                                  StackFrame::eExpressionPathOptionCheckPtrVsMember | StackFrame::eExpressionPathOptionsAllowDirectIVarAccess,
+                                                                                  var_sp,
+                                                                                  error));
+                sb_value.SetSP(value_sp, use_dynamic);
+            }
+            else
+            {
+                if (log)
+                    log->Printf ("SBFrame::GetValueForVariablePath () => error: could not reconstruct frame object for this SBFrame.");
+            }
         }
         else
         {
-            LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
             if (log)
-                log->Printf ("SBFrame(%p)::GetValueForVariablePath () => error: process is running", frame);
+                log->Printf ("SBFrame::GetValueForVariablePath () => error: process is running");
         }
     }
     return sb_value;
@@ -588,45 +735,63 @@
     LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     VariableSP var_sp;
     SBValue sb_value;
+
+    if (name == NULL || name[0] == '\0')
+    {
+        if (log)
+            log->Printf ("SBFrame::FindVariable called with empty name");
+        return sb_value;
+    }
+    
     ValueObjectSP value_sp;
     Mutex::Locker api_locker;
     ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
 
-    StackFrame *frame = exe_ctx.GetFramePtr();
+    StackFrame *frame = NULL;
     Target *target = exe_ctx.GetTargetPtr();
-    if (frame && target && name && name[0])
+    Process *process = exe_ctx.GetProcessPtr();
+    if (target && process)
     {
         Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
+        if (stop_locker.TryLock(&process->GetRunLock()))
         {
-            VariableList variable_list;
-            SymbolContext sc (frame->GetSymbolContext (eSymbolContextBlock));
-
-            if (sc.block)
+            frame = exe_ctx.GetFramePtr();
+            if (frame)
             {
-                const bool can_create = true;
-                const bool get_parent_variables = true;
-                const bool stop_if_block_is_inlined_function = true;
-                
-                if (sc.block->AppendVariables (can_create, 
-                                               get_parent_variables,
-                                               stop_if_block_is_inlined_function,
-                                               &variable_list))
+                VariableList variable_list;
+                SymbolContext sc (frame->GetSymbolContext (eSymbolContextBlock));
+
+                if (sc.block)
+                {
+                    const bool can_create = true;
+                    const bool get_parent_variables = true;
+                    const bool stop_if_block_is_inlined_function = true;
+                    
+                    if (sc.block->AppendVariables (can_create, 
+                                                   get_parent_variables,
+                                                   stop_if_block_is_inlined_function,
+                                                   &variable_list))
+                    {
+                        var_sp = variable_list.FindVariable (ConstString(name));
+                    }
+                }
+
+                if (var_sp)
                 {
-                    var_sp = variable_list.FindVariable (ConstString(name));
+                    value_sp = frame->GetValueObjectForFrameVariable(var_sp, eNoDynamicValues);
+                    sb_value.SetSP(value_sp, use_dynamic);
                 }
             }
-
-            if (var_sp)
+            else
             {
-                value_sp = frame->GetValueObjectForFrameVariable(var_sp, eNoDynamicValues);
-                sb_value.SetSP(value_sp, use_dynamic);
+                if (log)
+                    log->Printf ("SBFrame::FindVariable () => error: could not reconstruct frame object for this SBFrame.");
             }
         }
         else
         {
             if (log)
-                log->Printf ("SBFrame(%p)::FindVariable () => error: process is running", frame);
+                log->Printf ("SBFrame::FindVariable () => error: process is running");
         }
     }
     
@@ -657,119 +822,137 @@
 {
     LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     SBValue sb_value;
+    
+    if (name == NULL || name[0] == '\0')
+    {
+        if (log)
+            log->Printf ("SBFrame::FindValue called with empty name.");
+        return sb_value;
+    }
+    
     ValueObjectSP value_sp;
     Mutex::Locker api_locker;
     ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
 
-    StackFrame *frame = exe_ctx.GetFramePtr();
+    StackFrame *frame = NULL;
     Target *target = exe_ctx.GetTargetPtr();
-    if (frame && target && name && name[0])
+    Process *process = exe_ctx.GetProcessPtr();
+    if (target && process)
     {
         Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
+        if (stop_locker.TryLock(&process->GetRunLock()))
         {
-            switch (value_type)
+            frame = exe_ctx.GetFramePtr();
+            if (frame)
             {
-            case eValueTypeVariableGlobal:      // global variable
-            case eValueTypeVariableStatic:      // static variable
-            case eValueTypeVariableArgument:    // function argument variables
-            case eValueTypeVariableLocal:       // function local variables
+                switch (value_type)
                 {
-                    VariableList *variable_list = frame->GetVariableList(true);
-
-                    SymbolContext sc (frame->GetSymbolContext (eSymbolContextBlock));
+                case eValueTypeVariableGlobal:      // global variable
+                case eValueTypeVariableStatic:      // static variable
+                case eValueTypeVariableArgument:    // function argument variables
+                case eValueTypeVariableLocal:       // function local variables
+                    {
+                        VariableList *variable_list = frame->GetVariableList(true);
 
-                    const bool can_create = true;
-                    const bool get_parent_variables = true;
-                    const bool stop_if_block_is_inlined_function = true;
+                        SymbolContext sc (frame->GetSymbolContext (eSymbolContextBlock));
 
-                    if (sc.block && sc.block->AppendVariables (can_create, 
-                                                               get_parent_variables,
-                                                               stop_if_block_is_inlined_function,
-                                                               variable_list))
-                    {
-                        ConstString const_name(name);
-                        const uint32_t num_variables = variable_list->GetSize();
-                        for (uint32_t i = 0; i < num_variables; ++i)
+                        const bool can_create = true;
+                        const bool get_parent_variables = true;
+                        const bool stop_if_block_is_inlined_function = true;
+
+                        if (sc.block && sc.block->AppendVariables (can_create, 
+                                                                   get_parent_variables,
+                                                                   stop_if_block_is_inlined_function,
+                                                                   variable_list))
                         {
-                            VariableSP variable_sp (variable_list->GetVariableAtIndex(i));
-                            if (variable_sp && 
-                                variable_sp->GetScope() == value_type &&
-                                variable_sp->GetName() == const_name)
+                            ConstString const_name(name);
+                            const uint32_t num_variables = variable_list->GetSize();
+                            for (uint32_t i = 0; i < num_variables; ++i)
                             {
-                                value_sp = frame->GetValueObjectForFrameVariable (variable_sp, eNoDynamicValues);
-                                sb_value.SetSP (value_sp, use_dynamic);
-                                break;
+                                VariableSP variable_sp (variable_list->GetVariableAtIndex(i));
+                                if (variable_sp && 
+                                    variable_sp->GetScope() == value_type &&
+                                    variable_sp->GetName() == const_name)
+                                {
+                                    value_sp = frame->GetValueObjectForFrameVariable (variable_sp, eNoDynamicValues);
+                                    sb_value.SetSP (value_sp, use_dynamic);
+                                    break;
+                                }
                             }
                         }
                     }
-                }
-                break;
+                    break;
 
-            case eValueTypeRegister:            // stack frame register value
-                {
-                    RegisterContextSP reg_ctx (frame->GetRegisterContext());
-                    if (reg_ctx)
+                case eValueTypeRegister:            // stack frame register value
                     {
-                        const uint32_t num_regs = reg_ctx->GetRegisterCount();
-                        for (uint32_t reg_idx = 0; reg_idx < num_regs; ++reg_idx)
+                        RegisterContextSP reg_ctx (frame->GetRegisterContext());
+                        if (reg_ctx)
                         {
-                            const RegisterInfo *reg_info = reg_ctx->GetRegisterInfoAtIndex (reg_idx);
-                            if (reg_info && 
-                                ((reg_info->name && strcasecmp (reg_info->name, name) == 0) ||
-                                 (reg_info->alt_name && strcasecmp (reg_info->alt_name, name) == 0)))
+                            const uint32_t num_regs = reg_ctx->GetRegisterCount();
+                            for (uint32_t reg_idx = 0; reg_idx < num_regs; ++reg_idx)
                             {
-                                value_sp = ValueObjectRegister::Create (frame, reg_ctx, reg_idx);
-                                sb_value.SetSP (value_sp);
-                                break;
+                                const RegisterInfo *reg_info = reg_ctx->GetRegisterInfoAtIndex (reg_idx);
+                                if (reg_info && 
+                                    ((reg_info->name && strcasecmp (reg_info->name, name) == 0) ||
+                                     (reg_info->alt_name && strcasecmp (reg_info->alt_name, name) == 0)))
+                                {
+                                    value_sp = ValueObjectRegister::Create (frame, reg_ctx, reg_idx);
+                                    sb_value.SetSP (value_sp);
+                                    break;
+                                }
                             }
                         }
                     }
-                }
-                break;
+                    break;
 
-            case eValueTypeRegisterSet:         // A collection of stack frame register values
-                {
-                    RegisterContextSP reg_ctx (frame->GetRegisterContext());
-                    if (reg_ctx)
+                case eValueTypeRegisterSet:         // A collection of stack frame register values
                     {
-                        const uint32_t num_sets = reg_ctx->GetRegisterSetCount();
-                        for (uint32_t set_idx = 0; set_idx < num_sets; ++set_idx)
+                        RegisterContextSP reg_ctx (frame->GetRegisterContext());
+                        if (reg_ctx)
                         {
-                            const RegisterSet *reg_set = reg_ctx->GetRegisterSet (set_idx);
-                            if (reg_set && 
-                                ((reg_set->name && strcasecmp (reg_set->name, name) == 0) ||
-                                 (reg_set->short_name && strcasecmp (reg_set->short_name, name) == 0)))
+                            const uint32_t num_sets = reg_ctx->GetRegisterSetCount();
+                            for (uint32_t set_idx = 0; set_idx < num_sets; ++set_idx)
                             {
-                                value_sp = ValueObjectRegisterSet::Create (frame, reg_ctx, set_idx);
-                                sb_value.SetSP (value_sp);
-                                break;
+                                const RegisterSet *reg_set = reg_ctx->GetRegisterSet (set_idx);
+                                if (reg_set && 
+                                    ((reg_set->name && strcasecmp (reg_set->name, name) == 0) ||
+                                     (reg_set->short_name && strcasecmp (reg_set->short_name, name) == 0)))
+                                {
+                                    value_sp = ValueObjectRegisterSet::Create (frame, reg_ctx, set_idx);
+                                    sb_value.SetSP (value_sp);
+                                    break;
+                                }
                             }
                         }
                     }
-                }
-                break;
+                    break;
 
-            case eValueTypeConstResult:         // constant result variables
-                {
-                    ConstString const_name(name);
-                    ClangExpressionVariableSP expr_var_sp (target->GetPersistentVariables().GetVariable (const_name));
-                    if (expr_var_sp)
+                case eValueTypeConstResult:         // constant result variables
                     {
-                        value_sp = expr_var_sp->GetValueObject();
-                        sb_value.SetSP (value_sp, use_dynamic);
+                        ConstString const_name(name);
+                        ClangExpressionVariableSP expr_var_sp (target->GetPersistentVariables().GetVariable (const_name));
+                        if (expr_var_sp)
+                        {
+                            value_sp = expr_var_sp->GetValueObject();
+                            sb_value.SetSP (value_sp, use_dynamic);
+                        }
                     }
-                }
-                break;
+                    break;
 
-            default:
-                break;
+                default:
+                    break;
+                }
+            }
+            else
+            {
+                if (log)
+                    log->Printf ("SBFrame::FindValue () => error: could not reconstruct frame object for this SBFrame.");
             }
         }
         else
         {
             if (log)
-                log->Printf ("SBFrame(%p)::FindValue () => error: process is running", frame);
+                log->Printf ("SBFrame::FindValue () => error: process is running");
         }
     }
     
@@ -831,19 +1014,29 @@
     Mutex::Locker api_locker;
     ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
 
-    StackFrame *frame = exe_ctx.GetFramePtr();
+    StackFrame *frame = NULL;
     Target *target = exe_ctx.GetTargetPtr();
-    if (frame && target)
+    Process *process = exe_ctx.GetProcessPtr();
+    if (target && process)
     {
         Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
+        if (stop_locker.TryLock(&process->GetRunLock()))
         {
-            disassembly = frame->Disassemble();
+            frame = exe_ctx.GetFramePtr();
+            if (frame)
+            {
+                disassembly = frame->Disassemble();
+            }
+            else
+            {
+                if (log)
+                    log->Printf ("SBFrame::Disassemble () => error: could not reconstruct frame object for this SBFrame.");
+            }
         }
         else
         {
             if (log)
-                log->Printf ("SBFrame(%p)::Disassemble () => error: process is running", frame);
+                log->Printf ("SBFrame::Disassemble () => error: process is running");
         }            
     }
 
@@ -885,74 +1078,82 @@
     Mutex::Locker api_locker;
     ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
 
-    StackFrame *frame = exe_ctx.GetFramePtr();
+    StackFrame *frame = NULL;
     Target *target = exe_ctx.GetTargetPtr();
 
     if (log)
-        log->Printf ("SBFrame(%p)::GetVariables (arguments=%i, locals=%i, statics=%i, in_scope_only=%i)", 
-                     frame, 
+        log->Printf ("SBFrame::GetVariables (arguments=%i, locals=%i, statics=%i, in_scope_only=%i)", 
                      arguments,
                      locals,
                      statics,
                      in_scope_only);
     
-    if (frame && target)
+    Process *process = exe_ctx.GetProcessPtr();
+    if (target && process)
     {
         Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
+        if (stop_locker.TryLock(&process->GetRunLock()))
         {
-
-            size_t i;
-            VariableList *variable_list = NULL;
-            variable_list = frame->GetVariableList(true);
-            if (variable_list)
+            frame = exe_ctx.GetFramePtr();
+            if (frame)
             {
-                const size_t num_variables = variable_list->GetSize();
-                if (num_variables)
+                size_t i;
+                VariableList *variable_list = NULL;
+                variable_list = frame->GetVariableList(true);
+                if (variable_list)
                 {
-                    for (i = 0; i < num_variables; ++i)
+                    const size_t num_variables = variable_list->GetSize();
+                    if (num_variables)
                     {
-                        VariableSP variable_sp (variable_list->GetVariableAtIndex(i));
-                        if (variable_sp)
+                        for (i = 0; i < num_variables; ++i)
                         {
-                            bool add_variable = false;
-                            switch (variable_sp->GetScope())
-                            {
-                            case eValueTypeVariableGlobal:
-                            case eValueTypeVariableStatic:
-                                add_variable = statics;
-                                break;
-
-                            case eValueTypeVariableArgument:
-                                add_variable = arguments;
-                                break;
-
-                            case eValueTypeVariableLocal:
-                                add_variable = locals;
-                                break;
-
-                            default:
-                                break;
-                            }
-                            if (add_variable)
+                            VariableSP variable_sp (variable_list->GetVariableAtIndex(i));
+                            if (variable_sp)
                             {
-                                if (in_scope_only && !variable_sp->IsInScope(frame))
-                                    continue;
-
-                                ValueObjectSP valobj_sp(frame->GetValueObjectForFrameVariable (variable_sp, eNoDynamicValues));
-                                SBValue value_sb;
-                                value_sb.SetSP(valobj_sp,use_dynamic);
-                                value_list.Append(value_sb);
+                                bool add_variable = false;
+                                switch (variable_sp->GetScope())
+                                {
+                                case eValueTypeVariableGlobal:
+                                case eValueTypeVariableStatic:
+                                    add_variable = statics;
+                                    break;
+
+                                case eValueTypeVariableArgument:
+                                    add_variable = arguments;
+                                    break;
+
+                                case eValueTypeVariableLocal:
+                                    add_variable = locals;
+                                    break;
+
+                                default:
+                                    break;
+                                }
+                                if (add_variable)
+                                {
+                                    if (in_scope_only && !variable_sp->IsInScope(frame))
+                                        continue;
+
+                                    ValueObjectSP valobj_sp(frame->GetValueObjectForFrameVariable (variable_sp, eNoDynamicValues));
+                                    SBValue value_sb;
+                                    value_sb.SetSP(valobj_sp,use_dynamic);
+                                    value_list.Append(value_sb);
+                                }
                             }
                         }
                     }
                 }
             }
+            else
+            {
+                if (log)
+                    log->Printf ("SBFrame::GetVariables () => error: could not reconstruct frame object for this SBFrame.");
+            }
         }
         else
         {
             if (log)
-                log->Printf ("SBFrame(%p)::GetVariables () => error: process is running", frame);
+                log->Printf ("SBFrame::GetVariables () => error: process is running");
         }            
     }
 
@@ -974,27 +1175,37 @@
     Mutex::Locker api_locker;
     ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
 
-    StackFrame *frame = exe_ctx.GetFramePtr();
+    StackFrame *frame = NULL;
     Target *target = exe_ctx.GetTargetPtr();
-    if (frame && target)
+    Process *process = exe_ctx.GetProcessPtr();
+    if (target && process)
     {
         Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
+        if (stop_locker.TryLock(&process->GetRunLock()))
         {
-            RegisterContextSP reg_ctx (frame->GetRegisterContext());
-            if (reg_ctx)
+            frame = exe_ctx.GetFramePtr();
+            if (frame)
             {
-                const uint32_t num_sets = reg_ctx->GetRegisterSetCount();
-                for (uint32_t set_idx = 0; set_idx < num_sets; ++set_idx)
+                RegisterContextSP reg_ctx (frame->GetRegisterContext());
+                if (reg_ctx)
                 {
-                    value_list.Append(ValueObjectRegisterSet::Create (frame, reg_ctx, set_idx));
+                    const uint32_t num_sets = reg_ctx->GetRegisterSetCount();
+                    for (uint32_t set_idx = 0; set_idx < num_sets; ++set_idx)
+                    {
+                        value_list.Append(ValueObjectRegisterSet::Create (frame, reg_ctx, set_idx));
+                    }
                 }
             }
+            else
+            {
+                if (log)
+                    log->Printf ("SBFrame::GetRegisters () => error: could not reconstruct frame object for this SBFrame.");
+            }
         }
         else
         {
             if (log)
-                log->Printf ("SBFrame(%p)::GetRegisters () => error: process is running", frame);
+                log->Printf ("SBFrame::GetRegisters () => error: process is running");
         }            
     }
 
@@ -1007,25 +1218,35 @@
 bool
 SBFrame::GetDescription (SBStream &description)
 {
+    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     Stream &strm = description.ref();
 
     Mutex::Locker api_locker;
     ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
 
-    StackFrame *frame = exe_ctx.GetFramePtr();
+    StackFrame *frame;
     Target *target = exe_ctx.GetTargetPtr();
-    if (frame && target)
+    Process *process = exe_ctx.GetProcessPtr();
+    if (target && process)
     {
         Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
+        if (stop_locker.TryLock(&process->GetRunLock()))
         {
-            frame->DumpUsingSettingsFormat (&strm);
+            frame = exe_ctx.GetFramePtr();
+            if (frame)
+            {
+                frame->DumpUsingSettingsFormat (&strm);
+            }
+            else
+            {
+                if (log)
+                    log->Printf ("SBFrame::GetDescription () => error: could not reconstruct frame object for this SBFrame.");
+            }
         }
         else
         {
-            LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
             if (log)
-                log->Printf ("SBFrame(%p)::GetDescription () => error: process is running", frame);
+                log->Printf ("SBFrame::GetDescription () => error: process is running");
         }            
 
     }
@@ -1080,40 +1301,59 @@
 
     ExecutionResults exe_results = eExecutionSetupError;
     SBValue expr_result;
+    
+    if (expr == NULL || expr[0] == '\0')
+    {
+        if (log)
+            log->Printf ("SBFrame::EvaluateExpression called with an empty expression");
+        return expr_result;
+    }
+    
     ValueObjectSP expr_value_sp;
 
     Mutex::Locker api_locker;
     ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
 
-    StackFrame *frame = exe_ctx.GetFramePtr();
-    Target *target = exe_ctx.GetTargetPtr();
     if (log)
-        log->Printf ("SBFrame(%p)::EvaluateExpression (expr=\"%s\")...", frame, expr);
+        log->Printf ("SBFrame()::EvaluateExpression (expr=\"%s\")...", expr);
 
-    if (frame && target)
-    {            
+    StackFrame *frame = NULL;
+    Target *target = exe_ctx.GetTargetPtr();
+    Process *process = exe_ctx.GetProcessPtr();
+    
+    if (target && process)
+    {
         Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
+        if (stop_locker.TryLock(&process->GetRunLock()))
         {
+            frame = exe_ctx.GetFramePtr();
+            if (frame)
+            {
 #ifdef LLDB_CONFIGURATION_DEBUG
-            StreamString frame_description;
-            frame->DumpUsingSettingsFormat (&frame_description);
-            Host::SetCrashDescriptionWithFormat ("SBFrame::EvaluateExpression (expr = \"%s\", fetch_dynamic_value = %u) %s",
-                                                 expr, options.GetFetchDynamicValue(), frame_description.GetString().c_str());
+                StreamString frame_description;
+                frame->DumpUsingSettingsFormat (&frame_description);
+                Host::SetCrashDescriptionWithFormat ("SBFrame::EvaluateExpression (expr = \"%s\", fetch_dynamic_value = %u) %s",
+                                                     expr, options.GetFetchDynamicValue(), frame_description.GetString().c_str());
 #endif
-            exe_results = target->EvaluateExpression (expr, 
-                                                      frame,
-                                                      expr_value_sp,
-                                                      options.ref());
-            expr_result.SetSP(expr_value_sp,options.GetFetchDynamicValue());
+                exe_results = target->EvaluateExpression (expr, 
+                                                          frame,
+                                                          expr_value_sp,
+                                                          options.ref());
+                expr_result.SetSP(expr_value_sp, options.GetFetchDynamicValue());
 #ifdef LLDB_CONFIGURATION_DEBUG
-            Host::SetCrashDescription (NULL);
+                Host::SetCrashDescription (NULL);
 #endif
+            }
+            else
+            {
+                if (log)
+                    log->Printf ("SBFrame::EvaluateExpression () => error: could not reconstruct frame object for this SBFrame.");
+            }
         }
         else
         {
             if (log)
-                log->Printf ("SBFrame(%p)::EvaluateExpression () => error: process is running", frame);
+                log->Printf ("SBFrame::EvaluateExpression () => error: process is running");
         }            
     }
 
@@ -1137,24 +1377,34 @@
 bool
 SBFrame::IsInlined()
 {
+    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     ExecutionContext exe_ctx(m_opaque_sp.get());
-    StackFrame *frame = exe_ctx.GetFramePtr();
+    StackFrame *frame = NULL;
     Target *target = exe_ctx.GetTargetPtr();
-    if (frame && target)
+    Process *process = exe_ctx.GetProcessPtr();
+    if (target && process)
     {
         Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
+        if (stop_locker.TryLock(&process->GetRunLock()))
         {
+            frame = exe_ctx.GetFramePtr();
+            if (frame)
+            {
 
-            Block *block = frame->GetSymbolContext(eSymbolContextBlock).block;
-            if (block)
-                return block->GetContainingInlinedBlock () != NULL;
+                Block *block = frame->GetSymbolContext(eSymbolContextBlock).block;
+                if (block)
+                    return block->GetContainingInlinedBlock () != NULL;
+            }
+            else
+            {
+                if (log)
+                    log->Printf ("SBFrame::IsInlined () => error: could not reconstruct frame object for this SBFrame.");
+            }
         }
         else
         {
-            LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
             if (log)
-                log->Printf ("SBFrame(%p)::IsInlined () => error: process is running", frame);
+                log->Printf ("SBFrame::IsInlined () => error: process is running");
         }            
 
     }
@@ -1164,43 +1414,53 @@
 const char *
 SBFrame::GetFunctionName()
 {
+    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     const char *name = NULL;
     ExecutionContext exe_ctx(m_opaque_sp.get());
-    StackFrame *frame = exe_ctx.GetFramePtr();
+    StackFrame *frame = NULL;
     Target *target = exe_ctx.GetTargetPtr();
-    if (frame && target)
+    Process *process = exe_ctx.GetProcessPtr();
+    if (target && process)
     {
         Process::StopLocker stop_locker;
-        if (stop_locker.TryLock(&exe_ctx.GetProcessPtr()->GetRunLock()))
+        if (stop_locker.TryLock(&process->GetRunLock()))
         {
-            SymbolContext sc (frame->GetSymbolContext(eSymbolContextFunction | eSymbolContextBlock | eSymbolContextSymbol));
-            if (sc.block)
+            frame = exe_ctx.GetFramePtr();
+            if (frame)
             {
-                Block *inlined_block = sc.block->GetContainingInlinedBlock ();
-                if (inlined_block)
+                SymbolContext sc (frame->GetSymbolContext(eSymbolContextFunction | eSymbolContextBlock | eSymbolContextSymbol));
+                if (sc.block)
                 {
-                    const InlineFunctionInfo* inlined_info = inlined_block->GetInlinedFunctionInfo();
-                    name = inlined_info->GetName().AsCString();
+                    Block *inlined_block = sc.block->GetContainingInlinedBlock ();
+                    if (inlined_block)
+                    {
+                        const InlineFunctionInfo* inlined_info = inlined_block->GetInlinedFunctionInfo();
+                        name = inlined_info->GetName().AsCString();
+                    }
+                }
+                
+                if (name == NULL)
+                {
+                    if (sc.function)
+                        name = sc.function->GetName().GetCString();
                 }
-            }
-            
-            if (name == NULL)
-            {
-                if (sc.function)
-                    name = sc.function->GetName().GetCString();
-            }
 
-            if (name == NULL)
+                if (name == NULL)
+                {
+                    if (sc.symbol)
+                        name = sc.symbol->GetName().GetCString();
+                }
+            }
+            else
             {
-                if (sc.symbol)
-                    name = sc.symbol->GetName().GetCString();
+                if (log)
+                    log->Printf ("SBFrame::GetFunctionName () => error: could not reconstruct frame object for this SBFrame.");
             }
         }
         else
         {
-            LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
             if (log)
-                log->Printf ("SBFrame(%p)::GetFunctionName() => error: process is running", frame);
+                log->Printf ("SBFrame::GetFunctionName() => error: process is running");
 
         }
     }

Modified: lldb/branches/windows/source/API/SBFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/API/SBFunction.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/API/SBFunction.cpp (original)
+++ lldb/branches/windows/source/API/SBFunction.cpp Tue Jan  8 06:51:53 2013
@@ -107,7 +107,7 @@
 {
     if (m_opaque_ptr)
     {
-        s.Printf ("SBFunction: id = 0x%8.8llx, name = %s", 
+        s.Printf ("SBFunction: id = 0x%8.8" PRIx64 ", name = %s",
                   m_opaque_ptr->GetID(),
                   m_opaque_ptr->GetName().AsCString());
         Type *func_type = m_opaque_ptr->GetType();

Modified: lldb/branches/windows/source/API/SBHostOS.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/API/SBHostOS.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/API/SBHostOS.cpp (original)
+++ lldb/branches/windows/source/API/SBHostOS.cpp Tue Jan  8 06:51:53 2013
@@ -26,6 +26,18 @@
     return sb_filespec;
 }
 
+SBFileSpec
+SBHostOS::GetLLDBPythonPath ()
+{
+    SBFileSpec sb_lldb_python_filespec;
+    FileSpec lldb_python_spec;
+    if (Host::GetLLDBPath (ePathTypePythonDir, lldb_python_spec))
+    {
+        sb_lldb_python_filespec.SetFileSpec (lldb_python_spec);
+    }
+    return sb_lldb_python_filespec;
+}
+
 lldb::thread_t
 SBHostOS::ThreadCreate
 (

Modified: lldb/branches/windows/source/API/SBListener.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/API/SBListener.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/API/SBListener.cpp (original)
+++ lldb/branches/windows/source/API/SBListener.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/API/SBListener.h"
 #include "lldb/API/SBBroadcaster.h"
 #include "lldb/API/SBDebugger.h"

Modified: lldb/branches/windows/source/API/SBModule.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/API/SBModule.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/API/SBModule.cpp (original)
+++ lldb/branches/windows/source/API/SBModule.cpp Tue Jan  8 06:51:53 2013
@@ -328,6 +328,68 @@
     return sb_symbol;
 }
 
+lldb::SBSymbol
+SBModule::FindSymbol (const char *name,
+                      lldb::SymbolType symbol_type)
+{
+    SBSymbol sb_symbol;
+    if (name && name[0])
+    {
+        ModuleSP module_sp (GetSP ());
+        if (module_sp)
+        {
+            ObjectFile *obj_file = module_sp->GetObjectFile();
+            if (obj_file)
+            {
+                Symtab *symtab = obj_file->GetSymtab();
+                if (symtab)
+                    sb_symbol.SetSymbol(symtab->FindFirstSymbolWithNameAndType(ConstString(name), symbol_type, Symtab::eDebugAny, Symtab::eVisibilityAny));
+            }
+        }
+    }
+    return sb_symbol;
+}
+
+
+lldb::SBSymbolContextList
+SBModule::FindSymbols (const char *name, lldb::SymbolType symbol_type)
+{
+    SBSymbolContextList sb_sc_list;
+    if (name && name[0])
+    {
+        ModuleSP module_sp (GetSP ());
+        if (module_sp)
+        {
+            ObjectFile *obj_file = module_sp->GetObjectFile();
+            if (obj_file)
+            {
+                Symtab *symtab = obj_file->GetSymtab();
+                if (symtab)
+                {
+                    std::vector<uint32_t> matching_symbol_indexes;
+                    const size_t num_matches = symtab->FindAllSymbolsWithNameAndType(ConstString(name), symbol_type, matching_symbol_indexes);
+                    if (num_matches)
+                    {
+                        SymbolContext sc;
+                        sc.module_sp = module_sp;
+                        SymbolContextList &sc_list = *sb_sc_list;
+                        for (size_t i=0; i<num_matches; ++i)
+                        {
+                            sc.symbol = symtab->SymbolAtIndex (matching_symbol_indexes[i]);
+                            if (sc.symbol)
+                                sc_list.Append(sc);
+                        }
+                    }
+                }
+            }
+        }
+    }
+    return sb_sc_list;
+    
+}
+
+
+
 size_t
 SBModule::GetNumSections ()
 {
@@ -426,27 +488,29 @@
     if (name_cstr && module_sp)
     {
         SymbolContext sc;
-        TypeList type_list;
-        uint32_t num_matches = 0;
         const bool exact_match = false;
         ConstString name(name_cstr);
 
-        num_matches = module_sp->FindTypes (sc,
-                                            name,
-                                            exact_match,
-                                            1,
-                                            type_list);
+        sb_type = SBType (module_sp->FindFirstType(sc, name, exact_match));
         
-        if (num_matches)
-            sb_type = lldb::SBType(type_list.GetTypeAtIndex(0));
+        if (!sb_type.IsValid())
+            sb_type = SBType (ClangASTType::GetBasicType (module_sp->GetClangASTContext().getASTContext(), name));
     }
     return sb_type;
 }
 
+lldb::SBType
+SBModule::GetBasicType(lldb::BasicType type)
+{
+    ModuleSP module_sp (GetSP ());
+    if (module_sp)
+        return SBType (ClangASTType::GetBasicType (module_sp->GetClangASTContext().getASTContext(), type));
+    return SBType();
+}
+
 lldb::SBTypeList
 SBModule::FindTypes (const char *type)
 {
-    
     SBTypeList retval;
     
     ModuleSP module_sp (GetSP ());
@@ -455,20 +519,27 @@
         SymbolContext sc;
         TypeList type_list;
         const bool exact_match = false;
-        uint32_t num_matches = 0;
         ConstString name(type);
+        const uint32_t num_matches = module_sp->FindTypes (sc,
+                                                           name,
+                                                           exact_match,
+                                                           UINT32_MAX,
+                                                           type_list);
         
-        num_matches = module_sp->FindTypes (sc,
-                                            name,
-                                            exact_match,
-                                            UINT32_MAX,
-                                            type_list);
-            
-        for (size_t idx = 0; idx < num_matches; idx++)
-        {
-            TypeSP type_sp (type_list.GetTypeAtIndex(idx));
-            if (type_sp)
-                retval.Append(SBType(type_sp));
+        if (num_matches > 0)
+        {
+            for (size_t idx = 0; idx < num_matches; idx++)
+            {
+                TypeSP type_sp (type_list.GetTypeAtIndex(idx));
+                if (type_sp)
+                    retval.Append(SBType(type_sp));
+            }
+        }
+        else
+        {
+            SBType sb_type(ClangASTType::GetBasicType (module_sp->GetClangASTContext().getASTContext(), name));
+            if (sb_type.IsValid())
+                retval.Append(sb_type);
         }
     }
 

Modified: lldb/branches/windows/source/API/SBProcess.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/API/SBProcess.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/API/SBProcess.cpp (original)
+++ lldb/branches/windows/source/API/SBProcess.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/API/SBProcess.h"
 
 #include "lldb/lldb-defines.h"
@@ -224,7 +226,7 @@
     if (log) {
         SBStream sstr;
         error.GetDescription (sstr);
-        log->Printf ("SBProcess(%p)::RemoteAttachToProcessWithID (%llu) => SBError (%p): %s", process_sp.get(), pid, error.get(), sstr.GetData());
+        log->Printf ("SBProcess(%p)::RemoteAttachToProcessWithID (%" PRIu64 ") => SBError (%p): %s", process_sp.get(), pid, error.get(), sstr.GetData());
     }
 
     return error.Success();
@@ -333,7 +335,7 @@
     
     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log)
-        log->Printf ("SBProcess(%p)::GetSTDOUT (dst=\"%.*s\", dst_len=%llu) => %llu", 
+        log->Printf ("SBProcess(%p)::GetSTDOUT (dst=\"%.*s\", dst_len=%" PRIu64 ") => %" PRIu64,
                      process_sp.get(),
                      (int) bytes_read,
                      dst,
@@ -356,7 +358,7 @@
 
     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log)
-        log->Printf ("SBProcess(%p)::GetSTDERR (dst=\"%.*s\", dst_len=%llu) => %llu",
+        log->Printf ("SBProcess(%p)::GetSTDERR (dst=\"%.*s\", dst_len=%" PRIu64 ") => %" PRIu64,
                      process_sp.get(),
                      (int) bytes_read,
                      dst,
@@ -379,7 +381,7 @@
     
     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log)
-        log->Printf ("SBProcess(%p)::GetProfileData (dst=\"%.*s\", dst_len=%llu) => %llu",
+        log->Printf ("SBProcess(%p)::GetProfileData (dst=\"%.*s\", dst_len=%" PRIu64 ") => %" PRIu64,
                      process_sp.get(),
                      (int) bytes_read,
                      dst,
@@ -402,7 +404,7 @@
         char message[1024];
         int message_len = ::snprintf (message,
                                       sizeof (message),
-                                      "Process %llu %s\n",
+                                      "Process %" PRIu64 " %s\n",
                                       process_sp->GetID(),
                                       SBDebugger::StateAsCString (event_state));
 
@@ -421,7 +423,7 @@
         char message[1024];
         ::snprintf (message,
                     sizeof (message),
-                    "Process %llu %s\n",
+                    "Process %" PRIu64 " %s\n",
                     process_sp->GetID(),
                     SBDebugger::StateAsCString (event_state));
 
@@ -455,7 +457,7 @@
     }
 
     if (log)
-        log->Printf ("SBProcess(%p)::SetSelectedThreadByID (tid=0x%4.4llx) => %s", 
+        log->Printf ("SBProcess(%p)::SetSelectedThreadByID (tid=0x%4.4" PRIx64 ") => %s",
                      process_sp.get(), tid, (ret_val ? "true" : "false"));
 
     return ret_val;
@@ -574,7 +576,7 @@
 
     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log)
-        log->Printf ("SBProcess(%p)::GetProcessID () => %llu", process_sp.get(), ret_val);
+        log->Printf ("SBProcess(%p)::GetProcessID () => %" PRIu64, process_sp.get(), ret_val);
 
     return ret_val;
 }
@@ -802,7 +804,7 @@
     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log)
     {
-        log->Printf ("SBProcess(%p)::GetThreadByID (tid=0x%4.4llx) => SBThread (%p)", 
+        log->Printf ("SBProcess(%p)::GetThreadByID (tid=0x%4.4" PRIx64 ") => SBThread (%p)",
                      process_sp.get(), 
                      tid,
                      thread_sp.get());
@@ -904,7 +906,7 @@
 
     if (log)
     {
-        log->Printf ("SBProcess(%p)::ReadMemory (addr=0x%llx, dst=%p, dst_len=%llu, SBError (%p))...",
+        log->Printf ("SBProcess(%p)::ReadMemory (addr=0x%" PRIx64 ", dst=%p, dst_len=%" PRIu64 ", SBError (%p))...",
                      process_sp.get(), 
                      addr, 
                      dst, 
@@ -936,7 +938,7 @@
     {
         SBStream sstr;
         sb_error.GetDescription (sstr);
-        log->Printf ("SBProcess(%p)::ReadMemory (addr=0x%llx, dst=%p, dst_len=%llu, SBError (%p): %s) => %llu", 
+        log->Printf ("SBProcess(%p)::ReadMemory (addr=0x%" PRIx64 ", dst=%p, dst_len=%" PRIu64 ", SBError (%p): %s) => %" PRIu64,
                      process_sp.get(), 
                      addr, 
                      dst, 
@@ -1044,7 +1046,7 @@
 
     if (log)
     {
-        log->Printf ("SBProcess(%p)::WriteMemory (addr=0x%llx, src=%p, src_len=%llu, SBError (%p))...",
+        log->Printf ("SBProcess(%p)::WriteMemory (addr=0x%" PRIx64 ", src=%p, src_len=%" PRIu64 ", SBError (%p))...",
                      process_sp.get(), 
                      addr, 
                      src, 
@@ -1072,7 +1074,7 @@
     {
         SBStream sstr;
         sb_error.GetDescription (sstr);
-        log->Printf ("SBProcess(%p)::WriteMemory (addr=0x%llx, src=%p, src_len=%llu, SBError (%p): %s) => %llu",
+        log->Printf ("SBProcess(%p)::WriteMemory (addr=0x%" PRIx64 ", src=%p, src_len=%" PRIu64 ", SBError (%p): %s) => %" PRIu64,
                      process_sp.get(), 
                      addr, 
                      src, 
@@ -1100,7 +1102,7 @@
         if (exe_module)
             exe_name = exe_module->GetFileSpec().GetFilename().AsCString();
 
-        strm.Printf ("SBProcess: pid = %llu, state = %s, threads = %d%s%s", 
+        strm.Printf ("SBProcess: pid = %" PRIu64 ", state = %s, threads = %d%s%s",
                      process_sp->GetID(),
                      lldb_private::StateAsCString (GetState()), 
                      GetNumThreads(),

Modified: lldb/branches/windows/source/API/SBSection.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/API/SBSection.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/API/SBSection.cpp (original)
+++ lldb/branches/windows/source/API/SBSection.cpp Tue Jan  8 06:51:53 2013
@@ -264,7 +264,7 @@
     if (section_sp)
     {
         const addr_t file_addr = section_sp->GetFileAddress();
-        strm.Printf ("[0x%16.16llx-0x%16.16llx) ", file_addr, file_addr + section_sp->GetByteSize());
+        strm.Printf ("[0x%16.16" PRIx64 "-0x%16.16" PRIx64 ") ", file_addr, file_addr + section_sp->GetByteSize());
         section_sp->DumpName(&strm);
     }
     else

Modified: lldb/branches/windows/source/API/SBSourceManager.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/API/SBSourceManager.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/API/SBSourceManager.cpp (original)
+++ lldb/branches/windows/source/API/SBSourceManager.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/API/SBDebugger.h"
 #include "lldb/API/SBSourceManager.h"
 #include "lldb/API/SBTarget.h"

Modified: lldb/branches/windows/source/API/SBTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/API/SBTarget.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/API/SBTarget.cpp (original)
+++ lldb/branches/windows/source/API/SBTarget.cpp Tue Jan  8 06:51:53 2013
@@ -7,12 +7,15 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/API/SBTarget.h"
 
 #include "lldb/lldb-public.h"
 
 #include "lldb/API/SBDebugger.h"
 #include "lldb/API/SBBreakpoint.h"
+#include "lldb/API/SBExpressionOptions.h"
 #include "lldb/API/SBFileSpec.h"
 #include "lldb/API/SBListener.h"
 #include "lldb/API/SBModule.h"
@@ -876,7 +879,7 @@
                     }
                     else
                     {
-                        error.ref().SetErrorStringWithFormat("no process found with process ID %llu", attach_pid);
+                        error.ref().SetErrorStringWithFormat("no process found with process ID %" PRIu64, attach_pid);
                         if (log)
                         {
                             log->Printf ("SBTarget(%p)::Attach (...) => error %s",
@@ -944,7 +947,7 @@
 
     if (log)
     {
-        log->Printf ("SBTarget(%p)::AttachToProcessWithID (listener, pid=%lld, error)...", target_sp.get(), pid);
+        log->Printf ("SBTarget(%p)::AttachToProcessWithID (listener, pid=%" PRId64 ", error)...", target_sp.get(), pid);
     }
     
     if (target_sp)
@@ -1487,7 +1490,7 @@
     
     if (log)
     {
-        log->Printf ("SBTarget(%p)::BreakpointCreateByAddress (address=%llu) => SBBreakpoint(%p)", target_sp.get(), (uint64_t) address, sb_bp.get());
+        log->Printf ("SBTarget(%p)::BreakpointCreateByAddress (address=%" PRIu64 ") => SBBreakpoint(%p)", target_sp.get(), (uint64_t) address, sb_bp.get());
     }
 
     return sb_bp;
@@ -1792,7 +1795,7 @@
     
     if (log)
     {
-        log->Printf ("SBTarget(%p)::WatchAddress (addr=0x%llx, 0x%u) => SBWatchpoint(%p)", 
+        log->Printf ("SBTarget(%p)::WatchAddress (addr=0x%" PRIx64 ", 0x%u) => SBWatchpoint(%p)",
                      target_sp.get(), addr, (uint32_t) size, watchpoint_sp.get());
     }
     
@@ -2062,52 +2065,138 @@
 }
 
 lldb::SBType
-SBTarget::FindFirstType (const char* type)
+SBTarget::FindFirstType (const char* typename_cstr)
 {
     TargetSP target_sp(GetSP());
-    if (type && target_sp)
+    if (typename_cstr && typename_cstr[0] && target_sp)
     {
-        size_t count = target_sp->GetImages().GetSize();
+        ConstString const_typename(typename_cstr);
+        SymbolContext sc;
+        const bool exact_match = false;
+
+        const ModuleList &module_list = target_sp->GetImages();
+        size_t count = module_list.GetSize();
         for (size_t idx = 0; idx < count; idx++)
         {
-            SBType found_at_idx = GetModuleAtIndex(idx).FindFirstType(type);
+            ModuleSP module_sp (module_list.GetModuleAtIndex(idx));
+            if (module_sp)
+            {
+                TypeSP type_sp (module_sp->FindFirstType(sc, const_typename, exact_match));
+                if (type_sp)
+                    return SBType(type_sp);
+            }
+        }
+        
+        // Didn't find the type in the symbols; try the Objective-C runtime
+        // if one is installed
+        
+        ProcessSP process_sp(target_sp->GetProcessSP());
+        
+        if (process_sp)
+        {
+            ObjCLanguageRuntime *objc_language_runtime = process_sp->GetObjCLanguageRuntime();
             
-            if (found_at_idx.IsValid())
-                return found_at_idx;
+            if (objc_language_runtime)
+            {
+                TypeVendor *objc_type_vendor = objc_language_runtime->GetTypeVendor();
+                
+                if (objc_type_vendor)
+                {
+                    std::vector <ClangASTType> types;
+                    
+                    if (objc_type_vendor->FindTypes(const_typename, true, 1, types) > 0)
+                        return SBType(types[0]);
+                }
+            }
         }
+
+        // No matches, search for basic typename matches
+        ClangASTContext *clang_ast = target_sp->GetScratchClangASTContext();
+        if (clang_ast)
+            return SBType (ClangASTType::GetBasicType (clang_ast->getASTContext(), const_typename));
     }
     return SBType();
 }
 
+SBType
+SBTarget::GetBasicType(lldb::BasicType type)
+{
+    TargetSP target_sp(GetSP());
+    if (target_sp)
+    {
+        ClangASTContext *clang_ast = target_sp->GetScratchClangASTContext();
+        if (clang_ast)
+            return SBType (ClangASTType::GetBasicType (clang_ast->getASTContext(), type));
+    }
+    return SBType();
+}
+
+
 lldb::SBTypeList
-SBTarget::FindTypes (const char* type)
+SBTarget::FindTypes (const char* typename_cstr)
 {
-    
-    SBTypeList retval;
-    
+    SBTypeList sb_type_list;
     TargetSP target_sp(GetSP());
-    if (type && target_sp)
+    if (typename_cstr && typename_cstr[0] && target_sp)
     {
         ModuleList& images = target_sp->GetImages();
-        ConstString name_const(type);
+        ConstString const_typename(typename_cstr);
         bool exact_match = false;
         SymbolContext sc;
         TypeList type_list;
         
         uint32_t num_matches = images.FindTypes (sc,
-                                                 name_const,
+                                                 const_typename,
                                                  exact_match,
                                                  UINT32_MAX,
                                                  type_list);
         
-        for (size_t idx = 0; idx < num_matches; idx++)
+        if (num_matches > 0)
+        {
+            for (size_t idx = 0; idx < num_matches; idx++)
+            {
+                TypeSP type_sp (type_list.GetTypeAtIndex(idx));
+                if (type_sp)
+                    sb_type_list.Append(SBType(type_sp));
+            }
+        }
+        
+        // Try the Objective-C runtime if one is installed
+        
+        ProcessSP process_sp(target_sp->GetProcessSP());
+        
+        if (process_sp)
+        {
+            ObjCLanguageRuntime *objc_language_runtime = process_sp->GetObjCLanguageRuntime();
+            
+            if (objc_language_runtime)
+            {
+                TypeVendor *objc_type_vendor = objc_language_runtime->GetTypeVendor();
+                
+                if (objc_type_vendor)
+                {
+                    std::vector <ClangASTType> types;
+                    
+                    if (objc_type_vendor->FindTypes(const_typename, true, UINT32_MAX, types))
+                    {
+                        for (auto type = types.begin(); type != types.end(); ++type)
+                        {
+                            sb_type_list.Append(SBType(*type));
+                        }
+                    }
+                }
+            }
+        }
+        
+        if (sb_type_list.GetSize() == 0)
         {
-            TypeSP type_sp (type_list.GetTypeAtIndex(idx));
-            if (type_sp)
-                retval.Append(SBType(type_sp));
+            // No matches, search for basic typename matches
+            ClangASTContext *clang_ast = target_sp->GetScratchClangASTContext();
+            if (clang_ast)
+                sb_type_list.Append (SBType (ClangASTType::GetBasicType (clang_ast->getASTContext(), const_typename)));
         }
     }
-    return retval;
+    return sb_type_list;
 }
 
 SBValueList
@@ -2355,3 +2444,94 @@
 }
 
 
+lldb::SBSymbolContextList
+SBTarget::FindSymbols (const char *name, lldb::SymbolType symbol_type)
+{
+    SBSymbolContextList sb_sc_list;
+    if (name && name[0])
+    {
+        TargetSP target_sp(GetSP());
+        if (target_sp)
+        {
+            bool append = true;
+            target_sp->GetImages().FindSymbolsWithNameAndType (ConstString(name),
+                                                               symbol_type,
+                                                               *sb_sc_list,
+                                                               append);
+        }
+    }
+    return sb_sc_list;
+    
+}
+
+
+lldb::SBValue
+SBTarget::EvaluateExpression (const char *expr, const SBExpressionOptions &options)
+{
+    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    LogSP expr_log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS));
+    SBValue expr_result;
+    ExecutionResults exe_results = eExecutionSetupError;
+    ValueObjectSP expr_value_sp;
+    TargetSP target_sp(GetSP());
+    StackFrame *frame = NULL;
+    if (target_sp)
+    {
+        if (expr == NULL || expr[0] == '\0')
+        {
+            if (log)
+                log->Printf ("SBTarget::EvaluateExpression called with an empty expression");
+            return expr_result;
+        }
+        
+        Mutex::Locker api_locker (target_sp->GetAPIMutex());
+        ExecutionContext exe_ctx (m_opaque_sp.get());
+        
+        if (log)
+            log->Printf ("SBTarget()::EvaluateExpression (expr=\"%s\")...", expr);
+        
+        frame = exe_ctx.GetFramePtr();
+        Target *target = exe_ctx.GetTargetPtr();
+        
+        if (target)
+        {
+#ifdef LLDB_CONFIGURATION_DEBUG
+            StreamString frame_description;
+            if (frame)
+                frame->DumpUsingSettingsFormat (&frame_description);
+            Host::SetCrashDescriptionWithFormat ("SBTarget::EvaluateExpression (expr = \"%s\", fetch_dynamic_value = %u) %s",
+                                                 expr, options.GetFetchDynamicValue(), frame_description.GetString().c_str());
+#endif
+            exe_results = target->EvaluateExpression (expr,
+                                                      frame,
+                                                      expr_value_sp,
+                                                      options.ref());
+
+            expr_result.SetSP(expr_value_sp, options.GetFetchDynamicValue());
+#ifdef LLDB_CONFIGURATION_DEBUG
+            Host::SetCrashDescription (NULL);
+#endif
+        }
+        else
+        {
+            if (log)
+                log->Printf ("SBTarget::EvaluateExpression () => error: could not reconstruct frame object for this SBTarget.");
+        }
+    }
+#ifndef LLDB_DISABLE_PYTHON
+    if (expr_log)
+        expr_log->Printf("** [SBTarget::EvaluateExpression] Expression result is %s, summary %s **",
+                         expr_result.GetValue(),
+                         expr_result.GetSummary());
+    
+    if (log)
+        log->Printf ("SBTarget(%p)::EvaluateExpression (expr=\"%s\") => SBValue(%p) (execution result=%d)",
+                     frame,
+                     expr,
+                     expr_value_sp.get(),
+                     exe_results);
+#endif
+    
+    return expr_result;
+}
+

Modified: lldb/branches/windows/source/API/SBThread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/API/SBThread.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/API/SBThread.cpp (original)
+++ lldb/branches/windows/source/API/SBThread.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/API/SBThread.h"
 
 #include "lldb/API/SBSymbolContext.h"
@@ -147,7 +149,9 @@
                 case eStopReasonInvalid:
                 case eStopReasonNone:
                 case eStopReasonTrace:
+                case eStopReasonExec:
                 case eStopReasonPlanComplete:
+                case eStopReasonThreadExiting:
                     // There is no data for these stop reasons.
                     return 0;
 
@@ -204,7 +208,9 @@
                 case eStopReasonInvalid:
                 case eStopReasonNone:
                 case eStopReasonTrace:
+                case eStopReasonExec:
                 case eStopReasonPlanComplete:
+                case eStopReasonThreadExiting:
                     // There is no data for these stop reasons.
                     return 0;
 
@@ -336,6 +342,21 @@
                         }
                         break;          
 
+                    case eStopReasonExec:
+                        {
+                            char exc_desc[] = "exec";
+                            stop_desc = exc_desc;
+                            stop_desc_len = sizeof(exc_desc); // Include the NULL byte for size
+                        }
+                        break;
+
+                    case eStopReasonThreadExiting:
+                        {
+                            char limbo_desc[] = "thread exiting";
+                            stop_desc = limbo_desc;
+                            stop_desc_len = sizeof(limbo_desc);
+                        }
+                        break;
                     default:
                         break;
                     }
@@ -552,13 +573,10 @@
             if (frame_sp->HasDebugInformation ())
             {
                 SymbolContext sc(frame_sp->GetSymbolContext(eSymbolContextEverything));
-                new_plan = thread->QueueThreadPlanForStepRange (abort_other_plans,
-                                                                eStepTypeOver,
-                                                                sc.line_entry.range,
-                                                                sc,
-                                                                stop_other_threads,
-                                                                false);
-                
+                new_plan = thread->QueueThreadPlanForStepOverRange (abort_other_plans,
+                                                                    sc.line_entry.range,
+                                                                    sc,
+                                                                    stop_other_threads);
             }
             else
             {
@@ -576,14 +594,23 @@
 void
 SBThread::StepInto (lldb::RunMode stop_other_threads)
 {
+    StepInto (NULL, stop_other_threads);
+}
+
+void
+SBThread::StepInto (const char *target_name, lldb::RunMode stop_other_threads)
+{
     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     Mutex::Locker api_locker;
     ExecutionContext exe_ctx (m_opaque_sp.get(), api_locker);
 
     if (log)
-        log->Printf ("SBThread(%p)::StepInto (stop_other_threads='%s')", exe_ctx.GetThreadPtr(),
+        log->Printf ("SBThread(%p)::StepInto (target_name='%s', stop_other_threads='%s')",
+                     exe_ctx.GetThreadPtr(),
+                     target_name? target_name: "<NULL>",
                      Thread::RunModeAsCString (stop_other_threads));
+    
     if (exe_ctx.HasThreadScope())
     {
         bool abort_other_plans = false;
@@ -596,12 +623,12 @@
         {
             bool avoid_code_without_debug_info = true;
             SymbolContext sc(frame_sp->GetSymbolContext(eSymbolContextEverything));
-            new_plan = thread->QueueThreadPlanForStepRange (abort_other_plans,
-                                                            eStepTypeInto,
-                                                            sc.line_entry.range,
-                                                            sc,
-                                                            stop_other_threads,
-                                                            avoid_code_without_debug_info);
+            new_plan = thread->QueueThreadPlanForStepInRange (abort_other_plans,
+                                                              sc.line_entry.range,
+                                                              sc,
+                                                              target_name,
+                                                              stop_other_threads,
+                                                              avoid_code_without_debug_info);
         }
         else
         {
@@ -715,7 +742,7 @@
 
 
     if (log)
-        log->Printf ("SBThread(%p)::RunToAddress (addr=0x%llx)", exe_ctx.GetThreadPtr(), addr);
+        log->Printf ("SBThread(%p)::RunToAddress (addr=0x%" PRIx64 ")", exe_ctx.GetThreadPtr(), addr);
     
     if (exe_ctx.HasThreadScope())
     {
@@ -1185,7 +1212,7 @@
     ExecutionContext exe_ctx (m_opaque_sp.get());
     if (exe_ctx.HasThreadScope())
     {
-        strm.Printf("SBThread: tid = 0x%4.4llx", exe_ctx.GetThreadPtr()->GetID());
+        strm.Printf("SBThread: tid = 0x%4.4" PRIx64, exe_ctx.GetThreadPtr()->GetID());
     }
     else
         strm.PutCString ("No value");

Modified: lldb/branches/windows/source/API/SBType.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/API/SBType.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/API/SBType.cpp (original)
+++ lldb/branches/windows/source/API/SBType.cpp Tue Jan  8 06:51:53 2013
@@ -274,6 +274,18 @@
     return SBType(ClangASTType(m_opaque_sp->GetASTContext(),qt.getUnqualifiedType().getAsOpaquePtr()));
 }
 
+lldb::SBType
+SBType::GetCanonicalType()
+{
+    if (IsValid())
+    {
+        QualType qt (QualType::getFromOpaquePtr(m_opaque_sp->GetOpaqueQualType()));
+        return SBType(ClangASTType(m_opaque_sp->GetASTContext(),qt.getCanonicalType().getAsOpaquePtr()));
+    }
+    return SBType();
+}
+
+
 lldb::BasicType
 SBType::GetBasicType()
 {
@@ -285,111 +297,9 @@
 SBType
 SBType::GetBasicType(lldb::BasicType type)
 {
-    if (!IsValid())
-        return SBType();
-    
-    clang::QualType base_type_qual;
-    
-    switch (type)
-    {
-        case eBasicTypeVoid:
-            base_type_qual = m_opaque_sp->GetASTContext()->VoidTy;
-            break;
-        case eBasicTypeChar:
-            base_type_qual = m_opaque_sp->GetASTContext()->CharTy;
-            break;
-        case eBasicTypeSignedChar:
-            base_type_qual = m_opaque_sp->GetASTContext()->SignedCharTy;
-            break;
-        case eBasicTypeUnsignedChar:
-            base_type_qual = m_opaque_sp->GetASTContext()->UnsignedCharTy;
-            break;
-        case eBasicTypeWChar:
-            base_type_qual = m_opaque_sp->GetASTContext()->getWCharType();
-            break;
-        case eBasicTypeSignedWChar:
-            base_type_qual = m_opaque_sp->GetASTContext()->getSignedWCharType();
-            break;
-        case eBasicTypeUnsignedWChar:
-            base_type_qual = m_opaque_sp->GetASTContext()->getUnsignedWCharType();
-            break;
-        case eBasicTypeChar16:
-            base_type_qual = m_opaque_sp->GetASTContext()->Char16Ty;
-            break;
-        case eBasicTypeChar32:
-            base_type_qual = m_opaque_sp->GetASTContext()->Char32Ty;
-            break;
-        case eBasicTypeShort:
-            base_type_qual = m_opaque_sp->GetASTContext()->ShortTy;
-            break;
-        case eBasicTypeUnsignedShort:
-            base_type_qual = m_opaque_sp->GetASTContext()->UnsignedShortTy;
-            break;
-        case eBasicTypeInt:
-            base_type_qual = m_opaque_sp->GetASTContext()->IntTy;
-            break;
-        case eBasicTypeUnsignedInt:
-            base_type_qual = m_opaque_sp->GetASTContext()->UnsignedIntTy;
-            break;
-        case eBasicTypeLong:
-            base_type_qual = m_opaque_sp->GetASTContext()->LongTy;
-            break;
-        case eBasicTypeUnsignedLong:
-            base_type_qual = m_opaque_sp->GetASTContext()->UnsignedLongTy;
-            break;
-        case eBasicTypeLongLong:
-            base_type_qual = m_opaque_sp->GetASTContext()->LongLongTy;
-            break;
-        case eBasicTypeUnsignedLongLong:
-            base_type_qual = m_opaque_sp->GetASTContext()->UnsignedLongLongTy;
-            break;
-        case eBasicTypeInt128:
-            base_type_qual = m_opaque_sp->GetASTContext()->Int128Ty;
-            break;
-        case eBasicTypeUnsignedInt128:
-            base_type_qual = m_opaque_sp->GetASTContext()->UnsignedInt128Ty;
-            break;
-        case eBasicTypeBool:
-            base_type_qual = m_opaque_sp->GetASTContext()->BoolTy;
-            break;
-        case eBasicTypeHalf:
-            base_type_qual = m_opaque_sp->GetASTContext()->HalfTy;
-            break;
-        case eBasicTypeFloat:
-            base_type_qual = m_opaque_sp->GetASTContext()->FloatTy;
-            break;
-        case eBasicTypeDouble:
-            base_type_qual = m_opaque_sp->GetASTContext()->DoubleTy;
-            break;
-        case eBasicTypeLongDouble:
-            base_type_qual = m_opaque_sp->GetASTContext()->LongDoubleTy;
-            break;
-        case eBasicTypeFloatComplex:
-            base_type_qual = m_opaque_sp->GetASTContext()->FloatComplexTy;
-            break;
-        case eBasicTypeDoubleComplex:
-            base_type_qual = m_opaque_sp->GetASTContext()->DoubleComplexTy;
-            break;
-        case eBasicTypeLongDoubleComplex:
-            base_type_qual = m_opaque_sp->GetASTContext()->LongDoubleComplexTy;
-            break;
-        case eBasicTypeObjCID:
-            base_type_qual = m_opaque_sp->GetASTContext()->ObjCBuiltinIdTy;
-            break;
-        case eBasicTypeObjCClass:
-            base_type_qual = m_opaque_sp->GetASTContext()->ObjCBuiltinClassTy;
-            break;
-        case eBasicTypeObjCSel:
-            base_type_qual = m_opaque_sp->GetASTContext()->ObjCBuiltinSelTy;
-            break;
-        case eBasicTypeNullPtr:
-            base_type_qual = m_opaque_sp->GetASTContext()->NullPtrTy;
-            break;
-        default:
-            return SBType();
-    }
-    
-    return SBType(ClangASTType(m_opaque_sp->GetASTContext(), base_type_qual.getAsOpaquePtr()));
+    if (IsValid())
+        return SBType (ClangASTType::GetBasicType (m_opaque_sp->GetASTContext(), type));
+    return SBType();
 }
 
 uint32_t

Modified: lldb/branches/windows/source/API/SBTypeCategory.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/API/SBTypeCategory.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/API/SBTypeCategory.cpp (original)
+++ lldb/branches/windows/source/API/SBTypeCategory.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/API/SBTypeCategory.h"
 
 #include "lldb/API/SBTypeFilter.h"

Modified: lldb/branches/windows/source/API/SBTypeFilter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/API/SBTypeFilter.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/API/SBTypeFilter.cpp (original)
+++ lldb/branches/windows/source/API/SBTypeFilter.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/API/SBTypeFilter.h"
 
 #include "lldb/API/SBStream.h"

Modified: lldb/branches/windows/source/API/SBTypeFormat.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/API/SBTypeFormat.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/API/SBTypeFormat.cpp (original)
+++ lldb/branches/windows/source/API/SBTypeFormat.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/API/SBTypeFormat.h"
 
 #include "lldb/API/SBStream.h"

Modified: lldb/branches/windows/source/API/SBTypeNameSpecifier.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/API/SBTypeNameSpecifier.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/API/SBTypeNameSpecifier.cpp (original)
+++ lldb/branches/windows/source/API/SBTypeNameSpecifier.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/API/SBTypeNameSpecifier.h"
 
 #include "lldb/API/SBStream.h"

Modified: lldb/branches/windows/source/API/SBTypeSummary.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/API/SBTypeSummary.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/API/SBTypeSummary.cpp (original)
+++ lldb/branches/windows/source/API/SBTypeSummary.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/API/SBTypeSummary.h"
 
 #include "lldb/API/SBStream.h"

Modified: lldb/branches/windows/source/API/SBTypeSynthetic.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/API/SBTypeSynthetic.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/API/SBTypeSynthetic.cpp (original)
+++ lldb/branches/windows/source/API/SBTypeSynthetic.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/API/SBTypeSynthetic.h"
 
 #include "lldb/API/SBStream.h"

Modified: lldb/branches/windows/source/API/SBValue.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/API/SBValue.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/API/SBValue.cpp (original)
+++ lldb/branches/windows/source/API/SBValue.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/API/SBValue.h"
 
 #include "lldb/API/SBDeclaration.h"
@@ -301,7 +303,7 @@
     }
 
     if (log)
-        log->Printf ("SBValue(%p)::GetByteSize () => %llu", value_sp.get(), (uint64_t)result);
+        log->Printf ("SBValue(%p)::GetByteSize () => %" PRIu64, value_sp.get(), (uint64_t)result);
 
     return result;
 }
@@ -386,7 +388,6 @@
         case eValueTypeRegister:        log->Printf ("SBValue(%p)::GetValueType () => eValueTypeRegister", value_sp.get()); break;
         case eValueTypeRegisterSet:     log->Printf ("SBValue(%p)::GetValueType () => eValueTypeRegisterSet", value_sp.get()); break;
         case eValueTypeConstResult:     log->Printf ("SBValue(%p)::GetValueType () => eValueTypeConstResult", value_sp.get()); break;
-        default:     log->Printf ("SBValue(%p)::GetValueType () => %i ???", value_sp.get(), result); break;
         }
     }
     return result;
@@ -1755,7 +1756,7 @@
     }
     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log)
-        log->Printf ("SBValue(%p)::GetLoadAddress () => (%llu)", value_sp.get(), value);
+        log->Printf ("SBValue(%p)::GetLoadAddress () => (%" PRIu64 ")", value_sp.get(), value);
     
     return value;
 }
@@ -1792,7 +1793,7 @@
     }
     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log)
-        log->Printf ("SBValue(%p)::GetAddress () => (%s,%llu)", value_sp.get(),
+        log->Printf ("SBValue(%p)::GetAddress () => (%s,%" PRIu64 ")", value_sp.get(),
                      (addr.GetSection() ? addr.GetSection()->GetName().GetCString() : "NULL"),
                      addr.GetOffset());
     return SBAddress(new Address(addr));

Modified: lldb/branches/windows/source/API/SBWatchpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/API/SBWatchpoint.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/API/SBWatchpoint.cpp (original)
+++ lldb/branches/windows/source/API/SBWatchpoint.cpp Tue Jan  8 06:51:53 2013
@@ -11,6 +11,7 @@
 #include "lldb/API/SBDefines.h"
 #include "lldb/API/SBAddress.h"
 #include "lldb/API/SBDebugger.h"
+#include "lldb/API/SBEvent.h"
 #include "lldb/API/SBStream.h"
 
 #include "lldb/lldb-types.h"
@@ -271,3 +272,27 @@
 {
     m_opaque_sp = sp;
 }
+
+bool
+SBWatchpoint::EventIsWatchpointEvent (const lldb::SBEvent &event)
+{
+    return Watchpoint::WatchpointEventData::GetEventDataFromEvent(event.get()) != NULL;
+
+}
+
+WatchpointEventType
+SBWatchpoint::GetWatchpointEventTypeFromEvent (const SBEvent& event)
+{
+    if (event.IsValid())
+        return Watchpoint::WatchpointEventData::GetWatchpointEventTypeFromEvent (event.GetSP());
+    return eWatchpointEventTypeInvalidType;
+}
+
+SBWatchpoint
+SBWatchpoint::GetWatchpointFromEvent (const lldb::SBEvent& event)
+{
+    SBWatchpoint sb_watchpoint;
+    if (event.IsValid())
+        sb_watchpoint.m_opaque_sp = Watchpoint::WatchpointEventData::GetWatchpointFromEvent (event.GetSP());
+    return sb_watchpoint;
+}

Modified: lldb/branches/windows/source/Breakpoint/Breakpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Breakpoint/Breakpoint.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Breakpoint/Breakpoint.cpp (original)
+++ lldb/branches/windows/source/Breakpoint/Breakpoint.cpp Tue Jan  8 06:51:53 2013
@@ -545,9 +545,9 @@
     case lldb::eDescriptionLevelFull:
         if (num_locations > 0)
         {
-            s->Printf(", locations = %llu", (uint64_t)num_locations);
+            s->Printf(", locations = %" PRIu64, (uint64_t)num_locations);
             if (num_resolved_locations > 0)
-                s->Printf(", resolved = %llu", (uint64_t)num_resolved_locations);
+                s->Printf(", resolved = %" PRIu64, (uint64_t)num_resolved_locations);
         }
         else
         {

Modified: lldb/branches/windows/source/Breakpoint/BreakpointList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Breakpoint/BreakpointList.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Breakpoint/BreakpointList.cpp (original)
+++ lldb/branches/windows/source/Breakpoint/BreakpointList.cpp Tue Jan  8 06:51:53 2013
@@ -88,9 +88,14 @@
     {
         bp_collection::iterator pos, end = m_breakpoints.end();
         for (pos = m_breakpoints.begin(); pos != end; ++pos)
+        {
             if ((*pos)->GetTarget().EventTypeHasListeners(Target::eBroadcastBitBreakpointChanged))
+            {
                 (*pos)->GetTarget().BroadcastEvent (Target::eBroadcastBitBreakpointChanged,
-                                                    new Breakpoint::BreakpointEventData (eBreakpointEventTypeRemoved, *pos));
+                                                    new Breakpoint::BreakpointEventData (eBreakpointEventTypeRemoved,
+                                                                                         *pos));
+            }
+        }
     }
     m_breakpoints.erase (m_breakpoints.begin(), m_breakpoints.end());
 }

Modified: lldb/branches/windows/source/Breakpoint/BreakpointLocation.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Breakpoint/BreakpointLocation.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Breakpoint/BreakpointLocation.cpp (original)
+++ lldb/branches/windows/source/Breakpoint/BreakpointLocation.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 // C Includes
 // C++ Includes
 #include <string>
@@ -378,7 +380,7 @@
     {
         LogSP log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_BREAKPOINTS);
         if (log)
-            log->Warning ("Tried to add breakpoint site at 0x%llx but it was already present.\n",
+            log->Warning ("Tried to add breakpoint site at 0x%" PRIx64 " but it was already present.\n",
                           m_address.GetOpcodeLoadAddress (&m_owner.GetTarget()));
         return false;
     }
@@ -537,7 +539,7 @@
     if (s == NULL)
         return;
 
-    s->Printf("BreakpointLocation %u: tid = %4.4llx  load addr = 0x%8.8llx  state = %s  type = %s breakpoint  "
+    s->Printf("BreakpointLocation %u: tid = %4.4" PRIx64 "  load addr = 0x%8.8" PRIx64 "  state = %s  type = %s breakpoint  "
               "hw_index = %i  hit_count = %-4u  ignore_count = %-4u",
               GetID(),
               GetOptionsNoCreate()->GetThreadSpecNoCreate()->GetTID(),

Modified: lldb/branches/windows/source/Breakpoint/BreakpointLocationList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Breakpoint/BreakpointLocationList.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Breakpoint/BreakpointLocationList.cpp (original)
+++ lldb/branches/windows/source/Breakpoint/BreakpointLocationList.cpp Tue Jan  8 06:51:53 2013
@@ -128,7 +128,7 @@
     s->Printf("%p: ", this);
     //s->Indent();
     Mutex::Locker locker (m_mutex);
-    s->Printf("BreakpointLocationList with %llu BreakpointLocations:\n", (uint64_t)m_locations.size());
+    s->Printf("BreakpointLocationList with %" PRIu64 " BreakpointLocations:\n", (uint64_t)m_locations.size());
     s->IndentMore();
     collection::const_iterator pos, end = m_locations.end();
     for (pos = m_locations.begin(); pos != end; ++pos)

Modified: lldb/branches/windows/source/Breakpoint/BreakpointResolverFileLine.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Breakpoint/BreakpointResolverFileLine.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Breakpoint/BreakpointResolverFileLine.cpp (original)
+++ lldb/branches/windows/source/Breakpoint/BreakpointResolverFileLine.cpp Tue Jan  8 06:51:53 2013
@@ -174,7 +174,7 @@
                         }
                         else if (log)
                         {
-                            log->Printf ("Breakpoint at file address 0x%llx for %s:%d didn't pass the filter.\n",
+                            log->Printf ("Breakpoint at file address 0x%" PRIx64 " for %s:%d didn't pass the filter.\n",
                                          line_start.GetFileAddress(),
                                          m_file_spec.GetFilename().AsCString("<Unknown>"),
                                          m_line_number);
@@ -183,7 +183,7 @@
                     else
                     {
                         if (log)
-                            log->Printf ("error: Unable to set breakpoint at file address 0x%llx for %s:%d\n",
+                            log->Printf ("error: Unable to set breakpoint at file address 0x%" PRIx64 " for %s:%d\n",
                                          line_start.GetFileAddress(),
                                          m_file_spec.GetFilename().AsCString("<Unknown>"),
                                          m_line_number);

Modified: lldb/branches/windows/source/Breakpoint/BreakpointResolverFileRegex.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Breakpoint/BreakpointResolverFileRegex.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Breakpoint/BreakpointResolverFileRegex.cpp (original)
+++ lldb/branches/windows/source/Breakpoint/BreakpointResolverFileRegex.cpp Tue Jan  8 06:51:53 2013
@@ -92,7 +92,7 @@
                 }
                 else if (log)
                 {
-                    log->Printf ("Breakpoint at file address 0x%llx for %s:%d didn't pass filter.\n",
+                    log->Printf ("Breakpoint at file address 0x%" PRIx64 " for %s:%d didn't pass filter.\n",
                                  line_start.GetFileAddress(),
                                  cu_file_spec.GetFilename().AsCString("<Unknown>"),
                                  line_matches[i]);
@@ -101,7 +101,7 @@
             else
             {
                 if (log)
-                    log->Printf ("error: Unable to set breakpoint at file address 0x%llx for %s:%d\n",
+                    log->Printf ("error: Unable to set breakpoint at file address 0x%" PRIx64 " for %s:%d\n",
                                  line_start.GetFileAddress(),
                                  cu_file_spec.GetFilename().AsCString("<Unknown>"),
                                  line_matches[i]);

Modified: lldb/branches/windows/source/Breakpoint/BreakpointResolverName.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Breakpoint/BreakpointResolverName.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Breakpoint/BreakpointResolverName.cpp (original)
+++ lldb/branches/windows/source/Breakpoint/BreakpointResolverName.cpp Tue Jan  8 06:51:53 2013
@@ -182,8 +182,7 @@
                     
                     if (num_functions == 0 && !filter_by_cu)
                     {
-                        if (m_func_name_type_mask & (eFunctionNameTypeBase | eFunctionNameTypeFull | eFunctionNameTypeAuto))
-                            context.module_sp->FindSymbolsWithNameAndType (m_func_names[j], eSymbolTypeCode, sym_list);
+                        context.module_sp->FindFunctionSymbols (m_func_names[j], m_func_name_type_mask, sym_list);
                     }
                 }
             }

Modified: lldb/branches/windows/source/Breakpoint/BreakpointSite.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Breakpoint/BreakpointSite.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Breakpoint/BreakpointSite.cpp (original)
+++ lldb/branches/windows/source/Breakpoint/BreakpointSite.cpp Tue Jan  8 06:51:53 2013
@@ -83,7 +83,7 @@
     if (s == NULL)
         return;
 
-    s->Printf("BreakpointSite %u: addr = 0x%8.8llx  type = %s breakpoint  hw_index = %i  hit_count = %-4u",
+    s->Printf("BreakpointSite %u: addr = 0x%8.8" PRIx64 "  type = %s breakpoint  hw_index = %i  hit_count = %-4u",
             GetID(),
             (uint64_t)m_addr,
             IsHardware() ? "hardware" : "software",
@@ -95,7 +95,7 @@
 BreakpointSite::GetDescription (Stream *s, lldb::DescriptionLevel level)
 {
     if (level != lldb::eDescriptionLevelBrief)
-        s->Printf ("breakpoint site: %d at 0x%8.8llx", GetID(), GetLoadAddress());
+        s->Printf ("breakpoint site: %d at 0x%8.8" PRIx64, GetID(), GetLoadAddress());
     m_owners.GetDescription (s, level);
 }
 

Modified: lldb/branches/windows/source/Breakpoint/BreakpointSiteList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Breakpoint/BreakpointSiteList.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Breakpoint/BreakpointSiteList.cpp (original)
+++ lldb/branches/windows/source/Breakpoint/BreakpointSiteList.cpp Tue Jan  8 06:51:53 2013
@@ -69,10 +69,10 @@
     BreakpointSiteSP bp = FindByAddress (addr);
     if (bp)
     {
-        //DBLogIf(PD_LOG_BREAKPOINTS, "BreakpointSiteList::%s ( addr = 0x%8.8llx ) => %u", __FUNCTION__, (uint64_t)addr, bp->GetID());
+        //DBLogIf(PD_LOG_BREAKPOINTS, "BreakpointSiteList::%s ( addr = 0x%8.8" PRIx64 " ) => %u", __FUNCTION__, (uint64_t)addr, bp->GetID());
         return bp.get()->GetID();
     }
-    //DBLogIf(PD_LOG_BREAKPOINTS, "BreakpointSiteList::%s ( addr = 0x%8.8llx ) => NONE", __FUNCTION__, (uint64_t)addr);
+    //DBLogIf(PD_LOG_BREAKPOINTS, "BreakpointSiteList::%s ( addr = 0x%8.8" PRIx64 " ) => NONE", __FUNCTION__, (uint64_t)addr);
     return LLDB_INVALID_BREAK_ID;
 }
 

Modified: lldb/branches/windows/source/Breakpoint/Watchpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Breakpoint/Watchpoint.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Breakpoint/Watchpoint.cpp (original)
+++ lldb/branches/windows/source/Breakpoint/Watchpoint.cpp Tue Jan  8 06:51:53 2013
@@ -45,7 +45,8 @@
     m_watch_spec_str(),
     m_type(),
     m_error(),
-    m_options ()
+    m_options (),
+    m_being_created(true)
 {
     if (type && type->IsValid())
         m_type = *type;
@@ -64,6 +65,7 @@
         m_target.GetProcessSP()->CalculateExecutionContext(exe_ctx);
         CaptureWatchedValue (exe_ctx);
     }
+    m_being_created = false;
 }
 
 Watchpoint::~Watchpoint()
@@ -78,7 +80,7 @@
     // or delete it when it goes goes out of scope.
     m_options.SetCallback(callback, BatonSP (new Baton(baton)), is_synchronous);
     
-    //SendWatchpointChangedEvent (eWatchpointEventTypeCommandChanged);
+    SendWatchpointChangedEvent (eWatchpointEventTypeCommandChanged);
 }
 
 // This function is used when a baton needs to be freed and therefore is 
@@ -87,12 +89,14 @@
 Watchpoint::SetCallback (WatchpointHitCallback callback, const BatonSP &callback_baton_sp, bool is_synchronous)
 {
     m_options.SetCallback(callback, callback_baton_sp, is_synchronous);
+    SendWatchpointChangedEvent (eWatchpointEventTypeCommandChanged);
 }
 
 void
 Watchpoint::ClearCallback ()
 {
     m_options.ClearCallback ();
+    SendWatchpointChangedEvent (eWatchpointEventTypeCommandChanged);
 }
 
 void
@@ -235,7 +239,7 @@
     assert(description_level >= lldb::eDescriptionLevelBrief &&
            description_level <= lldb::eDescriptionLevelVerbose);
 
-    s->Printf("Watchpoint %u: addr = 0x%8.8llx size = %u state = %s type = %s%s",
+    s->Printf("Watchpoint %u: addr = 0x%8.8" PRIx64 " size = %u state = %s type = %s%s",
               GetID(),
               GetLoadAddress(),
               m_byte_size,
@@ -297,7 +301,7 @@
 }
 
 void
-Watchpoint::SetEnabled(bool enabled)
+Watchpoint::SetEnabled(bool enabled, bool notify)
 {
     if (!enabled)
     {
@@ -309,14 +313,21 @@
         // Don't clear the snapshots for now.
         // Within StopInfo.cpp, we purposely do disable/enable watchpoint while performing watchpoint actions.
     }
+    bool changed = enabled != m_enabled;
     m_enabled = enabled;
+    if (notify && !m_is_ephemeral && changed)
+        SendWatchpointChangedEvent (enabled ? eWatchpointEventTypeEnabled : eWatchpointEventTypeDisabled);
 }
 
 void
-Watchpoint::SetWatchpointType (uint32_t type)
+Watchpoint::SetWatchpointType (uint32_t type, bool notify)
 {
+    int old_watch_read = m_watch_read;
+    int old_watch_write = m_watch_write;
     m_watch_read = (type & LLDB_WATCH_TYPE_READ) != 0;
     m_watch_write = (type & LLDB_WATCH_TYPE_WRITE) != 0;
+    if (notify && (old_watch_read != m_watch_read || old_watch_write != m_watch_write))
+        SendWatchpointChangedEvent (eWatchpointEventTypeTypeChanged);
 }
 
 bool
@@ -338,7 +349,10 @@
 void
 Watchpoint::SetIgnoreCount (uint32_t n)
 {
+    bool changed = m_ignore_count != n;
     m_ignore_count = n;
+    if (changed)
+        SendWatchpointChangedEvent (eWatchpointEventTypeIgnoreChanged);
 }
 
 bool
@@ -360,6 +374,7 @@
         // Pass NULL for expr_prefix (no translation-unit level definitions).
         m_condition_ap.reset(new ClangUserExpression (condition, NULL, lldb::eLanguageTypeUnknown, ClangUserExpression::eResultTypeAny));
     }
+    SendWatchpointChangedEvent (eWatchpointEventTypeConditionChanged);
 }
 
 const char *
@@ -371,3 +386,105 @@
         return NULL;
 }
 
+void
+Watchpoint::SendWatchpointChangedEvent (lldb::WatchpointEventType eventKind)
+{
+    if (!m_being_created
+        && GetTarget().EventTypeHasListeners(Target::eBroadcastBitWatchpointChanged))
+    {
+        WatchpointEventData *data = new Watchpoint::WatchpointEventData (eventKind, shared_from_this());
+        GetTarget().BroadcastEvent (Target::eBroadcastBitWatchpointChanged, data);
+    }
+}
+
+void
+Watchpoint::SendWatchpointChangedEvent (WatchpointEventData *data)
+{
+
+    if (data == NULL)
+        return;
+        
+    if (!m_being_created
+        && GetTarget().EventTypeHasListeners(Target::eBroadcastBitWatchpointChanged))
+        GetTarget().BroadcastEvent (Target::eBroadcastBitWatchpointChanged, data);
+    else
+        delete data;
+}
+
+Watchpoint::WatchpointEventData::WatchpointEventData (WatchpointEventType sub_type, 
+                                                      const WatchpointSP &new_watchpoint_sp) :
+    EventData (),
+    m_watchpoint_event (sub_type),
+    m_new_watchpoint_sp (new_watchpoint_sp)
+{
+}
+
+Watchpoint::WatchpointEventData::~WatchpointEventData ()
+{
+}
+
+const ConstString &
+Watchpoint::WatchpointEventData::GetFlavorString ()
+{
+    static ConstString g_flavor ("Watchpoint::WatchpointEventData");
+    return g_flavor;
+}
+
+const ConstString &
+Watchpoint::WatchpointEventData::GetFlavor () const
+{
+    return WatchpointEventData::GetFlavorString ();
+}
+
+
+WatchpointSP &
+Watchpoint::WatchpointEventData::GetWatchpoint ()
+{
+    return m_new_watchpoint_sp;
+}
+
+WatchpointEventType
+Watchpoint::WatchpointEventData::GetWatchpointEventType () const
+{
+    return m_watchpoint_event;
+}
+
+void
+Watchpoint::WatchpointEventData::Dump (Stream *s) const
+{
+}
+
+const Watchpoint::WatchpointEventData *
+Watchpoint::WatchpointEventData::GetEventDataFromEvent (const Event *event)
+{
+    if (event)
+    {
+        const EventData *event_data = event->GetData();
+        if (event_data && event_data->GetFlavor() == WatchpointEventData::GetFlavorString())
+            return static_cast <const WatchpointEventData *> (event->GetData());
+    }
+    return NULL;
+}
+
+WatchpointEventType
+Watchpoint::WatchpointEventData::GetWatchpointEventTypeFromEvent (const EventSP &event_sp)
+{
+    const WatchpointEventData *data = GetEventDataFromEvent (event_sp.get());
+
+    if (data == NULL)
+        return eWatchpointEventTypeInvalidType;
+    else
+        return data->GetWatchpointEventType();
+}
+
+WatchpointSP
+Watchpoint::WatchpointEventData::GetWatchpointFromEvent (const EventSP &event_sp)
+{
+    WatchpointSP wp_sp;
+
+    const WatchpointEventData *data = GetEventDataFromEvent (event_sp.get());
+    if (data)
+        wp_sp = data->m_new_watchpoint_sp;
+
+    return wp_sp;
+}

Modified: lldb/branches/windows/source/Breakpoint/WatchpointList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Breakpoint/WatchpointList.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Breakpoint/WatchpointList.cpp (original)
+++ lldb/branches/windows/source/Breakpoint/WatchpointList.cpp Tue Jan  8 06:51:53 2013
@@ -31,11 +31,17 @@
 
 // Add a watchpoint to the list.
 lldb::watch_id_t
-WatchpointList::Add (const WatchpointSP &wp_sp)
+WatchpointList::Add (const WatchpointSP &wp_sp, bool notify)
 {
     Mutex::Locker locker (m_mutex);
     wp_sp->SetID(++m_next_wp_id);
     m_watchpoints.push_back(wp_sp);
+    if (notify)
+    {
+        if (wp_sp->GetTarget().EventTypeHasListeners(Target::eBroadcastBitWatchpointChanged))
+            wp_sp->GetTarget().BroadcastEvent (Target::eBroadcastBitWatchpointChanged,
+                                               new Watchpoint::WatchpointEventData (eWatchpointEventTypeAdded, wp_sp));
+    }
     return wp_sp->GetID();
 }
 
@@ -51,7 +57,7 @@
     Mutex::Locker locker (m_mutex);
     s->Printf("%p: ", this);
     //s->Indent();
-    s->Printf("WatchpointList with %llu Watchpoints:\n",
+    s->Printf("WatchpointList with %" PRIu64 " Watchpoints:\n",
               (uint64_t)m_watchpoints.size());
     s->IndentMore();
     wp_collection::const_iterator pos, end = m_watchpoints.end();
@@ -200,12 +206,19 @@
 }
 
 bool
-WatchpointList::Remove (lldb::watch_id_t watch_id)
+WatchpointList::Remove (lldb::watch_id_t watch_id, bool notify)
 {
     Mutex::Locker locker (m_mutex);
     wp_collection::iterator pos = GetIDIterator(watch_id);
     if (pos != m_watchpoints.end())
     {
+        WatchpointSP wp_sp = *pos;
+        if (notify)
+        {
+            if (wp_sp->GetTarget().EventTypeHasListeners(Target::eBroadcastBitWatchpointChanged))
+                wp_sp->GetTarget().BroadcastEvent (Target::eBroadcastBitWatchpointChanged,
+                                                   new Watchpoint::WatchpointEventData (eWatchpointEventTypeRemoved, wp_sp));
+        }
         m_watchpoints.erase(pos);
         return true;
     }
@@ -264,9 +277,25 @@
 }
 
 void
-WatchpointList::RemoveAll ()
+WatchpointList::RemoveAll (bool notify)
 {
     Mutex::Locker locker(m_mutex);
+    if (notify)
+    {
+        
+        {
+            wp_collection::iterator pos, end = m_watchpoints.end();
+            for (pos = m_watchpoints.begin(); pos != end; ++pos)
+            {
+                if ((*pos)->GetTarget().EventTypeHasListeners(Target::eBroadcastBitBreakpointChanged))
+                {
+                    (*pos)->GetTarget().BroadcastEvent (Target::eBroadcastBitWatchpointChanged,
+                                                        new Watchpoint::WatchpointEventData (eWatchpointEventTypeRemoved,
+                                                                                             *pos));
+                }
+            }
+        }
+    }
     m_watchpoints.clear();
 }
 

Modified: lldb/branches/windows/source/Commands/CommandCompletions.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Commands/CommandCompletions.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Commands/CommandCompletions.cpp (original)
+++ lldb/branches/windows/source/Commands/CommandCompletions.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
 
 // C Includes
 #include <sys/stat.h>

Modified: lldb/branches/windows/source/Commands/CommandObjectApropos.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Commands/CommandObjectApropos.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Commands/CommandObjectApropos.cpp (original)
+++ lldb/branches/windows/source/Commands/CommandObjectApropos.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "CommandObjectApropos.h"
 
 // C Includes

Modified: lldb/branches/windows/source/Commands/CommandObjectArgs.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Commands/CommandObjectArgs.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Commands/CommandObjectArgs.cpp (original)
+++ lldb/branches/windows/source/Commands/CommandObjectArgs.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "CommandObjectArgs.h"
 
 // C Includes
@@ -54,7 +56,7 @@
 {
     Error error;
     
-    char short_option = (char) m_getopt_table[option_idx].val;
+    const int short_option = m_getopt_table[option_idx].val;
     
     switch (short_option)
     {

Modified: lldb/branches/windows/source/Commands/CommandObjectBreakpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Commands/CommandObjectBreakpoint.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Commands/CommandObjectBreakpoint.cpp (original)
+++ lldb/branches/windows/source/Commands/CommandObjectBreakpoint.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "CommandObjectBreakpoint.h"
 #include "CommandObjectBreakpointCommand.h"
 
@@ -118,17 +120,15 @@
         SetOptionValue (uint32_t option_idx, const char *option_arg)
         {
             Error error;
-            char short_option = (char) m_getopt_table[option_idx].val;
+            const int short_option = m_getopt_table[option_idx].val;
 
             switch (short_option)
             {
                 case 'a':
-                    m_load_addr = Args::StringToUInt64(option_arg, LLDB_INVALID_ADDRESS, 0);
-                    if (m_load_addr == LLDB_INVALID_ADDRESS)
-                        m_load_addr = Args::StringToUInt64(option_arg, LLDB_INVALID_ADDRESS, 16);
-
-                    if (m_load_addr == LLDB_INVALID_ADDRESS)
-                        error.SetErrorStringWithFormat ("invalid address string '%s'", option_arg);
+                    {
+                        ExecutionContext exe_ctx (m_interpreter.GetExecutionContext());
+                        m_load_addr = Args::StringToAddress(&exe_ctx, option_arg, LLDB_INVALID_ADDRESS, &error);
+                    }
                     break;
 
                 case 'b':
@@ -742,7 +742,7 @@
         SetOptionValue (uint32_t option_idx, const char *option_arg)
         {
             Error error;
-            char short_option = (char) m_getopt_table[option_idx].val;
+            const int short_option = m_getopt_table[option_idx].val;
 
             switch (short_option)
             {
@@ -1249,7 +1249,7 @@
         SetOptionValue (uint32_t option_idx, const char *option_arg)
         {
             Error error;
-            char short_option = (char) m_getopt_table[option_idx].val;
+            const int short_option = m_getopt_table[option_idx].val;
 
             switch (short_option)
             {
@@ -1437,7 +1437,7 @@
         SetOptionValue (uint32_t option_idx, const char *option_arg)
         {
             Error error;
-            char short_option = (char) m_getopt_table[option_idx].val;
+            const int short_option = m_getopt_table[option_idx].val;
 
             switch (short_option)
             {

Modified: lldb/branches/windows/source/Commands/CommandObjectBreakpointCommand.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Commands/CommandObjectBreakpointCommand.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Commands/CommandObjectBreakpointCommand.cpp (original)
+++ lldb/branches/windows/source/Commands/CommandObjectBreakpointCommand.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 // C Includes
 // C++ Includes
 
@@ -413,7 +415,7 @@
         SetOptionValue (uint32_t option_idx, const char *option_arg)
         {
             Error error;
-            char short_option = (char) m_getopt_table[option_idx].val;
+            const int short_option = m_getopt_table[option_idx].val;
 
             switch (short_option)
             {

Modified: lldb/branches/windows/source/Commands/CommandObjectCommands.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Commands/CommandObjectCommands.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Commands/CommandObjectCommands.cpp (original)
+++ lldb/branches/windows/source/Commands/CommandObjectCommands.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "CommandObjectCommands.h"
 
 // C Includes
@@ -72,7 +74,7 @@
         SetOptionValue (uint32_t option_idx, const char *option_arg)
         {
             Error error;
-            char short_option = (char) m_getopt_table[option_idx].val;
+            const int short_option = m_getopt_table[option_idx].val;
             bool success;
             
             switch (short_option)
@@ -234,7 +236,7 @@
         SetOptionValue (uint32_t option_idx, const char *option_arg)
         {
             Error error;
-            char short_option = (char) m_getopt_table[option_idx].val;
+            const int short_option = m_getopt_table[option_idx].val;
             bool success;
             
             switch (short_option)
@@ -1082,7 +1084,7 @@
          SetOptionValue (uint32_t option_idx, const char *option_arg)
          {
              Error error;
-             char short_option = (char) m_getopt_table[option_idx].val;
+             const int short_option = m_getopt_table[option_idx].val;
              
              switch (short_option)
              {
@@ -1335,7 +1337,7 @@
         SetOptionValue (uint32_t option_idx, const char *option_arg)
         {
             Error error;
-            char short_option = (char) m_getopt_table[option_idx].val;
+            const int short_option = m_getopt_table[option_idx].val;
             
             switch (short_option)
             {
@@ -1478,7 +1480,7 @@
         SetOptionValue (uint32_t option_idx, const char *option_arg)
         {
             Error error;
-            char short_option = (char) m_getopt_table[option_idx].val;
+            const int short_option = m_getopt_table[option_idx].val;
             
             switch (short_option)
             {

Modified: lldb/branches/windows/source/Commands/CommandObjectDisassemble.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Commands/CommandObjectDisassemble.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Commands/CommandObjectDisassemble.cpp (original)
+++ lldb/branches/windows/source/Commands/CommandObjectDisassemble.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "CommandObjectDisassemble.h"
 
 // C Includes
@@ -38,7 +40,7 @@
     num_lines_context(0),
     num_instructions (0),
     func_name(),
-    cur_function (false),
+    current_function (false),
     start_addr(),
     end_addr (),
     at_pc (false),
@@ -59,7 +61,7 @@
 {
     Error error;
 
-    char short_option = (char) m_getopt_table[option_idx].val;
+    const int short_option = m_getopt_table[option_idx].val;
 
     bool success;
     
@@ -86,23 +88,21 @@
         break;
 
     case 's':
-        start_addr = Args::StringToUInt64(option_arg, LLDB_INVALID_ADDRESS, 0);
-        if (start_addr == LLDB_INVALID_ADDRESS)
-            start_addr = Args::StringToUInt64(option_arg, LLDB_INVALID_ADDRESS, 16);
-
-        if (start_addr == LLDB_INVALID_ADDRESS)
-            error.SetErrorStringWithFormat ("invalid start address string '%s'", option_arg);
-        some_location_specified = true;
+        {
+            ExecutionContext exe_ctx (m_interpreter.GetExecutionContext());
+            start_addr = Args::StringToAddress(&exe_ctx, option_arg, LLDB_INVALID_ADDRESS, &error);
+            if (start_addr != LLDB_INVALID_ADDRESS)
+                some_location_specified = true;
+        }
         break;
     case 'e':
-        end_addr = Args::StringToUInt64(option_arg, LLDB_INVALID_ADDRESS, 0);
-        if (end_addr == LLDB_INVALID_ADDRESS)
-            end_addr = Args::StringToUInt64(option_arg, LLDB_INVALID_ADDRESS, 16);
-
-        if (end_addr == LLDB_INVALID_ADDRESS)
-            error.SetErrorStringWithFormat ("invalid end address string '%s'", option_arg);
+        {
+            ExecutionContext exe_ctx (m_interpreter.GetExecutionContext());
+            end_addr = Args::StringToAddress(&exe_ctx, option_arg, LLDB_INVALID_ADDRESS, &error);
+            if (end_addr != LLDB_INVALID_ADDRESS)
+                some_location_specified = true;
+        }
         break;
-        some_location_specified = true;
     case 'n':
         func_name.assign (option_arg);
         some_location_specified = true;
@@ -130,7 +130,7 @@
         break;
 
     case 'f':
-        cur_function = true;
+        current_function = true;
         some_location_specified = true;
         break;
 
@@ -155,7 +155,7 @@
     num_lines_context = 0;
     num_instructions = 0;
     func_name.clear();
-    cur_function = false;
+    current_function = false;
     at_pc = false;
     frame_line = false;
     start_addr = LLDB_INVALID_ADDRESS;
@@ -170,7 +170,7 @@
 CommandObjectDisassemble::CommandOptions::OptionParsingFinished ()
 {
     if (!some_location_specified)
-        at_pc = true;
+        current_function = true;
     return Error();
     
 }
@@ -184,24 +184,25 @@
 OptionDefinition
 CommandObjectDisassemble::CommandOptions::g_option_table[] =
 {
-{ LLDB_OPT_SET_ALL  , false , "bytes",          'b', no_argument        , NULL, 0, eArgTypeNone,        "Show opcode bytes when disassembling."},
-{ LLDB_OPT_SET_ALL  , false , "context",        'C', required_argument  , NULL, 0, eArgTypeNumLines,    "Number of context lines of source to show."},
-{ LLDB_OPT_SET_ALL  , false , "mixed",          'm', no_argument        , NULL, 0, eArgTypeNone,        "Enable mixed source and assembly display."},
-{ LLDB_OPT_SET_ALL  , false , "raw",            'r', no_argument        , NULL, 0, eArgTypeNone,        "Print raw disassembly with no symbol information."},
-{ LLDB_OPT_SET_ALL  , false , "plugin",         'P', required_argument  , NULL, 0, eArgTypePlugin,      "Name of the disassembler plugin you want to use."},
-{ LLDB_OPT_SET_ALL  , false , "arch",           'a', required_argument  , NULL, 0, eArgTypeArchitecture,"Specify the architecture to use from cross disassembly."},
-{ LLDB_OPT_SET_1 |
-  LLDB_OPT_SET_2    , true  , "start-address" , 's', required_argument  , NULL, 0, eArgTypeStartAddress,"Address at which to start disassembling."},
-{ LLDB_OPT_SET_1    , false , "end-address"  ,  'e', required_argument  , NULL, 0, eArgTypeEndAddress,  "Address at which to end disassembling."},
-{ LLDB_OPT_SET_2 |
-  LLDB_OPT_SET_3 |
-  LLDB_OPT_SET_4 |
-  LLDB_OPT_SET_5    , false , "count",          'c', required_argument  , NULL, 0, eArgTypeNumLines,    "Number of instructions to display."},
-{ LLDB_OPT_SET_3    , false  , "name",           'n', required_argument  , NULL, CommandCompletions::eSymbolCompletion, eArgTypeFunctionName,             "Disassemble entire contents of the given function name."},
-{ LLDB_OPT_SET_4    , false  , "frame",          'f', no_argument        , NULL, 0, eArgTypeNone,        "Disassemble from the start of the current frame's function."},
-{ LLDB_OPT_SET_5    , false  , "pc",             'p', no_argument        , NULL, 0, eArgTypeNone,        "Disassemble around the current pc."},
-{ LLDB_OPT_SET_6    , false  , "line",           'l', no_argument        , NULL, 0, eArgTypeNone,        "Disassemble the current frame's current source line instructions if there debug line table information, else disasemble around the pc."},
-{ 0                 , false , NULL,             0,   0                  , NULL, 0, eArgTypeNone,        NULL }
+{ LLDB_OPT_SET_ALL, false, "bytes"        , 'b', no_argument        , NULL, 0, eArgTypeNone,        "Show opcode bytes when disassembling."},
+{ LLDB_OPT_SET_ALL, false, "context"      , 'C', required_argument  , NULL, 0, eArgTypeNumLines,    "Number of context lines of source to show."},
+{ LLDB_OPT_SET_ALL, false, "mixed"        , 'm', no_argument        , NULL, 0, eArgTypeNone,        "Enable mixed source and assembly display."},
+{ LLDB_OPT_SET_ALL, false, "raw"          , 'r', no_argument        , NULL, 0, eArgTypeNone,        "Print raw disassembly with no symbol information."},
+{ LLDB_OPT_SET_ALL, false, "plugin"       , 'P', required_argument  , NULL, 0, eArgTypePlugin,      "Name of the disassembler plugin you want to use."},
+{ LLDB_OPT_SET_ALL, false, "arch"         , 'a', required_argument  , NULL, 0, eArgTypeArchitecture,"Specify the architecture to use from cross disassembly."},
+{ LLDB_OPT_SET_1  |
+  LLDB_OPT_SET_2  , true , "start-address", 's', required_argument  , NULL, 0, eArgTypeStartAddress,"Address at which to start disassembling."},
+{ LLDB_OPT_SET_1  , false, "end-address"  , 'e', required_argument  , NULL, 0, eArgTypeEndAddress,  "Address at which to end disassembling."},
+{ LLDB_OPT_SET_2  |
+  LLDB_OPT_SET_3  |
+  LLDB_OPT_SET_4  |
+  LLDB_OPT_SET_5  , false, "count"        , 'c', required_argument  , NULL, 0, eArgTypeNumLines,    "Number of instructions to display."},
+{ LLDB_OPT_SET_3  , false, "name"         , 'n', required_argument  , NULL, CommandCompletions::eSymbolCompletion, eArgTypeFunctionName,
+                                                                                                    "Disassemble entire contents of the given function name."},
+{ LLDB_OPT_SET_4  , false, "frame"        , 'f', no_argument        , NULL, 0, eArgTypeNone,        "Disassemble from the start of the current frame's function."},
+{ LLDB_OPT_SET_5  , false, "pc"           , 'p', no_argument        , NULL, 0, eArgTypeNone,        "Disassemble around the current pc."},
+{ LLDB_OPT_SET_6  , false, "line"         , 'l', no_argument        , NULL, 0, eArgTypeNone,        "Disassemble the current frame's current source line instructions if there debug line table information, else disasemble around the pc."},
+{ 0               , false, NULL           ,   0, 0                  , NULL, 0, eArgTypeNone,        NULL }
 };
 
 
@@ -332,7 +333,7 @@
                 m_options.show_mixed = false;
             }
         }
-        else if (m_options.cur_function)
+        else if (m_options.current_function)
         {
             if (frame == NULL)
             {
@@ -424,7 +425,7 @@
             }
             else
             {
-                result.AppendErrorWithFormat ("Failed to disassemble memory at 0x%8.8llx.\n", m_options.start_addr);
+                result.AppendErrorWithFormat ("Failed to disassemble memory at 0x%8.8" PRIx64 ".\n", m_options.start_addr);
                 result.SetStatus (eReturnStatusFailed);            
             }
         }
@@ -470,7 +471,7 @@
             }
             else
             {
-                result.AppendErrorWithFormat ("Failed to disassemble memory at 0x%8.8llx.\n", m_options.start_addr);
+                result.AppendErrorWithFormat ("Failed to disassemble memory at 0x%8.8" PRIx64 ".\n", m_options.start_addr);
                 result.SetStatus (eReturnStatusFailed);            
             }
         }

Modified: lldb/branches/windows/source/Commands/CommandObjectDisassemble.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Commands/CommandObjectDisassemble.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Commands/CommandObjectDisassemble.h (original)
+++ lldb/branches/windows/source/Commands/CommandObjectDisassemble.h Tue Jan  8 06:51:53 2013
@@ -62,7 +62,7 @@
         uint32_t num_instructions;
         bool raw;
         std::string func_name;
-        bool cur_function;
+        bool current_function;
         lldb::addr_t start_addr;
         lldb::addr_t end_addr;
         bool at_pc;

Modified: lldb/branches/windows/source/Commands/CommandObjectExpression.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Commands/CommandObjectExpression.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Commands/CommandObjectExpression.cpp (original)
+++ lldb/branches/windows/source/Commands/CommandObjectExpression.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "CommandObjectExpression.h"
 
 // C Includes
@@ -54,7 +56,7 @@
     { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "dynamic-value",      'd', required_argument, NULL, 0, eArgTypeBoolean,    "Upcast the value resulting from the expression to its dynamic type if available."},
     { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "timeout",            't', required_argument, NULL, 0, eArgTypeUnsignedInteger,  "Timeout value for running the expression."},
     { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "unwind-on-error",    'u', required_argument, NULL, 0, eArgTypeBoolean,    "Clean up program state if the expression causes a crash, breakpoint hit or signal."},
-    { LLDB_OPT_SET_2                 , false, "object-description", 'o', no_argument,       NULL, 0, eArgTypeNone,       "Print the object description of the value resulting from the expression."},
+    { LLDB_OPT_SET_2                 , false, "object-description", 'O', no_argument,       NULL, 0, eArgTypeNone,       "Print the object description of the value resulting from the expression."},
 };
 
 
@@ -71,7 +73,7 @@
 {
     Error error;
 
-    const char short_option = (char) g_option_table[option_idx].short_option;
+    const int short_option = g_option_table[option_idx].short_option;
 
     switch (short_option)
     {
@@ -111,7 +113,7 @@
         }
         break;
         
-    case 'o':
+    case 'O':
         print_object = true;
         break;
         

Modified: lldb/branches/windows/source/Commands/CommandObjectFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Commands/CommandObjectFrame.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Commands/CommandObjectFrame.cpp (original)
+++ lldb/branches/windows/source/Commands/CommandObjectFrame.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "CommandObjectFrame.h"
 
 // C Includes
@@ -120,7 +122,7 @@
         {
             Error error;
             bool success = false;
-            char short_option = (char) m_getopt_table[option_idx].val;
+            const int short_option = m_getopt_table[option_idx].val;
             switch (short_option)
             {
             case 'r':   

Modified: lldb/branches/windows/source/Commands/CommandObjectHelp.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Commands/CommandObjectHelp.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Commands/CommandObjectHelp.cpp (original)
+++ lldb/branches/windows/source/Commands/CommandObjectHelp.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "CommandObjectHelp.h"
 
 // C Includes
@@ -171,8 +173,9 @@
                     {
                             // Also emit a warning about using "--" in case you are using a command that takes options and arguments.
                             m_interpreter.OutputFormattedHelpText (output_strm, "", "",
-                                                                   "\nThis command takes options and arguments, if your arguments look like option specifiers"
-                                                                   " you must use '--' to terminate the options before starting to give the arguments.", 1);
+                                                                   "\nThis command takes options and free-form arguments.  If your arguments resemble"
+                                                                   " option specifiers (i.e., they start with a - or --), you must use ' -- ' between"
+                                                                   " the end of the command options and the beginning of the arguments.", 1);
                     }
 
                     // Mark this help command with a success status.

Modified: lldb/branches/windows/source/Commands/CommandObjectHelp.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Commands/CommandObjectHelp.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Commands/CommandObjectHelp.h (original)
+++ lldb/branches/windows/source/Commands/CommandObjectHelp.h Tue Jan  8 06:51:53 2013
@@ -57,7 +57,7 @@
         SetOptionValue (uint32_t option_idx, const char *option_arg)
         {
             Error error;
-            char short_option = (char) m_getopt_table[option_idx].val;
+            const int short_option = m_getopt_table[option_idx].val;
             
             switch (short_option)
             {

Modified: lldb/branches/windows/source/Commands/CommandObjectLog.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Commands/CommandObjectLog.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Commands/CommandObjectLog.cpp (original)
+++ lldb/branches/windows/source/Commands/CommandObjectLog.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "CommandObjectLog.h"
 
 // C Includes
@@ -132,11 +134,11 @@
         SetOptionValue (uint32_t option_idx, const char *option_arg)
         {
             Error error;
-            char short_option = (char) m_getopt_table[option_idx].val;
+            const int short_option = m_getopt_table[option_idx].val;
 
             switch (short_option)
             {
-            case 'f':  log_file = option_arg;                                 break;
+            case 'f':  log_file.SetFile(option_arg, true);                    break;
             case 't':  log_options |= LLDB_LOG_OPTION_THREADSAFE;             break;
             case 'v':  log_options |= LLDB_LOG_OPTION_VERBOSE;                break;
             case 'g':  log_options |= LLDB_LOG_OPTION_DEBUG;                  break;
@@ -156,7 +158,7 @@
         void
         OptionParsingStarting ()
         {
-            log_file.clear();
+            log_file.Clear();
             log_options = 0;
         }
 
@@ -172,7 +174,7 @@
 
         // Instance variables to hold the values for command options.
 
-        std::string log_file;
+        FileSpec log_file;
         uint32_t log_options;
     };
 
@@ -189,9 +191,14 @@
         {
             std::string channel(args.GetArgumentAtIndex(0));
             args.Shift ();  // Shift off the channel
+            char log_file[PATH_MAX];
+            if (m_options.log_file)
+                m_options.log_file.GetPath(log_file, sizeof(log_file));
+            else
+                log_file[0] = '\0';
             bool success = m_interpreter.GetDebugger().EnableLog (channel.c_str(), 
                                                                   args.GetConstArgumentVector(), 
-                                                                  m_options.log_file.c_str(), 
+                                                                  log_file, 
                                                                   m_options.log_options, 
                                                                   result.GetErrorStream());
             if (success)

Modified: lldb/branches/windows/source/Commands/CommandObjectMemory.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Commands/CommandObjectMemory.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Commands/CommandObjectMemory.cpp (original)
+++ lldb/branches/windows/source/Commands/CommandObjectMemory.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "CommandObjectMemory.h"
 
 // C Includes
@@ -82,7 +84,7 @@
                     const char *option_arg)
     {
         Error error;
-        char short_option = (char) g_option_table[option_idx].short_option;
+        const int short_option = g_option_table[option_idx].short_option;
         
         switch (short_option)
         {
@@ -190,7 +192,7 @@
                 if (byte_size_option_set)
                 {
                     if (byte_size_value > 1)
-                        error.SetErrorStringWithFormat ("display format (bytes/bytes with ascii) conflicts with the specified byte size %llu\n"
+                        error.SetErrorStringWithFormat ("display format (bytes/bytes with ascii) conflicts with the specified byte size %" PRIu64 "\n"
                                                         "\tconsider using a different display format or don't specify the byte size",
                                                         byte_size_value.GetCurrentValue());
                 }
@@ -367,8 +369,7 @@
 
 protected:
     virtual bool
-    DoExecute (Args& command,
-             CommandReturnObject &result)
+    DoExecute (Args& command, CommandReturnObject &result)
     {
         ExecutionContext exe_ctx (m_interpreter.GetExecutionContext());
         Target *target = exe_ctx.GetTargetPtr();
@@ -383,7 +384,8 @@
         
         if ((argc == 0 && m_next_addr == LLDB_INVALID_ADDRESS) || argc > 2)
         {
-            result.AppendErrorWithFormat ("%s takes 1 or two args.\n", m_cmd_name.c_str());
+            result.AppendErrorWithFormat ("%s takes a start address expression with an optional end address expression.\n", m_cmd_name.c_str());
+            result.AppendRawWarning("Expressions should be quoted if they contain spaces or other special characters.\n");
             result.SetStatus(eReturnStatusFailed);
             return false;
         }
@@ -391,11 +393,11 @@
         ClangASTType clang_ast_type;        
         Error error;
 
-        Format format = m_format_options.GetFormat();
         const char *view_as_type_cstr = m_memory_options.m_view_as_type.GetCurrentValue();
         if (view_as_type_cstr && view_as_type_cstr[0])
         {
             // We are viewing memory as a type
+            
             SymbolContext sc;
             const bool exact_match = false;
             TypeList type_list;
@@ -563,7 +565,7 @@
         // Look for invalid combinations of settings
         if (error.Fail())
         {
-            result.AppendErrorWithFormat("%s", error.AsCString());
+            result.AppendError(error.AsCString());
             result.SetStatus(eReturnStatusFailed);
             return false;
         }
@@ -576,7 +578,8 @@
             // if no options have been set
             addr = m_next_addr;
             total_byte_size = m_prev_byte_size;
-            if (!m_format_options.AnyOptionWasSet() && 
+            clang_ast_type = m_prev_clang_ast_type;
+            if (!m_format_options.AnyOptionWasSet() &&
                 !m_memory_options.AnyOptionWasSet() &&
                 !m_outfile_options.AnyOptionWasSet() &&
                 !m_varobj_options.AnyOptionWasSet())
@@ -600,33 +603,35 @@
         }
 
         if (argc > 0)
-            addr = Args::StringToUInt64(command.GetArgumentAtIndex(0), LLDB_INVALID_ADDRESS, 0);
+            addr = Args::StringToAddress(&exe_ctx, command.GetArgumentAtIndex(0), LLDB_INVALID_ADDRESS, &error);
 
         if (addr == LLDB_INVALID_ADDRESS)
         {
-            result.AppendErrorWithFormat("invalid start address string '%s'.\n", command.GetArgumentAtIndex(0));
+            result.AppendError("invalid start address expression.");
+            result.AppendError(error.AsCString());
             result.SetStatus(eReturnStatusFailed);
             return false;
         }
 
         if (argc == 2)
         {
-            lldb::addr_t end_addr = Args::StringToUInt64(command.GetArgumentAtIndex(1), LLDB_INVALID_ADDRESS, 0);
+            lldb::addr_t end_addr = Args::StringToAddress(&exe_ctx, command.GetArgumentAtIndex(1), LLDB_INVALID_ADDRESS, 0);
             if (end_addr == LLDB_INVALID_ADDRESS)
             {
-                result.AppendErrorWithFormat("invalid end address string '%s'.\n", command.GetArgumentAtIndex(1));
+                result.AppendError("invalid end address expression.");
+                result.AppendError(error.AsCString());
                 result.SetStatus(eReturnStatusFailed);
                 return false;
             }
             else if (end_addr <= addr)
             {
-                result.AppendErrorWithFormat("end address (0x%llx) must be greater that the start address (0x%llx).\n", end_addr, addr);
+                result.AppendErrorWithFormat("end address (0x%" PRIx64 ") must be greater that the start address (0x%" PRIx64 ").\n", end_addr, addr);
                 result.SetStatus(eReturnStatusFailed);
                 return false;
             }
             else if (m_format_options.GetCountValue().OptionWasSet())
             {
-                result.AppendErrorWithFormat("specify either the end address (0x%llx) or the count (--count %lu), not both.\n", end_addr, item_count);
+                result.AppendErrorWithFormat("specify either the end address (0x%" PRIx64 ") or the count (--count %lu), not both.\n", end_addr, item_count);
                 result.SetStatus(eReturnStatusFailed);
                 return false;
             }
@@ -644,7 +649,15 @@
         
         DataBufferSP data_sp;
         size_t bytes_read = 0;
-        if (!clang_ast_type.GetOpaqueQualType())
+        if (clang_ast_type.GetOpaqueQualType())
+        {
+            // Make sure we don't display our type as ASCII bytes like the default memory read
+            if (m_format_options.GetFormatValue().OptionWasSet() == false)
+                m_format_options.GetFormatValue().SetCurrentValue(eFormatDefault);
+
+            bytes_read = clang_ast_type.GetTypeByteSize() * m_format_options.GetCountValue().GetCurrentValue();
+        }
+        else
         {
             data_sp.reset (new DataBufferHeap (total_byte_size, '\0'));
             Address address(addr, NULL);
@@ -658,25 +671,24 @@
                 }
                 else
                 {
-                    result.AppendErrorWithFormat("failed to read memory from 0x%llx.\n", addr);
+                    result.AppendErrorWithFormat("failed to read memory from 0x%" PRIx64 ".\n", addr);
                 }
                 result.SetStatus(eReturnStatusFailed);
                 return false;
             }
             
             if (bytes_read < total_byte_size)
-                result.AppendWarningWithFormat("Not all bytes (%lu/%lu) were able to be read from 0x%llx.\n", bytes_read, total_byte_size, addr);
-            else
-            {
-                m_next_addr = addr + bytes_read;
-                m_prev_byte_size = bytes_read; 
-                m_prev_format_options = m_format_options;
-                m_prev_memory_options = m_memory_options;
-                m_prev_outfile_options = m_outfile_options;
-                m_prev_varobj_options = m_varobj_options;
-            }
+                result.AppendWarningWithFormat("Not all bytes (%lu/%lu) were able to be read from 0x%" PRIx64 ".", bytes_read, total_byte_size, addr);
         }
 
+        m_next_addr = addr + bytes_read;
+        m_prev_byte_size = bytes_read;
+        m_prev_format_options = m_format_options;
+        m_prev_memory_options = m_memory_options;
+        m_prev_outfile_options = m_outfile_options;
+        m_prev_varobj_options = m_varobj_options;
+        m_prev_clang_ast_type = clang_ast_type;
+
         StreamFile outfile_stream;
         Stream *output_stream = NULL;
         const FileSpec &outfile_spec = m_outfile_options.GetFile().GetCurrentValue();
@@ -705,7 +717,7 @@
                     }
                     else 
                     {
-                        result.AppendErrorWithFormat("Failed to write %llu bytes to '%s'.\n", (uint64_t)bytes_read, path);
+                        result.AppendErrorWithFormat("Failed to write %" PRIu64 " bytes to '%s'.\n", (uint64_t)bytes_read, path);
                         result.SetStatus(eReturnStatusFailed);
                         return false;
                     }
@@ -738,13 +750,14 @@
                 addr_t item_addr = addr + (i * item_byte_size);
                 Address address (item_addr);
                 StreamString name_strm;
-                name_strm.Printf ("0x%llx", item_addr);
+                name_strm.Printf ("0x%" PRIx64, item_addr);
                 ValueObjectSP valobj_sp (ValueObjectMemory::Create (exe_scope, 
                                                                     name_strm.GetString().c_str(), 
                                                                     address, 
                                                                     clang_ast_type));
                 if (valobj_sp)
                 {
+                    Format format = m_format_options.GetFormat();
                     if (format != eFormatDefault)
                         valobj_sp->SetFormat (format);
 
@@ -812,6 +825,7 @@
     OptionGroupReadMemory m_prev_memory_options;
     OptionGroupOutputFile m_prev_outfile_options;
     OptionGroupValueObjectDisplay m_prev_varobj_options;
+    ClangASTType m_prev_clang_ast_type;
 };
 
 
@@ -861,7 +875,7 @@
                         const char *option_arg)
         {
             Error error;
-            char short_option = (char) g_memory_write_option_table[option_idx].short_option;
+            const int short_option = g_memory_write_option_table[option_idx].short_option;
             
             switch (short_option)
             {
@@ -985,7 +999,8 @@
     virtual bool
     DoExecute (Args& command, CommandReturnObject &result)
     {
-        Process *process = m_interpreter.GetExecutionContext().GetProcessPtr();
+        ExecutionContext exe_ctx(m_interpreter.GetExecutionContext());
+        Process *process = exe_ctx.GetProcessPtr();
         if (process == NULL)
         {
             result.AppendError("need a process to read memory");
@@ -1018,11 +1033,16 @@
         OptionValueUInt64 &byte_size_value = m_format_options.GetByteSizeValue();
         size_t item_byte_size = byte_size_value.GetCurrentValue();
 
-        lldb::addr_t addr = Args::StringToUInt64(command.GetArgumentAtIndex(0), LLDB_INVALID_ADDRESS, 0);
+        Error error;
+        lldb::addr_t addr = Args::StringToAddress (&exe_ctx,
+                                                   command.GetArgumentAtIndex(0),
+                                                   LLDB_INVALID_ADDRESS,
+                                                   &error);
 
         if (addr == LLDB_INVALID_ADDRESS)
         {
-            result.AppendErrorWithFormat("Invalid address string '%s'.\n", command.GetArgumentAtIndex(0));
+            result.AppendError("invalid address expression\n");
+            result.AppendError(error.AsCString());
             result.SetStatus(eReturnStatusFailed);
             return false;
         }
@@ -1044,18 +1064,18 @@
                     if (bytes_written == length)
                     {
                         // All bytes written
-                        result.GetOutputStream().Printf("%llu bytes were written to 0x%llx\n", (uint64_t)bytes_written, addr);
+                        result.GetOutputStream().Printf("%" PRIu64 " bytes were written to 0x%" PRIx64 "\n", (uint64_t)bytes_written, addr);
                         result.SetStatus(eReturnStatusSuccessFinishResult);
                     }
                     else if (bytes_written > 0)
                     {
                         // Some byte written
-                        result.GetOutputStream().Printf("%llu bytes of %llu requested were written to 0x%llx\n", (uint64_t)bytes_written, (uint64_t)length, addr);
+                        result.GetOutputStream().Printf("%" PRIu64 " bytes of %" PRIu64 " requested were written to 0x%" PRIx64 "\n", (uint64_t)bytes_written, (uint64_t)length, addr);
                         result.SetStatus(eReturnStatusSuccessFinishResult);
                     }
                     else 
                     {
-                        result.AppendErrorWithFormat ("Memory write to 0x%llx failed: %s.\n", addr, error.AsCString());
+                        result.AppendErrorWithFormat ("Memory write to 0x%" PRIx64 " failed: %s.\n", addr, error.AsCString());
                         result.SetStatus(eReturnStatusFailed);
                     }
                 }
@@ -1133,7 +1153,7 @@
                 }
                 else if (!UIntValueIsValidForSize (uval64, item_byte_size))
                 {
-                    result.AppendErrorWithFormat ("Value 0x%llx is too large to fit in a %lu byte unsigned integer value.\n", uval64, item_byte_size);
+                    result.AppendErrorWithFormat ("Value 0x%" PRIx64 " is too large to fit in a %lu byte unsigned integer value.\n", uval64, item_byte_size);
                     result.SetStatus(eReturnStatusFailed);
                     return false;
                 }
@@ -1161,7 +1181,7 @@
                 }
                 else if (!UIntValueIsValidForSize (uval64, item_byte_size))
                 {
-                    result.AppendErrorWithFormat ("Value 0x%llx is too large to fit in a %lu byte unsigned integer value.\n", uval64, item_byte_size);
+                    result.AppendErrorWithFormat ("Value 0x%" PRIx64 " is too large to fit in a %lu byte unsigned integer value.\n", uval64, item_byte_size);
                     result.SetStatus(eReturnStatusFailed);
                     return false;
                 }
@@ -1184,7 +1204,7 @@
                     }
                     else
                     {
-                        result.AppendErrorWithFormat ("Memory write to 0x%llx failed: %s.\n", addr, error.AsCString());
+                        result.AppendErrorWithFormat ("Memory write to 0x%" PRIx64 " failed: %s.\n", addr, error.AsCString());
                         result.SetStatus(eReturnStatusFailed);
                         return false;
                     }
@@ -1201,7 +1221,7 @@
                 }
                 else if (!SIntValueIsValidForSize (sval64, item_byte_size))
                 {
-                    result.AppendErrorWithFormat ("Value %lli is too large or small to fit in a %lu byte signed integer value.\n", sval64, item_byte_size);
+                    result.AppendErrorWithFormat ("Value %" PRIi64 " is too large or small to fit in a %lu byte signed integer value.\n", sval64, item_byte_size);
                     result.SetStatus(eReturnStatusFailed);
                     return false;
                 }
@@ -1218,7 +1238,7 @@
                 }
                 else if (!UIntValueIsValidForSize (uval64, item_byte_size))
                 {
-                    result.AppendErrorWithFormat ("Value %llu is too large to fit in a %lu byte unsigned integer value.\n", uval64, item_byte_size);
+                    result.AppendErrorWithFormat ("Value %" PRIu64 " is too large to fit in a %lu byte unsigned integer value.\n", uval64, item_byte_size);
                     result.SetStatus(eReturnStatusFailed);
                     return false;
                 }
@@ -1235,7 +1255,7 @@
                 }
                 else if (!UIntValueIsValidForSize (uval64, item_byte_size))
                 {
-                    result.AppendErrorWithFormat ("Value %llo is too large to fit in a %lu byte unsigned integer value.\n", uval64, item_byte_size);
+                    result.AppendErrorWithFormat ("Value %" PRIo64 " is too large to fit in a %lu byte unsigned integer value.\n", uval64, item_byte_size);
                     result.SetStatus(eReturnStatusFailed);
                     return false;
                 }
@@ -1251,7 +1271,7 @@
                 return true;
             else
             {
-                result.AppendErrorWithFormat ("Memory write to 0x%llx failed: %s.\n", addr, error.AsCString());
+                result.AppendErrorWithFormat ("Memory write to 0x%" PRIx64 " failed: %s.\n", addr, error.AsCString());
                 result.SetStatus(eReturnStatusFailed);
                 return false;
             }

Modified: lldb/branches/windows/source/Commands/CommandObjectMultiword.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Commands/CommandObjectMultiword.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Commands/CommandObjectMultiword.cpp (original)
+++ lldb/branches/windows/source/Commands/CommandObjectMultiword.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/Interpreter/CommandObjectMultiword.h"
 // C Includes
 // C++ Includes

Modified: lldb/branches/windows/source/Commands/CommandObjectPlatform.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Commands/CommandObjectPlatform.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Commands/CommandObjectPlatform.cpp (original)
+++ lldb/branches/windows/source/Commands/CommandObjectPlatform.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "CommandObjectPlatform.h"
 
 // C Includes
@@ -519,7 +521,7 @@
                         }
                         else
                         {
-                            result.AppendErrorWithFormat ("no process found with pid = %llu\n", pid);
+                            result.AppendErrorWithFormat ("no process found with pid = %" PRIu64 "\n", pid);
                             result.SetStatus (eReturnStatusFailed);
                         }
                     }
@@ -606,7 +608,7 @@
         SetOptionValue (uint32_t option_idx, const char *option_arg)
         {
             Error error;
-            char short_option = (char) m_getopt_table[option_idx].val;
+            const int short_option = m_getopt_table[option_idx].val;
             bool success = false;
 
             switch (short_option)
@@ -796,12 +798,12 @@
                             ProcessInstanceInfo proc_info;
                             if (platform_sp->GetProcessInfo (pid, proc_info))
                             {
-                                ostrm.Printf ("Process information for process %llu:\n", pid);
+                                ostrm.Printf ("Process information for process %" PRIu64 ":\n", pid);
                                 proc_info.Dump (ostrm, platform_sp.get());
                             }
                             else
                             {
-                                ostrm.Printf ("error: no process information is available for process %llu\n", pid);
+                                ostrm.Printf ("error: no process information is available for process %" PRIu64 "\n", pid);
                             }
                             ostrm.EOL();
                         }

Modified: lldb/branches/windows/source/Commands/CommandObjectPlugin.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Commands/CommandObjectPlugin.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Commands/CommandObjectPlugin.cpp (original)
+++ lldb/branches/windows/source/Commands/CommandObjectPlugin.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "CommandObjectPlugin.h"
 
 #include "lldb/API/SBDebugger.h"

Modified: lldb/branches/windows/source/Commands/CommandObjectProcess.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Commands/CommandObjectProcess.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Commands/CommandObjectProcess.cpp (original)
+++ lldb/branches/windows/source/Commands/CommandObjectProcess.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "CommandObjectProcess.h"
 
 // C Includes
@@ -250,7 +252,7 @@
         {
             const char *archname = exe_module->GetArchitecture().GetArchitectureName();
 
-            result.AppendMessageWithFormat ("Process %llu launched: '%s' (%s)\n", process->GetID(), filename, archname);
+            result.AppendMessageWithFormat ("Process %" PRIu64 " launched: '%s' (%s)\n", process->GetID(), filename, archname);
             result.SetDidChangeProcessState (true);
             if (m_options.launch_info.GetFlags().Test(eLaunchFlagStopAtEntry) == false)
             {
@@ -355,7 +357,7 @@
         SetOptionValue (uint32_t option_idx, const char *option_arg)
         {
             Error error;
-            char short_option = (char) m_getopt_table[option_idx].val;
+            const int short_option = m_getopt_table[option_idx].val;
             bool success = false;
             switch (short_option)
             {
@@ -510,7 +512,7 @@
             state = process->GetState();
             if (process->IsAlive() && state != eStateConnected)
             {
-                result.AppendErrorWithFormat ("Process %llu is currently being debugged, kill the process before attaching.\n", 
+                result.AppendErrorWithFormat ("Process %" PRIu64 " is currently being debugged, kill the process before attaching.\n",
                                               process->GetID());
                 result.SetStatus (eReturnStatusFailed);
                 return false;
@@ -597,7 +599,7 @@
 
                     if (state == eStateStopped)
                     {
-                        result.AppendMessageWithFormat ("Process %llu %s\n", process->GetID(), StateAsCString (state));
+                        result.AppendMessageWithFormat ("Process %" PRIu64 " %s\n", process->GetID(), StateAsCString (state));
                         result.SetStatus (eReturnStatusSuccessFinishNoResult);
                     }
                     else
@@ -640,7 +642,7 @@
             {
                 result.AppendMessageWithFormat ("Architecture set to: %s.\n", target->GetArchitecture().GetTriple().getTriple().c_str());
             }
-            else if (old_arch_spec != target->GetArchitecture())
+            else if (!old_arch_spec.IsExactMatch(target->GetArchitecture()))
             {
                 result.AppendWarningWithFormat("Architecture changed from %s to %s.\n", 
                                                old_arch_spec.GetTriple().getTriple().c_str(),
@@ -715,7 +717,7 @@
         SetOptionValue (uint32_t option_idx, const char *option_arg)
         {
             Error error;
-            char short_option = (char) m_getopt_table[option_idx].val;
+            const int short_option = m_getopt_table[option_idx].val;
             bool success = false;
             switch (short_option)
             {
@@ -815,13 +817,13 @@
             Error error(process->Resume());
             if (error.Success())
             {
-                result.AppendMessageWithFormat ("Process %llu resuming\n", process->GetID());
+                result.AppendMessageWithFormat ("Process %" PRIu64 " resuming\n", process->GetID());
                 if (synchronous_execution)
                 {
                     state = process->WaitForProcessToStop (NULL);
 
                     result.SetDidChangeProcessState (true);
-                    result.AppendMessageWithFormat ("Process %llu %s\n", process->GetID(), StateAsCString (state));
+                    result.AppendMessageWithFormat ("Process %" PRIu64 " %s\n", process->GetID(), StateAsCString (state));
                     result.SetStatus (eReturnStatusSuccessFinishNoResult);
                 }
                 else
@@ -897,7 +899,7 @@
             return false;
         }
 
-        result.AppendMessageWithFormat ("Detaching from process %llu\n", process->GetID());
+        result.AppendMessageWithFormat ("Detaching from process %" PRIu64 "\n", process->GetID());
         Error error (process->Detach());
         if (error.Success())
         {
@@ -941,7 +943,7 @@
         SetOptionValue (uint32_t option_idx, const char *option_arg)
         {
             Error error;
-            char short_option = (char) m_getopt_table[option_idx].val;
+            const int short_option = m_getopt_table[option_idx].val;
             
             switch (short_option)
             {
@@ -1011,7 +1013,7 @@
         {
             if (process->IsAlive())
             {
-                result.AppendErrorWithFormat ("Process %llu is currently being debugged, kill the process before connecting.\n", 
+                result.AppendErrorWithFormat ("Process %" PRIu64 " is currently being debugged, kill the process before connecting.\n",
                                               process->GetID());
                 result.SetStatus (eReturnStatusFailed);
                 return false;
@@ -1061,7 +1063,7 @@
             else
             {
                 result.AppendErrorWithFormat ("Unable to find process plug-in for remote URL '%s'.\nPlease specify a process plug-in name with the --plugin option, or specify an object file using the \"file\" command.\n", 
-                                              m_cmd_name.c_str());
+                                              remote_url);
                 result.SetStatus (eReturnStatusFailed);
             }
         }
@@ -1533,7 +1535,7 @@
         SetOptionValue (uint32_t option_idx, const char *option_arg)
         {
             Error error;
-            char short_option = (char) m_getopt_table[option_idx].val;
+            const int short_option = m_getopt_table[option_idx].val;
             
             switch (short_option)
             {

Modified: lldb/branches/windows/source/Commands/CommandObjectQuit.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Commands/CommandObjectQuit.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Commands/CommandObjectQuit.cpp (original)
+++ lldb/branches/windows/source/Commands/CommandObjectQuit.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "CommandObjectQuit.h"
 
 // C Includes

Modified: lldb/branches/windows/source/Commands/CommandObjectRegister.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Commands/CommandObjectRegister.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Commands/CommandObjectRegister.cpp (original)
+++ lldb/branches/windows/source/Commands/CommandObjectRegister.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "CommandObjectRegister.h"
 
 // C Includes
@@ -289,7 +291,7 @@
                         const char *option_value)
         {
             Error error;
-            const char short_option = (char) g_option_table[option_idx].short_option;
+            const int short_option = g_option_table[option_idx].short_option;
             switch (short_option)
             {
                 case 's':

Modified: lldb/branches/windows/source/Commands/CommandObjectSettings.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Commands/CommandObjectSettings.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Commands/CommandObjectSettings.cpp (original)
+++ lldb/branches/windows/source/Commands/CommandObjectSettings.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "CommandObjectSettings.h"
 
 // C Includes
@@ -119,7 +121,7 @@
         SetOptionValue (uint32_t option_idx, const char *option_arg)
         {
             Error error;
-            char short_option = (char) m_getopt_table[option_idx].val;
+            const int short_option = m_getopt_table[option_idx].val;
 
             switch (short_option)
             {

Modified: lldb/branches/windows/source/Commands/CommandObjectSource.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Commands/CommandObjectSource.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Commands/CommandObjectSource.cpp (original)
+++ lldb/branches/windows/source/Commands/CommandObjectSource.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "CommandObjectSource.h"
 
 // C Includes
@@ -16,6 +18,7 @@
 #include "lldb/Interpreter/Args.h"
 #include "lldb/Core/Debugger.h"
 #include "lldb/Core/FileLineResolver.h"
+#include "lldb/Core/Module.h"
 #include "lldb/Core/ModuleSpec.h"
 #include "lldb/Core/SourceManager.h"
 #include "lldb/Interpreter/CommandInterpreter.h"
@@ -54,7 +57,7 @@
         SetOptionValue (uint32_t option_idx, const char *option_arg)
         {
             Error error;
-            const char short_option = g_option_table[option_idx].short_option;
+            const int short_option = g_option_table[option_idx].short_option;
             switch (short_option)
             {
             case 'l':
@@ -162,7 +165,7 @@
         SetOptionValue (uint32_t option_idx, const char *option_arg)
         {
             Error error;
-            const char short_option = g_option_table[option_idx].short_option;
+            const int short_option = g_option_table[option_idx].short_option;
             switch (short_option)
             {
             case 'l':
@@ -185,6 +188,12 @@
                 symbol_name = option_arg;
                 break;
 
+            case 'a':
+                {
+                    ExecutionContext exe_ctx (m_interpreter.GetExecutionContext());
+                    address = Args::StringToAddress(&exe_ctx, option_arg, LLDB_INVALID_ADDRESS, &error);
+                }
+                break;
             case 's':
                 modules.push_back (std::string (option_arg));
                 break;
@@ -206,6 +215,7 @@
             file_spec.Clear();
             file_name.clear();
             symbol_name.clear();
+            address = LLDB_INVALID_ADDRESS;
             start_line = 0;
             num_lines = 10;
             show_bp_locs = false;
@@ -223,6 +233,7 @@
         FileSpec file_spec;
         std::string file_name;
         std::string symbol_name;
+        lldb::addr_t address;
         uint32_t start_line;
         uint32_t num_lines;
         STLStringArray modules;        
@@ -294,10 +305,10 @@
             return false;
         }
 
+        SymbolContextList sc_list;
         if (!m_options.symbol_name.empty())
         {
             // Displaying the source for a symbol:
-            SymbolContextList sc_list;
             ConstString name(m_options.symbol_name.c_str());
             bool include_symbols = false;
             bool include_inlines = true;
@@ -448,6 +459,108 @@
             return true;
 
         }
+        else if (m_options.address != LLDB_INVALID_ADDRESS)
+        {
+            SymbolContext sc;
+            Address so_addr;
+            StreamString error_strm;
+
+            if (target->GetSectionLoadList().IsEmpty())
+            {
+                // The target isn't loaded yet, we need to lookup the file address
+                // in all modules
+                const ModuleList &module_list = target->GetImages();
+                const uint32_t num_modules = module_list.GetSize();
+                for (uint32_t i=0; i<num_modules; ++i)
+                {
+                    ModuleSP module_sp (module_list.GetModuleAtIndex(i));
+                    if (module_sp && module_sp->ResolveFileAddress(m_options.address, so_addr))
+                    {
+                        sc.Clear();
+                        if (module_sp->ResolveSymbolContextForAddress (so_addr, eSymbolContextEverything, sc) & eSymbolContextLineEntry)
+                            sc_list.Append(sc);
+                    }
+                }
+                
+                if (sc_list.GetSize() == 0)
+                {
+                    result.AppendErrorWithFormat("no modules have source information for file address 0x%" PRIx64 ".\n",
+                                                 m_options.address);
+                    result.SetStatus (eReturnStatusFailed);
+                    return false;
+                }
+            }
+            else
+            {
+                // The target has some things loaded, resolve this address to a
+                // compile unit + file + line and display
+                if (target->GetSectionLoadList().ResolveLoadAddress (m_options.address, so_addr))
+                {
+                    ModuleSP module_sp (so_addr.GetModule());
+                    if (module_sp)
+                    {
+                        sc.Clear();
+                        if (module_sp->ResolveSymbolContextForAddress (so_addr, eSymbolContextEverything, sc) & eSymbolContextLineEntry)
+                        {
+                            sc_list.Append(sc);
+                        }
+                        else
+                        {
+                            so_addr.Dump(&error_strm, NULL, Address::DumpStyleModuleWithFileAddress);
+                            result.AppendErrorWithFormat("address resolves to %s, but there is no line table information available for this address.\n",
+                                                         error_strm.GetData());
+                            result.SetStatus (eReturnStatusFailed);
+                            return false;
+                        }
+                    }
+                }
+
+                if (sc_list.GetSize() == 0)
+                {
+                    result.AppendErrorWithFormat("no modules contain load address 0x%" PRIx64 ".\n", m_options.address);
+                    result.SetStatus (eReturnStatusFailed);
+                    return false;
+                }
+            }
+            uint32_t num_matches = sc_list.GetSize();
+            for (uint32_t i=0; i<num_matches; ++i)
+            {
+                sc_list.GetContextAtIndex(i, sc);
+                if (sc.comp_unit)
+                {
+                    if (m_options.show_bp_locs)
+                    {
+                        m_breakpoint_locations.Clear();
+                        const bool show_inlines = true;
+                        m_breakpoint_locations.Reset (*sc.comp_unit, 0, show_inlines);
+                        SearchFilter target_search_filter (target->shared_from_this());
+                        target_search_filter.Search (m_breakpoint_locations);
+                    }
+                    
+                    bool show_fullpaths = true;
+                    bool show_module = true;
+                    bool show_inlined_frames = true;
+                    sc.DumpStopContext(&result.GetOutputStream(),
+                                       exe_ctx.GetBestExecutionContextScope(),
+                                       sc.line_entry.range.GetBaseAddress(),
+                                       show_fullpaths,
+                                       show_module,
+                                       show_inlined_frames);
+                    result.GetOutputStream().EOL();
+                    
+                    size_t lines_to_back_up = m_options.num_lines >= 10 ? 5 : m_options.num_lines/2;
+
+                    target->GetSourceManager().DisplaySourceLinesWithLineNumbers (sc.comp_unit,
+                                                                                  sc.line_entry.line,
+                                                                                  lines_to_back_up,
+                                                                                  m_options.num_lines - lines_to_back_up,
+                                                                                  "->",
+                                                                                  &result.GetOutputStream(),
+                                                                                  GetBreakpointLocations ());
+                    result.SetStatus (eReturnStatusSuccessFinishResult);
+                }
+            }
+        }
         else if (m_options.file_name.empty())
         {
             // Last valid source manager context, or the current frame if no
@@ -617,12 +730,14 @@
 OptionDefinition
 CommandObjectSourceList::CommandOptions::g_option_table[] =
 {
-{ LLDB_OPT_SET_ALL, false, "count",    'c', required_argument, NULL, 0, eArgTypeCount,   "The number of source lines to display."},
-{ LLDB_OPT_SET_ALL, false, "shlib",    's', required_argument, NULL, CommandCompletions::eModuleCompletion, eArgTypeShlibName, "Look up the source file in the given shared library."},
+{ LLDB_OPT_SET_ALL, false, "count",  'c', required_argument, NULL, 0, eArgTypeCount,   "The number of source lines to display."},
+{ LLDB_OPT_SET_1  |
+  LLDB_OPT_SET_2  , false, "shlib",  's', required_argument, NULL, CommandCompletions::eModuleCompletion, eArgTypeShlibName, "Look up the source file in the given shared library."},
 { LLDB_OPT_SET_ALL, false, "show-breakpoints", 'b', no_argument, NULL, 0, eArgTypeNone, "Show the line table locations from the debug information that indicate valid places to set source level breakpoints."},
-{ LLDB_OPT_SET_1, false, "file",       'f', required_argument, NULL, CommandCompletions::eSourceFileCompletion, eArgTypeFilename,    "The file from which to display source."},
-{ LLDB_OPT_SET_1, false, "line",       'l', required_argument, NULL, 0, eArgTypeLineNum,    "The line number at which to start the display source."},
-{ LLDB_OPT_SET_2, false, "name",       'n', required_argument, NULL, CommandCompletions::eSymbolCompletion, eArgTypeSymbol,    "The name of a function whose source to display."},
+{ LLDB_OPT_SET_1  , false, "file",   'f', required_argument, NULL, CommandCompletions::eSourceFileCompletion, eArgTypeFilename,    "The file from which to display source."},
+{ LLDB_OPT_SET_1  , false, "line",   'l', required_argument, NULL, 0, eArgTypeLineNum,    "The line number at which to start the display source."},
+{ LLDB_OPT_SET_2  , false, "name",   'n', required_argument, NULL, CommandCompletions::eSymbolCompletion, eArgTypeSymbol,    "The name of a function whose source to display."},
+{ LLDB_OPT_SET_3  , false, "address",'a', required_argument, NULL, 0, eArgTypeAddress, "Lookup the address and display the source information for the corresponding file and line."},
 { 0, false, NULL, 0, 0, NULL, 0, eArgTypeNone, NULL }
 };
 

Modified: lldb/branches/windows/source/Commands/CommandObjectSyntax.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Commands/CommandObjectSyntax.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Commands/CommandObjectSyntax.cpp (original)
+++ lldb/branches/windows/source/Commands/CommandObjectSyntax.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "CommandObjectSyntax.h"
 
 // C Includes

Modified: lldb/branches/windows/source/Commands/CommandObjectTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Commands/CommandObjectTarget.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Commands/CommandObjectTarget.cpp (original)
+++ lldb/branches/windows/source/Commands/CommandObjectTarget.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "CommandObjectTarget.h"
 
 // C Includes
@@ -91,7 +93,7 @@
             show_process_status = StateIsStoppedState(state, true);
         const char *state_cstr = StateAsCString (state);
         if (pid != LLDB_INVALID_PROCESS_ID)
-            strm.Printf ("%spid=%llu", properties++ > 0 ? ", " : " ( ", pid);
+            strm.Printf ("%spid=%" PRIu64, properties++ > 0 ? ", " : " ( ", pid);
         strm.Printf ("%sstate=%s", properties++ > 0 ? ", " : " ( ", state_cstr);
     }
     if (properties > 0)
@@ -155,7 +157,9 @@
         m_option_group (interpreter),
         m_arch_option (),
         m_platform_options(true), // Do include the "--platform" option in the platform settings by passing true
-        m_core_file (LLDB_OPT_SET_1, false, "core", 'c', 0, eArgTypeFilename, "Fullpath to a core file to use for this target.")
+        m_core_file (LLDB_OPT_SET_1, false, "core", 'c', 0, eArgTypeFilename, "Fullpath to a core file to use for this target."),
+        m_symbol_file (LLDB_OPT_SET_1, false, "symfile", 's', 0, eArgTypeFilename, "Fullpath to a stand alone debug symbols file for when debug symbols are not in the executable."),
+        m_add_dependents (LLDB_OPT_SET_1, false, "no-dependents", 'd', "Don't load dependent files when creating the target, just add the specified executable.", true, true)
     {
         CommandArgumentEntry arg;
         CommandArgumentData file_arg;
@@ -173,6 +177,8 @@
         m_option_group.Append (&m_arch_option, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1);
         m_option_group.Append (&m_platform_options, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1);
         m_option_group.Append (&m_core_file, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1);
+        m_option_group.Append (&m_symbol_file, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1);
+        m_option_group.Append (&m_add_dependents, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1);
         m_option_group.Finalize();
     }
 
@@ -219,12 +225,25 @@
 
         if (argc == 1 || core_file)
         {
+            FileSpec symfile (m_symbol_file.GetOptionValue().GetCurrentValue());
+            if (symfile)
+            {
+                if (!symfile.Exists())
+                {
+                    char symfile_path[PATH_MAX];
+                    symfile.GetPath(symfile_path, sizeof(symfile_path));
+                    result.AppendErrorWithFormat("invalid symbol file path '%s'", symfile_path);
+                    result.SetStatus (eReturnStatusFailed);
+                    return false;
+                }
+            }
+
             const char *file_path = command.GetArgumentAtIndex(0);
             Timer scoped_timer(__PRETTY_FUNCTION__, "(lldb) target create '%s'", file_path);
             TargetSP target_sp;
             Debugger &debugger = m_interpreter.GetDebugger();
             const char *arch_cstr = m_arch_option.GetArchitectureName();
-            const bool get_dependent_files = true;
+            const bool get_dependent_files = m_add_dependents.GetOptionValue().GetCurrentValue();
             Error error (debugger.GetTargetList().CreateTarget (debugger,
                                                                 file_path,
                                                                 arch_cstr,
@@ -234,6 +253,13 @@
 
             if (target_sp)
             {
+                if (symfile)
+                {
+                    ModuleSP module_sp (target_sp->GetExecutableModule());
+                    if (module_sp)
+                        module_sp->SetSymbolFileFileSpec(symfile);
+                }
+                
                 debugger.GetTargetList().SetSelectedTarget(target_sp.get());
                 if (core_file)
                 {
@@ -303,7 +329,8 @@
     OptionGroupArchitecture m_arch_option;
     OptionGroupPlatform m_platform_options;
     OptionGroupFile m_core_file;
-
+    OptionGroupFile m_symbol_file;
+    OptionGroupBoolean m_add_dependents;
 };
 
 #pragma mark CommandObjectTargetList
@@ -577,8 +604,8 @@
         m_option_group (interpreter),
         m_option_variable (false), // Don't include frame options
         m_option_format (eFormatDefault),
-        m_option_compile_units    (LLDB_OPT_SET_1, false, "file", 'f', 0, eArgTypeFilename, "A basename or fullpath to a file that contains global variables. This option can be specified multiple times."),
-        m_option_shared_libraries (LLDB_OPT_SET_1, false, "shlib",'s', 0, eArgTypeFilename, "A basename or fullpath to a shared library to use in the search for global variables. This option can be specified multiple times."),
+        m_option_compile_units    (LLDB_OPT_SET_1, false, "file", 'file', 0, eArgTypeFilename, "A basename or fullpath to a file that contains global variables. This option can be specified multiple times."),
+        m_option_shared_libraries (LLDB_OPT_SET_1, false, "shlib",'shlb', 0, eArgTypeFilename, "A basename or fullpath to a shared library to use in the search for global variables. This option can be specified multiple times."),
         m_varobj_options()
     {
         CommandArgumentEntry arg;
@@ -694,6 +721,51 @@
     }
     
 protected:
+    
+    void
+    DumpGlobalVariableList(const ExecutionContext &exe_ctx, const SymbolContext &sc, const VariableList &variable_list, Stream &s)
+    {
+        size_t count = variable_list.GetSize();
+        if (count > 0)
+        {
+            if (sc.module_sp)
+            {
+                if (sc.comp_unit)
+                {
+                    s.Printf ("Global variables for %s/%s in %s/%s:\n",
+                              sc.comp_unit->GetDirectory().GetCString(),
+                              sc.comp_unit->GetFilename().GetCString(),
+                              sc.module_sp->GetFileSpec().GetDirectory().GetCString(),
+                              sc.module_sp->GetFileSpec().GetFilename().GetCString());
+                }
+                else
+                {
+                    s.Printf ("Global variables for %s/%s\n",
+                              sc.module_sp->GetFileSpec().GetDirectory().GetCString(),
+                              sc.module_sp->GetFileSpec().GetFilename().GetCString());
+                }
+            }
+            else if (sc.comp_unit)
+            {
+                s.Printf ("Global variables for %s/%s\n",
+                          sc.comp_unit->GetDirectory().GetCString(),
+                          sc.comp_unit->GetFilename().GetCString());
+            }
+            
+            for (uint32_t i=0; i<count; ++i)
+            {
+                VariableSP var_sp (variable_list.GetVariableAtIndex(i));
+                if (var_sp)
+                {
+                    ValueObjectSP valobj_sp (ValueObjectVariable::Create (exe_ctx.GetBestExecutionContextScope(), var_sp));
+                    
+                    if (valobj_sp)
+                        DumpValueObject (s, var_sp, valobj_sp, var_sp->GetName().GetCString());
+                }
+            }
+        }
+
+    }
     virtual bool
     DoExecute (Args& args, CommandReturnObject &result)
     {
@@ -703,6 +775,7 @@
         {
             const size_t argc = args.GetArgumentCount();
             Stream &s = result.GetOutputStream();
+            
             if (argc > 0)
             {
 
@@ -766,55 +839,120 @@
             }
             else
             {
-                bool success = false;
-                StackFrame *frame = exe_ctx.GetFramePtr();
-                CompileUnit *comp_unit = NULL;
-                if (frame)
-                {
-                    comp_unit = frame->GetSymbolContext (eSymbolContextCompUnit).comp_unit;
-                    if (comp_unit)
-                    {
-                        const bool can_create = true;
-                        VariableListSP comp_unit_varlist_sp (comp_unit->GetVariableList(can_create));
-                        if (comp_unit_varlist_sp)
+                const FileSpecList &compile_units = m_option_compile_units.GetOptionValue().GetCurrentValue();
+                const FileSpecList &shlibs = m_option_shared_libraries.GetOptionValue().GetCurrentValue();
+                SymbolContextList sc_list;
+                const size_t num_compile_units = compile_units.GetSize();
+                const size_t num_shlibs = shlibs.GetSize();
+                if (num_compile_units == 0 && num_shlibs == 0)
+                {
+                    bool success = false;
+                    StackFrame *frame = exe_ctx.GetFramePtr();
+                    CompileUnit *comp_unit = NULL;
+                    if (frame)
+                    {
+                        SymbolContext sc = frame->GetSymbolContext (eSymbolContextCompUnit);
+                        if (sc.comp_unit)
                         {
-                            size_t count = comp_unit_varlist_sp->GetSize();
-                            if (count > 0)
+                            const bool can_create = true;
+                            VariableListSP comp_unit_varlist_sp (sc.comp_unit->GetVariableList(can_create));
+                            if (comp_unit_varlist_sp)
                             {
-                                s.Printf ("Global variables for %s/%s:\n", 
-                                          comp_unit->GetDirectory().GetCString(),
-                                          comp_unit->GetFilename().GetCString());
-
-                                success = true;
-                                for (uint32_t i=0; i<count; ++i)
+                                size_t count = comp_unit_varlist_sp->GetSize();
+                                if (count > 0)
                                 {
-                                    VariableSP var_sp (comp_unit_varlist_sp->GetVariableAtIndex(i));
-                                    if (var_sp)
-                                    {
-                                        ValueObjectSP valobj_sp (ValueObjectVariable::Create (exe_ctx.GetBestExecutionContextScope(), var_sp));
-                                        
-                                        if (valobj_sp)
-                                            DumpValueObject (s, var_sp, valobj_sp, var_sp->GetName().GetCString());
-                                    }
+                                    DumpGlobalVariableList(exe_ctx, sc, *comp_unit_varlist_sp, s);
+                                    success = true;
                                 }
                             }
                         }
                     }
+                    if (!success)
+                    {
+                        if (frame)
+                        {
+                            if (comp_unit)
+                                result.AppendErrorWithFormat ("no global variables in current compile unit: %s/%s\n", 
+                                                              comp_unit->GetDirectory().GetCString(), 
+                                                              comp_unit->GetFilename().GetCString());
+                            else
+                                result.AppendErrorWithFormat ("no debug information for frame %u\n", frame->GetFrameIndex());
+                        }                        
+                        else
+                            result.AppendError ("'target variable' takes one or more global variable names as arguments\n");
+                        result.SetStatus (eReturnStatusFailed);
+                    }
                 }
-                if (!success)
+                else
                 {
-                    if (frame)
+                    SymbolContextList sc_list;
+                    const bool append = true;
+                    // We have one or more compile unit or shlib
+                    if (num_shlibs > 0)
                     {
-                        if (comp_unit)
-                            result.AppendErrorWithFormat ("no global variables in current compile unit: %s/%s\n", 
-                                                          comp_unit->GetDirectory().GetCString(), 
-                                                          comp_unit->GetFilename().GetCString());
-                        else
-                            result.AppendError ("no debug information for frame %u\n", frame->GetFrameIndex());
-                    }                        
+                        for (size_t shlib_idx=0; shlib_idx<num_shlibs; ++shlib_idx)
+                        {
+                            const FileSpec module_file(shlibs.GetFileSpecAtIndex(shlib_idx));
+                            ModuleSpec module_spec (module_file);
+                            
+                            ModuleSP module_sp (target->GetImages().FindFirstModule(module_spec));
+                            if (module_sp)
+                            {
+                                if (num_compile_units > 0)
+                                {
+                                    for (size_t cu_idx=0; cu_idx<num_compile_units; ++cu_idx)
+                                        module_sp->FindCompileUnits(compile_units.GetFileSpecAtIndex(cu_idx), append, sc_list);
+                                }
+                                else
+                                {
+                                    SymbolContext sc;
+                                    sc.module_sp = module_sp;
+                                    sc_list.Append(sc);
+                                }
+                            }
+                            else
+                            {
+                                // Didn't find matching shlib/module in target...
+                                result.AppendErrorWithFormat ("target doesn't contain the specified shared library: %s%s%s\n",
+                                                              module_file.GetDirectory().GetCString(),
+                                                              module_file.GetDirectory() ? "/" : "",
+                                                              module_file.GetFilename().GetCString());
+                            }
+                        }
+                    }
                     else
-                        result.AppendError ("'target variable' takes one or more global variable names as arguments\n");
-                    result.SetStatus (eReturnStatusFailed);
+                    {
+                        // No shared libraries, we just want to find globals for the compile units files that were specified
+                        for (size_t cu_idx=0; cu_idx<num_compile_units; ++cu_idx)
+                            target->GetImages().FindCompileUnits(compile_units.GetFileSpecAtIndex(cu_idx), append, sc_list);
+                    }
+                    
+                    const uint32_t num_scs = sc_list.GetSize();
+                    if (num_scs > 0)
+                    {
+                        SymbolContext sc;
+                        for (uint32_t sc_idx=0; sc_idx<num_scs; ++sc_idx)
+                        {
+                            if (sc_list.GetContextAtIndex(sc_idx, sc))
+                            {
+                                if (sc.comp_unit)
+                                {
+                                    const bool can_create = true;
+                                    VariableListSP comp_unit_varlist_sp (sc.comp_unit->GetVariableList(can_create));
+                                    if (comp_unit_varlist_sp)
+                                        DumpGlobalVariableList(exe_ctx, sc, *comp_unit_varlist_sp, s);
+                                }
+                                else if (sc.module_sp)
+                                {
+                                    // Get all global variables for this module
+                                    lldb_private::RegularExpression all_globals_regex("."); // Any global with at least one character
+                                    VariableList variable_list;
+                                    sc.module_sp->FindGlobalVariables(all_globals_regex, append, UINT32_MAX, variable_list);
+                                    DumpGlobalVariableList(exe_ctx, sc, variable_list, s);
+                                }
+                            }
+                        }
+                    }
                 }
             }
         }
@@ -1955,7 +2093,7 @@
         SetOptionValue (uint32_t option_idx, const char *option_arg)
         {
             Error error;
-            char short_option = (char) m_getopt_table[option_idx].val;
+            const int short_option = m_getopt_table[option_idx].val;
             
             switch (short_option)
             {
@@ -2442,14 +2580,25 @@
         CommandObjectParsed (interpreter,
                              "target modules add",
                              "Add a new module to the current target's modules.",
-                             "target modules add [<module>]")
+                             "target modules add [<module>]"),
+        m_option_group (interpreter),
+        m_symbol_file (LLDB_OPT_SET_1, false, "symfile", 's', 0, eArgTypeFilename, "Fullpath to a stand alone debug symbols file for when debug symbols are not in the executable.")
     {
+        m_option_group.Append (&m_uuid_option_group, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1);
+        m_option_group.Append (&m_symbol_file, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1);
+        m_option_group.Finalize();
     }
     
     virtual
     ~CommandObjectTargetModulesAdd ()
     {
     }
+        
+    virtual Options *
+    GetOptions ()
+    {
+        return &m_option_group;
+    }
     
     int
     HandleArgumentCompletion (Args &input,
@@ -2476,6 +2625,12 @@
     }
 
 protected:
+    
+    OptionGroupOptions m_option_group;
+    OptionGroupUUID m_uuid_option_group;
+    OptionGroupFile m_symbol_file;
+    
+
     virtual bool
     DoExecute (Args& args,
              CommandReturnObject &result)
@@ -2489,12 +2644,75 @@
         }
         else
         {
+            bool flush = false;
+            
             const size_t argc = args.GetArgumentCount();
             if (argc == 0)
             {
-                result.AppendError ("one or more executable image paths must be specified");
-                result.SetStatus (eReturnStatusFailed);
-                return false;
+                if (m_uuid_option_group.GetOptionValue ().OptionWasSet())
+                {
+                    // We are given a UUID only, go locate the file
+                    ModuleSpec module_spec;
+                    module_spec.GetUUID() = m_uuid_option_group.GetOptionValue ().GetCurrentValue();
+                    if (m_symbol_file.GetOptionValue().OptionWasSet())
+                        module_spec.GetSymbolFileSpec() = m_symbol_file.GetOptionValue().GetCurrentValue();
+                    if (Symbols::DownloadObjectAndSymbolFile (module_spec))
+                    {
+                        ModuleSP module_sp (target->GetSharedModule (module_spec));
+                        if (module_sp)
+                        {
+                            result.SetStatus (eReturnStatusSuccessFinishResult);
+                            return true;
+                        }
+                        else
+                        {
+                            flush = true;
+                            
+                            StreamString strm;
+                            module_spec.GetUUID().Dump (&strm);
+                            if (module_spec.GetFileSpec())
+                            {
+                                if (module_spec.GetSymbolFileSpec())
+                                {
+                                    result.AppendErrorWithFormat ("Unable to create the executable or symbol file with UUID %s with path %s/%s and symbol file %s/%s",
+                                                                  strm.GetString().c_str(),
+                                                                  module_spec.GetFileSpec().GetDirectory().GetCString(),
+                                                                  module_spec.GetFileSpec().GetFilename().GetCString(),
+                                                                  module_spec.GetSymbolFileSpec().GetDirectory().GetCString(),
+                                                                  module_spec.GetSymbolFileSpec().GetFilename().GetCString());
+                                }
+                                else
+                                {
+                                    result.AppendErrorWithFormat ("Unable to create the executable or symbol file with UUID %s with path %s/%s",
+                                                                  strm.GetString().c_str(),
+                                                                  module_spec.GetFileSpec().GetDirectory().GetCString(),
+                                                                  module_spec.GetFileSpec().GetFilename().GetCString());
+                                }
+                            }
+                            else
+                            {
+                                result.AppendErrorWithFormat ("Unable to create the executable or symbol file with UUID %s",
+                                                              strm.GetString().c_str());
+                            }
+                            result.SetStatus (eReturnStatusFailed);
+                            return false;
+                        }
+                    }
+                    else
+                    {
+                        StreamString strm;
+                        module_spec.GetUUID().Dump (&strm);
+                        result.AppendErrorWithFormat ("Unable to locate the executable or symbol file with UUID %s", strm.GetString().c_str());
+                        result.SetStatus (eReturnStatusFailed);
+                        return false;
+                    }
+                }
+                else
+                {
+                    result.AppendError ("one or more executable image paths must be specified");
+                    result.SetStatus (eReturnStatusFailed);
+                    return false;
+                }
             }
             else
             {
@@ -2507,13 +2725,26 @@
                         if (file_spec.Exists())
                         {
                             ModuleSpec module_spec (file_spec);
-                            ModuleSP module_sp (target->GetSharedModule (module_spec));
+                            if (m_uuid_option_group.GetOptionValue ().OptionWasSet())
+                                module_spec.GetUUID() = m_uuid_option_group.GetOptionValue ().GetCurrentValue();
+                            if (m_symbol_file.GetOptionValue().OptionWasSet())
+                                module_spec.GetSymbolFileSpec() = m_symbol_file.GetOptionValue().GetCurrentValue();
+                            Error error;
+                            ModuleSP module_sp (target->GetSharedModule (module_spec, &error));
                             if (!module_sp)
                             {
-                                result.AppendError ("one or more executable image paths must be specified");
+                                const char *error_cstr = error.AsCString();
+                                if (error_cstr)
+                                    result.AppendError (error_cstr);
+                                else
+                                    result.AppendErrorWithFormat ("unsupported module: %s", path);
                                 result.SetStatus (eReturnStatusFailed);
                                 return false;
                             }
+                            else
+                            {
+                                flush = true;
+                            }
                             result.SetStatus (eReturnStatusSuccessFinishResult);
                         }
                         else
@@ -2534,7 +2765,15 @@
                     }
                 }
             }
+            
+            if (flush)
+            {
+                ProcessSP process = target->GetProcessSP();
+                if (process)
+                    process->Flush();
+            }
         }
+        
         return result.Succeeded();
     }
 
@@ -2664,7 +2903,7 @@
                                                     {
                                                         if (target->GetSectionLoadList().SetSectionLoadAddress (section_sp, load_addr))
                                                             changed = true;
-                                                        result.AppendMessageWithFormat("section '%s' loaded at 0x%llx\n", sect_name, load_addr);
+                                                        result.AppendMessageWithFormat("section '%s' loaded at 0x%" PRIx64 "\n", sect_name, load_addr);
                                                     }
                                                 }
                                                 else
@@ -2803,20 +3042,16 @@
         virtual Error
         SetOptionValue (uint32_t option_idx, const char *option_arg)
         {
-            char short_option = (char) m_getopt_table[option_idx].val;
+            Error error;
+
+            const int short_option = m_getopt_table[option_idx].val;
             if (short_option == 'g')
             {
                 m_use_global_module_list = true;
             }
             else if (short_option == 'a')
             {
-                bool success;
-                m_module_addr = Args::StringToAddress(option_arg, LLDB_INVALID_ADDRESS, &success);
-                if (!success)
-                {
-                    Error error;
-                    error.SetErrorStringWithFormat("invalid address: \"%s\"", option_arg);
-                }
+                m_module_addr = Args::StringToAddress(NULL, option_arg, LLDB_INVALID_ADDRESS, &error);
             }
             else
             {
@@ -2825,7 +3060,6 @@
                     width = strtoul (option_arg, NULL, 0);
                 m_format_array.push_back(std::make_pair(short_option, width));
             }
-            Error error;
             return error;
         }
         
@@ -2918,13 +3152,13 @@
                         }
                         else
                         {
-                            result.AppendError ("Couldn't find module matching address: 0x%llx.", m_options.m_module_addr);
+                            result.AppendErrorWithFormat ("Couldn't find module matching address: 0x%" PRIx64 ".", m_options.m_module_addr);
                             result.SetStatus (eReturnStatusFailed);
                         }
                     }
                     else
                     {
-                        result.AppendError ("Couldn't find module containing address: 0x%llx.", m_options.m_module_addr);
+                        result.AppendErrorWithFormat ("Couldn't find module containing address: 0x%" PRIx64 ".", m_options.m_module_addr);
                         result.SetStatus (eReturnStatusFailed);
                     }
                 }
@@ -3102,12 +3336,12 @@
                                         if (format_char == 'o')
                                         {
                                             // Show the offset of slide for the image
-                                            strm.Printf ("0x%*.*llx", addr_nibble_width, addr_nibble_width, header_load_addr - header_addr.GetFileAddress());
+                                            strm.Printf ("0x%*.*" PRIx64, addr_nibble_width, addr_nibble_width, header_load_addr - header_addr.GetFileAddress());
                                         }
                                         else
                                         {
                                             // Show the load address of the image
-                                            strm.Printf ("0x%*.*llx", addr_nibble_width, addr_nibble_width, header_load_addr);
+                                            strm.Printf ("0x%*.*" PRIx64, addr_nibble_width, addr_nibble_width, header_load_addr);
                                         }
                                     }
                                     break;
@@ -3258,7 +3492,7 @@
         {
             Error error;
 
-            char short_option = (char) m_getopt_table[option_idx].val;
+            const int short_option = m_getopt_table[option_idx].val;
 
             switch (short_option)
             {
@@ -3399,14 +3633,14 @@
                 Address first_non_prologue_insn (func_unwinders_sp->GetFirstNonPrologueInsn(*target));
                 if (first_non_prologue_insn.IsValid())
                 {
-                    result.GetOutputStream().Printf("First non-prologue instruction is at address 0x%llx or offset %lld into the function.\n", first_non_prologue_insn.GetLoadAddress(target), first_non_prologue_insn.GetLoadAddress(target) - start_addr);
+                    result.GetOutputStream().Printf("First non-prologue instruction is at address 0x%" PRIx64 " or offset %" PRId64 " into the function.\n", first_non_prologue_insn.GetLoadAddress(target), first_non_prologue_insn.GetLoadAddress(target) - start_addr);
                     result.GetOutputStream().Printf ("\n");
                 }
 
                 UnwindPlanSP non_callsite_unwind_plan = func_unwinders_sp->GetUnwindPlanAtNonCallSite(*thread.get());
                 if (non_callsite_unwind_plan.get())
                 {
-                    result.GetOutputStream().Printf("Asynchronous (not restricted to call-sites) UnwindPlan for %s`%s (start addr 0x%llx):\n", sc.module_sp->GetPlatformFileSpec().GetFilename().AsCString(), funcname.AsCString(), start_addr);
+                    result.GetOutputStream().Printf("Asynchronous (not restricted to call-sites) UnwindPlan for %s`%s (start addr 0x%" PRIx64 "):\n", sc.module_sp->GetPlatformFileSpec().GetFilename().AsCString(), funcname.AsCString(), start_addr);
                     non_callsite_unwind_plan->Dump(result.GetOutputStream(), thread.get(), LLDB_INVALID_ADDRESS);
                     result.GetOutputStream().Printf ("\n");
                 }
@@ -3414,7 +3648,7 @@
                 UnwindPlanSP callsite_unwind_plan = func_unwinders_sp->GetUnwindPlanAtCallSite(-1);
                 if (callsite_unwind_plan.get())
                 {
-                    result.GetOutputStream().Printf("Synchronous (restricted to call-sites) UnwindPlan for %s`%s (start addr 0x%llx):\n", sc.module_sp->GetPlatformFileSpec().GetFilename().AsCString(), funcname.AsCString(), start_addr);
+                    result.GetOutputStream().Printf("Synchronous (restricted to call-sites) UnwindPlan for %s`%s (start addr 0x%" PRIx64 "):\n", sc.module_sp->GetPlatformFileSpec().GetFilename().AsCString(), funcname.AsCString(), start_addr);
                     callsite_unwind_plan->Dump(result.GetOutputStream(), thread.get(), LLDB_INVALID_ADDRESS);
                     result.GetOutputStream().Printf ("\n");
                 }
@@ -3422,7 +3656,7 @@
                 UnwindPlanSP arch_default_unwind_plan = func_unwinders_sp->GetUnwindPlanArchitectureDefault(*thread.get());
                 if (arch_default_unwind_plan.get())
                 {
-                    result.GetOutputStream().Printf("Architecture default UnwindPlan for %s`%s (start addr 0x%llx):\n", sc.module_sp->GetPlatformFileSpec().GetFilename().AsCString(), funcname.AsCString(), start_addr);
+                    result.GetOutputStream().Printf("Architecture default UnwindPlan for %s`%s (start addr 0x%" PRIx64 "):\n", sc.module_sp->GetPlatformFileSpec().GetFilename().AsCString(), funcname.AsCString(), start_addr);
                     arch_default_unwind_plan->Dump(result.GetOutputStream(), thread.get(), LLDB_INVALID_ADDRESS);
                     result.GetOutputStream().Printf ("\n");
                 }
@@ -3430,7 +3664,7 @@
                 UnwindPlanSP fast_unwind_plan = func_unwinders_sp->GetUnwindPlanFastUnwind(*thread.get());
                 if (fast_unwind_plan.get())
                 {
-                    result.GetOutputStream().Printf("Fast UnwindPlan for %s`%s (start addr 0x%llx):\n", sc.module_sp->GetPlatformFileSpec().GetFilename().AsCString(), funcname.AsCString(), start_addr);
+                    result.GetOutputStream().Printf("Fast UnwindPlan for %s`%s (start addr 0x%" PRIx64 "):\n", sc.module_sp->GetPlatformFileSpec().GetFilename().AsCString(), funcname.AsCString(), start_addr);
                     fast_unwind_plan->Dump(result.GetOutputStream(), thread.get(), LLDB_INVALID_ADDRESS);
                     result.GetOutputStream().Printf ("\n");
                 }
@@ -3491,7 +3725,7 @@
         {
             Error error;
             
-            char short_option = (char) m_getopt_table[option_idx].val;
+            const int short_option = m_getopt_table[option_idx].val;
             
             switch (short_option)
             {
@@ -4041,63 +4275,100 @@
     
     bool
     AddModuleSymbols (Target *target,
-                      const FileSpec &symfile_spec,
+                      ModuleSpec &module_spec,
                       bool &flush,
                       CommandReturnObject &result)
     {
-        ModuleSP symfile_module_sp (new Module (symfile_spec, target->GetArchitecture()));
-        const UUID &symfile_uuid = symfile_module_sp->GetUUID();
-        StreamString ss_symfile_uuid;
-        symfile_uuid.Dump(&ss_symfile_uuid);
-        
-        if (symfile_module_sp)
+        const FileSpec &symbol_fspec = module_spec.GetSymbolFileSpec();
+        if (symbol_fspec)
         {
             char symfile_path[PATH_MAX];
-            symfile_spec.GetPath (symfile_path, sizeof(symfile_path));
+            symbol_fspec.GetPath (symfile_path, sizeof(symfile_path));
+            
+            if (!module_spec.GetUUID().IsValid())
+            {
+                if (!module_spec.GetFileSpec() && !module_spec.GetPlatformFileSpec())
+                    module_spec.GetFileSpec().GetFilename() = symbol_fspec.GetFilename();
+            }
             // We now have a module that represents a symbol file
             // that can be used for a module that might exist in the
             // current target, so we need to find that module in the
             // target
-            
-            ModuleSP old_module_sp (target->GetImages().FindModule (symfile_uuid));
-            if (old_module_sp)
+            ModuleList matching_module_list;
+            const size_t num_matches = target->GetImages().FindModules (module_spec, matching_module_list);
+            if (num_matches > 1)
             {
+                result.AppendErrorWithFormat ("multiple modules match symbol file '%s', use the --uuid option to resolve the ambiguity.\n", symfile_path);
+            }
+            else if (num_matches == 1)
+            {
+                ModuleSP module_sp (matching_module_list.GetModuleAtIndex(0));
+                
                 // The module has not yet created its symbol vendor, we can just
                 // give the existing target module the symfile path to use for
                 // when it decides to create it!
-                old_module_sp->SetSymbolFileFileSpec (symfile_module_sp->GetFileSpec());
-                
-                // Provide feedback that the symfile has been successfully added.
-                const FileSpec &module_fs = old_module_sp->GetFileSpec();
-                result.AppendMessageWithFormat("symbol file '%s' with UUID %s has been successfully added to the '%s/%s' module\n",
-                                               symfile_path, ss_symfile_uuid.GetData(),
-                                               module_fs.GetDirectory().AsCString(), module_fs.GetFilename().AsCString());
+                module_sp->SetSymbolFileFileSpec (symbol_fspec);
                 
-                // Let clients know something changed in the module
-                // if it is currently loaded
-                ModuleList module_list;
-                module_list.Append (old_module_sp);
-                target->ModulesDidLoad (module_list);
-                flush = true;
+                SymbolVendor *symbol_vendor = module_sp->GetSymbolVendor(true, &result.GetErrorStream());
+                if (symbol_vendor)
+                {
+                    SymbolFile *symbol_file = symbol_vendor->GetSymbolFile();
+                    
+                    if (symbol_file)
+                    {
+                        ObjectFile *object_file = symbol_file->GetObjectFile();
+                        
+                        if (object_file && object_file->GetFileSpec() == symbol_fspec)
+                        {
+                            // Provide feedback that the symfile has been successfully added.
+                            const FileSpec &module_fs = module_sp->GetFileSpec();
+                            result.AppendMessageWithFormat("symbol file '%s' has been added to '%s/%s'\n",
+                                                           symfile_path,
+                                                           module_fs.GetDirectory().AsCString(),
+                                                           module_fs.GetFilename().AsCString());
+                            
+                            // Let clients know something changed in the module
+                            // if it is currently loaded
+                            ModuleList module_list;
+                            module_list.Append (module_sp);
+                            target->ModulesDidLoad (module_list);
+                            flush = true;
+                            result.SetStatus (eReturnStatusSuccessFinishResult);
+                            return true;
+                        }
+                    }
+                }
+                // Clear the symbol file spec if anything went wrong
+                module_sp->SetSymbolFileFileSpec (FileSpec());
+
+            }
+
+            if (module_spec.GetUUID().IsValid())
+            {
+                StreamString ss_symfile_uuid;
+                module_spec.GetUUID().Dump(&ss_symfile_uuid);
+                result.AppendErrorWithFormat ("symbol file '%s' (%s) does not match any existing module%s\n",
+                                              symfile_path,
+                                              ss_symfile_uuid.GetData(),
+                                              (symbol_fspec.GetFileType() != FileSpec::eFileTypeRegular)
+                                                ? "\n       please specify the full path to the symbol file"
+                                                : "");
             }
             else
             {
-                result.AppendErrorWithFormat ("symbol file '%s' with UUID %s does not match any existing module%s\n",
-                                              symfile_path, ss_symfile_uuid.GetData(),
-                                              (symfile_spec.GetFileType() != FileSpec::eFileTypeRegular)
-                                              ? "\n       please specify the full path to the symbol file"
-                                              : "");
-                return false;
+                result.AppendErrorWithFormat ("symbol file '%s' does not match any existing module%s\n",
+                                              symfile_path,
+                                              (symbol_fspec.GetFileType() != FileSpec::eFileTypeRegular)
+                                                ? "\n       please specify the full path to the symbol file"
+                                                : "");
             }
         }
         else
         {
             result.AppendError ("one or more executable image paths must be specified");
-            result.SetStatus (eReturnStatusFailed);
-            return false;
         }
-        result.SetStatus (eReturnStatusSuccessFinishResult);
-        return true;
+        result.SetStatus (eReturnStatusFailed);
+        return false;
     }
 
     virtual bool
@@ -4114,7 +4385,7 @@
         else
         {
             bool flush = false;
-            ModuleSpec sym_spec;
+            ModuleSpec module_spec;
             const bool uuid_option_set = m_uuid_option_group.GetOptionValue().OptionWasSet();
             const bool file_option_set = m_file_option.GetOptionValue().OptionWasSet();
             const bool frame_option_set = m_current_frame_option.GetOptionValue().OptionWasSet();
@@ -4142,11 +4413,11 @@
                                     {
                                         if (frame_module_sp->GetPlatformFileSpec().Exists())
                                         {
-                                            sym_spec.GetArchitecture() = frame_module_sp->GetArchitecture();
-                                            sym_spec.GetFileSpec() = frame_module_sp->GetPlatformFileSpec();
+                                            module_spec.GetArchitecture() = frame_module_sp->GetArchitecture();
+                                            module_spec.GetFileSpec() = frame_module_sp->GetPlatformFileSpec();
                                         }
-                                        sym_spec.GetUUID() = frame_module_sp->GetUUID();
-                                        success = sym_spec.GetUUID().IsValid() || sym_spec.GetFileSpec();
+                                        module_spec.GetUUID() = frame_module_sp->GetUUID();
+                                        success = module_spec.GetUUID().IsValid() || module_spec.GetFileSpec();
                                     }
                                     else
                                     {
@@ -4176,34 +4447,34 @@
                     {
                         if (uuid_option_set)
                         {
-                            sym_spec.GetUUID() = m_uuid_option_group.GetOptionValue().GetCurrentValue();
-                            success |= sym_spec.GetUUID().IsValid();
+                            module_spec.GetUUID() = m_uuid_option_group.GetOptionValue().GetCurrentValue();
+                            success |= module_spec.GetUUID().IsValid();
                         }
                         else if (file_option_set)
                         {
-                            sym_spec.GetFileSpec() = m_file_option.GetOptionValue().GetCurrentValue();
-                            ModuleSP module_sp (target->GetImages().FindFirstModule(sym_spec));
+                            module_spec.GetFileSpec() = m_file_option.GetOptionValue().GetCurrentValue();
+                            ModuleSP module_sp (target->GetImages().FindFirstModule(module_spec));
                             if (module_sp)
                             {
-                                sym_spec.GetFileSpec() = module_sp->GetFileSpec();
-                                sym_spec.GetPlatformFileSpec() = module_sp->GetPlatformFileSpec();
-                                sym_spec.GetUUID() = module_sp->GetUUID();
-                                sym_spec.GetArchitecture() = module_sp->GetArchitecture();
+                                module_spec.GetFileSpec() = module_sp->GetFileSpec();
+                                module_spec.GetPlatformFileSpec() = module_sp->GetPlatformFileSpec();
+                                module_spec.GetUUID() = module_sp->GetUUID();
+                                module_spec.GetArchitecture() = module_sp->GetArchitecture();
                             }
                             else
                             {
-                                sym_spec.GetArchitecture() = target->GetArchitecture();
+                                module_spec.GetArchitecture() = target->GetArchitecture();
                             }
-                            success |= sym_spec.GetFileSpec().Exists();
+                            success |= module_spec.GetFileSpec().Exists();
                         }
                     }
 
                     if (success)
                     {
-                        if (Symbols::DownloadObjectAndSymbolFile (sym_spec))
+                        if (Symbols::DownloadObjectAndSymbolFile (module_spec))
                         {
-                            if (sym_spec.GetSymbolFileSpec())
-                                success = AddModuleSymbols (target, sym_spec.GetSymbolFileSpec(), flush, result);
+                            if (module_spec.GetSymbolFileSpec())
+                                success = AddModuleSymbols (target, module_spec, flush, result);
                         }
                     }
 
@@ -4213,12 +4484,12 @@
                         if (uuid_option_set)
                         {
                             error_strm.PutCString("unable to find debug symbols for UUID ");
-                            sym_spec.GetUUID().Dump (&error_strm);
+                            module_spec.GetUUID().Dump (&error_strm);
                         }
                         else if (file_option_set)
                         {
                             error_strm.PutCString("unable to find debug symbols for the executable file ");
-                            error_strm << sym_spec.GetFileSpec();
+                            error_strm << module_spec.GetFileSpec();
                         }
                         else if (frame_option_set)
                         {
@@ -4255,25 +4526,26 @@
                         const char *symfile_path = args.GetArgumentAtIndex(i);
                         if (symfile_path)
                         {
-                            FileSpec symfile_spec;
-                            sym_spec.GetSymbolFileSpec().SetFile(symfile_path, true);
+                            module_spec.GetSymbolFileSpec().SetFile(symfile_path, true);
                             if (platform_sp)
-                                platform_sp->ResolveSymbolFile(*target, sym_spec, symfile_spec);
-                            else
-                                symfile_spec.SetFile(symfile_path, true);
+                            {
+                                FileSpec symfile_spec;
+                                if (platform_sp->ResolveSymbolFile(*target, module_spec, symfile_spec).Success())
+                                    module_spec.GetSymbolFileSpec() = symfile_spec;
+                            }
                             
                             ArchSpec arch;
-                            bool symfile_exists = symfile_spec.Exists();
+                            bool symfile_exists = module_spec.GetSymbolFileSpec().Exists();
 
                             if (symfile_exists)
                             {
-                                if (!AddModuleSymbols (target, symfile_spec, flush, result))
+                                if (!AddModuleSymbols (target, module_spec, flush, result))
                                     break;
                             }
                             else
                             {
                                 char resolved_symfile_path[PATH_MAX];
-                                if (symfile_spec.GetPath (resolved_symfile_path, sizeof(resolved_symfile_path)))
+                                if (module_spec.GetSymbolFileSpec().GetPath (resolved_symfile_path, sizeof(resolved_symfile_path)))
                                 {
                                     if (strcmp (resolved_symfile_path, symfile_path) != 0)
                                     {
@@ -4379,7 +4651,7 @@
         SetOptionValue (uint32_t option_idx, const char *option_arg)
         {
             Error error;
-            char short_option = (char) m_getopt_table[option_idx].val;
+            const int short_option = m_getopt_table[option_idx].val;
             bool success;
 
             switch (short_option)
@@ -4604,7 +4876,7 @@
         case eInputReaderDone:
             if (!got_interrupted && !batch_mode)
             {
-                out_stream->Printf ("Stop hook #%llu added.\n", new_stop_hook->GetID());
+                out_stream->Printf ("Stop hook #%" PRIu64 " added.\n", new_stop_hook->GetID());
                 out_stream->Flush();
             }
             break;
@@ -4690,7 +4962,7 @@
             {
                 // Use one-liner.
                 new_hook_sp->GetCommandPointer()->AppendString (m_options.m_one_liner.c_str());
-                result.AppendMessageWithFormat("Stop hook #%llu added.\n", new_hook_sp->GetID());
+                result.AppendMessageWithFormat("Stop hook #%" PRIu64 " added.\n", new_hook_sp->GetID());
             }
             else
             {

Modified: lldb/branches/windows/source/Commands/CommandObjectThread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Commands/CommandObjectThread.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Commands/CommandObjectThread.cpp (original)
+++ lldb/branches/windows/source/Commands/CommandObjectThread.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "CommandObjectThread.h"
 
 // C Includes
@@ -67,7 +69,7 @@
         SetOptionValue (uint32_t option_idx, const char *option_arg)
         {
             Error error;
-            char short_option = (char) m_getopt_table[option_idx].val;
+            const int short_option = m_getopt_table[option_idx].val;
 
             switch (short_option)
             {
@@ -296,7 +298,7 @@
         SetOptionValue (uint32_t option_idx, const char *option_arg)
         {
             Error error;
-            char short_option = (char) m_getopt_table[option_idx].val;
+            const int short_option = m_getopt_table[option_idx].val;
 
             switch (short_option)
             {
@@ -323,6 +325,13 @@
                 }
                 break;
 
+            case 't':
+                {
+                    m_step_in_target.clear();
+                    m_step_in_target.assign(option_arg);
+
+                }
+                break;
             default:
                 error.SetErrorStringWithFormat("invalid short option character '%c'", short_option);
                 break;
@@ -337,6 +346,7 @@
             m_avoid_no_debug = true;
             m_run_mode = eOnlyDuringStepping;
             m_avoid_regexp.clear();
+            m_step_in_target.clear();
         }
 
         const OptionDefinition*
@@ -353,6 +363,7 @@
         bool m_avoid_no_debug;
         RunMode m_run_mode;
         std::string m_avoid_regexp;
+        std::string m_step_in_target;
     };
 
     CommandObjectThreadStepWithTypeAndScope (CommandInterpreter &interpreter,
@@ -467,9 +478,10 @@
 
                 if (frame->HasDebugInformation ())
                 {
-                    new_plan = thread->QueueThreadPlanForStepRange (abort_other_plans, m_step_type, 
+                    new_plan = thread->QueueThreadPlanForStepInRange (abort_other_plans,
                                                                     frame->GetSymbolContext(eSymbolContextEverything).line_entry.range, 
-                                                                    frame->GetSymbolContext(eSymbolContextEverything), 
+                                                                    frame->GetSymbolContext(eSymbolContextEverything),
+                                                                    m_options.m_step_in_target.c_str(),
                                                                     stop_other_threads,
                                                                     m_options.m_avoid_no_debug);
                     if (new_plan && !m_options.m_avoid_regexp.empty())
@@ -487,12 +499,10 @@
                 StackFrame *frame = thread->GetStackFrameAtIndex(0).get();
 
                 if (frame->HasDebugInformation())
-                    new_plan = thread->QueueThreadPlanForStepRange (abort_other_plans, 
-                                                                    m_step_type, 
-                                                                    frame->GetSymbolContext(eSymbolContextEverything).line_entry.range, 
-                                                                    frame->GetSymbolContext(eSymbolContextEverything), 
-                                                                    stop_other_threads,
-                                                                    false);
+                    new_plan = thread->QueueThreadPlanForStepOverRange (abort_other_plans,
+                                                                        frame->GetSymbolContext(eSymbolContextEverything).line_entry.range, 
+                                                                        frame->GetSymbolContext(eSymbolContextEverything), 
+                                                                        stop_other_threads);
                 else
                     new_plan = thread->QueueThreadPlanForStepSingleInstruction (true, 
                                                                                 abort_other_plans, 
@@ -548,7 +558,7 @@
                     //  }
                     process->GetThreadList().SetSelectedThreadByID (thread->GetID());
                     result.SetDidChangeProcessState (true);
-                    result.AppendMessageWithFormat ("Process %llu %s\n", process->GetID(), StateAsCString (state));
+                    result.AppendMessageWithFormat ("Process %" PRIu64 " %s\n", process->GetID(), StateAsCString (state));
                     result.SetStatus (eReturnStatusSuccessFinishNoResult);
                 }
                 else
@@ -593,7 +603,8 @@
 {
 { LLDB_OPT_SET_1, false, "avoid-no-debug",  'a', required_argument, NULL,               0, eArgTypeBoolean,     "A boolean value that sets whether step-in will step over functions with no debug information."},
 { LLDB_OPT_SET_1, false, "run-mode",        'm', required_argument, g_tri_running_mode, 0, eArgTypeRunMode, "Determine how to run other threads while stepping the current thread."},
-{ LLDB_OPT_SET_1, false, "step-over-regexp",'r', required_argument, NULL,               0, eArgTypeRegularExpression,   "A regular expression that defines function names to step over."},
+{ LLDB_OPT_SET_1, false, "step-over-regexp",'r', required_argument, NULL,               0, eArgTypeRegularExpression,   "A regular expression that defines function names to not to stop at when stepping in."},
+{ LLDB_OPT_SET_1, false, "step-in-target",  't', required_argument, NULL,               0, eArgTypeFunctionName,   "The name of the directly called function step in should stop at when stepping into."},
 { 0, false, NULL, 0, 0, NULL, 0, eArgTypeNone, NULL }
 };
 
@@ -723,7 +734,7 @@
                             thread->SetResumeState (eStateSuspended);
                         }
                     }
-                    result.AppendMessageWithFormat ("in process %llu\n", process->GetID());
+                    result.AppendMessageWithFormat ("in process %" PRIu64 "\n", process->GetID());
                 }
             }
             else
@@ -741,7 +752,7 @@
                     Thread *thread = process->GetThreadList().GetThreadAtIndex(idx).get();
                     if (thread == current_thread)
                     {
-                        result.AppendMessageWithFormat ("Resuming thread 0x%4.4llx in process %llu\n", thread->GetID(), process->GetID());
+                        result.AppendMessageWithFormat ("Resuming thread 0x%4.4" PRIx64 " in process %" PRIu64 "\n", thread->GetID(), process->GetID());
                         thread->SetResumeState (eStateRunning);
                     }
                     else
@@ -754,13 +765,13 @@
             Error error (process->Resume());
             if (error.Success())
             {
-                result.AppendMessageWithFormat ("Process %llu resuming\n", process->GetID());
+                result.AppendMessageWithFormat ("Process %" PRIu64 " resuming\n", process->GetID());
                 if (synchronous_execution)
                 {
                     state = process->WaitForProcessToStop (NULL);
                     
                     result.SetDidChangeProcessState (true);
-                    result.AppendMessageWithFormat ("Process %llu %s\n", process->GetID(), StateAsCString (state));
+                    result.AppendMessageWithFormat ("Process %" PRIu64 " %s\n", process->GetID(), StateAsCString (state));
                     result.SetStatus (eReturnStatusSuccessFinishNoResult);
                 }
                 else
@@ -818,7 +829,7 @@
         SetOptionValue (uint32_t option_idx, const char *option_arg)
         {
             Error error;
-            char short_option = (char) m_getopt_table[option_idx].val;
+            const int short_option = m_getopt_table[option_idx].val;
 
             switch (short_option)
             {
@@ -1082,13 +1093,13 @@
             Error error (process->Resume ());
             if (error.Success())
             {
-                result.AppendMessageWithFormat ("Process %llu resuming\n", process->GetID());
+                result.AppendMessageWithFormat ("Process %" PRIu64 " resuming\n", process->GetID());
                 if (synchronous_execution)
                 {
                     StateType state = process->WaitForProcessToStop (NULL);
 
                     result.SetDidChangeProcessState (true);
-                    result.AppendMessageWithFormat ("Process %llu %s\n", process->GetID(), StateAsCString (state));
+                    result.AppendMessageWithFormat ("Process %" PRIu64 " %s\n", process->GetID(), StateAsCString (state));
                     result.SetStatus (eReturnStatusSuccessFinishNoResult);
                 }
                 else
@@ -1183,17 +1194,9 @@
             return false;
         }
 
-        process->GetThreadList().SetSelectedThreadByID(new_thread->GetID());
+        process->GetThreadList().SetSelectedThreadByID(new_thread->GetID(), true);
         result.SetStatus (eReturnStatusSuccessFinishNoResult);
         
-        const uint32_t start_frame = 0;
-        const uint32_t num_frames = 1;
-        const uint32_t num_frames_with_source = 1;
-        new_thread->GetStatus (result.GetOutputStream(), 
-                               start_frame,
-                               num_frames,
-                               num_frames_with_source);
-
         return result.Succeeded();
     }
 

Modified: lldb/branches/windows/source/Commands/CommandObjectType.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Commands/CommandObjectType.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Commands/CommandObjectType.cpp (original)
+++ lldb/branches/windows/source/Commands/CommandObjectType.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "CommandObjectType.h"
 
 // C Includes
@@ -209,7 +211,7 @@
         SetOptionValue (uint32_t option_idx, const char *option_arg)
         {
             Error error;
-            char short_option = (char) m_getopt_table[option_idx].val;
+            const int short_option = m_getopt_table[option_idx].val;
             bool success;
             
             switch (short_option)
@@ -374,7 +376,7 @@
                         const char *option_value)
         {
             Error error;
-            const char short_option = (char) g_option_table[option_idx].short_option;
+            const int short_option = g_option_table[option_idx].short_option;
             bool success;
             
             switch (short_option)
@@ -816,7 +818,7 @@
         ScriptAddOptions *options_ptr = ((ScriptAddOptions*)data.baton);
         if (!options_ptr)
         {
-            out_stream->Printf ("Internal error #1: no script attached.\n");
+            out_stream->Printf ("internal synchronization information missing or invalid.\n");
             out_stream->Flush();
             return;
         }
@@ -826,7 +828,7 @@
         ScriptInterpreter *interpreter = data.reader.GetDebugger().GetCommandInterpreter().GetScriptInterpreter();
         if (!interpreter)
         {
-            out_stream->Printf ("Internal error #2: no script attached.\n");
+            out_stream->Printf ("no script interpreter.\n");
             out_stream->Flush();
             return;
         }
@@ -834,13 +836,13 @@
         if (!interpreter->GenerateTypeScriptFunction (options->m_user_source, 
                                                       funct_name_str))
         {
-            out_stream->Printf ("Internal error #3: no script attached.\n");
+            out_stream->Printf ("unable to generate a function.\n");
             out_stream->Flush();
             return;
         }
         if (funct_name_str.empty())
         {
-            out_stream->Printf ("Internal error #4: no script attached.\n");
+            out_stream->Printf ("unable to obtain a valid function name from the script interpreter.\n");
             out_stream->Flush();
             return;
         }
@@ -915,7 +917,7 @@
 CommandObjectTypeSummaryAdd::CommandOptions::SetOptionValue (uint32_t option_idx, const char *option_arg)
 {
     Error error;
-    char short_option = (char) m_getopt_table[option_idx].val;
+    const int short_option = m_getopt_table[option_idx].val;
     bool success;
     
     switch (short_option)
@@ -1035,17 +1037,10 @@
     
     if (!m_options.m_python_function.empty()) // we have a Python function ready to use
     {
-        ScriptInterpreter *interpreter = m_interpreter.GetScriptInterpreter();
-        if (!interpreter)
-        {
-            result.AppendError ("Internal error #1N: no script attached.\n");
-            result.SetStatus (eReturnStatusFailed);
-            return false;
-        }
         const char *funct_name = m_options.m_python_function.c_str();
         if (!funct_name || !funct_name[0])
         {
-            result.AppendError ("Internal error #2N: no script attached.\n");
+            result.AppendError ("function name empty.\n");
             result.SetStatus (eReturnStatusFailed);
             return false;
         }
@@ -1055,13 +1050,20 @@
         script_format.reset(new ScriptSummaryFormat(m_options.m_flags,
                                                     funct_name,
                                                     code.c_str()));
+        
+        ScriptInterpreter *interpreter = m_interpreter.GetScriptInterpreter();
+        
+        if (interpreter && interpreter->CheckObjectExists(funct_name) == false)
+            result.AppendWarningWithFormat("The provided function \"%s\" does not exist - "
+                                           "please define it before attempting to use this summary.\n",
+                                           funct_name);
     }
     else if (!m_options.m_python_script.empty()) // we have a quick 1-line script, just use it
     {
         ScriptInterpreter *interpreter = m_interpreter.GetScriptInterpreter();
         if (!interpreter)
         {
-            result.AppendError ("Internal error #1Q: no script attached.\n");
+            result.AppendError ("script interpreter missing - unable to generate function wrapper.\n");
             result.SetStatus (eReturnStatusFailed);
             return false;
         }
@@ -1071,13 +1073,13 @@
         if (!interpreter->GenerateTypeScriptFunction (funct_sl, 
                                                       funct_name_str))
         {
-            result.AppendError ("Internal error #2Q: no script attached.\n");
+            result.AppendError ("unable to generate function wrapper.\n");
             result.SetStatus (eReturnStatusFailed);
             return false;
         }
         if (funct_name_str.empty())
         {
-            result.AppendError ("Internal error #3Q: no script attached.\n");
+            result.AppendError ("script interpreter failed to generate a valid function name.\n");
             result.SetStatus (eReturnStatusFailed);
             return false;
         }
@@ -1417,7 +1419,7 @@
         SetOptionValue (uint32_t option_idx, const char *option_arg)
         {
             Error error;
-            char short_option = (char) m_getopt_table[option_idx].val;
+            const int short_option = m_getopt_table[option_idx].val;
             
             switch (short_option)
             {
@@ -1580,7 +1582,7 @@
         SetOptionValue (uint32_t option_idx, const char *option_arg)
         {
             Error error;
-            char short_option = (char) m_getopt_table[option_idx].val;
+            const int short_option = m_getopt_table[option_idx].val;
             
             switch (short_option)
             {
@@ -1724,7 +1726,7 @@
         SetOptionValue (uint32_t option_idx, const char *option_arg)
         {
             Error error;
-            char short_option = (char) m_getopt_table[option_idx].val;
+            const int short_option = m_getopt_table[option_idx].val;
             
             switch (short_option)
             {
@@ -2287,7 +2289,7 @@
         SetOptionValue (uint32_t option_idx, const char *option_arg)
         {
             Error error;
-            char short_option = (char) m_getopt_table[option_idx].val;
+            const int short_option = m_getopt_table[option_idx].val;
             
             switch (short_option)
             {
@@ -2501,7 +2503,7 @@
         SetOptionValue (uint32_t option_idx, const char *option_arg)
         {
             Error error;
-            char short_option = (char) m_getopt_table[option_idx].val;
+            const int short_option = m_getopt_table[option_idx].val;
             
             switch (short_option)
             {
@@ -2699,7 +2701,7 @@
         SetOptionValue (uint32_t option_idx, const char *option_arg)
         {
             Error error;
-            char short_option = (char) m_getopt_table[option_idx].val;
+            const int short_option = m_getopt_table[option_idx].val;
             
             switch (short_option)
             {
@@ -2865,7 +2867,7 @@
         SetOptionValue (uint32_t option_idx, const char *option_arg)
         {
             Error error;
-            char short_option = (char) m_getopt_table[option_idx].val;
+            const int short_option = m_getopt_table[option_idx].val;
             
             switch (short_option)
             {
@@ -3032,7 +3034,7 @@
         SetOptionValue (uint32_t option_idx, const char *option_arg)
         {
             Error error;
-            char short_option = (char) m_getopt_table[option_idx].val;
+            const int short_option = m_getopt_table[option_idx].val;
             
             switch (short_option)
             {
@@ -3161,7 +3163,7 @@
         SetOptionValue (uint32_t option_idx, const char *option_arg)
         {
             Error error;
-            char short_option = (char) m_getopt_table[option_idx].val;
+            const int short_option = m_getopt_table[option_idx].val;
             
             switch (short_option)
             {
@@ -3351,7 +3353,7 @@
         SynthAddOptions *options_ptr = ((SynthAddOptions*)data.baton);
         if (!options_ptr)
         {
-            out_stream->Printf ("Internal error #1: no script attached.\n");
+            out_stream->Printf ("internal synchronization data missing.\n");
             out_stream->Flush();
             return;
         }
@@ -3361,7 +3363,7 @@
         ScriptInterpreter *interpreter = data.reader.GetDebugger().GetCommandInterpreter().GetScriptInterpreter();
         if (!interpreter)
         {
-            out_stream->Printf ("Internal error #2: no script attached.\n");
+            out_stream->Printf ("no script interpreter.\n");
             out_stream->Flush();
             return;
         }
@@ -3369,13 +3371,13 @@
         if (!interpreter->GenerateTypeSynthClass (options->m_user_source, 
                                                   class_name_str))
         {
-            out_stream->Printf ("Internal error #3: no script attached.\n");
+            out_stream->Printf ("unable to generate a class.\n");
             out_stream->Flush();
             return;
         }
         if (class_name_str.empty())
         {
-            out_stream->Printf ("Internal error #4: no script attached.\n");
+            out_stream->Printf ("unable to obtain a proper name for the class.\n");
             out_stream->Flush();
             return;
         }
@@ -3413,7 +3415,7 @@
             }
             else
             {
-                out_stream->Printf ("Internal error #6: no script attached.\n");
+                out_stream->Printf ("invalid type name.\n");
                 out_stream->Flush();
                 return;
             }
@@ -3510,6 +3512,11 @@
     
     entry.reset(impl);
     
+    ScriptInterpreter *interpreter = m_interpreter.GetScriptInterpreter();
+    
+    if (interpreter && interpreter->CheckObjectExists(impl->GetPythonClassName()) == false)
+        result.AppendWarning("The provided class does not exist - please define it before attempting to use this synthetic provider");
+    
     // now I have a valid provider, let's add it to every type
     
     lldb::TypeCategoryImplSP category;
@@ -3658,7 +3665,7 @@
         SetOptionValue (uint32_t option_idx, const char *option_arg)
         {
             Error error;
-            char short_option = (char) m_getopt_table[option_idx].val;
+            const int short_option = m_getopt_table[option_idx].val;
             bool success;
             
             switch (short_option)

Modified: lldb/branches/windows/source/Commands/CommandObjectVersion.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Commands/CommandObjectVersion.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Commands/CommandObjectVersion.cpp (original)
+++ lldb/branches/windows/source/Commands/CommandObjectVersion.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "CommandObjectVersion.h"
 
 // C Includes

Modified: lldb/branches/windows/source/Commands/CommandObjectWatchpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Commands/CommandObjectWatchpoint.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Commands/CommandObjectWatchpoint.cpp (original)
+++ lldb/branches/windows/source/Commands/CommandObjectWatchpoint.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "CommandObjectWatchpoint.h"
 #include "CommandObjectWatchpointCommand.h"
 
@@ -213,7 +215,7 @@
         SetOptionValue (uint32_t option_idx, const char *option_arg)
         {
             Error error;
-            char short_option = (char) m_getopt_table[option_idx].val;
+            const int short_option = m_getopt_table[option_idx].val;
 
             switch (short_option)
             {
@@ -642,7 +644,7 @@
         SetOptionValue (uint32_t option_idx, const char *option_arg)
         {
             Error error;
-            char short_option = (char) m_getopt_table[option_idx].val;
+            const int short_option = m_getopt_table[option_idx].val;
 
             switch (short_option)
             {
@@ -799,7 +801,7 @@
         SetOptionValue (uint32_t option_idx, const char *option_arg)
         {
             Error error;
-            char short_option = (char) m_getopt_table[option_idx].val;
+            const int short_option = m_getopt_table[option_idx].val;
 
             switch (short_option)
             {
@@ -1096,7 +1098,7 @@
             output_stream.EOL();
             result.SetStatus(eReturnStatusSuccessFinishResult);
         } else {
-            result.AppendErrorWithFormat("Watchpoint creation failed (addr=0x%llx, size=%lu, variable expression='%s').\n",
+            result.AppendErrorWithFormat("Watchpoint creation failed (addr=0x%" PRIx64 ", size=%lu, variable expression='%s').\n",
                                          addr, size, command.GetArgumentAtIndex(0));
             if (error.AsCString(NULL))
                 result.AppendError(error.AsCString());
@@ -1286,7 +1288,7 @@
             output_stream.EOL();
             result.SetStatus(eReturnStatusSuccessFinishResult);
         } else {
-            result.AppendErrorWithFormat("Watchpoint creation failed (addr=0x%llx, size=%lu).\n",
+            result.AppendErrorWithFormat("Watchpoint creation failed (addr=0x%" PRIx64 ", size=%lu).\n",
                                          addr, size);
             if (error.AsCString(NULL))
                 result.AppendError(error.AsCString());

Modified: lldb/branches/windows/source/Commands/CommandObjectWatchpointCommand.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Commands/CommandObjectWatchpointCommand.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Commands/CommandObjectWatchpointCommand.cpp (original)
+++ lldb/branches/windows/source/Commands/CommandObjectWatchpointCommand.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 // C Includes
 // C++ Includes
 
@@ -396,7 +398,7 @@
         SetOptionValue (uint32_t option_idx, const char *option_arg)
         {
             Error error;
-            char short_option = (char) m_getopt_table[option_idx].val;
+            const int short_option = m_getopt_table[option_idx].val;
 
             switch (short_option)
             {

Modified: lldb/branches/windows/source/Commands/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Commands/Makefile?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Commands/Makefile (original)
+++ lldb/branches/windows/source/Commands/Makefile Tue Jan  8 06:51:53 2013
@@ -12,3 +12,5 @@
 BUILD_ARCHIVE = 1
 
 include $(LLDB_LEVEL)/Makefile
+
+EXTRA_OPTIONS += -Wno-four-char-constants
\ No newline at end of file

Modified: lldb/branches/windows/source/Core/Address.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Core/Address.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Core/Address.cpp (original)
+++ lldb/branches/windows/source/Core/Address.cpp Tue Jan  8 06:51:53 2013
@@ -384,7 +384,7 @@
         if (section_sp)
         {
             section_sp->DumpName(s);
-            s->Printf (" + %llu", m_offset);
+            s->Printf (" + %" PRIu64, m_offset);
         }
         else
         {
@@ -465,7 +465,7 @@
                                         s->PutCString(symbol_name);
                                         addr_t delta = file_Addr - symbol->GetAddress().GetFileAddress();
                                         if (delta)
-                                            s->Printf(" + %llu", delta);
+                                            s->Printf(" + %" PRIu64, delta);
                                         showed_info = true;
                                     }
                                 }
@@ -703,7 +703,7 @@
                         if (var && var->LocationIsValidForAddress (*this))
                         {
                             s->Indent();
-                            s->Printf ("   Variable: id = {0x%8.8llx}, name = \"%s\", type= \"%s\", location =",
+                            s->Printf ("   Variable: id = {0x%8.8" PRIx64 "}, name = \"%s\", type= \"%s\", location =",
                                        var->GetID(),
                                        var->GetName().GetCString(),
                                        var->GetType()->GetName().GetCString());

Modified: lldb/branches/windows/source/Core/AddressRange.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Core/AddressRange.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Core/AddressRange.cpp (original)
+++ lldb/branches/windows/source/Core/AddressRange.cpp Tue Jan  8 06:51:53 2013
@@ -196,7 +196,7 @@
 void
 AddressRange::DumpDebug (Stream *s) const
 {
-    s->Printf("%p: AddressRange section = %p, offset = 0x%16.16llx, byte_size = 0x%16.16llx\n", this, m_base_addr.GetSection().get(), m_base_addr.GetOffset(), GetByteSize());
+    s->Printf("%p: AddressRange section = %p, offset = 0x%16.16" PRIx64 ", byte_size = 0x%16.16" PRIx64 "\n", this, m_base_addr.GetSection().get(), m_base_addr.GetOffset(), GetByteSize());
 }
 //
 //bool

Modified: lldb/branches/windows/source/Core/AddressResolverFileLine.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Core/AddressResolverFileLine.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Core/AddressResolverFileLine.cpp (original)
+++ lldb/branches/windows/source/Core/AddressResolverFileLine.cpp Tue Jan  8 06:51:53 2013
@@ -77,7 +77,7 @@
             else
             {
                 if (log)
-                  log->Printf ("error: Unable to resolve address at file address 0x%llx for %s:%d\n",
+                  log->Printf ("error: Unable to resolve address at file address 0x%" PRIx64 " for %s:%d\n",
                                line_start.GetFileAddress(),
                                m_file_spec.GetFilename().AsCString("<Unknown>"),
                                m_line_number);

Modified: lldb/branches/windows/source/Core/ArchSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Core/ArchSpec.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Core/ArchSpec.cpp (original)
+++ lldb/branches/windows/source/Core/ArchSpec.cpp Tue Jan  8 06:51:53 2013
@@ -717,17 +717,17 @@
 bool
 ArchSpec::IsExactMatch (const ArchSpec& rhs) const
 {
-    return Compare (rhs, true);
+    return IsEqualTo (rhs, true);
 }
 
 bool
 ArchSpec::IsCompatibleMatch (const ArchSpec& rhs) const
 {
-    return Compare (rhs, false);
+    return IsEqualTo (rhs, false);
 }
 
 bool
-ArchSpec::Compare (const ArchSpec& rhs, bool exact_match) const
+ArchSpec::IsEqualTo (const ArchSpec& rhs, bool exact_match) const
 {
     if (GetByteOrder() != rhs.GetByteOrder())
         return false;
@@ -746,12 +746,15 @@
         const llvm::Triple::VendorType rhs_triple_vendor = rhs_triple.getVendor();
         if (lhs_triple_vendor != rhs_triple_vendor)
         {
-            const bool rhs_vendor_specified = rhs.TripleVendorWasSpecified();
-            const bool lhs_vendor_specified = TripleVendorWasSpecified();
-            // Both architectures had the vendor specified, so if they aren't
-            // equal then we return false
-            if (rhs_vendor_specified && lhs_vendor_specified)
-                return false;
+            if (exact_match)
+            {
+                const bool rhs_vendor_specified = rhs.TripleVendorWasSpecified();
+                const bool lhs_vendor_specified = TripleVendorWasSpecified();
+                // Both architectures had the vendor specified, so if they aren't
+                // equal then we return false
+                if (rhs_vendor_specified && lhs_vendor_specified)
+                    return false;
+            }
             
             // Only fail if both vendor types are not unknown
             if (lhs_triple_vendor != llvm::Triple::UnknownVendor &&
@@ -763,12 +766,15 @@
         const llvm::Triple::OSType rhs_triple_os = rhs_triple.getOS();
         if (lhs_triple_os != rhs_triple_os)
         {
-            const bool rhs_os_specified = rhs.TripleOSWasSpecified();
-            const bool lhs_os_specified = TripleOSWasSpecified();
-            // Both architectures had the OS specified, so if they aren't
-            // equal then we return false
-            if (rhs_os_specified && lhs_os_specified)
-                return false;
+            if (exact_match)
+            {
+                const bool rhs_os_specified = rhs.TripleOSWasSpecified();
+                const bool lhs_os_specified = TripleOSWasSpecified();
+                // Both architectures had the OS specified, so if they aren't
+                // equal then we return false
+                if (rhs_os_specified && lhs_os_specified)
+                    return false;
+            }
             // Only fail if both os types are not unknown
             if (lhs_triple_os != llvm::Triple::UnknownOS &&
                 rhs_triple_os != llvm::Triple::UnknownOS)
@@ -869,18 +875,6 @@
 }
 
 bool
-lldb_private::operator== (const ArchSpec& lhs, const ArchSpec& rhs)
-{
-    return lhs.IsExactMatch (rhs);
-}
-
-bool
-lldb_private::operator!= (const ArchSpec& lhs, const ArchSpec& rhs)
-{
-    return !(lhs == rhs);
-}
-
-bool
 lldb_private::operator<(const ArchSpec& lhs, const ArchSpec& rhs)
 {
     const ArchSpec::Core lhs_core = lhs.GetCore ();

Modified: lldb/branches/windows/source/Core/CXXFormatterFunctions.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Core/CXXFormatterFunctions.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Core/CXXFormatterFunctions.cpp (original)
+++ lldb/branches/windows/source/Core/CXXFormatterFunctions.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/Core/CXXFormatterFunctions.h"
 
 // needed to get ConvertUTF16/32ToUTF8
@@ -37,10 +39,8 @@
         return false;
     if (!selector || !*selector)
         return false;
-    StreamString expr_path_stream;
-    valobj.GetExpressionPath(expr_path_stream, false);
     StreamString expr;
-    expr.Printf("(%s)[%s %s]",target_type,expr_path_stream.GetData(),selector);
+    expr.Printf("(%s)[(id)0x%" PRIx64 " %s]",target_type,valobj.GetPointerValue(),selector);
     ExecutionContext exe_ctx (valobj.GetExecutionContextRef());
     lldb::ValueObjectSP result_sp;
     Target* target = exe_ctx.GetTargetPtr();
@@ -51,8 +51,7 @@
     EvaluateExpressionOptions options;
     options.SetCoerceToId(false)
     .SetUnwindOnError(true)
-    .SetKeepInMemory(true)
-    .SetUseDynamic(lldb::eDynamicCanRunTarget);
+    .SetKeepInMemory(true);
     
     target->EvaluateExpression(expr.GetData(),
                                stack_frame,
@@ -78,7 +77,7 @@
     StreamString expr_path_stream;
     valobj.GetExpressionPath(expr_path_stream, false);
     StreamString expr;
-    expr.Printf("(%s)[%s %s:%lld]",return_type,expr_path_stream.GetData(),selector,index);
+    expr.Printf("(%s)[%s %s:%" PRId64 "]",return_type,expr_path_stream.GetData(),selector,index);
     ExecutionContext exe_ctx (valobj.GetExecutionContextRef());
     lldb::ValueObjectSP result_sp;
     Target* target = exe_ctx.GetTargetPtr();
@@ -200,7 +199,7 @@
             return false;
     }
     
-    stream.Printf("%s%llu %s%s",
+    stream.Printf("%s%" PRIu64 " %s%s",
                   (name_entries ? "@\"" : ""),
                   value,
                   (name_entries ? (value == 1 ? "entry" : "entries") : (value == 1 ? "key/value pair" : "key/value pairs")),
@@ -266,7 +265,7 @@
             return false;
     }
     
-    stream.Printf("@\"%llu object%s\"",
+    stream.Printf("@\"%" PRIu64 " object%s\"",
                   value,
                   value == 1 ? "" : "s");
     return true;
@@ -319,7 +318,7 @@
             return false;
     }
     
-    stream.Printf("%s%llu byte%s%s",
+    stream.Printf("%s%" PRIu64 " byte%s%s",
                   (needs_at ? "@\"" : ""),
                   value,
                   (value > 1 ? "s" : ""),
@@ -377,10 +376,10 @@
                     stream.Printf("(int)%d",(int)value);
                     break;
                 case 12:
-                    stream.Printf("(long)%lld",value);
+                    stream.Printf("(long)%" PRId64,value);
                     break;
                 default:
-                    stream.Printf("absurd value:(info=%llu, value=%llu",i_bits,value);
+                    stream.Printf("unexpected value:(info=%" PRIu64 ", value=%" PRIu64,i_bits,value);
                     break;
             }
             return true;
@@ -419,7 +418,7 @@
                     value = process_sp->ReadUnsignedIntegerFromMemory(data_location, 8, 0, error);
                     if (error.Fail())
                         return false;
-                    stream.Printf("(long)%lld",value);
+                    stream.Printf("(long)%" PRId64,value);
                     break;
                 case 5: // 0B0101
                 {
@@ -833,9 +832,7 @@
 bool
 lldb_private::formatters::NSArrayMSyntheticFrontEnd::MightHaveChildren ()
 {
-    if (!m_data_32 && !m_data_64)
-        Update ();
-    return CalculateNumChildren();
+    return true;
 }
 
 static uint32_t
@@ -950,9 +947,7 @@
 bool
 lldb_private::formatters::NSArrayISyntheticFrontEnd::MightHaveChildren ()
 {
-    if (!m_data_ptr)
-        Update ();
-    return CalculateNumChildren();
+    return true;
 }
 
 lldb::ValueObjectSP
@@ -970,7 +965,7 @@
     if (error.Fail())
         return lldb::ValueObjectSP();
     StreamString expr;
-    expr.Printf("(id)%llu",object_at_idx);
+    expr.Printf("(id)%" PRIu64,object_at_idx);
     StreamString idx_name;
     idx_name.Printf("[%d]",idx);
     lldb::ValueObjectSP retval_sp = ValueObject::CreateValueObjectFromExpression(idx_name.GetData(), expr.GetData(), m_exe_ctx_ref);
@@ -1052,7 +1047,7 @@
 bool
 lldb_private::formatters::NSArrayCodeRunningSyntheticFrontEnd::MightHaveChildren ()
 {
-    return CalculateNumChildren() > 0;
+    return true;
 }
 
 uint32_t
@@ -1149,7 +1144,7 @@
 bool
 lldb_private::formatters::NSDictionaryCodeRunningSyntheticFrontEnd::MightHaveChildren ()
 {
-    return CalculateNumChildren() > 0;
+    return true;
 }
 
 uint32_t
@@ -1247,9 +1242,7 @@
 bool
 lldb_private::formatters::NSDictionaryISyntheticFrontEnd::MightHaveChildren ()
 {
-    if (!m_data_32 && !m_data_64)
-        Update ();
-    return CalculateNumChildren();
+    return true;
 }
 
 lldb::ValueObjectSP
@@ -1303,7 +1296,7 @@
     {
         // make the new ValueObject
         StreamString expr;
-        expr.Printf("struct __lldb_autogen_nspair { id key; id value; } _lldb_valgen_item; _lldb_valgen_item.key = (id)%llu ; _lldb_valgen_item.value = (id)%llu; _lldb_valgen_item;",dict_item.key_ptr,dict_item.val_ptr);
+        expr.Printf("struct __lldb_autogen_nspair { id key; id value; } _lldb_valgen_item; _lldb_valgen_item.key = (id)%" PRIu64 " ; _lldb_valgen_item.value = (id)%" PRIu64 "; _lldb_valgen_item;",dict_item.key_ptr,dict_item.val_ptr);
         StreamString idx_name;
         idx_name.Printf("[%d]",idx);
         dict_item.valobj_sp = ValueObject::CreateValueObjectFromExpression(idx_name.GetData(), expr.GetData(), m_exe_ctx_ref);
@@ -1396,9 +1389,7 @@
 bool
 lldb_private::formatters::NSDictionaryMSyntheticFrontEnd::MightHaveChildren ()
 {
-    if (!m_data_32 && !m_data_64)
-        Update ();
-    return CalculateNumChildren();
+    return true;
 }
 
 lldb::ValueObjectSP
@@ -1455,7 +1446,7 @@
     {
         // make the new ValueObject
         StreamString expr;
-        expr.Printf("struct __lldb_autogen_nspair { id key; id value; } _lldb_valgen_item; _lldb_valgen_item.key = (id)%llu ; _lldb_valgen_item.value = (id)%llu; _lldb_valgen_item;",dict_item.key_ptr,dict_item.val_ptr);
+        expr.Printf("struct __lldb_autogen_nspair { id key; id value; } _lldb_valgen_item; _lldb_valgen_item.key = (id)%" PRIu64 " ; _lldb_valgen_item.value = (id)%" PRIu64 "; _lldb_valgen_item;",dict_item.key_ptr,dict_item.val_ptr);
         StreamString idx_name;
         idx_name.Printf("[%d]",idx);
         dict_item.valobj_sp = ValueObject::CreateValueObjectFromExpression(idx_name.GetData(), expr.GetData(), m_exe_ctx_ref);

Modified: lldb/branches/windows/source/Core/Communication.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Core/Communication.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Core/Communication.cpp (original)
+++ lldb/branches/windows/source/Core/Communication.cpp Tue Jan  8 06:51:53 2013
@@ -136,7 +136,7 @@
 Communication::Read (void *dst, size_t dst_len, uint32_t timeout_usec, ConnectionStatus &status, Error *error_ptr)
 {
     lldb_private::LogIfAnyCategoriesSet (LIBLLDB_LOG_COMMUNICATION,
-                                         "%p Communication::Read (dst = %p, dst_len = %llu, timeout = %u usec) connection = %p",
+                                         "%p Communication::Read (dst = %p, dst_len = %" PRIu64 ", timeout = %u usec) connection = %p",
                                          this, 
                                          dst, 
                                          (uint64_t)dst_len,
@@ -210,7 +210,7 @@
 
     Mutex::Locker locker(m_write_mutex);
     lldb_private::LogIfAnyCategoriesSet (LIBLLDB_LOG_COMMUNICATION,
-                                         "%p Communication::Write (src = %p, src_len = %llu) connection = %p",
+                                         "%p Communication::Write (src = %p, src_len = %" PRIu64 ") connection = %p",
                                          this, 
                                          src, 
                                          (uint64_t)src_len,
@@ -295,7 +295,7 @@
 Communication::AppendBytesToCache (const uint8_t * bytes, size_t len, bool broadcast, ConnectionStatus status)
 {
     lldb_private::LogIfAnyCategoriesSet (LIBLLDB_LOG_COMMUNICATION,
-                                 "%p Communication::AppendBytesToCache (src = %p, src_len = %llu, broadcast = %i)",
+                                 "%p Communication::AppendBytesToCache (src = %p, src_len = %" PRIu64 ", broadcast = %i)",
                                  this, bytes, (uint64_t)len, broadcast);
     if ((bytes == NULL || len == 0)
         && (status != lldb::eConnectionStatusEndOfFile))
@@ -374,7 +374,6 @@
         case eConnectionStatusLostConnection:   // Lost connection while connected to a valid connection
             done = true;
             // Fall through...
-        default:
         case eConnectionStatusError:            // Check GetError() for details
         case eConnectionStatusTimedOut:         // Request timed out
             if (log)

Modified: lldb/branches/windows/source/Core/ConnectionFileDescriptor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Core/ConnectionFileDescriptor.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Core/ConnectionFileDescriptor.cpp (original)
+++ lldb/branches/windows/source/Core/ConnectionFileDescriptor.cpp Tue Jan  8 06:51:53 2013
@@ -385,7 +385,7 @@
 {
     LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_CONNECTION));
     if (log)
-        log->Printf ("%p ConnectionFileDescriptor::Read () ::read (fd = %i, dst = %p, dst_len = %llu)...",
+        log->Printf ("%p ConnectionFileDescriptor::Read () ::read (fd = %i, dst = %p, dst_len = %" PRIu64 ")...",
                      this, m_fd_recv, dst, (uint64_t)dst_len);
 
     Mutex::Locker locker;
@@ -448,7 +448,7 @@
     }
 
     if (log)
-        log->Printf ("%p ConnectionFileDescriptor::Read () ::read (fd = %i, dst = %p, dst_len = %llu) => %lli, error = %s",
+        log->Printf ("%p ConnectionFileDescriptor::Read () ::read (fd = %i, dst = %p, dst_len = %" PRIu64 ") => %" PRIi64 ", error = %s",
                      this, 
                      m_fd_recv, 
                      dst, 
@@ -512,7 +512,7 @@
 {
     LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_CONNECTION));
     if (log)
-        log->Printf ("%p ConnectionFileDescriptor::Write (src = %p, src_len = %llu)", this, src, (uint64_t)src_len);
+        log->Printf ("%p ConnectionFileDescriptor::Write (src = %p, src_len = %" PRIu64 ")", this, src, (uint64_t)src_len);
 
     if (!IsConnected ())
     {
@@ -570,7 +570,7 @@
         switch (m_fd_send_type)
         {
             case eFDTypeFile:       // Other FD requireing read/write
-                log->Printf ("%p ConnectionFileDescriptor::Write()  ::write (fd = %i, src = %p, src_len = %llu) => %lli (error = %s)",
+                log->Printf ("%p ConnectionFileDescriptor::Write()  ::write (fd = %i, src = %p, src_len = %" PRIu64 ") => %" PRIi64 " (error = %s)",
                              this, 
                              m_fd_send, 
                              src, 
@@ -580,7 +580,7 @@
                 break;
                 
             case eFDTypeSocket:     // Socket requiring send/recv
-                log->Printf ("%p ConnectionFileDescriptor::Write()  ::send (socket = %i, src = %p, src_len = %llu, flags = 0) => %lli (error = %s)",
+                log->Printf ("%p ConnectionFileDescriptor::Write()  ::send (socket = %i, src = %p, src_len = %" PRIu64 ", flags = 0) => %" PRIi64 " (error = %s)",
                              this, 
                              m_fd_send, 
                              src, 
@@ -590,7 +590,7 @@
                 break;
                 
             case eFDTypeSocketUDP:  // Unconnected UDP socket requiring sendto/recvfrom
-                log->Printf ("%p ConnectionFileDescriptor::Write()  ::sendto (socket = %i, src = %p, src_len = %llu, flags = 0) => %lli (error = %s)",
+                log->Printf ("%p ConnectionFileDescriptor::Write()  ::sendto (socket = %i, src = %p, src_len = %" PRIu64 ", flags = 0) => %" PRIi64 " (error = %s)",
                              this, 
                              m_fd_send, 
                              src, 

Modified: lldb/branches/windows/source/Core/ConstString.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Core/ConstString.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Core/ConstString.cpp (original)
+++ lldb/branches/windows/source/Core/ConstString.cpp Tue Jan  8 06:51:53 2013
@@ -294,7 +294,7 @@
     size_t cstr_len = GetLength();
     // Only print the parens if we have a non-NULL string
     const char *parens = cstr ? "\"" : "";
-    s->Printf("%*p: ConstString, string = %s%s%s, length = %llu", (int)sizeof(void*) * 2, this, parens, cstr, parens, (uint64_t)cstr_len);
+    s->Printf("%*p: ConstString, string = %s%s%s, length = %" PRIu64, (int)sizeof(void*) * 2, this, parens, cstr, parens, (uint64_t)cstr_len);
 }
 
 void

Modified: lldb/branches/windows/source/Core/DataBufferMemoryMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Core/DataBufferMemoryMap.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Core/DataBufferMemoryMap.cpp (original)
+++ lldb/branches/windows/source/Core/DataBufferMemoryMap.cpp Tue Jan  8 06:51:53 2013
@@ -261,7 +261,7 @@
                         }
                         if (error.GetError() == ENOMEM)
                         {
-                           error.SetErrorStringWithFormat("could not allocate %lld bytes of memory to mmap in file", (uint64_t) length);
+                           error.SetErrorStringWithFormat("could not allocate %" PRId64 " bytes of memory to mmap in file", (uint64_t) length);
                         }
                     }
                     else

Modified: lldb/branches/windows/source/Core/DataExtractor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Core/DataExtractor.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Core/DataExtractor.cpp (original)
+++ lldb/branches/windows/source/Core/DataExtractor.cpp Tue Jan  8 06:51:53 2013
@@ -1408,7 +1408,7 @@
                 s->EOL();
             }
             if (base_addr != LLDB_INVALID_ADDRESS)
-                s->Printf ("0x%8.8llx: ", (uint64_t)(base_addr + (offset - start_offset)));
+                s->Printf ("0x%8.8" PRIx64 ": ", (uint64_t)(base_addr + (offset - start_offset)));
             line_start_offset = offset;
         }
         else
@@ -1498,7 +1498,7 @@
                         if (item_byte_size == 1)
                             s->Printf ("\\x%2.2x", (uint8_t)ch); 
                         else
-                            s->Printf ("%llu", ch); 
+                            s->Printf ("%" PRIu64, ch);
                         break;
                     }
                 }
@@ -1516,7 +1516,7 @@
         case eFormatEnum:       // Print enum value as a signed integer when we don't get the enum type
         case eFormatDecimal:
             if (item_byte_size <= 8)
-                s->Printf ("%lld", GetMaxS64Bitfield(&offset, item_byte_size, item_bit_size, item_bit_offset));
+                s->Printf ("%" PRId64, GetMaxS64Bitfield(&offset, item_byte_size, item_bit_size, item_bit_offset));
             else
             {
                 const bool is_signed = true;
@@ -1527,7 +1527,7 @@
 
         case eFormatUnsigned:
             if (item_byte_size <= 8)
-                s->Printf ("%llu", GetMaxU64Bitfield(&offset, item_byte_size, item_bit_size, item_bit_offset));
+                s->Printf ("%" PRIu64, GetMaxU64Bitfield(&offset, item_byte_size, item_bit_size, item_bit_offset));
             else
             {
                 const bool is_signed = false;
@@ -1538,7 +1538,7 @@
 
         case eFormatOctal:
             if (item_byte_size <= 8)
-                s->Printf ("0%llo", GetMaxS64Bitfield(&offset, item_byte_size, item_bit_size, item_bit_offset));
+                s->Printf ("0%" PRIo64, GetMaxS64Bitfield(&offset, item_byte_size, item_bit_size, item_bit_offset));
             else
             {
                 const bool is_signed = false;
@@ -1632,8 +1632,8 @@
                 
                 if (complex_int_byte_size <= 8)
                 {
-                    s->Printf("%llu", GetMaxU64Bitfield(&offset, complex_int_byte_size, 0, 0));
-                    s->Printf(" + %llui", GetMaxU64Bitfield(&offset, complex_int_byte_size, 0, 0));
+                    s->Printf("%" PRIu64, GetMaxU64Bitfield(&offset, complex_int_byte_size, 0, 0));
+                    s->Printf(" + %" PRIu64 "i", GetMaxU64Bitfield(&offset, complex_int_byte_size, 0, 0));
                 }
                 else
                 {
@@ -1682,7 +1682,7 @@
                 bool wantsuppercase  = (item_format == eFormatHexUppercase);
                 if (item_byte_size <= 8)
                 {
-                    s->Printf(wantsuppercase ? "0x%*.*llX" : "0x%*.*llx", 2 * item_byte_size, 2 * item_byte_size, GetMaxU64Bitfield(&offset, item_byte_size, item_bit_size, item_bit_offset));
+                    s->Printf(wantsuppercase ? "0x%*.*" PRIX64 : "0x%*.*" PRIx64, 2 * item_byte_size, 2 * item_byte_size, GetMaxU64Bitfield(&offset, item_byte_size, item_bit_size, item_bit_offset));
                 }
                 else
                 {
@@ -1746,7 +1746,7 @@
         case eFormatAddressInfo:
             {
                 addr_t addr = GetMaxU64Bitfield(&offset, item_byte_size, item_bit_size, item_bit_offset);
-                s->Printf("0x%*.*llx", 2 * item_byte_size, 2 * item_byte_size, addr);
+                s->Printf("0x%*.*" PRIx64, 2 * item_byte_size, 2 * item_byte_size, addr);
                 if (exe_scope)
                 {
                     TargetSP target_sp (exe_scope->CalculateTarget());
@@ -1923,12 +1923,11 @@
             }
             // Reset string offset and fill the current line string with address:
             if (base_addr != LLDB_INVALID_ADDRESS)
-                sstr.Printf("0x%8.8llx:", (uint64_t)(base_addr + (offset - start_offset)));
+                sstr.Printf("0x%8.8" PRIx64 ":", (uint64_t)(base_addr + (offset - start_offset)));
         }
 
         switch (type)
         {
-            default:
             case TypeUInt8:   sstr.Printf (format ? format : " %2.2x", GetU8(&offset)); break;
             case TypeChar:
                 {
@@ -1938,10 +1937,10 @@
                 break;
             case TypeUInt16:  sstr.Printf (format ? format : " %4.4x",       GetU16(&offset)); break;
             case TypeUInt32:  sstr.Printf (format ? format : " %8.8x",       GetU32(&offset)); break;
-            case TypeUInt64:  sstr.Printf (format ? format : " %16.16llx",   GetU64(&offset)); break;
-            case TypePointer: sstr.Printf (format ? format : " 0x%llx",      GetAddress(&offset)); break;
-            case TypeULEB128: sstr.Printf (format ? format : " 0x%llx",      GetULEB128(&offset)); break;
-            case TypeSLEB128: sstr.Printf (format ? format : " %lld",        GetSLEB128(&offset)); break;
+            case TypeUInt64:  sstr.Printf (format ? format : " %16.16" PRIx64,   GetU64(&offset)); break;
+            case TypePointer: sstr.Printf (format ? format : " 0x%" PRIx64,      GetAddress(&offset)); break;
+            case TypeULEB128: sstr.Printf (format ? format : " 0x%" PRIx64,      GetULEB128(&offset)); break;
+            case TypeSLEB128: sstr.Printf (format ? format : " %" PRId64,        GetSLEB128(&offset)); break;
         }
     }
 

Modified: lldb/branches/windows/source/Core/DataVisualization.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Core/DataVisualization.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Core/DataVisualization.cpp (original)
+++ lldb/branches/windows/source/Core/DataVisualization.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/Core/DataVisualization.h"
 
 // C Includes

Modified: lldb/branches/windows/source/Core/Debugger.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Core/Debugger.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Core/Debugger.cpp (original)
+++ lldb/branches/windows/source/Core/Debugger.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/API/SBDebugger.h"
 
 #include "lldb/Core/Debugger.h"
@@ -548,6 +550,7 @@
     m_input_file (),
     m_output_file (),
     m_error_file (),
+    m_terminal_state (),
     m_target_list (*this),
     m_platform_list (),
     m_listener ("lldb.Debugger"),
@@ -615,6 +618,7 @@
     
     // Close the input file _before_ we close the input read communications class
     // as it does NOT own the input file, our m_input_file does.
+    m_terminal_state.Clear();
     GetInputFile().Close ();
     // Now that we have closed m_input_file, we can now tell our input communication
     // class to close down. Its read thread should quickly exit after we close
@@ -662,7 +666,10 @@
     // want to objects trying to own and close a file descriptor.
     m_input_comm.SetConnection (new ConnectionFileDescriptor (in_file.GetDescriptor(), false));
     m_input_comm.SetReadThreadBytesReceivedCallback (Debugger::DispatchInputCallback, this);
-
+    
+    // Save away the terminal state if that is relevant, so that we can restore it in RestoreInputState.
+    SaveInputTerminalState ();
+    
     Error error;
     if (m_input_comm.StartReadThread (&error) == false)
     {
@@ -698,6 +705,20 @@
         err_file.SetStream (stderr, false);
 }
 
+void
+Debugger::SaveInputTerminalState ()
+{
+    File &in_file = GetInputFile();
+    if (in_file.GetDescriptor() != File::kInvalidDescriptor)
+        m_terminal_state.Save(in_file.GetDescriptor(), true);
+}
+
+void
+Debugger::RestoreInputTerminalState ()
+{
+    m_terminal_state.Restore();
+}
+
 ExecutionContext
 Debugger::GetSelectedExecutionContext ()
 {
@@ -1187,7 +1208,7 @@
             *index_lower = ::strtoul (*open_bracket_position+1, &end, 0);
             *index_higher = *index_lower;
             if (log)
-                log->Printf("[ScanBracketedRange] [%lld] detected, high index is same", *index_lower);
+                log->Printf("[ScanBracketedRange] [%" PRId64 "] detected, high index is same", *index_lower);
         }
         else if (*close_bracket_position && *close_bracket_position < var_name_end)
         {
@@ -1195,7 +1216,7 @@
             *index_lower = ::strtoul (*open_bracket_position+1, &end, 0);
             *index_higher = ::strtoul (*separator_position+1, &end, 0);
             if (log)
-                log->Printf("[ScanBracketedRange] [%lld-%lld] detected", *index_lower, *index_higher);
+                log->Printf("[ScanBracketedRange] [%" PRId64 "-%" PRId64 "] detected", *index_lower, *index_higher);
         }
         else
         {
@@ -1530,7 +1551,7 @@
                                 }
                                 
                                 // TODO use flags for these
-                                bool is_array = ClangASTContext::IsArrayType(target->GetClangType());
+                                bool is_array = ClangASTContext::IsArrayType(target->GetClangType(), NULL, NULL, NULL);
                                 bool is_pointer = ClangASTContext::IsPointerType(target->GetClangType());
                                 bool is_aggregate = ClangASTContext::IsAggregateType(target->GetClangType());
                                 
@@ -1642,7 +1663,7 @@
                                         if (!item)
                                         {
                                             if (log)
-                                                log->Printf("[Debugger::FormatPrompt] ERROR in getting child item at index %lld", index_lower);
+                                                log->Printf("[Debugger::FormatPrompt] ERROR in getting child item at index %" PRId64, index_lower);
                                         }
                                         else
                                         {
@@ -1898,7 +1919,7 @@
                                         var_name_begin += ::strlen ("process.");
                                         if (::strncmp (var_name_begin, "id}", strlen("id}")) == 0)
                                         {
-                                            s.Printf("%llu", process->GetID());
+                                            s.Printf("%" PRIu64, process->GetID());
                                             var_success = true;
                                         }
                                         else if ((::strncmp (var_name_begin, "name}", strlen("name}")) == 0) ||
@@ -1936,7 +1957,7 @@
                                         var_name_begin += ::strlen ("thread.");
                                         if (::strncmp (var_name_begin, "id}", strlen("id}")) == 0)
                                         {
-                                            s.Printf("0x%4.4llx", thread->GetID());
+                                            s.Printf("0x%4.4" PRIx64, thread->GetID());
                                             var_success = true;
                                         }
                                         else if (::strncmp (var_name_begin, "index}", strlen("index}")) == 0)
@@ -2144,7 +2165,7 @@
                                     if (::strncmp (var_name_begin, "id}", strlen("id}")) == 0)
                                     {
                                         if (sc->function)
-                                            s.Printf("function{0x%8.8llx}", sc->function->GetID());
+                                            s.Printf("function{0x%8.8" PRIx64 "}", sc->function->GetID());
                                         else
                                             s.Printf("symbol[%u]", sc->symbol->GetID());
 
@@ -2248,12 +2269,12 @@
                                                         ValueObjectSP var_value_sp (ValueObjectVariable::Create (exe_scope, var_sp));
                                                         const char *var_name = var_value_sp->GetName().GetCString();
                                                         const char *var_value = var_value_sp->GetValueAsCString();
+                                                        if (arg_idx > 0)
+                                                            s.PutCString (", ");
                                                         if (var_value_sp->GetError().Success())
-                                                        {
-                                                            if (arg_idx > 0)
-                                                                s.PutCString (", ");
                                                             s.Printf ("%s=%s", var_name, var_value);
-                                                        }
+                                                        else
+                                                            s.Printf ("%s=<unavailable>", var_name);
                                                     }
                                                     
                                                     if (close_paren)
@@ -2430,9 +2451,9 @@
                                             addr_t func_file_addr = func_addr.GetFileAddress();
                                             addr_t addr_file_addr = format_addr.GetFileAddress();
                                             if (addr_file_addr > func_file_addr)
-                                                s.Printf(" + %llu", addr_file_addr - func_file_addr);
+                                                s.Printf(" + %" PRIu64, addr_file_addr - func_file_addr);
                                             else if (addr_file_addr < func_file_addr)
-                                                s.Printf(" - %llu", func_file_addr - addr_file_addr);
+                                                s.Printf(" - %" PRIu64, func_file_addr - addr_file_addr);
                                             var_success = true;
                                         }
                                         else
@@ -2443,9 +2464,9 @@
                                                 addr_t func_load_addr = func_addr.GetLoadAddress (target);
                                                 addr_t addr_load_addr = format_addr.GetLoadAddress (target);
                                                 if (addr_load_addr > func_load_addr)
-                                                    s.Printf(" + %llu", addr_load_addr - func_load_addr);
+                                                    s.Printf(" + %" PRIu64, addr_load_addr - func_load_addr);
                                                 else if (addr_load_addr < func_load_addr)
-                                                    s.Printf(" - %llu", func_load_addr - addr_load_addr);
+                                                    s.Printf(" - %" PRIu64, func_load_addr - addr_load_addr);
                                                 var_success = true;
                                             }
                                         }
@@ -2465,7 +2486,7 @@
                                         int addr_width = target->GetArchitecture().GetAddressByteSize() * 2;
                                         if (addr_width == 0)
                                             addr_width = 16;
-                                        s.Printf("0x%*.*llx", addr_width, addr_width, vaddr);
+                                        s.Printf("0x%*.*" PRIx64, addr_width, addr_width, vaddr);
                                         var_success = true;
                                     }
                                 }
@@ -2593,13 +2614,13 @@
     else
     {
         LogStreamMap::iterator pos = m_log_streams.find(log_file);
-        if (pos == m_log_streams.end())
+        if (pos != m_log_streams.end())
+            log_stream_sp = pos->second.lock();
+        if (!log_stream_sp)
         {
             log_stream_sp.reset (new StreamFile (log_file));
             m_log_streams[log_file] = log_stream_sp;
         }
-        else
-            log_stream_sp = pos->second;
     }
     assert (log_stream_sp.get());
     

Modified: lldb/branches/windows/source/Core/Disassembler.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Core/Disassembler.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Core/Disassembler.cpp (original)
+++ lldb/branches/windows/source/Core/Disassembler.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/Core/Disassembler.h"
 
 // C Includes
@@ -539,7 +541,7 @@
                    bool show_bytes,
                    const ExecutionContext* exe_ctx)
 {
-    const size_t opcode_column_width = 7;
+    size_t opcode_column_width = 7;
     const size_t operand_column_width = 25;
     
     CalculateMnemonicOperandsAndCommentIfNeeded (exe_ctx);
@@ -582,6 +584,14 @@
     
     const size_t opcode_pos = ss.GetSize();
     
+    // The default opcode size of 7 characters is plenty for most architectures
+    // but some like arm can pull out the occasional vqrshrun.s16.  We won't get
+    // consistent column spacing in these cases, unfortunately.
+    if (m_opcode_name.length() >= opcode_column_width)
+    {
+        opcode_column_width = m_opcode_name.length() + 1;
+    }
+
     ss.PutCString (m_opcode_name.c_str());
     ss.FillLastLineToColumn (opcode_pos + opcode_column_width, ' ');
     ss.PutCString (m_mnemocics.c_str());

Modified: lldb/branches/windows/source/Core/EmulateInstruction.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Core/EmulateInstruction.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Core/EmulateInstruction.cpp (original)
+++ lldb/branches/windows/source/Core/EmulateInstruction.cpp Tue Jan  8 06:51:53 2013
@@ -361,7 +361,7 @@
                                        size_t length)
 {
     StreamFile strm (stdout, false);
-    strm.Printf ("    Read from Memory (address = 0x%llx, length = %llu, context = ", addr, (uint64_t)length);
+    strm.Printf ("    Read from Memory (address = 0x%" PRIx64 ", length = %" PRIu64 ", context = ", addr, (uint64_t)length);
     context.Dump (strm, instruction);    
     strm.EOL();
     *((uint64_t *) dst) = 0xdeadbeef;
@@ -377,7 +377,7 @@
                                         size_t length)
 {
     StreamFile strm (stdout, false);
-    strm.Printf ("    Write to Memory (address = 0x%llx, length = %llu, context = ", addr, (uint64_t)length);
+    strm.Printf ("    Write to Memory (address = 0x%" PRIx64 ", length = %" PRIu64 ", context = ", addr, (uint64_t)length);
     context.Dump (strm, instruction);    
     strm.EOL();
     return length;
@@ -503,7 +503,7 @@
     {
     case eInfoTypeRegisterPlusOffset:
         {
-            strm.Printf (" (reg_plus_offset = %s%+lld)",
+            strm.Printf (" (reg_plus_offset = %s%+" PRId64 ")",
                          info.RegisterPlusOffset.reg.name,
                          info.RegisterPlusOffset.signed_offset);
         }
@@ -519,7 +519,7 @@
 
     case eInfoTypeRegisterToRegisterPlusOffset:
         {
-            strm.Printf (" (base_and_imm_offset = %s%+lld, data_reg = %s)", 
+            strm.Printf (" (base_and_imm_offset = %s%+" PRId64 ", data_reg = %s)",
                          info.RegisterToRegisterPlusOffset.base_reg.name, 
                          info.RegisterToRegisterPlusOffset.offset,
                          info.RegisterToRegisterPlusOffset.data_reg.name);
@@ -544,7 +544,7 @@
         break;
 
     case eInfoTypeOffset:
-        strm.Printf (" (signed_offset = %+lld)", info.signed_offset);
+        strm.Printf (" (signed_offset = %+" PRId64 ")", info.signed_offset);
         break;
         
     case eInfoTypeRegister:
@@ -552,19 +552,19 @@
         break;
         
     case eInfoTypeImmediate:
-        strm.Printf (" (unsigned_immediate = %llu (0x%16.16llx))", 
+        strm.Printf (" (unsigned_immediate = %" PRIu64 " (0x%16.16" PRIx64 "))",
                      info.unsigned_immediate, 
                      info.unsigned_immediate);
         break;
 
     case eInfoTypeImmediateSigned:
-        strm.Printf (" (signed_immediate = %+lld (0x%16.16llx))", 
+        strm.Printf (" (signed_immediate = %+" PRId64 " (0x%16.16" PRIx64 "))",
                      info.signed_immediate, 
                      info.signed_immediate);
         break;
         
     case eInfoTypeAddress:
-        strm.Printf (" (address = 0x%llx)", info.address);
+        strm.Printf (" (address = 0x%" PRIx64 ")", info.address);
         break;
         
     case eInfoTypeISAAndImmediate:
@@ -587,10 +587,6 @@
         
     case eInfoTypeNoArgs:
         break;
-
-    default:
-        strm.Printf (" (unknown <info_type>)");
-        break;
     }
 }
 

Modified: lldb/branches/windows/source/Core/FormatClasses.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Core/FormatClasses.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Core/FormatClasses.cpp (original)
+++ lldb/branches/windows/source/Core/FormatClasses.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 // C Includes
 
 // C++ Includes

Modified: lldb/branches/windows/source/Core/FormatManager.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Core/FormatManager.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Core/FormatManager.cpp (original)
+++ lldb/branches/windows/source/Core/FormatManager.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/Core/FormatManager.h"
 
 // C Includes
@@ -877,10 +879,10 @@
 }
 
 static void
-AddSummary(TypeCategoryImpl::SharedPointer category_sp,
-           const char* string,
-           ConstString type_name,
-           TypeSummaryImpl::Flags flags)
+AddStringSummary(TypeCategoryImpl::SharedPointer category_sp,
+                 const char* string,
+                 ConstString type_name,
+                 TypeSummaryImpl::Flags flags)
 {
     lldb::TypeSummaryImplSP summary_sp(new StringSummaryFormat(flags,
                                                                string));
@@ -970,80 +972,80 @@
 
     TypeCategoryImpl::SharedPointer corefoundation_category_sp = GetCategory(m_corefoundation_category_name);
 
-    AddSummary(corefoundation_category_sp,
-               "${var.years} years, ${var.months} months, ${var.days} days, ${var.hours} hours, ${var.minutes} minutes ${var.seconds} seconds",
-               ConstString("CFGregorianUnits"),
-               objc_flags);
-    AddSummary(corefoundation_category_sp,
-               "location=${var.location} length=${var.length}",
-               ConstString("CFRange"),
-               objc_flags);
-    AddSummary(corefoundation_category_sp,
-               "(x=${var.x}, y=${var.y})",
-               ConstString("NSPoint"),
-               objc_flags);
-    AddSummary(corefoundation_category_sp,
-               "location=${var.location}, length=${var.length}",
-               ConstString("NSRange"),
-               objc_flags);
-    AddSummary(corefoundation_category_sp,
-               "${var.origin}, ${var.size}",
-               ConstString("NSRect"),
-               objc_flags);
-    AddSummary(corefoundation_category_sp,
-               "(${var.origin}, ${var.size}), ...",
-               ConstString("NSRectArray"),
-               objc_flags);
-    AddSummary(objc_category_sp,
-               "(width=${var.width}, height=${var.height})",
-               ConstString("NSSize"),
-               objc_flags);
+    AddStringSummary(corefoundation_category_sp,
+                     "${var.years} years, ${var.months} months, ${var.days} days, ${var.hours} hours, ${var.minutes} minutes ${var.seconds} seconds",
+                     ConstString("CFGregorianUnits"),
+                     objc_flags);
+    AddStringSummary(corefoundation_category_sp,
+                     "location=${var.location} length=${var.length}",
+                     ConstString("CFRange"),
+                     objc_flags);
+    AddStringSummary(corefoundation_category_sp,
+                     "(x=${var.x}, y=${var.y})",
+                     ConstString("NSPoint"),
+                     objc_flags);
+    AddStringSummary(corefoundation_category_sp,
+                     "location=${var.location}, length=${var.length}",
+                     ConstString("NSRange"),
+                     objc_flags);
+    AddStringSummary(corefoundation_category_sp,
+                     "${var.origin}, ${var.size}",
+                     ConstString("NSRect"),
+                     objc_flags);
+    AddStringSummary(corefoundation_category_sp,
+                     "(${var.origin}, ${var.size}), ...",
+                     ConstString("NSRectArray"),
+                     objc_flags);
+    AddStringSummary(objc_category_sp,
+                     "(width=${var.width}, height=${var.height})",
+                     ConstString("NSSize"),
+                     objc_flags);
     
     TypeCategoryImpl::SharedPointer coregraphics_category_sp = GetCategory(m_coregraphics_category_name);
     
-    AddSummary(coregraphics_category_sp,
-               "(width=${var.width}, height=${var.height})",
-               ConstString("CGSize"),
-               objc_flags);
-    AddSummary(coregraphics_category_sp,
-               "(x=${var.x}, y=${var.y})",
-               ConstString("CGPoint"),
-               objc_flags);
-    AddSummary(coregraphics_category_sp,
-               "origin=${var.origin} size=${var.size}",
-               ConstString("CGRect"),
-               objc_flags);
+    AddStringSummary(coregraphics_category_sp,
+                     "(width=${var.width}, height=${var.height})",
+                     ConstString("CGSize"),
+                     objc_flags);
+    AddStringSummary(coregraphics_category_sp,
+                     "(x=${var.x}, y=${var.y})",
+                     ConstString("CGPoint"),
+                     objc_flags);
+    AddStringSummary(coregraphics_category_sp,
+                     "origin=${var.origin} size=${var.size}",
+                     ConstString("CGRect"),
+                     objc_flags);
     
     TypeCategoryImpl::SharedPointer coreservices_category_sp = GetCategory(m_coreservices_category_name);
     
-    AddSummary(coreservices_category_sp,
-               "red=${var.red} green=${var.green} blue=${var.blue}",
-               ConstString("RGBColor"),
-               objc_flags);
-    AddSummary(coreservices_category_sp,
-               "(t=${var.top}, l=${var.left}, b=${var.bottom}, r=${var.right})",
-               ConstString("Rect"),
-               objc_flags);
-    AddSummary(coreservices_category_sp,
-               "(v=${var.v}, h=${var.h})",
-               ConstString("Point"),
-               objc_flags);
-    AddSummary(coreservices_category_sp,
-               "${var.month}/${var.day}/${var.year}  ${var.hour} :${var.minute} :${var.second} dayOfWeek:${var.dayOfWeek}",
-               ConstString("DateTimeRect *"),
-               objc_flags);
-    AddSummary(coreservices_category_sp,
-               "${var.ld.month}/${var.ld.day}/${var.ld.year} ${var.ld.hour} :${var.ld.minute} :${var.ld.second} dayOfWeek:${var.ld.dayOfWeek}",
-               ConstString("LongDateRect"),
-               objc_flags);
-    AddSummary(coreservices_category_sp,
-               "(x=${var.x}, y=${var.y})",
-               ConstString("HIPoint"),
-               objc_flags);
-    AddSummary(coreservices_category_sp,
-               "origin=${var.origin} size=${var.size}",
-               ConstString("HIRect"),
-               objc_flags);
+    AddStringSummary(coreservices_category_sp,
+                     "red=${var.red} green=${var.green} blue=${var.blue}",
+                     ConstString("RGBColor"),
+                     objc_flags);
+    AddStringSummary(coreservices_category_sp,
+                     "(t=${var.top}, l=${var.left}, b=${var.bottom}, r=${var.right})",
+                     ConstString("Rect"),
+                     objc_flags);
+    AddStringSummary(coreservices_category_sp,
+                     "(v=${var.v}, h=${var.h})",
+                     ConstString("Point"),
+                     objc_flags);
+    AddStringSummary(coreservices_category_sp,
+                     "${var.month}/${var.day}/${var.year}  ${var.hour} :${var.minute} :${var.second} dayOfWeek:${var.dayOfWeek}",
+                     ConstString("DateTimeRect *"),
+                     objc_flags);
+    AddStringSummary(coreservices_category_sp,
+                     "${var.ld.month}/${var.ld.day}/${var.ld.year} ${var.ld.hour} :${var.ld.minute} :${var.ld.second} dayOfWeek:${var.ld.dayOfWeek}",
+                     ConstString("LongDateRect"),
+                     objc_flags);
+    AddStringSummary(coreservices_category_sp,
+                     "(x=${var.x}, y=${var.y})",
+                     ConstString("HIPoint"),
+                     objc_flags);
+    AddStringSummary(coreservices_category_sp,
+                     "origin=${var.origin} size=${var.size}",
+                     ConstString("HIRect"),
+                     objc_flags);
     
     TypeCategoryImpl::SharedPointer appkit_category_sp = GetCategory(m_appkit_category_name);
     
@@ -1128,6 +1130,8 @@
     AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.NSNotification.NSNotification_SummaryProvider", ConstString("NSNotification"), appkit_flags);
     AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.NSNotification.NSNotification_SummaryProvider", ConstString("NSConcreteNotification"), appkit_flags);
 
+    AddStringSummary(appkit_category_sp, "domain: ${var._domain} - code: ${var._code}", ConstString("NSError"), appkit_flags);
+    
     AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSNumberSummaryProvider, "NSNumber summary provider", ConstString("NSNumber"), appkit_flags);
     AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSNumberSummaryProvider, "NSNumber summary provider", ConstString("__NSCFBoolean"), appkit_flags);
     AddCXXSummary(appkit_category_sp, lldb_private::formatters::NSNumberSummaryProvider, "NSNumber summary provider", ConstString("__NSCFNumber"), appkit_flags);
@@ -1168,7 +1172,10 @@
     AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.NSIndexSet.NSIndexSet_SummaryProvider", ConstString("NSIndexSet"), appkit_flags);
     AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.NSIndexSet.NSIndexSet_SummaryProvider", ConstString("NSMutableIndexSet"), appkit_flags);
 
-    AddSummary(appkit_category_sp, "@\"${var.month%d}/${var.day%d}/${var.year%d} ${var.hour%d}:${var.minute%d}:${var.second}\"", ConstString("CFGregorianDate"), appkit_flags);
+    AddStringSummary(appkit_category_sp,
+                     "@\"${var.month%d}/${var.day%d}/${var.year%d} ${var.hour%d}:${var.minute%d}:${var.second}\"",
+                     ConstString("CFGregorianDate"),
+                     appkit_flags);
     
     AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.CFBitVector.CFBitVector_SummaryProvider", ConstString("CFBitVectorRef"), appkit_flags);
     AddScriptSummary(appkit_category_sp, "lldb.formatters.objc.CFBitVector.CFBitVector_SummaryProvider", ConstString("CFMutableBitVectorRef"), appkit_flags);
@@ -1187,61 +1194,61 @@
     .SetShowMembersOneLiner(true)
     .SetHideItemNames(true);
     
-    AddSummary(vectors_category_sp,
-               "${var.uint128}",
-               ConstString("builtin_type_vec128"),
-               objc_flags);
-
-    AddSummary(vectors_category_sp,
-               "",
-               ConstString("float [4]"),
-               vector_flags);
-    AddSummary(vectors_category_sp,
-               "",
-               ConstString("int32_t [4]"),
-               vector_flags);
-    AddSummary(vectors_category_sp,
-               "",
-               ConstString("int16_t [8]"),
-               vector_flags);
-    AddSummary(vectors_category_sp,
-               "",
-               ConstString("vDouble"),
-               vector_flags);
-    AddSummary(vectors_category_sp,
-               "",
-               ConstString("vFloat"),
-               vector_flags);
-    AddSummary(vectors_category_sp,
-               "",
-               ConstString("vSInt8"),
-               vector_flags);
-    AddSummary(vectors_category_sp,
-               "",
-               ConstString("vSInt16"),
-               vector_flags);
-    AddSummary(vectors_category_sp,
-               "",
-               ConstString("vSInt32"),
-               vector_flags);
-    AddSummary(vectors_category_sp,
-               "",
-               ConstString("vUInt16"),
-               vector_flags);
-    AddSummary(vectors_category_sp,
-               "",
-               ConstString("vUInt8"),
-               vector_flags);
-    AddSummary(vectors_category_sp,
-               "",
-               ConstString("vUInt16"),
-               vector_flags);
-    AddSummary(vectors_category_sp,
-               "",
-               ConstString("vUInt32"),
-               vector_flags);
-    AddSummary(vectors_category_sp,
-               "",
-               ConstString("vBool32"),
-               vector_flags);
+    AddStringSummary(vectors_category_sp,
+                     "${var.uint128}",
+                     ConstString("builtin_type_vec128"),
+                     objc_flags);
+
+    AddStringSummary(vectors_category_sp,
+                     "",
+                     ConstString("float [4]"),
+                     vector_flags);
+    AddStringSummary(vectors_category_sp,
+                     "",
+                     ConstString("int32_t [4]"),
+                     vector_flags);
+    AddStringSummary(vectors_category_sp,
+                     "",
+                     ConstString("int16_t [8]"),
+                     vector_flags);
+    AddStringSummary(vectors_category_sp,
+                     "",
+                     ConstString("vDouble"),
+                     vector_flags);
+    AddStringSummary(vectors_category_sp,
+                     "",
+                     ConstString("vFloat"),
+                     vector_flags);
+    AddStringSummary(vectors_category_sp,
+                     "",
+                     ConstString("vSInt8"),
+                     vector_flags);
+    AddStringSummary(vectors_category_sp,
+                     "",
+                     ConstString("vSInt16"),
+                     vector_flags);
+    AddStringSummary(vectors_category_sp,
+                     "",
+                     ConstString("vSInt32"),
+                     vector_flags);
+    AddStringSummary(vectors_category_sp,
+                     "",
+                     ConstString("vUInt16"),
+                     vector_flags);
+    AddStringSummary(vectors_category_sp,
+                     "",
+                     ConstString("vUInt8"),
+                     vector_flags);
+    AddStringSummary(vectors_category_sp,
+                     "",
+                     ConstString("vUInt16"),
+                     vector_flags);
+    AddStringSummary(vectors_category_sp,
+                     "",
+                     ConstString("vUInt32"),
+                     vector_flags);
+    AddStringSummary(vectors_category_sp,
+                     "",
+                     ConstString("vBool32"),
+                     vector_flags);
 }

Modified: lldb/branches/windows/source/Core/History.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Core/History.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Core/History.cpp (original)
+++ lldb/branches/windows/source/Core/History.cpp Tue Jan  8 06:51:53 2013
@@ -10,6 +10,9 @@
 #include "lldb/Core/History.h"
 
 // C Includes
+#ifndef _WIN32
+#include <inttypes.h>
+#endif
 // C++ Includes
 // Other libraries and framework includes
 // Project includes
@@ -21,5 +24,9 @@
 void
 HistorySourceUInt::DumpHistoryEvent (Stream &strm, HistoryEvent event)
 {
+#if _WIN32
     strm.Printf ("%s %llu", m_name.c_str(), (uint64_t)((uintptr_t)event));
+#else
+    strm.Printf ("%s %" PRIu64, m_name.c_str(), (uint64_t)((uintptr_t)event));
+#endif
 }

Modified: lldb/branches/windows/source/Core/InputReader.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Core/InputReader.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Core/InputReader.cpp (original)
+++ lldb/branches/windows/source/Core/InputReader.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include <string>
 
 #include "lldb/Core/InputReader.h"

Modified: lldb/branches/windows/source/Core/Log.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Core/Log.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Core/Log.cpp (original)
+++ lldb/branches/windows/source/Core/Log.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 // C Includes
 #include <stdio.h>
 #include <stdarg.h>
@@ -108,12 +110,12 @@
         if (m_options.Test (LLDB_LOG_OPTION_PREPEND_TIMESTAMP))
         {
             struct timeval tv = TimeValue::Now().GetAsTimeVal();
-            header.Printf ("%9ld.%6.6d ", tv.tv_sec, tv.tv_usec);
+            header.Printf ("%9ld.%6.6d ", tv.tv_sec, (int32_t)tv.tv_usec);
         }
 
         // Add the process and thread if requested
         if (m_options.Test (LLDB_LOG_OPTION_PREPEND_PROC_AND_THREAD))
-            header.Printf ("[%4.4x/%4.4llx]: ", getpid(), Host::GetCurrentThreadID());
+            header.Printf ("[%4.4x/%4.4" PRIx64 "]: ", getpid(), Host::GetCurrentThreadID());
 
         // Add the process and thread if requested
         if (m_options.Test (LLDB_LOG_OPTION_PREPEND_THREAD_NAME))

Modified: lldb/branches/windows/source/Core/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Core/Makefile?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Core/Makefile (original)
+++ lldb/branches/windows/source/Core/Makefile Tue Jan  8 06:51:53 2013
@@ -11,4 +11,15 @@
 LIBRARYNAME := lldbCore
 BUILD_ARCHIVE = 1
 
+# Enable RTTI on GCC builds because one source file in this directory
+# (cxa_demangle.cpp) uses dynamic_cast<> and GCC (at least 4.6 and 4.7)
+# complain if we try to compile it with -fno-rtti. This is somewhat of a
+# kludge because it forces us to enable RTTI in liblldbUtility.a and also
+# link in additional clang static libraries to resolve vtable references,
+# but actually has negligible impact on (shard object) file size.
+$(info shell basename CXX is $(shell basename $(CXX)))
+ifeq (g++,$(shell basename $(CXX)))
+  REQUIRES_RTTI = 1
+endif
+
 include $(LLDB_LEVEL)/Makefile

Modified: lldb/branches/windows/source/Core/Module.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Core/Module.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Core/Module.cpp (original)
+++ lldb/branches/windows/source/Core/Module.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/Core/Error.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Core/DataBuffer.h"
@@ -103,7 +105,7 @@
         Mutex::Locker locker (Module::GetAllocationModuleCollectionMutex());
         ModuleCollection &modules = GetModuleCollection();
         const size_t count = modules.size();
-        printf ("%s: %llu modules:\n", __PRETTY_FUNCTION__, (uint64_t)count);
+        printf ("%s: %" PRIu64 " modules:\n", __PRETTY_FUNCTION__, (uint64_t)count);
         for (size_t i=0; i<count; ++i)
         {
             
@@ -263,7 +265,7 @@
                 if (m_objfile_sp)
                 {
                     StreamString s;
-                    s.Printf("0x%16.16llx", header_addr);
+                    s.Printf("0x%16.16" PRIx64, header_addr);
                     m_object_name.SetCString (s.GetData());
 
                     // Once we get the object file, update our module with the object file's
@@ -429,7 +431,7 @@
 Module::ResolveFileAddress (lldb::addr_t vm_addr, Address& so_addr)
 {
     Mutex::Locker locker (m_mutex);
-    Timer scoped_timer(__PRETTY_FUNCTION__, "Module::ResolveFileAddress (vm_addr = 0x%llx)", vm_addr);
+    Timer scoped_timer(__PRETTY_FUNCTION__, "Module::ResolveFileAddress (vm_addr = 0x%" PRIx64 ")", vm_addr);
     ObjectFile* ofile = GetObjectFile();
     if (ofile)
         return so_addr.ResolveAddressUsingFileSections(vm_addr, ofile->GetSectionList());
@@ -688,6 +690,19 @@
     return FindTypes_Impl(sc, type_name, namespace_decl, append, max_matches, type_list);
 }
 
+lldb::TypeSP
+Module::FindFirstType (const SymbolContext& sc,
+                       const ConstString &name,
+                       bool exact_match)
+{
+    TypeList type_list;
+    const uint32_t num_matches = FindTypes (sc, name, exact_match, 1, type_list);
+    if (num_matches)
+        return type_list.GetTypeAtIndex(0);
+    return TypeSP();
+}
+
+
 uint32_t
 Module::FindTypes (const SymbolContext& sc,
                    const ConstString &name,
@@ -753,7 +768,7 @@
 //}
 
 SymbolVendor*
-Module::GetSymbolVendor (bool can_create)
+Module::GetSymbolVendor (bool can_create, lldb_private::Stream *feedback_strm)
 {
     Mutex::Locker locker (m_mutex);
     if (m_did_load_symbol_vendor == false && can_create)
@@ -762,7 +777,7 @@
         if (obj_file != NULL)
         {
             Timer scoped_timer(__PRETTY_FUNCTION__, __PRETTY_FUNCTION__);
-            m_symfile_ap.reset(SymbolVendor::FindPlugin(shared_from_this()));
+            m_symfile_ap.reset(SymbolVendor::FindPlugin(shared_from_this(), feedback_strm));
             m_did_load_symbol_vendor = true;
         }
     }
@@ -1049,6 +1064,25 @@
 }
 
 size_t
+Module::FindFunctionSymbols (const ConstString &name,
+                             uint32_t name_type_mask,
+                             SymbolContextList& sc_list)
+{
+    Timer scoped_timer(__PRETTY_FUNCTION__,
+                       "Module::FindSymbolsFunctions (name = %s, mask = 0x%8.8x)",
+                       name.AsCString(),
+                       name_type_mask);
+    ObjectFile *objfile = GetObjectFile ();
+    if (objfile)
+    {
+        Symtab *symtab = objfile->GetSymtab();
+        if (symtab)
+            return symtab->FindFunctionSymbols (name, name_type_mask, sc_list);
+    }
+    return 0;
+}
+
+size_t
 Module::FindSymbolsWithNameAndType (const ConstString &name, SymbolType symbol_type, SymbolContextList &sc_list)
 {
     // No need to protect this call using m_mutex all other method calls are
@@ -1164,7 +1198,9 @@
         {
             StreamString scripting_stream;
             scripting_fspec.Dump(&scripting_stream);
-            bool did_load = script_interpreter->LoadScriptingModule(scripting_stream.GetData(), false, true, error);
+            const bool can_reload = false;
+            const bool init_lldb_globals = false;
+            bool did_load = script_interpreter->LoadScriptingModule(scripting_stream.GetData(), can_reload, init_lldb_globals, error);
             if (!did_load)
                 return false;
         }
@@ -1185,7 +1221,7 @@
         m_arch = new_arch;
         return true;
     }    
-    return m_arch == new_arch;
+    return m_arch.IsExactMatch(new_arch);
 }
 
 bool 
@@ -1251,7 +1287,7 @@
     const ArchSpec &arch = module_ref.GetArchitecture();
     if (arch.IsValid())
     {
-        if (m_arch != arch)
+        if (!m_arch.IsCompatibleMatch(arch))
             return false;
     }
     

Modified: lldb/branches/windows/source/Core/Opcode.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Core/Opcode.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Core/Opcode.cpp (original)
+++ lldb/branches/windows/source/Core/Opcode.cpp Tue Jan  8 06:51:53 2013
@@ -46,7 +46,7 @@
         break;
 
     case Opcode::eType64:
-        bytes_written = s->Printf ("0x%16.16llx", m_data.inst64); 
+        bytes_written = s->Printf ("0x%16.16" PRIx64, m_data.inst64);
         break;
 
     case Opcode::eTypeBytes:

Modified: lldb/branches/windows/source/Core/PluginManager.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Core/PluginManager.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Core/PluginManager.cpp (original)
+++ lldb/branches/windows/source/Core/PluginManager.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/Core/PluginManager.h"
 
 #include <limits.h>

Modified: lldb/branches/windows/source/Core/RegisterValue.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Core/RegisterValue.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Core/RegisterValue.cpp (original)
+++ lldb/branches/windows/source/Core/RegisterValue.cpp Tue Jan  8 06:51:53 2013
@@ -450,7 +450,6 @@
     const uint32_t byte_size = reg_info->byte_size;
     switch (reg_info->encoding)
     {
-        default:
         case eEncodingInvalid:
             error.SetErrorString ("Invalid encoding.");
             break;
@@ -462,7 +461,7 @@
                 if (!success)
                     error.SetErrorStringWithFormat ("'%s' is not a valid unsigned integer string value", value_str);
                 else if (!Args::UInt64ValueIsValidForByteSize (uval64, byte_size))
-                    error.SetErrorStringWithFormat ("value 0x%llx is too large to fit in a %u byte unsigned integer value", uval64, byte_size);
+                    error.SetErrorStringWithFormat ("value 0x%" PRIx64 " is too large to fit in a %u byte unsigned integer value", uval64, byte_size);
                 else
                 {
                     if (!SetUInt (uval64, reg_info->byte_size))
@@ -483,7 +482,7 @@
                 if (!success)
                     error.SetErrorStringWithFormat ("'%s' is not a valid signed integer string value", value_str);
                 else if (!Args::SInt64ValueIsValidForByteSize (sval64, byte_size))
-                    error.SetErrorStringWithFormat ("value 0x%llx is too large to fit in a %u byte signed integer value", sval64, byte_size);
+                    error.SetErrorStringWithFormat ("value 0x%" PRIx64 " is too large to fit in a %u byte signed integer value", sval64, byte_size);
                 else
                 {
                     if (!SetUInt (sval64, reg_info->byte_size))
@@ -637,7 +636,6 @@
     m_type = rhs.m_type;
     switch (m_type)
     {
-        default:
         case eTypeInvalid: 
             return false;
         case eTypeUInt8:        m_data.uint8 = rhs.m_data.uint8; break;

Modified: lldb/branches/windows/source/Core/Scalar.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Core/Scalar.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Core/Scalar.cpp (original)
+++ lldb/branches/windows/source/Core/Scalar.cpp Tue Jan  8 06:51:53 2013
@@ -10,6 +10,9 @@
 #include "lldb/Core/Scalar.h"
 
 #include <math.h>
+#ifndef _WIN32
+#include <inttypes.h>
+#endif
 
 #include "lldb/Interpreter/Args.h"
 #include "lldb/Core/Error.h"
@@ -168,7 +171,6 @@
 {
     switch (m_type)
     {
-    default:
     case e_void:
         break;
     case e_sint:        return sizeof(m_data.sint);
@@ -189,7 +191,6 @@
 {
     switch (m_type)
     {
-    default:
     case e_void:
         break;
     case e_sint:        return m_data.sint == 0;
@@ -214,7 +215,6 @@
     switch (m_type)
     {
     case e_void:
-    default:
         break;
     case e_sint:        s->Printf("%i", m_data.sint);               break;
     case e_uint:        s->Printf("0x%8.8x", m_data.uint);          break;
@@ -233,8 +233,6 @@
 {
     switch (m_type)
     {
-    default:
-        break;
     case e_void:        return "void";
     case e_sint:        return "int";
     case e_uint:        return "unsigned int";
@@ -357,7 +355,6 @@
     case e_sint:
         switch (type)
         {
-        default:
         case e_void:        break;
         case e_sint:        success = true; break;
         case e_uint:        m_data.uint         = m_data.sint;      success = true; break;
@@ -374,7 +371,6 @@
     case e_uint:
         switch (type)
         {
-        default:
         case e_void:
         case e_sint:        break;
         case e_uint:        success = true; break;
@@ -391,7 +387,6 @@
     case e_slong:
         switch (type)
         {
-        default:
         case e_void:
         case e_sint:
         case e_uint:        break;
@@ -408,7 +403,6 @@
     case e_ulong:
         switch (type)
         {
-        default:
         case e_void:
         case e_sint:
         case e_uint:
@@ -425,7 +419,6 @@
     case e_slonglong:
         switch (type)
         {
-        default:
         case e_void:
         case e_sint:
         case e_uint:
@@ -442,7 +435,6 @@
     case e_ulonglong:
         switch (type)
         {
-        default:
         case e_void:
         case e_sint:
         case e_uint:
@@ -459,7 +451,6 @@
     case e_float:
         switch (type)
         {
-        default:
         case e_void:
         case e_sint:
         case e_uint:
@@ -476,7 +467,6 @@
     case e_double:
         switch (type)
         {
-        default:
         case e_void:
         case e_sint:
         case e_uint:
@@ -493,7 +483,6 @@
     case e_long_double:
         switch (type)
         {
-        default:
         case e_void:
         case e_sint:
         case e_uint:
@@ -518,7 +507,6 @@
 {
     switch (type)
     {
-    default:            break;
     case e_void:        return "void";
     case e_sint:        return "int";
     case e_uint:        return "unsigned int";
@@ -582,7 +570,6 @@
     case e_sint:
         switch (type)
         {
-        default:
         case e_void:        break;
         case e_sint:        success = true; break;
         case e_uint:        m_data.uint         = m_data.sint;      success = true; break;
@@ -599,7 +586,6 @@
     case e_uint:
         switch (type)
         {
-        default:
         case e_void:
         case e_sint:        m_data.sint         = m_data.uint;      success = true; break;
         case e_uint:        success = true; break;
@@ -616,7 +602,6 @@
     case e_slong:
         switch (type)
         {
-        default:
         case e_void:
         case e_sint:        m_data.sint         = m_data.slong;     success = true; break;
         case e_uint:        m_data.uint         = m_data.slong;     success = true; break;
@@ -633,7 +618,6 @@
     case e_ulong:
         switch (type)
         {
-        default:
         case e_void:
         case e_sint:        m_data.sint         = m_data.ulong;     success = true; break;
         case e_uint:        m_data.uint         = m_data.ulong;     success = true; break;
@@ -650,7 +634,6 @@
     case e_slonglong:
         switch (type)
         {
-        default:
         case e_void:
         case e_sint:        m_data.sint         = m_data.slonglong;     success = true; break;
         case e_uint:        m_data.uint         = m_data.slonglong;     success = true; break;
@@ -667,7 +650,6 @@
     case e_ulonglong:
         switch (type)
         {
-        default:
         case e_void:
         case e_sint:        m_data.sint         = m_data.ulonglong;     success = true; break;
         case e_uint:        m_data.uint         = m_data.ulonglong;     success = true; break;
@@ -684,7 +666,6 @@
     case e_float:
         switch (type)
         {
-        default:
         case e_void:
         case e_sint:        m_data.sint         = m_data.flt;       success = true; break;
         case e_uint:        m_data.uint         = m_data.flt;       success = true; break;
@@ -701,7 +682,6 @@
     case e_double:
         switch (type)
         {
-        default:
         case e_void:
         case e_sint:        m_data.sint         = m_data.dbl;       success = true; break;
         case e_uint:        m_data.uint         = m_data.dbl;       success = true; break;
@@ -718,7 +698,6 @@
     case e_long_double:
         switch (type)
         {
-        default:
         case e_void:
         case e_sint:        m_data.sint         = m_data.ldbl;      success = true; break;
         case e_uint:        m_data.uint         = m_data.ldbl;      success = true; break;
@@ -743,7 +722,6 @@
 {
     switch (m_type)
     {
-    default:
     case e_void:        break;
     case e_sint:        return m_data.sint;
     case e_uint:        return (int)m_data.uint;
@@ -763,7 +741,6 @@
 {
     switch (m_type)
     {
-    default:
     case e_void:        break;
     case e_sint:        return (unsigned int)m_data.sint;
     case e_uint:        return (unsigned int)m_data.uint;
@@ -784,7 +761,6 @@
 {
     switch (m_type)
     {
-    default:
     case e_void:        break;
     case e_sint:        return (long)m_data.sint;
     case e_uint:        return (long)m_data.uint;
@@ -806,7 +782,6 @@
 {
     switch (m_type)
     {
-    default:
     case e_void:        break;
     case e_sint:        return (unsigned long)m_data.sint;
     case e_uint:        return (unsigned long)m_data.uint;
@@ -826,7 +801,6 @@
 {
     switch (m_type)
     {
-    default:
     case e_void:
         break;
 
@@ -879,7 +853,6 @@
 {
     switch (m_type)
     {
-    default:
     case e_void:        break;
     case e_sint:        return (long long)m_data.sint;
     case e_uint:        return (long long)m_data.uint;
@@ -900,7 +873,6 @@
 {
     switch (m_type)
     {
-    default:
     case e_void:        break;
     case e_sint:        return (unsigned long long)m_data.sint;
     case e_uint:        return (unsigned long long)m_data.uint;
@@ -921,7 +893,6 @@
 {
     switch (m_type)
     {
-    default:
     case e_void:        break;
     case e_sint:        return (float)m_data.sint;
     case e_uint:        return (float)m_data.uint;
@@ -942,7 +913,6 @@
 {
     switch (m_type)
     {
-    default:
     case e_void:        break;
     case e_sint:        return (double)m_data.sint;
     case e_uint:        return (double)m_data.uint;
@@ -963,7 +933,6 @@
 {
     switch (m_type)
     {
-    default:
     case e_void:        break;
     case e_sint:        return (long double)m_data.sint;
     case e_uint:        return (long double)m_data.uint;
@@ -989,7 +958,6 @@
     {
         switch (m_type)
         {
-        default:
         case e_void:        break;
         case e_sint:        m_data.sint         = a->m_data.sint        + b->m_data.sint;       break;
         case e_uint:        m_data.uint         = a->m_data.uint        + b->m_data.uint;       break;
@@ -1010,7 +978,6 @@
 {
     switch (m_type)
     {
-    default:
     case e_void:
     case e_float:
     case e_double:
@@ -1021,7 +988,6 @@
     case e_sint:
         switch (rhs.m_type)
         {
-        default:
         case e_void:
         case e_float:
         case e_double:
@@ -1040,7 +1006,6 @@
     case e_uint:
         switch (rhs.m_type)
         {
-        default:
         case e_void:
         case e_float:
         case e_double:
@@ -1059,7 +1024,6 @@
     case e_slong:
         switch (rhs.m_type)
         {
-        default:
         case e_void:
         case e_float:
         case e_double:
@@ -1078,7 +1042,6 @@
     case e_ulong:
         switch (rhs.m_type)
         {
-        default:
         case e_void:
         case e_float:
         case e_double:
@@ -1096,7 +1059,6 @@
     case e_slonglong:
         switch (rhs.m_type)
         {
-        default:
         case e_void:
         case e_float:
         case e_double:
@@ -1115,7 +1077,6 @@
     case e_ulonglong:
         switch (rhs.m_type)
         {
-        default:
         case e_void:
         case e_float:
         case e_double:
@@ -1139,7 +1100,6 @@
 {
     switch (m_type)
     {
-    default:
     case e_void:
     case e_float:
     case e_double:
@@ -1151,7 +1111,6 @@
     case e_uint:
         switch (rhs.m_type)
         {
-        default:
         case e_void:
         case e_float:
         case e_double:
@@ -1171,7 +1130,6 @@
     case e_ulong:
         switch (rhs.m_type)
         {
-        default:
         case e_void:
         case e_float:
         case e_double:
@@ -1191,7 +1149,6 @@
     case e_ulonglong:
         switch (rhs.m_type)
         {
-        default:
         case e_void:
         case e_float:
         case e_double:
@@ -1216,7 +1173,6 @@
 {
     switch (m_type)
     {
-    default:
     case e_void:
     case e_float:
     case e_double:
@@ -1227,7 +1183,6 @@
     case e_sint:
         switch (rhs.m_type)
         {
-        default:
         case e_void:
         case e_float:
         case e_double:
@@ -1246,7 +1201,6 @@
     case e_uint:
         switch (rhs.m_type)
         {
-        default:
         case e_void:
         case e_float:
         case e_double:
@@ -1265,7 +1219,6 @@
     case e_slong:
         switch (rhs.m_type)
         {
-        default:
         case e_void:
         case e_float:
         case e_double:
@@ -1284,7 +1237,6 @@
     case e_ulong:
         switch (rhs.m_type)
         {
-        default:
         case e_void:
         case e_float:
         case e_double:
@@ -1302,7 +1254,6 @@
     case e_slonglong:
         switch (rhs.m_type)
         {
-        default:
         case e_void:
         case e_float:
         case e_double:
@@ -1321,7 +1272,6 @@
     case e_ulonglong:
         switch (rhs.m_type)
         {
-        default:
         case e_void:
         case e_float:
         case e_double:
@@ -1346,7 +1296,6 @@
 {
     switch (m_type)
     {
-    default:
     case e_void:
     case e_float:
     case e_double:
@@ -1357,7 +1306,6 @@
     case e_sint:
         switch (rhs.m_type)
         {
-        default:
         case e_void:
         case e_float:
         case e_double:
@@ -1376,7 +1324,6 @@
     case e_uint:
         switch (rhs.m_type)
         {
-        default:
         case e_void:
         case e_float:
         case e_double:
@@ -1395,7 +1342,6 @@
     case e_slong:
         switch (rhs.m_type)
         {
-        default:
         case e_void:
         case e_float:
         case e_double:
@@ -1414,7 +1360,6 @@
     case e_ulong:
         switch (rhs.m_type)
         {
-        default:
         case e_void:
         case e_float:
         case e_double:
@@ -1432,7 +1377,6 @@
     case e_slonglong:
         switch (rhs.m_type)
         {
-        default:
         case e_void:
         case e_float:
         case e_double:
@@ -1451,7 +1395,6 @@
     case e_ulonglong:
         switch (rhs.m_type)
         {
-        default:
         case e_void:
         case e_float:
         case e_double:
@@ -1477,7 +1420,6 @@
 {
     switch (m_type)
     {
-    default:
     case e_void:
         break;
 
@@ -1512,7 +1454,6 @@
 {
     switch (m_type)
     {
-    default:
     case e_void:        break;
     case e_sint:        m_data.sint = -m_data.sint;             return true;
     case e_uint:        m_data.uint = -m_data.uint;             return true;
@@ -1539,7 +1480,6 @@
     case e_slonglong:   m_data.slonglong = ~m_data.slonglong; return true;
     case e_ulonglong:   m_data.ulonglong = ~m_data.ulonglong; return true;
 
-    default:
     case e_void:
     case e_float:
     case e_double:
@@ -1561,7 +1501,6 @@
     {
         switch (result.m_type)
         {
-        default:
         case Scalar::e_void:            break;
         case Scalar::e_sint:            result.m_data.sint      = a->m_data.sint        + b->m_data.sint;       break;
         case Scalar::e_uint:            result.m_data.uint      = a->m_data.uint        + b->m_data.uint;       break;
@@ -1589,7 +1528,6 @@
     {
         switch (result.m_type)
         {
-        default:
         case Scalar::e_void:            break;
         case Scalar::e_sint:            result.m_data.sint      = a->m_data.sint        - b->m_data.sint;       break;
         case Scalar::e_uint:            result.m_data.uint      = a->m_data.uint        - b->m_data.uint;       break;
@@ -1616,7 +1554,6 @@
     {
         switch (result.m_type)
         {
-        default:
         case Scalar::e_void:            break;
 
         case Scalar::e_sint:            if (b->m_data.sint != 0)        { result.m_data.sint = a->m_data.sint/ b->m_data.sint; return result; } break;
@@ -1647,7 +1584,6 @@
     {
         switch (result.m_type)
         {
-        default:
         case Scalar::e_void:            break;
         case Scalar::e_sint:            result.m_data.sint      = a->m_data.sint        * b->m_data.sint;       break;
         case Scalar::e_uint:            result.m_data.uint      = a->m_data.uint        * b->m_data.uint;       break;
@@ -1681,7 +1617,6 @@
         case Scalar::e_slonglong:   result.m_data.slonglong = a->m_data.slonglong   & b->m_data.slonglong;  break;
         case Scalar::e_ulonglong:   result.m_data.ulonglong = a->m_data.ulonglong   & b->m_data.ulonglong;  break;
 
-        default:
         case Scalar::e_void:
         case Scalar::e_float:
         case Scalar::e_double:
@@ -1712,7 +1647,6 @@
         case Scalar::e_slonglong:   result.m_data.slonglong = a->m_data.slonglong   | b->m_data.slonglong;  break;
         case Scalar::e_ulonglong:   result.m_data.ulonglong = a->m_data.ulonglong   | b->m_data.ulonglong;  break;
 
-        default:
         case Scalar::e_void:
         case Scalar::e_float:
         case Scalar::e_double:
@@ -1743,7 +1677,6 @@
         case Scalar::e_slonglong:   result.m_data.slonglong = a->m_data.slonglong   % b->m_data.slonglong;  break;
         case Scalar::e_ulonglong:   result.m_data.ulonglong = a->m_data.ulonglong   % b->m_data.ulonglong;  break;
 
-        default:
         case Scalar::e_void:
         case Scalar::e_float:
         case Scalar::e_double:
@@ -1774,7 +1707,6 @@
         case Scalar::e_slonglong:   result.m_data.slonglong = a->m_data.slonglong   ^ b->m_data.slonglong;  break;
         case Scalar::e_ulonglong:   result.m_data.ulonglong = a->m_data.ulonglong   ^ b->m_data.ulonglong;  break;
 
-        default:
         case Scalar::e_void:
         case Scalar::e_float:
         case Scalar::e_double:
@@ -1821,7 +1753,6 @@
     bool success = false;
     switch (encoding)
     {
-    default:
     case eEncodingInvalid:
         error.SetErrorString ("Invalid encoding.");
         break;
@@ -1833,7 +1764,11 @@
             if (!success)
                 error.SetErrorStringWithFormat ("'%s' is not a valid unsigned integer string value", value_str);
             else if (!UIntValueIsValidForSize (uval64, byte_size))
-                error.SetErrorStringWithFormat ("value 0x%llx is too large to fit in a %u byte unsigned integer value", uval64, byte_size);
+#ifdef _WIN32
+                error.SetErrorStringWithFormat ("value 0x%llu is too large to fit in a %u byte unsigned integer value", uval64, byte_size);
+#else
+                error.SetErrorStringWithFormat ("value 0x%" PRIx64 " is too large to fit in a %u byte unsigned integer value", uval64, byte_size);
+#endif
             else
             {
                 m_type = Scalar::GetValueTypeForUnsignedIntegerWithByteSize (byte_size);
@@ -1862,7 +1797,11 @@
             if (!success)
                 error.SetErrorStringWithFormat ("'%s' is not a valid signed integer string value", value_str);
             else if (!SIntValueIsValidForSize (sval64, byte_size))
-                error.SetErrorStringWithFormat ("value 0x%llx is too large to fit in a %u byte signed integer value", sval64, byte_size);
+#ifdef _WIN32
+                error.SetErrorStringWithFormat ("value 0x%llu is too large to fit in a %u byte signed integer value", sval64, byte_size);
+#else
+                error.SetErrorStringWithFormat ("value 0x%" PRIx64 " is too large to fit in a %u byte signed integer value", sval64, byte_size);
+#endif
             else
             {
                 m_type = Scalar::GetValueTypeForSignedIntegerWithByteSize (byte_size);
@@ -1932,7 +1871,6 @@
     {
         switch (m_type)
         {
-        default:
         case Scalar::e_void:
         case Scalar::e_float:
         case Scalar::e_double:
@@ -2042,7 +1980,6 @@
     uint32_t lsbit = bit_offset;
     switch (m_type)
     {
-        default:
         case Scalar::e_void:
             break;
             
@@ -2122,7 +2059,6 @@
     const Scalar* b;
     switch (PromoteToMaxType(lhs, rhs, temp_value, a, b))
     {
-    default:
     case Scalar::e_void:            break;
     case Scalar::e_sint:            return a->m_data.sint       == b->m_data.sint;
     case Scalar::e_uint:            return a->m_data.uint       == b->m_data.uint;
@@ -2149,7 +2085,6 @@
     const Scalar* b;
     switch (PromoteToMaxType(lhs, rhs, temp_value, a, b))
     {
-    default:
     case Scalar::e_void:            break;
     case Scalar::e_sint:            return a->m_data.sint       != b->m_data.sint;
     case Scalar::e_uint:            return a->m_data.uint       != b->m_data.uint;
@@ -2175,7 +2110,6 @@
     const Scalar* b;
     switch (PromoteToMaxType(lhs, rhs, temp_value, a, b))
     {
-    default:
     case Scalar::e_void:            break;
     case Scalar::e_sint:            return a->m_data.sint       < b->m_data.sint;
     case Scalar::e_uint:            return a->m_data.uint       < b->m_data.uint;
@@ -2201,7 +2135,6 @@
     const Scalar* b;
     switch (PromoteToMaxType(lhs, rhs, temp_value, a, b))
     {
-    default:
     case Scalar::e_void:            break;
     case Scalar::e_sint:            return a->m_data.sint       <= b->m_data.sint;
     case Scalar::e_uint:            return a->m_data.uint       <= b->m_data.uint;
@@ -2228,7 +2161,6 @@
     const Scalar* b;
     switch (PromoteToMaxType(lhs, rhs, temp_value, a, b))
     {
-    default:
     case Scalar::e_void:            break;
     case Scalar::e_sint:            return a->m_data.sint       > b->m_data.sint;
     case Scalar::e_uint:            return a->m_data.uint       > b->m_data.uint;
@@ -2254,7 +2186,6 @@
     const Scalar* b;
     switch (PromoteToMaxType(lhs, rhs, temp_value, a, b))
     {
-    default:
     case Scalar::e_void:            break;
     case Scalar::e_sint:            return a->m_data.sint       >= b->m_data.sint;
     case Scalar::e_uint:            return a->m_data.uint       >= b->m_data.uint;

Modified: lldb/branches/windows/source/Core/Section.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Core/Section.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Core/Section.cpp (original)
+++ lldb/branches/windows/source/Core/Section.cpp Tue Jan  8 06:51:53 2013
@@ -41,7 +41,7 @@
     m_linked_section_wp(),
     m_linked_offset (0)
 {
-//    printf ("Section::Section(%p): module=%p, sect_id = 0x%16.16llx, addr=[0x%16.16llx - 0x%16.16llx), file [0x%16.16llx - 0x%16.16llx), flags = 0x%8.8x, name = %s\n",
+//    printf ("Section::Section(%p): module=%p, sect_id = 0x%16.16" PRIx64 ", addr=[0x%16.16" PRIx64 " - 0x%16.16" PRIx64 "), file [0x%16.16" PRIx64 " - 0x%16.16" PRIx64 "), flags = 0x%8.8x, name = %s\n",
 //            this, module_sp.get(), sect_id, file_addr, file_addr + byte_size, file_offset, file_offset + file_size, flags, name.GetCString());
 }
 
@@ -72,7 +72,7 @@
     m_linked_section_wp(),
     m_linked_offset (0)
 {
-//    printf ("Section::Section(%p): module=%p, sect_id = 0x%16.16llx, addr=[0x%16.16llx - 0x%16.16llx), file [0x%16.16llx - 0x%16.16llx), flags = 0x%8.8x, name = %s.%s\n",
+//    printf ("Section::Section(%p): module=%p, sect_id = 0x%16.16" PRIx64 ", addr=[0x%16.16" PRIx64 " - 0x%16.16" PRIx64 "), file [0x%16.16" PRIx64 " - 0x%16.16" PRIx64 "), flags = 0x%8.8x, name = %s.%s\n",
 //            this, module_sp.get(), sect_id, file_addr, file_addr + byte_size, file_offset, file_offset + file_size, flags, parent_section_sp->GetName().GetCString(), name.GetCString());
     if (parent_section_sp)
         m_parent_wp = parent_section_sp;
@@ -257,7 +257,7 @@
 {
 //    s->Printf("%.*p: ", (int)sizeof(void*) * 2, this);
     s->Indent();
-    s->Printf("0x%8.8llx %-16s ", GetID(), GetSectionTypeAsCString (m_type));
+    s->Printf("0x%8.8" PRIx64 " %-16s ", GetID(), GetSectionTypeAsCString (m_type));
     bool resolved = true;
     addr_t addr = LLDB_INVALID_ADDRESS;
 
@@ -280,7 +280,7 @@
         range.Dump (s, 0);
     }
 
-    s->Printf("%c 0x%8.8llx 0x%8.8llx 0x%8.8x ", resolved ? ' ' : '*', m_file_offset, m_file_size, Get());
+    s->Printf("%c 0x%8.8" PRIx64 " 0x%8.8" PRIx64 " 0x%8.8x ", resolved ? ' ' : '*', m_file_offset, m_file_size, Get());
 
     DumpName (s);
 
@@ -312,7 +312,7 @@
         s->Printf("%c%*.*s", resolved ? ' ' : '*', indent, indent, "");
 
         linked_section_sp->DumpName(s);
-        s->Printf(" + 0x%llx\n", m_linked_offset);
+        s->Printf(" + 0x%" PRIx64 "\n", m_linked_offset);
     }
 
     if (depth > 0)

Modified: lldb/branches/windows/source/Core/SourceManager.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Core/SourceManager.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Core/SourceManager.cpp (original)
+++ lldb/branches/windows/source/Core/SourceManager.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/Core/SourceManager.h"
 
 // C Includes

Modified: lldb/branches/windows/source/Core/State.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Core/State.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Core/State.cpp (original)
+++ lldb/branches/windows/source/Core/State.cpp Tue Jan  8 06:51:53 2013
@@ -83,7 +83,6 @@
     case eStateCrashed:
     case eStateExited:
     case eStateSuspended:
-    default:
         break;
     }
     return false;
@@ -101,7 +100,6 @@
     case eStateRunning:
     case eStateStepping:
     case eStateDetached:
-    default:
         break;
 
     case eStateUnloaded:

Modified: lldb/branches/windows/source/Core/Stream.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Core/Stream.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Core/Stream.cpp (original)
+++ lldb/branches/windows/source/Core/Stream.cpp Tue Jan  8 06:51:53 2013
@@ -14,6 +14,10 @@
 #include <string.h>
 #include <stdlib.h>
 
+#ifndef _WIN32
+#include <inttypes.h>
+#endif
+
 using namespace lldb;
 using namespace lldb_private;
 
@@ -85,7 +89,11 @@
     }
     else
     {
-        bytes_written = Printf ("0x%lli", sval);
+#ifdef _WIN32
+        bytes_written = Printf ("0x%llu", sval);
+#else
+        bytes_written = Printf ("0x%" PRIi64, sval);
+#endif
     }
 
     return bytes_written;
@@ -117,7 +125,11 @@
     }
     else
     {
-        bytes_written = Printf ("0x%llx", uval);
+#ifdef _WIN32
+        bytes_written = Printf ("0x%llu", uval);
+#else
+        bytes_written = Printf ("0x%" PRIi64, uval);
+#endif
     }
     return bytes_written;
 }
@@ -157,8 +169,12 @@
     if (suffix == NULL)
         suffix = "";
 //    int addr_width = m_addr_size << 1;
-//    Printf ("%s0x%0*llx%s", prefix, addr_width, addr, suffix);
-    Printf ("%s0x%0*llx%s", prefix, addr_size * 2, (uint64_t)addr, suffix);
+//    Printf ("%s0x%0*" PRIx64 "%s", prefix, addr_width, addr, suffix);
+#if _WIN32
+    Printf ("%s0x%d*%llu%s", prefix, addr_size * 2, (uint64_t)addr, suffix);
+#else
+    Printf ("%s0x%0*" PRIx64 "%s", prefix, addr_size * 2, (uint64_t)addr, suffix);
+#endif
 }
 
 //------------------------------------------------------------------
@@ -364,7 +380,11 @@
 Stream&
 Stream::operator<< (int64_t sval)
 {
-    Printf ("%lli", sval);
+#if _WIN32
+    Printf ("%llu", sval);
+#else
+    Printf ("%" PRIi64, sval);
+#endif
     return *this;
 }
 

Modified: lldb/branches/windows/source/Core/UserID.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Core/UserID.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Core/UserID.cpp (original)
+++ lldb/branches/windows/source/Core/UserID.cpp Tue Jan  8 06:51:53 2013
@@ -10,6 +10,10 @@
 #include "lldb/Core/UserID.h"
 #include "lldb/Core/Stream.h"
 
+#ifndef _WIN32
+#include <inttypes.h>
+#endif
+
 using namespace lldb;
 using namespace lldb_private;
 
@@ -20,6 +24,10 @@
 Stream&
 lldb_private::operator << (Stream& strm, const UserID& uid)
 {
-    strm.Printf("{0x%8.8llx}", uid.GetID());
+#ifdef _WIN32
+    strm.Printf("{0xllu}", uid.GetID());
+#else
+    strm.Printf("{0x%8.8" PRIx64 "}", uid.GetID());
+#endif
     return strm;
 }

Modified: lldb/branches/windows/source/Core/UserSettingsController.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Core/UserSettingsController.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Core/UserSettingsController.cpp (original)
+++ lldb/branches/windows/source/Core/UserSettingsController.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include <string.h>
 #include <algorithm>
 

Modified: lldb/branches/windows/source/Core/Value.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Core/Value.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Core/Value.cpp (original)
+++ lldb/branches/windows/source/Core/Value.cpp Tue Jan  8 06:51:53 2013
@@ -156,7 +156,6 @@
 {
     switch (m_context_type)
     {
-    default:
     case eContextTypeInvalid:
     case eContextTypeClangType:         // clang::Type *
     case eContextTypeRegisterInfo:      // RegisterInfo *
@@ -177,7 +176,6 @@
 
     switch (m_context_type)
     {
-    default:
     case eContextTypeInvalid:
         // If we have no context, there is no way to know how much memory to read
         if (error_ptr)
@@ -201,8 +199,7 @@
         if (GetRegisterInfo())
             byte_size = GetRegisterInfo()->byte_size;
         else if (error_ptr)
-                error_ptr->SetErrorString ("Can't determine byte size with NULL RegisterInfo *.");
-
+            error_ptr->SetErrorString ("Can't determine byte size with NULL RegisterInfo *.");
         break;
 
     case eContextTypeLLDBType:             // Type *
@@ -245,7 +242,6 @@
 {
     switch (m_context_type)
     {
-    default:
     case eContextTypeInvalid:
         break;
 
@@ -274,7 +270,6 @@
 {
     switch (m_context_type)
     {
-    default:
     case eContextTypeInvalid:
         break;
 
@@ -456,14 +451,14 @@
                         if (module)
                         {
                             if (variable)
-                                error.SetErrorStringWithFormat ("unable to resolve the module for file address 0x%llx for variable '%s' in %s%s%s", 
+                                error.SetErrorStringWithFormat ("unable to resolve the module for file address 0x%" PRIx64 " for variable '%s' in %s%s%s",
                                                                 address, 
                                                                 variable->GetName().AsCString(""),
                                                                 module->GetFileSpec().GetDirectory().GetCString(),
                                                                 module->GetFileSpec().GetDirectory() ? "/" : "",
                                                                 module->GetFileSpec().GetFilename().GetCString());
                             else
-                                error.SetErrorStringWithFormat ("unable to resolve the module for file address 0x%llx in %s%s%s", 
+                                error.SetErrorStringWithFormat ("unable to resolve the module for file address 0x%" PRIx64 " in %s%s%s",
                                                                 address, 
                                                                 module->GetFileSpec().GetDirectory().GetCString(),
                                                                 module->GetFileSpec().GetDirectory() ? "/" : "",
@@ -472,11 +467,11 @@
                         else
                         {
                             if (variable)
-                                error.SetErrorStringWithFormat ("unable to resolve the module for file address 0x%llx for variable '%s'", 
+                                error.SetErrorStringWithFormat ("unable to resolve the module for file address 0x%" PRIx64 " for variable '%s'",
                                                                 address, 
                                                                 variable->GetName().AsCString(""));
                             else
-                                error.SetErrorStringWithFormat ("unable to resolve the module for file address 0x%llx", address);
+                                error.SetErrorStringWithFormat ("unable to resolve the module for file address 0x%" PRIx64, address);
                         }
                     }
                 }
@@ -555,7 +550,7 @@
                 const bool prefer_file_cache = false;
                 if (exe_ctx->GetTargetRef().ReadMemory(file_so_addr, prefer_file_cache, dst, byte_size, error) != byte_size)
                 {
-                    error.SetErrorStringWithFormat("read memory from 0x%llx failed", (uint64_t)address);
+                    error.SetErrorStringWithFormat("read memory from 0x%" PRIx64 " failed", (uint64_t)address);
                 }
             }
             else
@@ -570,14 +565,14 @@
                 {
                     const size_t bytes_read = process->ReadMemory(address, dst, byte_size, error);
                     if (bytes_read != byte_size)
-                        error.SetErrorStringWithFormat("read memory from 0x%llx failed (%u of %u bytes read)", 
+                        error.SetErrorStringWithFormat("read memory from 0x%" PRIx64 " failed (%u of %u bytes read)",
                                                        (uint64_t)address, 
                                                        (uint32_t)bytes_read, 
                                                        (uint32_t)byte_size);
                 }
                 else
                 {
-                    error.SetErrorStringWithFormat("read memory from 0x%llx failed (invalid process)", (uint64_t)address);                    
+                    error.SetErrorStringWithFormat("read memory from 0x%" PRIx64 " failed (invalid process)", (uint64_t)address);
                 }
             }
         }

Modified: lldb/branches/windows/source/Core/ValueObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Core/ValueObject.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Core/ValueObject.cpp (original)
+++ lldb/branches/windows/source/Core/ValueObject.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/Core/ValueObject.h"
 
 // C Includes
@@ -418,9 +420,6 @@
 
             switch (m_value.GetValueType())
             {
-            default:
-                break;
-
             case Value::eValueTypeScalar:
             case Value::eValueTypeVector:
                 if (m_value.GetContextType() == Value::eContextTypeRegisterInfo)
@@ -673,7 +672,7 @@
                                                                   child_bitfield_bit_offset,
                                                                   child_is_base_class,
                                                                   child_is_deref_of_parent);
-    if (child_clang_type && child_byte_size)
+    if (child_clang_type)
     {
         if (synthetic_index)
             child_byte_offset += child_byte_size * synthetic_index;
@@ -924,7 +923,6 @@
                 }
                 break;
             case eAddressTypeInvalid:
-            default:
                 break;
         }
     }
@@ -1244,7 +1242,7 @@
     if (UpdateValueIfNeeded(true) && m_value_str.empty())
     {
         lldb::Format my_format = GetFormat();
-        if (m_format == lldb::eFormatDefault)
+        if (my_format == lldb::eFormatDefault)
         {
             if (m_type_format_sp)
                 my_format = m_type_format_sp->GetFormat();
@@ -1522,9 +1520,6 @@
             case eValueObjectRepresentationStyleType:
                 return_value = GetTypeName().AsCString();
                 break;
-                
-            default:
-                break;
         }
         
         if (!return_value)
@@ -1796,7 +1791,7 @@
 bool
 ValueObject::IsArrayType ()
 {
-    return ClangASTContext::IsArrayType (GetClangType());
+    return ClangASTContext::IsArrayType (GetClangType(), NULL, NULL, NULL);
 }
 
 bool
@@ -1828,6 +1823,15 @@
         return ClangASTContext::IsPossibleDynamicType (GetClangAST (), GetClangType(), NULL, true, true);
 }
 
+bool
+ValueObject::IsObjCNil ()
+{
+    bool isObjCpointer = ClangASTContext::IsObjCObjectPointerType(GetClangType(), NULL);
+    bool canReadValue = true;
+    bool isZero = GetValueAsUnsigned(0,&canReadValue) == 0;
+    return canReadValue && isZero && isObjCpointer;
+}
+
 ValueObjectSP
 ValueObject::GetSyntheticArrayMember (int32_t index, bool can_create)
 {
@@ -2532,7 +2536,7 @@
                     
                     if (child_valobj_sp.get()) // we know we are done, so just return
                     {
-                        *first_unparsed = '\0';
+                        *first_unparsed = "";
                         *reason_to_stop = ValueObject::eExpressionPathScanEndReasonEndOfString;
                         *final_result = ValueObject::eExpressionPathEndResultTypePlain;
                         return child_valobj_sp;
@@ -2556,7 +2560,7 @@
                     // so we hit the "else" branch, and return an error
                     if(child_valobj_sp.get()) // if it worked, just return
                     {
-                        *first_unparsed = '\0';
+                        *first_unparsed = "";
                         *reason_to_stop = ValueObject::eExpressionPathScanEndReasonEndOfString;
                         *final_result = ValueObject::eExpressionPathEndResultTypePlain;
                         return child_valobj_sp;
@@ -3313,6 +3317,8 @@
         if (options.m_omit_summary_depth > 0)
             entry = NULL;
         
+        bool is_nil = valobj->IsObjCNil();
+        
         if (err_cstr == NULL)
         {
             if (options.m_format != eFormatDefault && options.m_format != valobj->GetFormat())
@@ -3338,7 +3344,9 @@
             const bool is_ref = type_flags.Test (ClangASTContext::eTypeIsReference);
             if (print_valobj)
             {
-                if (options.m_omit_summary_depth == 0)
+                if (is_nil)
+                    sum_cstr = "nil";
+                else if (options.m_omit_summary_depth == 0)
                 {
                     if (options.m_summary_sp)
                     {
@@ -3350,14 +3358,16 @@
                 }
 
                 // Make sure we have a value and make sure the summary didn't
-                // specify that the value should not be printed
-                if (!value_str.empty() && (entry == NULL || entry->DoesPrintValue() || sum_cstr == NULL))
+                // specify that the value should not be printed - and do not print
+                // the value if this thing is nil
+                if (!is_nil && !value_str.empty() && (entry == NULL || entry->DoesPrintValue() || sum_cstr == NULL))
                     s.Printf(" %s", value_str.c_str());
 
                 if (sum_cstr)
                     s.Printf(" %s", sum_cstr);
                 
-                if (options.m_use_objc)
+                // let's avoid the overly verbose no description error for a nil thing
+                if (options.m_use_objc && !is_nil)
                 {
                     const char *object_desc = valobj->GetObjectDescription();
                     if (object_desc)
@@ -3433,7 +3443,7 @@
                         }
 
                         ValueObject::DumpValueObjectOptions child_options(options);
-                        child_options.SetFormat().SetSummary().SetRootValueObjectName();
+                        child_options.SetFormat(options.m_format).SetSummary().SetRootValueObjectName();
                         child_options.SetScopeChecked(true)
                         .SetOmitSummaryDepth(child_options.m_omit_summary_depth > 1 ? child_options.m_omit_summary_depth - 1 : 0);
                         for (uint32_t idx=0; idx<num_children; ++idx)
@@ -3672,7 +3682,6 @@
     {
         switch (address_type)
         {
-        default:
         case eAddressTypeInvalid:
             {
                 StreamString expr_path_strm;

Modified: lldb/branches/windows/source/Core/ValueObjectChild.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Core/ValueObjectChild.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Core/ValueObjectChild.cpp (original)
+++ lldb/branches/windows/source/Core/ValueObjectChild.cpp Tue Jan  8 06:51:53 2013
@@ -164,7 +164,6 @@
                             m_value.SetValueType(Value::eValueTypeHostAddress);
                             break;
                         case eAddressTypeInvalid:
-                        default:
                             // TODO: does this make sense?
                             m_value.SetValueType(Value::eValueTypeScalar);
                             break;

Modified: lldb/branches/windows/source/Core/ValueObjectConstResult.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Core/ValueObjectConstResult.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Core/ValueObjectConstResult.cpp (original)
+++ lldb/branches/windows/source/Core/ValueObjectConstResult.cpp Tue Jan  8 06:51:53 2013
@@ -219,7 +219,6 @@
     //m_value.SetValueType(Value::eValueTypeHostAddress); 
     switch (address_type)
     {
-    default:
     case eAddressTypeInvalid:   m_value.SetValueType(Value::eValueTypeScalar);      break;
     case eAddressTypeFile:      m_value.SetValueType(Value::eValueTypeFileAddress); break;
     case eAddressTypeLoad:      m_value.SetValueType(Value::eValueTypeLoadAddress); break;    

Modified: lldb/branches/windows/source/Core/ValueObjectDynamicValue.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Core/ValueObjectDynamicValue.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Core/ValueObjectDynamicValue.cpp (original)
+++ lldb/branches/windows/source/Core/ValueObjectDynamicValue.cpp Tue Jan  8 06:51:53 2013
@@ -178,6 +178,8 @@
     {
         if (m_type_sp)
             SetValueDidChange(true);
+        ClearDynamicTypeInformation();
+        m_type_sp.reset();
         m_value = m_parent->GetValue();
         m_error = m_value.GetValueAsData (&exe_ctx, GetClangAST(), m_data, 0, GetModule().get());
         return m_error.Success();

Modified: lldb/branches/windows/source/Core/ValueObjectSyntheticFilter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Core/ValueObjectSyntheticFilter.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Core/ValueObjectSyntheticFilter.cpp (original)
+++ lldb/branches/windows/source/Core/ValueObjectSyntheticFilter.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
 
 #include "lldb/Core/ValueObjectSyntheticFilter.h"
 

Modified: lldb/branches/windows/source/Core/cxa_demangle.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Core/cxa_demangle.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Core/cxa_demangle.cpp (original)
+++ lldb/branches/windows/source/Core/cxa_demangle.cpp Tue Jan  8 06:51:53 2013
@@ -134,9 +134,14 @@
     {
         for (int i = 0; i < 2*indent; ++i)
             printf(" ");
-        char* buf = (char*)malloc(x->size());
+        size_t sz = x->size();
+        char* buf = (char*)calloc(sz+10, 1);
         x->get_demangled_name(buf);
-        printf("%s %s, %p\n", typeid(*x).name(), buf, x);
+        printf("%s [%ld] %s, %p\n", typeid(*x).name(), sz, buf, x);
+        if (strlen(buf) != sz)
+        {
+            printf("strlen(buf) = %ld and size = %ld\n", strlen(buf), sz);
+        }
         free(buf);
         display(x->__left_, indent+1);
         display(x->__right_, indent+1);
@@ -3823,10 +3828,14 @@
     }
     virtual bool ends_with_template(bool parsing = false) const
     {
-        if (__right_ != NULL)
+        if (__right_ && __right_->size() > 0)
+        {
             return __right_->ends_with_template(parsing);
-        if (__left_ != NULL)
+        }
+        else if (__left_ && __left_->size() > 0)
+        {
             return __left_->ends_with_template(parsing);
+        }
         return false;
     }
     virtual bool fix_forward_references(__node** t_begin, __node** t_end)
@@ -3933,11 +3942,11 @@
     }
 };
 
-class __lambda
+class ___lambda_node
     : public __node
 {
 public:
-    __lambda(__node* params, const char *number, size_t number_size)
+    ___lambda_node(__node* params, const char *number, size_t number_size)
     {
         __right_ = params;
         __name_ = number;
@@ -6970,50 +6979,62 @@
         {
         case 't':
         case 'l':
-            first += 2;
-
+            {
+            const char* t = first + 2;
+            __node* params = 0;
             if (type == 'l')
             {
-                __root_ = 0;
-                if (first[0] == 'v')
+                if (*t == 'v')
                 {
                     // void lambda
-                    ++first;
-                    if (first[0] == 'E')
-                        ++first;
+                    ++t;
+                    if (t != last && *t == 'E')
+                        ++t;
                     else
                         return first;
                 }
                 else
                 {
-                    while (first[0] && first[0] != 'E')
+                    const char* t1 = __parse_type(t, last);
+                    if (t1 == t || !__make<__list>(__root_))
+                        return first;
+                    params = __root_;
+                    __node* prev = params;
+                    t = t1;
+                    while (true)
                     {
-                        const char *old = first;
-                        first = __parse_type(first, last);
-                        if (first == old)
+                        t1 = __parse_type(t, last);
+                        if (t1 == t)
                             break;
+                        if (!__make<__list>(__root_))
+                            return first;
+                        t = t1;
+                        prev->__right_ = __root_;
+                        __root_->__size_ = prev->__size_ + 1;
+                        prev = __root_;
                     }
-                    if (first[0] == 'E')
-                        ++first;
-                    else
+                    if (t == last || *t != 'E')
                         return first;
+                    ++t;
                 }
             }
-            const char *number_start = first;
-            first = __parse_number(first, last);
-            const char *number_end = first;
-            if (first[0] == '_')
-            {
-                ++first;
-            }
-            else
+            const char* number_start = t;
+            const char* number_end = __parse_number(t, last);
+            if (number_end == last || *number_end != '_')
                 return first;
-              
+            t = number_end + 1;
             if (type == 'l')
-                __make<__lambda>(__root_, number_start, static_cast<size_t>(number_end - number_start));
+            {
+                if (!__make<___lambda_node>(params, number_start, static_cast<size_t>(number_end - number_start)))
+                    return first;
+            }
             else
-                __make<__unnamed>(number_start, static_cast<size_t>(number_end - number_start));
-            
+            {
+                if (!__make<__unnamed>(number_start, static_cast<size_t>(number_end - number_start)))
+                    return first;
+            }
+            first = t;
+            }
             break;
         }
     }

Modified: lldb/branches/windows/source/Expression/ASTResultSynthesizer.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Expression/ASTResultSynthesizer.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Expression/ASTResultSynthesizer.cpp (original)
+++ lldb/branches/windows/source/Expression/ASTResultSynthesizer.cpp Tue Jan  8 06:51:53 2013
@@ -131,8 +131,6 @@
 {
     lldb::LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS));
     
-    ASTContext &Ctx(*m_ast_context);
-
     if (!m_sema)
         return false;
     
@@ -146,11 +144,11 @@
         std::string s;
         raw_string_ostream os(s);
         
-        Ctx.getTranslationUnitDecl()->print(os);
+        function_decl->print(os);
         
         os.flush();
         
-        log->Printf("AST context before transforming:\n%s", s.c_str());
+        log->Printf ("Untransformed function AST:\n%s", s.c_str());
     }
     
     Stmt *function_body = function_decl->getBody();
@@ -178,9 +176,7 @@
 ASTResultSynthesizer::SynthesizeObjCMethodResult (ObjCMethodDecl *MethodDecl)
 {
     lldb::LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS));
-    
-    ASTContext &Ctx(*m_ast_context);
-    
+        
     if (!m_sema)
         return false;
         
@@ -192,11 +188,11 @@
         std::string s;
         raw_string_ostream os(s);
         
-        Ctx.getTranslationUnitDecl()->print(os);
+        MethodDecl->print(os);
         
         os.flush();
         
-        log->Printf("AST context before transforming:\n%s", s.c_str());
+        log->Printf ("Untransformed method AST:\n%s", s.c_str());
     }
     
     Stmt *method_body = MethodDecl->getBody();
@@ -209,7 +205,7 @@
     bool ret = SynthesizeBodyResult (compound_stmt,
                                      MethodDecl);
     
-    if (log)
+    if (log && log->GetVerbose())
     {
         std::string s;
         raw_string_ostream os(s);
@@ -218,7 +214,7 @@
         
         os.flush();
         
-        log->Printf("Transformed function AST:\n%s", s.c_str());
+        log->Printf("Transformed method AST:\n%s", s.c_str());
     }
     
     return ret;

Modified: lldb/branches/windows/source/Expression/ClangASTSource.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Expression/ClangASTSource.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Expression/ClangASTSource.cpp (original)
+++ lldb/branches/windows/source/Expression/ClangASTSource.cpp Tue Jan  8 06:51:53 2013
@@ -681,7 +681,7 @@
             if (!copied_type)
             {                
                 if (log)
-                    log->Printf("  CAS::FEVD[%u] - Couldn't export the type for a constant integer result",
+                    log->Printf("  CAS::FEVD[%u] - Couldn't export a type",
                                 current_id);
                     
                 break;
@@ -689,6 +689,63 @@
                 
             context.AddTypeDecl(copied_type);
         }
+        else
+        {
+            do
+            {
+                // Couldn't find any types elsewhere.  Try the Objective-C runtime if one exists.
+                
+                lldb::ProcessSP process(m_target->GetProcessSP());
+                
+                if (!process)
+                    break;
+                
+                ObjCLanguageRuntime *language_runtime(process->GetObjCLanguageRuntime());
+                
+                if (!language_runtime)
+                    break;
+                
+                TypeVendor *type_vendor = language_runtime->GetTypeVendor();
+                
+                if (!type_vendor)
+                    break;
+                
+                bool append = false;
+                uint32_t max_matches = 1;
+                std::vector <ClangASTType> types;
+                
+                if (!type_vendor->FindTypes(name,
+                                            append,
+                                            max_matches,
+                                            types))
+                    break;
+                
+                if (log)
+                {                    
+                    log->Printf("  CAS::FEVD[%u] Matching type found for \"%s\" in the runtime",
+                                current_id,
+                                name.GetCString());
+                }
+                
+                const clang::Type *runtime_clang_type = QualType::getFromOpaquePtr(types[0].GetOpaqueQualType()).getTypePtr();
+                
+                clang::QualType runtime_qual_type(runtime_clang_type, 0);
+                
+                void *copied_type = GuardedCopyType(m_ast_context, type_vendor->GetClangASTContext(), runtime_qual_type.getAsOpaquePtr());
+                
+                if (!copied_type)
+                {
+                    if (log)
+                        log->Printf("  CAS::FEVD[%u] - Couldn't export a type from the runtime",
+                                    current_id);
+                    
+                    break;
+                }
+                
+                context.AddTypeDecl(copied_type);
+            }
+            while(0);
+        }
         
     } while(0);
 }
@@ -750,7 +807,7 @@
     return DeclFromParser<D>(dyn_cast<D>(parser_generic_decl.decl));
 }
 
-static void
+static bool
 FindObjCMethodDeclsWithOrigin (unsigned int current_id,
                                NameSearchContext &context,
                                ObjCInterfaceDecl *original_interface_decl,
@@ -797,26 +854,26 @@
     
     ObjCInterfaceDecl::lookup_result result = original_interface_decl->lookup(original_decl_name);
     
-    if (result.first == result.second)
-        return;
+    if (result.empty())
+        return false;
     
-    if (!*result.first)
-        return;
+    if (!result[0])
+        return false;
     
-    ObjCMethodDecl *result_method = dyn_cast<ObjCMethodDecl>(*result.first);
+    ObjCMethodDecl *result_method = dyn_cast<ObjCMethodDecl>(result[0]);
     
     if (!result_method)
-        return;
+        return false;
     
     Decl *copied_decl = ast_importer->CopyDecl(ast_context, &result_method->getASTContext(), result_method);
     
     if (!copied_decl)
-        return;
+        return false;
     
     ObjCMethodDecl *copied_method_decl = dyn_cast<ObjCMethodDecl>(copied_decl);
     
     if (!copied_method_decl)
-        return;
+        return false;
     
     lldb::LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS));
     
@@ -828,7 +885,7 @@
     
     context.AddNamedDecl(copied_method_decl);
     
-    return;
+    return true;
 }
 
 void
@@ -859,12 +916,13 @@
             
         ObjCInterfaceDecl *original_interface_decl = dyn_cast<ObjCInterfaceDecl>(original_decl);
         
-        FindObjCMethodDeclsWithOrigin(current_id,
-                                      context,
-                                      original_interface_decl,
-                                      m_ast_context,
-                                      m_ast_importer,
-                                      "at origin");
+        if (FindObjCMethodDeclsWithOrigin(current_id,
+                                          context,
+                                          original_interface_decl,
+                                          m_ast_context,
+                                          m_ast_importer,
+                                          "at origin"))
+            return; // found it, no need to look any further
     } while (0);
     
     StreamString ss;
@@ -1075,6 +1133,9 @@
         
         ObjCLanguageRuntime *language_runtime(process->GetObjCLanguageRuntime());
         
+        if (!language_runtime)
+            break;
+        
         TypeVendor *type_vendor = language_runtime->GetTypeVendor();
         
         if (!type_vendor)
@@ -1430,14 +1491,14 @@
     {
         log->Printf("LRT[%u] returned:", current_id);
         log->Printf("LRT[%u]   Original = (RecordDecl*)%p", current_id, origin_record.decl);
-        log->Printf("LRT[%u]   Size = %lld", current_id, size);
-        log->Printf("LRT[%u]   Alignment = %lld", current_id, alignment);
+        log->Printf("LRT[%u]   Size = %" PRId64, current_id, size);
+        log->Printf("LRT[%u]   Alignment = %" PRId64, current_id, alignment);
         log->Printf("LRT[%u]   Fields:", current_id);
         for (RecordDecl::field_iterator fi = record->field_begin(), fe = record->field_end();
              fi != fe;
              ++fi)
         {
-            log->Printf("LRT[%u]     (FieldDecl*)%p, Name = '%s', Offset = %lld bits",
+            log->Printf("LRT[%u]     (FieldDecl*)%p, Name = '%s', Offset = %" PRId64 " bits",
                         current_id,
                         *fi,
                         fi->getNameAsString().c_str(),
@@ -1458,7 +1519,7 @@
                 DeclFromParser <RecordDecl> base_record(base_record_type->getDecl());
                 DeclFromParser <CXXRecordDecl> base_cxx_record = DynCast<CXXRecordDecl>(base_record);
                 
-                log->Printf("LRT[%u]     %s(CXXRecordDecl*)%p, Name = '%s', Offset = %lld chars",
+                log->Printf("LRT[%u]     %s(CXXRecordDecl*)%p, Name = '%s', Offset = %" PRId64 " chars",
                             current_id,
                             (is_virtual ? "Virtual " : ""),
                             base_cxx_record.decl,
@@ -1745,10 +1806,8 @@
 void 
 NameSearchContext::AddLookupResult (clang::DeclContextLookupConstResult result)
 {
-    for (clang::NamedDecl * const *decl_iterator = result.first;
-         decl_iterator != result.second;
-         ++decl_iterator)
-        m_decls.push_back (*decl_iterator);
+    for (auto decl = result.begin(); decl != result.end(); ++decl)
+        m_decls.push_back (*decl);
 }
 
 void

Modified: lldb/branches/windows/source/Expression/ClangExpressionDeclMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Expression/ClangExpressionDeclMap.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Expression/ClangExpressionDeclMap.cpp (original)
+++ lldb/branches/windows/source/Expression/ClangExpressionDeclMap.cpp Tue Jan  8 06:51:53 2013
@@ -1499,7 +1499,7 @@
         
         if (mem == LLDB_INVALID_ADDRESS)
         {
-            err.SetErrorStringWithFormat("Couldn't allocate 0x%llx bytes for materialized argument struct", 
+            err.SetErrorStringWithFormat("Couldn't allocate 0x%llx bytes for materialized argument struct",
                                          (unsigned long long)(m_struct_vars->m_struct_alignment + m_struct_vars->m_struct_size));
             return false;
         }
@@ -1683,7 +1683,7 @@
                 mem = var_sp->m_live_sp->GetValue().GetScalar().ULongLong();
                 
                 if (log)
-                    log->Printf("Dematerializing %s from 0x%llx (size = %u)", var_sp->GetName().GetCString(), (uint64_t)mem, (unsigned)pvar_byte_size);
+                    log->Printf("Dematerializing %s from 0x%" PRIx64 " (size = %u)", var_sp->GetName().GetCString(), (uint64_t)mem, (unsigned)pvar_byte_size);
                 
                 // Read the contents of the spare memory area
                                 
@@ -1758,7 +1758,7 @@
             }
             
             if (log)
-                log->Printf("Allocated %s (0x%llx) sucessfully", var_sp->GetName().GetCString(), mem);
+                log->Printf("Allocated %s (0x%" PRIx64 ") sucessfully", var_sp->GetName().GetCString(), mem);
             
             // Put the location of the spare memory into the live data of the ValueObject.
             
@@ -1838,7 +1838,7 @@
     TypeFromUser type(expr_var->GetTypeFromUser());
     
     VariableSP &var(expr_var->m_parser_vars->m_lldb_var);
-    lldb_private::Symbol *sym(expr_var->m_parser_vars->m_lldb_sym);
+    const lldb_private::Symbol *symbol = expr_var->m_parser_vars->m_lldb_sym;
     
     bool is_reference(expr_var->m_flags & ClangExpressionVariable::EVTypeIsReference);
     
@@ -1849,7 +1849,7 @@
         location_value.reset(GetVariableValue(var,
                                               NULL));
     }
-    else if (sym)
+    else if (symbol)
     {
         addr_t location_load_addr = GetSymbolAddress(*target, process, name, lldb::eSymbolTypeAny);
         
@@ -2281,25 +2281,69 @@
     return lldb::VariableSP();
 }
 
-Symbol *
-ClangExpressionDeclMap::FindGlobalDataSymbol
-(
-    Target &target,
-    const ConstString &name
-)
+const Symbol *
+ClangExpressionDeclMap::FindGlobalDataSymbol (Target &target,
+                                              const ConstString &name)
 {
     SymbolContextList sc_list;
     
-    target.GetImages().FindSymbolsWithNameAndType(name, 
-                                                  eSymbolTypeData, 
-                                                  sc_list);
+    target.GetImages().FindSymbolsWithNameAndType(name, eSymbolTypeAny, sc_list);
     
-    if (sc_list.GetSize())
+    const uint32_t matches = sc_list.GetSize();
+    for (uint32_t i=0; i<matches; ++i)
     {
         SymbolContext sym_ctx;
-        sc_list.GetContextAtIndex(0, sym_ctx);
-        
-        return sym_ctx.symbol;
+        sc_list.GetContextAtIndex(i, sym_ctx);
+        if (sym_ctx.symbol)
+        {
+            const Symbol *symbol = sym_ctx.symbol;
+            const Address *sym_address = &symbol->GetAddress();
+            
+            if (sym_address && sym_address->IsValid())
+            {
+                switch (symbol->GetType())
+                {
+                    case eSymbolTypeData:
+                    case eSymbolTypeRuntime:
+                    case eSymbolTypeAbsolute:
+                    case eSymbolTypeObjCClass:
+                    case eSymbolTypeObjCMetaClass:
+                    case eSymbolTypeObjCIVar:
+                        if (symbol->GetDemangledNameIsSynthesized())
+                        {
+                            // If the demangled name was synthesized, then don't use it
+                            // for expressions. Only let the symbol match if the mangled
+                            // named matches for these symbols.
+                            if (symbol->GetMangled().GetMangledName() != name)
+                                break;
+                        }
+                        return symbol;
+
+                    case eSymbolTypeCode: // We already lookup functions elsewhere
+                    case eSymbolTypeVariable:
+                    case eSymbolTypeLocal:
+                    case eSymbolTypeParam:
+                    case eSymbolTypeTrampoline:
+                    case eSymbolTypeInvalid:
+                    case eSymbolTypeException:
+                    case eSymbolTypeSourceFile:
+                    case eSymbolTypeHeaderFile:
+                    case eSymbolTypeObjectFile:
+                    case eSymbolTypeCommonBlock:
+                    case eSymbolTypeBlock:
+                    case eSymbolTypeVariableType:
+                    case eSymbolTypeLineEntry:
+                    case eSymbolTypeLineHeader:
+                    case eSymbolTypeScopeBegin:
+                    case eSymbolTypeScopeEnd:
+                    case eSymbolTypeAdditional:
+                    case eSymbolTypeCompiler:
+                    case eSymbolTypeInstrumentation:
+                    case eSymbolTypeUndefined:
+                        break;
+                }
+            }
+        }
     }
     
     return NULL;
@@ -2878,7 +2922,7 @@
                 // We couldn't find a non-symbol variable for this.  Now we'll hunt for a generic 
                 // data symbol, and -- if it is found -- treat it as a variable.
                 
-                Symbol *data_symbol = FindGlobalDataSymbol(*target, name);
+                const Symbol *data_symbol = FindGlobalDataSymbol(*target, name);
                 
                 if (data_symbol)
                 {
@@ -3144,7 +3188,7 @@
 
 void
 ClangExpressionDeclMap::AddOneGenericVariable(NameSearchContext &context, 
-                                              Symbol &symbol, 
+                                              const Symbol &symbol,
                                               unsigned int current_id)
 {
     assert(m_parser_vars.get());
@@ -3158,10 +3202,10 @@
 
     ASTContext *scratch_ast_context = target->GetScratchClangASTContext()->getASTContext();
     
-    TypeFromUser user_type (ClangASTContext::CreateLValueReferenceType(scratch_ast_context, ClangASTContext::GetVoidPtrType(scratch_ast_context, true)),
+    TypeFromUser user_type (ClangASTContext::CreateLValueReferenceType(scratch_ast_context, ClangASTContext::GetVoidPtrType(scratch_ast_context, false)),
                             scratch_ast_context);
     
-    TypeFromParser parser_type (ClangASTContext::CreateLValueReferenceType(scratch_ast_context, ClangASTContext::GetVoidPtrType(m_ast_context, true)),
+    TypeFromParser parser_type (ClangASTContext::CreateLValueReferenceType(m_ast_context, ClangASTContext::GetVoidPtrType(m_ast_context, false)),
                                 m_ast_context);
     
     NamedDecl *var_decl = context.AddVarDecl(parser_type.GetOpaqueQualType());
@@ -3177,7 +3221,7 @@
     
     std::auto_ptr<Value> symbol_location(new Value);
     
-    Address &symbol_address = symbol.GetAddress();
+    const Address &symbol_address = symbol.GetAddress();
     lldb::addr_t symbol_load_addr = symbol_address.GetLoadAddress(target);
     
     symbol_location->SetContext(Value::eContextTypeClangType, user_type.GetOpaqueQualType());
@@ -3354,7 +3398,7 @@
             // We failed to copy the type we found
             if (log)
             {
-                log->Printf ("  Failed to import the function type '%s' {0x%8.8llx} into the expression parser AST contenxt",
+                log->Printf ("  Failed to import the function type '%s' {0x%8.8" PRIx64 "} into the expression parser AST contenxt",
                              fun_type->GetName().GetCString(), 
                              fun_type->GetID());
             }

Modified: lldb/branches/windows/source/Expression/ClangExpressionParser.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Expression/ClangExpressionParser.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Expression/ClangExpressionParser.cpp (original)
+++ lldb/branches/windows/source/Expression/ClangExpressionParser.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/Expression/ClangExpressionParser.h"
 
 #include "lldb/Core/ArchSpec.h"
@@ -62,8 +64,8 @@
 #else
 #include "llvm/ExecutionEngine/MCJIT.h"
 #endif
-#include "llvm/LLVMContext.h"
-#include "llvm/Module.h"
+#include "llvm/IR/LLVMContext.h"
+#include "llvm/IR/Module.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include "llvm/Support/DynamicLibrary.h"
@@ -264,14 +266,14 @@
         break;
     case lldb::eLanguageTypeC_plus_plus:
         m_compiler->getLangOpts().CPlusPlus = true;
-        m_compiler->getLangOpts().CPlusPlus0x = true;
+        m_compiler->getLangOpts().CPlusPlus11 = true;
         break;
     case lldb::eLanguageTypeObjC_plus_plus:
     default:
         m_compiler->getLangOpts().ObjC1 = true;
         m_compiler->getLangOpts().ObjC2 = true;
         m_compiler->getLangOpts().CPlusPlus = true;
-        m_compiler->getLangOpts().CPlusPlus0x = true;
+        m_compiler->getLangOpts().CPlusPlus11 = true;
         break;
     }
     
@@ -735,7 +737,7 @@
     }
     
     if (log)
-        log->Printf("Found function, has local address 0x%llx and remote address 0x%llx", (uint64_t)func_local_addr, (uint64_t)func_remote_addr);
+        log->Printf("Found function, has local address 0x%" PRIx64 " and remote address 0x%" PRIx64, (uint64_t)func_local_addr, (uint64_t)func_remote_addr);
     
     std::pair <lldb::addr_t, lldb::addr_t> func_range;
     
@@ -749,7 +751,7 @@
     }
     
     if (log)
-        log->Printf("Function's code range is [0x%llx+0x%llx]", func_range.first, func_range.second);
+        log->Printf("Function's code range is [0x%" PRIx64 "+0x%" PRIx64 "]", func_range.first, func_range.second);
     
     Target *target = exe_ctx.GetTargetPtr();
     if (!target)

Modified: lldb/branches/windows/source/Expression/ClangFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Expression/ClangFunction.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Expression/ClangFunction.cpp (original)
+++ lldb/branches/windows/source/Expression/ClangFunction.cpp Tue Jan  8 06:51:53 2013
@@ -19,7 +19,7 @@
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/Triple.h"
 #include "llvm/ExecutionEngine/ExecutionEngine.h"
-#include "llvm/Module.h"
+#include "llvm/IR/Module.h"
 
 // Project includes
 #include "lldb/Expression/ASTStructExtractor.h"
@@ -186,7 +186,7 @@
         char arg_buf[32];
         args_buffer.append ("    ");
         args_buffer.append (type_name);
-        snprintf(arg_buf, 31, "arg_%llu", (uint64_t)i);
+        snprintf(arg_buf, 31, "arg_%" PRIu64, (uint64_t)i);
         args_buffer.push_back (' ');
         args_buffer.append (arg_buf);
         args_buffer.append (";\n");
@@ -389,7 +389,7 @@
 
     lldb::LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP));
     if (log)
-        log->Printf ("Call Address: 0x%llx Struct Address: 0x%llx.\n", m_jit_start_addr, args_addr_ref);
+        log->Printf ("Call Address: 0x%" PRIx64 " Struct Address: 0x%" PRIx64 ".\n", m_jit_start_addr, args_addr_ref);
         
     return true;
 }
@@ -517,9 +517,7 @@
                                                                                  this_arg));
     if (!call_plan_sp)
         return eExecutionSetupError;
-    
-    call_plan_sp->SetPrivate(true);
-    
+        
     // <rdar://problem/12027563> we need to make sure we record the fact that we are running an expression here
     // otherwise this fact will fail to be recorded when fetching an Objective-C object description
     if (exe_ctx.GetProcessPtr())

Modified: lldb/branches/windows/source/Expression/ClangUserExpression.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Expression/ClangUserExpression.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Expression/ClangUserExpression.cpp (original)
+++ lldb/branches/windows/source/Expression/ClangUserExpression.cpp Tue Jan  8 06:51:53 2013
@@ -58,7 +58,7 @@
     m_language (language),
     m_transformed_text (),
     m_desired_type (desired_type),
-    m_enforce_valid_object (false),
+    m_enforce_valid_object (true),
     m_cplusplus (false),
     m_objectivec (false),
     m_static_method(false),
@@ -106,31 +106,56 @@
 void
 ClangUserExpression::ScanContext(ExecutionContext &exe_ctx, Error &err)
 {
+    lldb::LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS));
+
+    if (log)
+        log->Printf("ClangUserExpression::ScanContext()");
+    
     m_target = exe_ctx.GetTargetPtr();
     
     if (!(m_allow_cxx || m_allow_objc))
+    {
+        if (log)
+            log->Printf("  [CUE::SC] Settings inhibit C++ and Objective-C");
         return;
+    }
     
     StackFrame *frame = exe_ctx.GetFramePtr();
     if (frame == NULL)
+    {
+        if (log)
+            log->Printf("  [CUE::SC] Null stack frame");
         return;
+    }
     
     SymbolContext sym_ctx = frame->GetSymbolContext(lldb::eSymbolContextFunction | lldb::eSymbolContextBlock);
     
     if (!sym_ctx.function)
+    {
+        if (log)
+            log->Printf("  [CUE::SC] Null function");
         return;
+    }
     
     // Find the block that defines the function represented by "sym_ctx"
     Block *function_block = sym_ctx.GetFunctionBlock();
     
     if (!function_block)
+    {
+        if (log)
+            log->Printf("  [CUE::SC] Null function block");
         return;
+    }
 
     clang::DeclContext *decl_context = function_block->GetClangDeclContext();
 
     if (!decl_context)
+    {
+        if (log)
+            log->Printf("  [CUE::SC] Null decl context");
         return;
-            
+    }
+    
     if (clang::CXXMethodDecl *method_decl = llvm::dyn_cast<clang::CXXMethodDecl>(decl_context))
     {
         if (m_allow_cxx && method_decl->isInstance())
@@ -463,19 +488,19 @@
 #if 0
 		// jingham: look here
         StreamFile logfile ("/tmp/exprs.txt", "a");
-        logfile.Printf("0x%16.16llx: thread = 0x%4.4x, expr = '%s'\n", m_jit_start_addr, exe_ctx.thread ? exe_ctx.thread->GetID() : -1, m_expr_text.c_str());
+        logfile.Printf("0x%16.16" PRIx64 ": thread = 0x%4.4x, expr = '%s'\n", m_jit_start_addr, exe_ctx.thread ? exe_ctx.thread->GetID() : -1, m_expr_text.c_str());
 #endif
         
         if (log)
         {
             log->Printf("-- [ClangUserExpression::PrepareToExecuteJITExpression] Materializing for execution --");
             
-            log->Printf("  Function address  : 0x%llx", (uint64_t)m_jit_start_addr);
+            log->Printf("  Function address  : 0x%" PRIx64, (uint64_t)m_jit_start_addr);
             
             if (m_needs_object_ptr)
-                log->Printf("  Object pointer    : 0x%llx", (uint64_t)object_ptr);
+                log->Printf("  Object pointer    : 0x%" PRIx64, (uint64_t)object_ptr);
             
-            log->Printf("  Structure address : 0x%llx", (uint64_t)struct_address);
+            log->Printf("  Structure address : 0x%" PRIx64, (uint64_t)struct_address);
                     
             StreamString args;
             
@@ -608,9 +633,7 @@
             return eExecutionSetupError;
         
         lldb::addr_t function_stack_pointer = static_cast<ThreadPlanCallFunction *>(call_plan_sp.get())->GetFunctionStackPointer();
-    
-        call_plan_sp->SetPrivate(true);
-    
+
         if (log)
             log->Printf("-- [ClangUserExpression::Execute] Execution of expression begins --");
         

Modified: lldb/branches/windows/source/Expression/ClangUtilityFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Expression/ClangUtilityFunction.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Expression/ClangUtilityFunction.cpp (original)
+++ lldb/branches/windows/source/Expression/ClangUtilityFunction.cpp Tue Jan  8 06:51:53 2013
@@ -153,7 +153,7 @@
 #if 0
 	// jingham: look here
     StreamFile logfile ("/tmp/exprs.txt", "a");
-    logfile.Printf ("0x%16.16llx: func = %s, source =\n%s\n", 
+    logfile.Printf ("0x%16.16" PRIx64 ": func = %s, source =\n%s\n",
                     m_jit_start_addr, 
                     m_function_name.c_str(), 
                     m_function_text.c_str());

Modified: lldb/branches/windows/source/Expression/DWARFExpression.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Expression/DWARFExpression.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Expression/DWARFExpression.cpp (original)
+++ lldb/branches/windows/source/Expression/DWARFExpression.cpp Tue Jan  8 06:51:53 2013
@@ -322,10 +322,10 @@
         case DW_OP_const2s: s->Printf("DW_OP_const2s(0x%4.4x) ", m_data.GetU16(&offset)); break;      // 0x0b 1 2-byte constant
         case DW_OP_const4u: s->Printf("DW_OP_const4u(0x%8.8x) ", m_data.GetU32(&offset)); break;      // 0x0c 1 4-byte constant
         case DW_OP_const4s: s->Printf("DW_OP_const4s(0x%8.8x) ", m_data.GetU32(&offset)); break;      // 0x0d 1 4-byte constant
-        case DW_OP_const8u: s->Printf("DW_OP_const8u(0x%16.16llx) ", m_data.GetU64(&offset)); break;  // 0x0e 1 8-byte constant
-        case DW_OP_const8s: s->Printf("DW_OP_const8s(0x%16.16llx) ", m_data.GetU64(&offset)); break;  // 0x0f 1 8-byte constant
-        case DW_OP_constu:  s->Printf("DW_OP_constu(0x%llx) ", m_data.GetULEB128(&offset)); break;    // 0x10 1 ULEB128 constant
-        case DW_OP_consts:  s->Printf("DW_OP_consts(0x%lld) ", m_data.GetSLEB128(&offset)); break;    // 0x11 1 SLEB128 constant
+        case DW_OP_const8u: s->Printf("DW_OP_const8u(0x%16.16" PRIx64 ") ", m_data.GetU64(&offset)); break;  // 0x0e 1 8-byte constant
+        case DW_OP_const8s: s->Printf("DW_OP_const8s(0x%16.16" PRIx64 ") ", m_data.GetU64(&offset)); break;  // 0x0f 1 8-byte constant
+        case DW_OP_constu:  s->Printf("DW_OP_constu(0x%" PRIx64 ") ", m_data.GetULEB128(&offset)); break;    // 0x10 1 ULEB128 constant
+        case DW_OP_consts:  s->Printf("DW_OP_consts(0x%" PRId64 ") ", m_data.GetSLEB128(&offset)); break;    // 0x11 1 SLEB128 constant
         case DW_OP_dup:     s->PutCString("DW_OP_dup"); break;                                        // 0x12
         case DW_OP_drop:    s->PutCString("DW_OP_drop"); break;                                       // 0x13
         case DW_OP_over:    s->PutCString("DW_OP_over"); break;                                       // 0x14
@@ -344,7 +344,7 @@
         case DW_OP_or:      s->PutCString("DW_OP_or"); break;                                         // 0x21
         case DW_OP_plus:    s->PutCString("DW_OP_plus"); break;                                       // 0x22
         case DW_OP_plus_uconst:                                                                 // 0x23 1 ULEB128 addend
-            s->Printf("DW_OP_plus_uconst(0x%llx) ", m_data.GetULEB128(&offset));
+            s->Printf("DW_OP_plus_uconst(0x%" PRIx64 ") ", m_data.GetULEB128(&offset));
             break;
 
         case DW_OP_shl:     s->PutCString("DW_OP_shl"); break;                                        // 0x24
@@ -490,17 +490,17 @@
                     {
                         if (reg_info.name)
                         {
-                            s->Printf("[%s%+lli]", reg_info.name, reg_offset); 
+                            s->Printf("[%s%+" PRIi64 "]", reg_info.name, reg_offset);
                             break;
                         }
                         else if (reg_info.alt_name)
                         {
-                            s->Printf("[%s%+lli]", reg_info.alt_name, reg_offset); 
+                            s->Printf("[%s%+" PRIi64 "]", reg_info.alt_name, reg_offset);
                             break;
                         }
                     }
                 }
-                s->Printf("DW_OP_breg%i(0x%llx)", reg_num, reg_offset); 
+                s->Printf("DW_OP_breg%i(0x%" PRIx64 ")", reg_num, reg_offset);
             }
             break;
 
@@ -524,11 +524,11 @@
                         }
                     }
                 }
-                s->Printf("DW_OP_regx(%llu)", reg_num); break; 
+                s->Printf("DW_OP_regx(%" PRIu64 ")", reg_num); break;
             }
             break;
         case DW_OP_fbreg:                                                   // 0x91 1 SLEB128 offset
-            s->Printf("DW_OP_fbreg(%lli)",m_data.GetSLEB128(&offset));
+            s->Printf("DW_OP_fbreg(%" PRIi64 ")",m_data.GetSLEB128(&offset));
             break;
         case DW_OP_bregx:                                                   // 0x92 2 ULEB128 register followed by SLEB128 offset
             {
@@ -541,21 +541,21 @@
                     {
                         if (reg_info.name)
                         {
-                            s->Printf("[%s%+lli]", reg_info.name, reg_offset); 
+                            s->Printf("[%s%+" PRIi64 "]", reg_info.name, reg_offset);
                             break;
                         }
                         else if (reg_info.alt_name)
                         {
-                            s->Printf("[%s%+lli]", reg_info.alt_name, reg_offset); 
+                            s->Printf("[%s%+" PRIi64 "]", reg_info.alt_name, reg_offset);
                             break;
                         }
                     }
                 }
-                s->Printf("DW_OP_bregx(reg=%u,offset=%lli)", reg_num, reg_offset); 
+                s->Printf("DW_OP_bregx(reg=%u,offset=%" PRIi64 ")", reg_num, reg_offset);
             }
             break;
         case DW_OP_piece:                                                   // 0x93 1 ULEB128 size of piece addressed
-            s->Printf("DW_OP_piece(0x%llx)", m_data.GetULEB128(&offset));
+            s->Printf("DW_OP_piece(0x%" PRIx64 ")", m_data.GetULEB128(&offset));
             break;
         case DW_OP_deref_size:                                              // 0x94 1 1-byte size of data retrieved
             s->Printf("DW_OP_deref_size(0x%2.2x)", m_data.GetU8(&offset));
@@ -572,7 +572,7 @@
             s->Printf("DW_OP_call4(0x%8.8x)", m_data.GetU32(&offset));
             break;
         case DW_OP_call_ref:                                                // 0x9a DWARF3 1 4- or 8-byte offset of DIE
-            s->Printf("DW_OP_call_ref(0x%8.8llx)", m_data.GetAddress(&offset));
+            s->Printf("DW_OP_call_ref(0x%8.8" PRIx64 ")", m_data.GetAddress(&offset));
             break;
 //      case DW_OP_form_tls_address: s << "form_tls_address"; break;        // 0x9b DWARF3
 //      case DW_OP_call_frame_cfa: s << "call_frame_cfa"; break;            // 0x9c DWARF3
@@ -582,7 +582,7 @@
 //      case DW_OP_lo_user:     s->PutCString("DW_OP_lo_user"); break;                        // 0xe0
 //      case DW_OP_hi_user:     s->PutCString("DW_OP_hi_user"); break;                        // 0xff
 //        case DW_OP_APPLE_extern:
-//            s->Printf("DW_OP_APPLE_extern(%llu)", m_data.GetULEB128(&offset));
+//            s->Printf("DW_OP_APPLE_extern(%" PRIu64 ")", m_data.GetULEB128(&offset));
 //            break;
 //        case DW_OP_APPLE_array_ref:
 //            s->PutCString("DW_OP_APPLE_array_ref");
@@ -603,7 +603,7 @@
 //            s->PutCString("DW_OP_APPLE_deref_type");
 //            break;
 //        case DW_OP_APPLE_expr_local:    // 0xF5 - ULEB128 expression local index
-//            s->Printf("DW_OP_APPLE_expr_local(%llu)", m_data.GetULEB128(&offset));
+//            s->Printf("DW_OP_APPLE_expr_local(%" PRIu64 ")", m_data.GetULEB128(&offset));
 //            break;
 //        case DW_OP_APPLE_constf:        // 0xF6 - 1 byte float size, followed by constant float data
 //            {
@@ -1345,7 +1345,7 @@
             for (size_t i=0; i<count; ++i)
             {
                 StreamString new_value;
-                new_value.Printf("[%llu]", (uint64_t)i);
+                new_value.Printf("[%" PRIu64 "]", (uint64_t)i);
                 stack[i].Dump(&new_value);
                 log->Printf("  %s", new_value.GetData());
             }
@@ -1438,7 +1438,7 @@
                             else
                             {
                                 if (error_ptr)
-                                    error_ptr->SetErrorStringWithFormat ("Failed to dereference pointer from 0x%llx for DW_OP_deref: %s\n", 
+                                    error_ptr->SetErrorStringWithFormat ("Failed to dereference pointer from 0x%" PRIx64 " for DW_OP_deref: %s\n",
                                                                          pointer_addr,
                                                                          error.AsCString());
                                 return false;
@@ -1536,7 +1536,7 @@
                             else
                             {
                                 if (error_ptr)
-                                    error_ptr->SetErrorStringWithFormat ("Failed to dereference pointer from 0x%llx for DW_OP_deref: %s\n", 
+                                    error_ptr->SetErrorStringWithFormat ("Failed to dereference pointer from 0x%" PRIx64 " for DW_OP_deref: %s\n",
                                                                          pointer_addr,
                                                                          error.AsCString());
                                 return false;
@@ -2709,7 +2709,7 @@
                 if (size && (index >= size || index < 0))
                 {
                     if (error_ptr)
-                        error_ptr->SetErrorStringWithFormat("Out of bounds array access.  %lld is not in [0, %llu]", index, size);
+                        error_ptr->SetErrorStringWithFormat("Out of bounds array access.  %" PRId64 " is not in [0, %" PRIu64 "]", index, size);
                     return false;
                 }
                 
@@ -2892,7 +2892,7 @@
                                                                           new_value))
                                     {
                                         if (error_ptr)
-                                            error_ptr->SetErrorStringWithFormat ("Failed to write value to memory at 0x%llx.\n", addr);
+                                            error_ptr->SetErrorStringWithFormat ("Failed to write value to memory at 0x%" PRIx64 ".\n", addr);
                                         return false;
                                     }
                                 }
@@ -3186,7 +3186,7 @@
         for (size_t i=0; i<count; ++i)
         {
             StreamString new_value;
-            new_value.Printf("[%llu]", (uint64_t)i);
+            new_value.Printf("[%" PRIu64 "]", (uint64_t)i);
             stack[i].Dump(&new_value);
             log->Printf("  %s", new_value.GetData());
         }

Modified: lldb/branches/windows/source/Expression/IRDynamicChecks.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Expression/IRDynamicChecks.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Expression/IRDynamicChecks.cpp (original)
+++ lldb/branches/windows/source/Expression/IRDynamicChecks.cpp Tue Jan  8 06:51:53 2013
@@ -18,11 +18,11 @@
 #include "lldb/Target/StackFrame.h"
 
 #include "llvm/Support/raw_ostream.h"
-#include "llvm/Constants.h"
-#include "llvm/Function.h"
-#include "llvm/Instructions.h"
-#include "llvm/Module.h"
-#include "llvm/Value.h"
+#include "llvm/IR/Constants.h"
+#include "llvm/IR/Function.h"
+#include "llvm/IR/Instructions.h"
+#include "llvm/IR/Module.h"
+#include "llvm/IR/Value.h"
 
 using namespace llvm;
 using namespace lldb_private;

Modified: lldb/branches/windows/source/Expression/IRForTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Expression/IRForTarget.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Expression/IRForTarget.cpp (original)
+++ lldb/branches/windows/source/Expression/IRForTarget.cpp Tue Jan  8 06:51:53 2013
@@ -10,15 +10,15 @@
 #include "lldb/Expression/IRForTarget.h"
 
 #include "llvm/Support/raw_ostream.h"
-#include "llvm/Constants.h"
-#include "llvm/DataLayout.h"
-#include "llvm/InstrTypes.h"
-#include "llvm/Instructions.h"
-#include "llvm/Intrinsics.h"
-#include "llvm/Module.h"
+#include "llvm/IR/Constants.h"
+#include "llvm/IR/DataLayout.h"
+#include "llvm/IR/InstrTypes.h"
+#include "llvm/IR/Instructions.h"
+#include "llvm/IR/Intrinsics.h"
+#include "llvm/IR/Module.h"
 #include "llvm/PassManager.h"
 #include "llvm/Transforms/IPO.h"
-#include "llvm/ValueSymbolTable.h"
+#include "llvm/IR/ValueSymbolTable.h"
 
 #include "clang/AST/ASTContext.h"
 
@@ -294,7 +294,7 @@
     }
     
     if (log)
-        log->Printf("Found \"%s\" at 0x%llx", name.GetCString(), fun_addr);
+        log->Printf("Found \"%s\" at 0x%" PRIx64, name.GetCString(), fun_addr);
     
     return true;
 }
@@ -869,7 +869,7 @@
         }
             
         if (log)
-            log->Printf("Found CFStringCreateWithBytes at 0x%llx", CFStringCreateWithBytes_addr);
+            log->Printf("Found CFStringCreateWithBytes at 0x%" PRIx64, CFStringCreateWithBytes_addr);
         
         // Build the function type:
         //
@@ -1262,7 +1262,7 @@
             return false;
         
         if (log)
-            log->Printf("Found sel_registerName at 0x%llx", sel_registerName_addr);
+            log->Printf("Found sel_registerName at 0x%" PRIx64, sel_registerName_addr);
         
         // Build the function type: struct objc_selector *sel_registerName(uint8_t*)
         
@@ -1678,7 +1678,7 @@
         off_t value_alignment = (ast_context->getTypeAlign(qual_type) + 7) / 8;
         
         if (log)
-            log->Printf("Type of \"%s\" is [clang \"%s\", llvm \"%s\"] [size %lu, align %lld]", 
+            log->Printf("Type of \"%s\" is [clang \"%s\", llvm \"%s\"] [size %lu, align %" PRId64 "]",
                         name.c_str(), 
                         qual_type.getAsString().c_str(), 
                         PrintType(value_type).c_str(), 
@@ -1728,7 +1728,7 @@
     }
 
     if (log)
-        log->Printf("Found \"%s\" at 0x%llx", name.GetCString(), symbol_addr);
+        log->Printf("Found \"%s\" at 0x%" PRIx64, name.GetCString(), symbol_addr);
     
     Type *symbol_type = symbol->getType();
     IntegerType *intptr_ty = Type::getIntNTy(m_module->getContext(),
@@ -2529,7 +2529,7 @@
         }
             
         if (log)
-            log->Printf("  \"%s\" (\"%s\") placed at %lld",
+            log->Printf("  \"%s\" (\"%s\") placed at %" PRId64,
                         name.GetCString(),
                         decl->getNameAsString().c_str(),
                         offset);
@@ -2573,7 +2573,7 @@
     }
     
     if (log)
-        log->Printf("Total structure [align %lld, size %lu]", alignment, size);
+        log->Printf("Total structure [align %" PRId64 ", size %lu]", alignment, size);
     
     return true;
 }
@@ -2679,9 +2679,10 @@
 
         GlobalValue::use_iterator ui = global_var->use_begin();
         
-        log->Printf("Couldn't remove %s because of %s",
-                    PrintValue(global_var).c_str(),
-                    PrintValue(*ui).c_str());
+        if (log)
+            log->Printf("Couldn't remove %s because of %s",
+                        PrintValue(global_var).c_str(),
+                        PrintValue(*ui).c_str());
     }
     
     return true;

Modified: lldb/branches/windows/source/Expression/IRInterpreter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Expression/IRInterpreter.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Expression/IRInterpreter.cpp (original)
+++ lldb/branches/windows/source/Expression/IRInterpreter.cpp Tue Jan  8 06:51:53 2013
@@ -15,12 +15,12 @@
 #include "lldb/Expression/IRForTarget.h"
 #include "lldb/Expression/IRInterpreter.h"
 
-#include "llvm/Constants.h"
-#include "llvm/Function.h"
-#include "llvm/Instructions.h"
-#include "llvm/Module.h"
+#include "llvm/IR/Constants.h"
+#include "llvm/IR/Function.h"
+#include "llvm/IR/Instructions.h"
+#include "llvm/IR/Module.h"
 #include "llvm/Support/raw_ostream.h"
-#include "llvm/DataLayout.h"
+#include "llvm/IR/DataLayout.h"
 
 #include <map>
 
@@ -28,8 +28,7 @@
 
 IRInterpreter::IRInterpreter(lldb_private::ClangExpressionDeclMap &decl_map,
                                            lldb_private::Stream *error_stream) :
-    m_decl_map(decl_map),
-    m_error_stream(error_stream)
+    m_decl_map(decl_map)
 {
     
 }
@@ -389,7 +388,7 @@
 
         lldb_private::Value base = GetAccessTarget(region.m_base);
         
-        ss.Printf("%llx [%s - %s %llx]",
+        ss.Printf("%" PRIx64 " [%s - %s %llx]",
                   region.m_base,
                   lldb_private::Value::GetValueTypeAsCString(base.GetValueType()),
                   lldb_private::Value::GetContextTypeAsCString(base.GetContextType()),
@@ -558,6 +557,7 @@
                 default:
                     return false;
                 case Instruction::IntToPtr:
+                case Instruction::PtrToInt:
                 case Instruction::BitCast:
                     return ResolveConstantValue(value, constant_expr->getOperand(0));
                 case Instruction::GetElementPtr:
@@ -619,7 +619,7 @@
         // array then we need to build an extra level of indirection
         // for it.  This is the default; only magic arguments like
         // "this", "self", and "_cmd" are direct.
-        bool indirect_variable = true; 
+        bool variable_is_this = false;
         
         // Attempt to resolve the value using the program's data.
         // If it is, the values to be created are:
@@ -664,69 +664,121 @@
                     name_str == "_cmd")
                     resolved_value = m_decl_map.GetSpecialValue(lldb_private::ConstString(name_str.c_str()));
                 
-                indirect_variable = false;
+                variable_is_this = true;
             }
             
             if (resolved_value.GetScalar().GetType() != lldb_private::Scalar::e_void)
             {
                 if (resolved_value.GetContextType() == lldb_private::Value::eContextTypeRegisterInfo)
                 {
-                    bool bare_register = (flags & lldb_private::ClangExpressionVariable::EVBareRegister);
-
-                    if (bare_register)
-                        indirect_variable = false;
-                    
-                    lldb_private::RegisterInfo *reg_info = resolved_value.GetRegisterInfo();
-                    Memory::Region data_region = (reg_info->encoding == lldb::eEncodingVector) ?
+                    if (variable_is_this)
+                    {
+                        Memory::Region data_region = m_memory.Place(value->getType(), resolved_value.GetScalar().ULongLong(), resolved_value);
+                        
+                        lldb_private::Value origin;
+                        
+                        origin.SetValueType(lldb_private::Value::eValueTypeLoadAddress);
+                        origin.SetContext(lldb_private::Value::eContextTypeInvalid, NULL);
+                        origin.GetScalar() = resolved_value.GetScalar();
+                        
+                        data_region.m_allocation->m_origin = origin;
+                        
+                        Memory::Region ref_region = m_memory.Malloc(value->getType());
+                         
+                        if (ref_region.IsInvalid())
+                            return Memory::Region();
+                        
+                        DataEncoderSP ref_encoder = m_memory.GetEncoder(ref_region);
+                        
+                        if (ref_encoder->PutAddress(0, data_region.m_base) == UINT32_MAX)
+                            return Memory::Region();
+                        
+                        if (log)
+                        {
+                            log->Printf("Made an allocation for \"this\" register variable %s", PrintValue(value).c_str());
+                            log->Printf("  Data region    : %llx", (unsigned long long)data_region.m_base);
+                            log->Printf("  Ref region     : %llx", (unsigned long long)ref_region.m_base);
+                        }
+                        
+                        m_values[value] = ref_region;
+                        return ref_region;
+                    }
+                    else if (flags & lldb_private::ClangExpressionVariable::EVBareRegister)
+                    {                        
+                        lldb_private::RegisterInfo *reg_info = resolved_value.GetRegisterInfo();
+                        Memory::Region data_region = (reg_info->encoding == lldb::eEncodingVector) ?
                         m_memory.Malloc(reg_info->byte_size, m_target_data.getPrefTypeAlignment(value->getType())) :
                         m_memory.Malloc(value->getType());
-
-                    data_region.m_allocation->m_origin = resolved_value;
-                    Memory::Region ref_region = m_memory.Malloc(value->getType());
-                    Memory::Region pointer_region;
-                    
-                    if (indirect_variable)
+                        
+                        data_region.m_allocation->m_origin = resolved_value;
+                        Memory::Region ref_region = m_memory.Malloc(value->getType());
+                        
+                        if (!Cache(data_region.m_allocation, value->getType()))
+                            return Memory::Region();
+                        
+                        if (ref_region.IsInvalid())
+                            return Memory::Region();
+                        
+                        DataEncoderSP ref_encoder = m_memory.GetEncoder(ref_region);
+                        
+                        if (ref_encoder->PutAddress(0, data_region.m_base) == UINT32_MAX)
+                            return Memory::Region();
+                        
+                        if (log)
+                        {
+                            log->Printf("Made an allocation for bare register variable %s", PrintValue(value).c_str());
+                            log->Printf("  Data contents  : %s", m_memory.PrintData(data_region.m_base, data_region.m_extent).c_str());
+                            log->Printf("  Data region    : %llx", (unsigned long long)data_region.m_base);
+                            log->Printf("  Ref region     : %llx", (unsigned long long)ref_region.m_base);
+                        }
+                        
+                        m_values[value] = ref_region;
+                        return ref_region;
+                    }
+                    else
+                    {                        
+                        lldb_private::RegisterInfo *reg_info = resolved_value.GetRegisterInfo();
+                        Memory::Region data_region = (reg_info->encoding == lldb::eEncodingVector) ?
+                        m_memory.Malloc(reg_info->byte_size, m_target_data.getPrefTypeAlignment(value->getType())) :
+                        m_memory.Malloc(value->getType());
+                        
+                        data_region.m_allocation->m_origin = resolved_value;
+                        Memory::Region ref_region = m_memory.Malloc(value->getType());
+                        Memory::Region pointer_region;
+                        
                         pointer_region = m_memory.Malloc(value->getType());
-                    
-                    if (!Cache(data_region.m_allocation, value->getType()))
-                        return Memory::Region();
-
-                    if (ref_region.IsInvalid())
-                        return Memory::Region();
-                    
-                    if (pointer_region.IsInvalid() && indirect_variable)
-                        return Memory::Region();
-                    
-                    DataEncoderSP ref_encoder = m_memory.GetEncoder(ref_region);
-                    
-                    if (ref_encoder->PutAddress(0, data_region.m_base) == UINT32_MAX)
-                        return Memory::Region();
-                    
-                    if (log)
-                    {
-                        log->Printf("Made an allocation for register variable %s", PrintValue(value).c_str());
-                        log->Printf("  Data contents  : %s", m_memory.PrintData(data_region.m_base, data_region.m_extent).c_str());
-                        log->Printf("  Data region    : %llx", (unsigned long long)data_region.m_base);
-                        log->Printf("  Ref region     : %llx", (unsigned long long)ref_region.m_base);
-                        if (indirect_variable)
+                        
+                        if (!Cache(data_region.m_allocation, value->getType()))
+                            return Memory::Region();
+                        
+                        if (ref_region.IsInvalid())
+                            return Memory::Region();
+                        
+                        if (pointer_region.IsInvalid())
+                            return Memory::Region();
+                        
+                        DataEncoderSP ref_encoder = m_memory.GetEncoder(ref_region);
+                        
+                        if (ref_encoder->PutAddress(0, data_region.m_base) == UINT32_MAX)
+                            return Memory::Region();
+                        
+                        if (log)
+                        {
+                            log->Printf("Made an allocation for ordinary register variable %s", PrintValue(value).c_str());
+                            log->Printf("  Data contents  : %s", m_memory.PrintData(data_region.m_base, data_region.m_extent).c_str());
+                            log->Printf("  Data region    : %llx", (unsigned long long)data_region.m_base);
+                            log->Printf("  Ref region     : %llx", (unsigned long long)ref_region.m_base);
                             log->Printf("  Pointer region : %llx", (unsigned long long)pointer_region.m_base);
-                    }
-                    
-                    if (indirect_variable)
-                    {
-                        DataEncoderSP pointer_encoder = m_memory.GetEncoder(pointer_region);
+                        }
                         
+                        DataEncoderSP pointer_encoder = m_memory.GetEncoder(pointer_region);
+                            
                         if (pointer_encoder->PutAddress(0, ref_region.m_base) == UINT32_MAX)
                             return Memory::Region();
                         
                         m_values[value] = pointer_region;
                         return pointer_region;
                     }
-                    else
-                    {
-                        m_values[value] = ref_region;
-                        return ref_region;
-                    }
                 }
                 else
                 {
@@ -734,13 +786,13 @@
                     Memory::Region ref_region = m_memory.Malloc(value->getType());
                     Memory::Region pointer_region;
                     
-                    if (indirect_variable)
+                    if (!variable_is_this)
                         pointer_region = m_memory.Malloc(value->getType());
                            
                     if (ref_region.IsInvalid())
                         return Memory::Region();
                     
-                    if (pointer_region.IsInvalid() && indirect_variable)
+                    if (pointer_region.IsInvalid() && !variable_is_this)
                         return Memory::Region();
                     
                     DataEncoderSP ref_encoder = m_memory.GetEncoder(ref_region);
@@ -748,7 +800,7 @@
                     if (ref_encoder->PutAddress(0, data_region.m_base) == UINT32_MAX)
                         return Memory::Region();
                     
-                    if (indirect_variable)
+                    if (!variable_is_this)
                     {
                         DataEncoderSP pointer_encoder = m_memory.GetEncoder(pointer_region);
                     
@@ -764,14 +816,14 @@
                         log->Printf("  Data contents  : %s", m_memory.PrintData(data_region.m_base, data_region.m_extent).c_str());
                         log->Printf("  Data region    : %llx", (unsigned long long)data_region.m_base);
                         log->Printf("  Ref region     : %llx", (unsigned long long)ref_region.m_base);
-                        if (indirect_variable)
+                        if (!variable_is_this)
                             log->Printf("  Pointer region : %llx", (unsigned long long)pointer_region.m_base);
                     }
                     
-                    if (indirect_variable)
-                        return pointer_region;
-                    else 
+                    if (variable_is_this)
                         return ref_region;
+                    else
+                        return pointer_region;
                 }
             }
         }
@@ -991,13 +1043,16 @@
                 }
                 break;
             case Instruction::IntToPtr:
+            case Instruction::PtrToInt:
             case Instruction::Load:
             case Instruction::Mul:
             case Instruction::Ret:
             case Instruction::SDiv:
+            case Instruction::SRem:
             case Instruction::Store:
             case Instruction::Sub:
             case Instruction::UDiv:
+            case Instruction::URem:
             case Instruction::ZExt:
                 break;
             }
@@ -1088,6 +1143,8 @@
         case Instruction::Mul:
         case Instruction::SDiv:
         case Instruction::UDiv:
+        case Instruction::SRem:
+        case Instruction::URem:
             {
                 const BinaryOperator *bin_op = dyn_cast<BinaryOperator>(inst);
                 
@@ -1145,6 +1202,12 @@
                 case Instruction::UDiv:
                     result = L.GetRawBits64(0) / R.GetRawBits64(1);
                     break;
+                case Instruction::SRem:
+                    result = L % R;
+                    break;
+                case Instruction::URem:
+                    result = L.GetRawBits64(0) % R.GetRawBits64(1);
+                    break;
                 }
                                 
                 frame.AssignValue(inst, result, llvm_module);
@@ -1512,6 +1575,42 @@
                 }
             }
             break;
+        case Instruction::PtrToInt:
+            {
+                const PtrToIntInst *ptr_to_int_inst = dyn_cast<PtrToIntInst>(inst);
+                
+                if (!ptr_to_int_inst)
+                {
+                    if (log)
+                        log->Printf("getOpcode() returns PtrToInt, but instruction is not an PtrToIntInst");
+                    err.SetErrorToGenericError();
+                    err.SetErrorString(interpreter_internal_error);
+                    return false;
+                }
+                
+                Value *src_operand = ptr_to_int_inst->getOperand(0);
+                
+                lldb_private::Scalar I;
+                
+                if (!frame.EvaluateValue(I, src_operand, llvm_module))
+                {
+                    if (log)
+                        log->Printf("Couldn't evaluate %s", PrintValue(src_operand).c_str());
+                    err.SetErrorToGenericError();
+                    err.SetErrorString(bad_value_error);
+                    return false;
+                }
+                
+                frame.AssignValue(inst, I, llvm_module);
+                
+                if (log)
+                {
+                    log->Printf("Interpreted a PtrToInt");
+                    log->Printf("  Src : %s", frame.SummarizeValue(src_operand).c_str());
+                    log->Printf("  =   : %s", frame.SummarizeValue(inst).c_str());
+                }
+            }
+            break;
         case Instruction::Load:
             {
                 const LoadInst *load_inst = dyn_cast<LoadInst>(inst);

Modified: lldb/branches/windows/source/Expression/RecordingMemoryManager.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Expression/RecordingMemoryManager.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Expression/RecordingMemoryManager.cpp (original)
+++ lldb/branches/windows/source/Expression/RecordingMemoryManager.cpp Tue Jan  8 06:51:53 2013
@@ -89,7 +89,7 @@
     
     if (m_log)
     {
-        m_log->Printf("RecordingMemoryManager::allocateSpace(Size=%llu, Alignment=%u) = %p",
+        m_log->Printf("RecordingMemoryManager::allocateSpace(Size=%" PRIu64 ", Alignment=%u) = %p",
                       (uint64_t)Size, Alignment, return_value);
         allocation.dump(m_log);
     }
@@ -113,7 +113,7 @@
     
     if (m_log)
     {
-        m_log->Printf("RecordingMemoryManager::allocateCodeSection(Size=0x%llx, Alignment=%u, SectionID=%u) = %p",
+        m_log->Printf("RecordingMemoryManager::allocateCodeSection(Size=0x%" PRIx64 ", Alignment=%u, SectionID=%u) = %p",
                       (uint64_t)Size, Alignment, SectionID, return_value);
         allocation.dump(m_log);
     }
@@ -136,7 +136,7 @@
     
     if (m_log)
     {
-        m_log->Printf("RecordingMemoryManager::allocateDataSection(Size=0x%llx, Alignment=%u, SectionID=%u) = %p",
+        m_log->Printf("RecordingMemoryManager::allocateDataSection(Size=0x%" PRIx64 ", Alignment=%u, SectionID=%u) = %p",
                       (uint64_t)Size, Alignment, SectionID, return_value);
         allocation.dump(m_log);
     }
@@ -158,7 +158,7 @@
     
     if (m_log)
     {
-        m_log->Printf("RecordingMemoryManager::allocateGlobal(Size=0x%llx, Alignment=%u) = %p",
+        m_log->Printf("RecordingMemoryManager::allocateGlobal(Size=0x%" PRIx64 ", Alignment=%u) = %p",
                       (uint64_t)Size, Alignment, return_value);
         allocation.dump(m_log);
     }

Modified: lldb/branches/windows/source/Host/common/FileSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Host/common/FileSpec.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Host/common/FileSpec.cpp (original)
+++ lldb/branches/windows/source/Host/common/FileSpec.cpp Tue Jan  8 06:51:53 2013
@@ -962,7 +962,6 @@
                         
                         switch (result)
                         {
-                        default:
                         case eEnumerateDirectoryResultNext:  
                             // Enumerate next entry in the current directory. We just
                             // exit this switch and will continue enumerating the

Modified: lldb/branches/windows/source/Host/common/Host.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Host/common/Host.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Host/common/Host.cpp (original)
+++ lldb/branches/windows/source/Host/common/Host.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/Host/Host.h"
 #include "lldb/Core/ArchSpec.h"
 #include "lldb/Core/ConstString.h"
@@ -24,6 +26,7 @@
 
 #include "llvm/Support/Host.h"
 #include "llvm/Support/MachO.h"
+#include "llvm/ADT/Twine.h"
 
 #include <errno.h>
 #include <limits.h>
@@ -92,7 +95,7 @@
     info_ptr->monitor_signals = monitor_signals;
     
     char thread_name[256];
-    ::snprintf (thread_name, sizeof(thread_name), "<lldb.host.wait4(pid=%i)>", pid);
+    ::snprintf (thread_name, sizeof(thread_name), "<lldb.host.wait4(pid=%" PRIu64 ")>", pid);
     thread = ThreadCreate (thread_name,
                            MonitorChildProcessThreadFunction,
                            info_ptr,
@@ -155,7 +158,7 @@
     {
         log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS);
         if (log)
-            log->Printf("%s ::wait_pid (pid = %i, &status, options = %i)...", function, pid, options);
+            log->Printf("%s ::wait_pid (pid = %" PRIu64 ", &status, options = %i)...", function, pid, options);
 
         // Wait for all child processes
         ::pthread_testcancel ();
@@ -204,7 +207,7 @@
 
                 log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS);
                 if (log)
-                    log->Printf ("%s ::waitpid (pid = %i, &status, options = %i) => pid = %i, status = 0x%8.8x (%s), signal = %i, exit_state = %i",
+                    log->Printf ("%s ::waitpid (pid = %" PRIu64 ", &status, options = %i) => pid = %" PRIu64 ", status = 0x%8.8x (%s), signal = %i, exit_state = %i",
                                  function,
                                  wait_pid,
                                  options,
@@ -1060,15 +1063,9 @@
         }
         break;
 
+#ifndef LLDB_DISABLE_PYTHON
     case ePathTypePythonDir:                
         {
-            // TODO: Anyone know how we can determine this for linux? Other systems?
-            // For linux and FreeBSD we are currently assuming the
-            // location of the lldb binary that contains this function is
-            // the directory that will contain a python directory which
-            // has our lldb module. This is how files get placed when
-            // compiling with Makefiles.
-
             static ConstString g_lldb_python_dir;
             if (!g_lldb_python_dir)
             {
@@ -1087,9 +1084,19 @@
                         ::strncpy (framework_pos, "/Resources/Python", PATH_MAX - (framework_pos - raw_path));
                     }
 #else
+                    llvm::Twine python_version_dir;
+                    python_version_dir = "/python"
+                                       + llvm::Twine(PY_MAJOR_VERSION)
+                                       + "."
+                                       + llvm::Twine(PY_MINOR_VERSION)
+                                       + "/site-packages";
+
                     // We may get our string truncated. Should we protect
                     // this with an assert?
-                    ::strncat(raw_path, "/python", sizeof(raw_path) - strlen(raw_path) - 1);
+
+                    ::strncat(raw_path, python_version_dir.str().c_str(),
+                              sizeof(raw_path) - strlen(raw_path) - 1);
+
 #endif
                     FileSpec::Resolve (raw_path, resolved_path, sizeof(resolved_path));
                     g_lldb_python_dir.SetCString(resolved_path);
@@ -1099,7 +1106,7 @@
             return file_spec.GetDirectory();
         }
         break;
-    
+#endif
     case ePathTypeLLDBSystemPlugins:    // System plug-ins directory
         {
 #if defined (__APPLE__)
@@ -1158,9 +1165,6 @@
             // TODO: where would user LLDB plug-ins be located on linux? Other systems?
             return false;
         }
-    default:
-        assert (!"Unhandled PathType");
-        break;
     }
 
     return false;

Modified: lldb/branches/windows/source/Host/common/Mutex.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Host/common/Mutex.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Host/common/Mutex.cpp (original)
+++ lldb/branches/windows/source/Host/common/Mutex.cpp Tue Jan  8 06:51:53 2013
@@ -26,6 +26,7 @@
 // Enable extra mutex error checking
 #ifdef LLDB_CONFIGURATION_DEBUG
 #define ENABLE_MUTEX_ERROR_CHECKING 1
+#include <inttypes.h>
 #endif
 
 #if ENABLE_MUTEX_ERROR_CHECKING
@@ -224,10 +225,6 @@
     case eMutexTypeRecursive:
         err = ::pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE);
         break;
-
-    default:
-        err = -1;
-        break;
     }
     assert(err == 0);
     err = ::pthread_mutex_init (&m_mutex, &attr);
@@ -288,11 +285,12 @@
 int
 Mutex::Lock()
 {
+    DEBUG_LOG ("[%4.4" PRIx64 "/%4.4" PRIx64 "] pthread_mutex_lock (%p)...\n", Host::GetCurrentProcessID(), Host::GetCurrentThreadID(), &m_mutex);
+
 #ifdef _WIN32
     EnterCriticalSection(&m_mutex);
     return 0;
 #else 
-    DEBUG_LOG ("[%4.4llx/%4.4llx] pthread_mutex_lock (%p)...\n", Host::GetCurrentProcessID(), Host::GetCurrentThreadID(), &m_mutex);
 
 #if ENABLE_MUTEX_ERROR_CHECKING
     error_check_mutex (&m_mutex, eMutexActionAssertInitialized);
@@ -308,7 +306,7 @@
         assert(err == 0);
     }
 #endif
-    DEBUG_LOG ("[%4.4llx/%4.4llx] pthread_mutex_lock (%p) => %i\n", Host::GetCurrentProcessID(), Host::GetCurrentThreadID(), &m_mutex, err);
+    DEBUG_LOG ("[%4.4" PRIx64 "/%4.4" PRIx64 "] pthread_mutex_lock (%p) => %i\n", Host::GetCurrentProcessID(), Host::GetCurrentThreadID(), &m_mutex, err);
     return err;
 #endif
 }
@@ -332,7 +330,7 @@
 #endif
 
     int err = ::pthread_mutex_trylock (&m_mutex);
-    DEBUG_LOG ("[%4.4llx/%4.4llx] pthread_mutex_trylock (%p) => %i\n", Host::GetCurrentProcessID(), Host::GetCurrentThreadID(), &m_mutex, err);
+    DEBUG_LOG ("[%4.4" PRIx64 "/%4.4" PRIx64 "] pthread_mutex_trylock (%p) => %i\n", Host::GetCurrentProcessID(), Host::GetCurrentThreadID(), &m_mutex, err);
     return err;
 #endif
 }
@@ -366,7 +364,7 @@
         assert(err == 0);
     }
 #endif
-    DEBUG_LOG ("[%4.4llx/%4.4llx] pthread_mutex_unlock (%p) => %i\n", Host::GetCurrentProcessID(), Host::GetCurrentThreadID(), &m_mutex, err);
+    DEBUG_LOG ("[%4.4" PRIx64 "/%4.4" PRIx64 "] pthread_mutex_unlock (%p) => %i\n", Host::GetCurrentProcessID(), Host::GetCurrentThreadID(), &m_mutex, err);
     return err;
 #endif
 }
@@ -383,6 +381,38 @@
     assert (m_failure_message.empty());
     return Mutex::Unlock();
 }
+
+int
+LoggingMutex::Lock ()
+{
+    printf("locking mutex %p by [%4.4" PRIx64 "/%4.4" PRIx64 "]...", this, Host::GetCurrentProcessID(), Host::GetCurrentThreadID());
+    int x = Mutex::Lock();
+    m_locked = true;
+    printf("%d\n",x);
+    return x;
+}
+
+int
+LoggingMutex::Unlock ()
+{
+    printf("unlocking mutex %p by [%4.4" PRIx64 "/%4.4" PRIx64 "]...", this, Host::GetCurrentProcessID(), Host::GetCurrentThreadID());
+    int x = Mutex::Unlock();
+    m_locked = false;
+    printf("%d\n",x);
+    return x;
+}
+
+int
+LoggingMutex::TryLock (const char *failure_message)
+{
+    printf("trylocking mutex %p by [%4.4" PRIx64 "/%4.4" PRIx64 "]...", this, Host::GetCurrentProcessID(), Host::GetCurrentThreadID());
+    int x = Mutex::TryLock(failure_message);
+    if (x == 0)
+        m_locked = true;
+    printf("%d\n",x);
+    return x;
+}
+
 #endif
-    
+
 

Modified: lldb/branches/windows/source/Host/common/Terminal.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Host/common/Terminal.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Host/common/Terminal.cpp (original)
+++ lldb/branches/windows/source/Host/common/Terminal.cpp Tue Jan  8 06:51:53 2013
@@ -123,6 +123,15 @@
 {
 }
 
+void
+TerminalState::Clear ()
+{
+    m_tty.Clear();
+    m_tflags = -1;
+    m_termios_ap.reset();
+    m_process_group = -1;
+}
+
 //----------------------------------------------------------------------
 // Save the current state of the TTY for the file descriptor "fd"
 // and if "save_process_group" is true, attempt to save the process

Modified: lldb/branches/windows/source/Host/linux/Host.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Host/linux/Host.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Host/linux/Host.cpp (original)
+++ lldb/branches/windows/source/Host/linux/Host.cpp Tue Jan  8 06:51:53 2013
@@ -65,7 +65,7 @@
     // dynamically generated by the kernel) which is incompatible with the
     // current ReadFileContents implementation.  Therefore we simply stream the
     // data into a DataBuffer ourselves.
-    if (snprintf(path, path_size, "/proc/%d/auxv", process->GetID()) < 0)
+    if (snprintf(path, path_size, "/proc/%" PRIu64 "/auxv", process->GetID()) < 0)
         return buf_sp;
 
     if ((fd = open(path, O_RDONLY, 0)) < 0)

Modified: lldb/branches/windows/source/Host/macosx/Host.mm
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Host/macosx/Host.mm?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Host/macosx/Host.mm (original)
+++ lldb/branches/windows/source/Host/macosx/Host.mm Tue Jan  8 06:51:53 2013
@@ -1377,7 +1377,7 @@
         return error;
     
     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_HOST | LIBLLDB_LOG_PROCESS));
-        
+    
     uid_t requested_uid = launch_info.GetUserID();
     const char *xpc_service  = nil;
     bool send_auth = false;
@@ -1394,7 +1394,7 @@
         }
         else
         {
-            error.SetError(4, eErrorTypeGeneric);
+            error.SetError(3, eErrorTypeGeneric);
             error.SetErrorStringWithFormat("Launching root via XPC needs to externalize authorization reference.");
             if (log)
             {
@@ -1406,7 +1406,7 @@
     }
     else
     {
-        error.SetError(3, eErrorTypeGeneric);
+        error.SetError(4, eErrorTypeGeneric);
         error.SetErrorStringWithFormat("Launching via XPC is only currently available for either the login user or root.");
         if (log)
         {
@@ -1422,7 +1422,7 @@
         
         if (type == XPC_TYPE_ERROR) {
             if (event == XPC_ERROR_CONNECTION_INTERRUPTED) {
-                // The service has either canceled itself, crashed, or been terminated. 
+                // The service has either canceled itself, crashed, or been terminated.
                 // The XPC connection is still valid and sending a message to it will re-launch the service.
                 // If the service is state-full, this is the time to initialize the new service.
                 return;
@@ -1435,12 +1435,12 @@
                 // printf("Unexpected error from service: %s", xpc_dictionary_get_string(event, XPC_ERROR_KEY_DESCRIPTION));
             }
             
-        } else {			
+        } else {
             // printf("Received unexpected event in handler");
         }
     });
     
-        xpc_connection_set_finalizer_f (conn, xpc_finalizer_t(xpc_release));
+    xpc_connection_set_finalizer_f (conn, xpc_finalizer_t(xpc_release));
 	xpc_connection_resume (conn);
     xpc_object_t message = xpc_dictionary_create (nil, nil, 0);
     
@@ -1457,24 +1457,36 @@
     xpc_dictionary_set_int64(message, LauncherXPCServicePosixspawnFlagsKey, GetPosixspawnFlags(launch_info));
     
     xpc_object_t reply = xpc_connection_send_message_with_reply_sync(conn, message);
-    
-    pid = xpc_dictionary_get_int64(reply, LauncherXPCServiceChildPIDKey);
-    if (pid == 0)
+    xpc_type_t returnType = xpc_get_type(reply);
+    if (returnType == XPC_TYPE_DICTIONARY)
     {
-        int errorType = xpc_dictionary_get_int64(reply, LauncherXPCServiceErrorTypeKey);
-        int errorCode = xpc_dictionary_get_int64(reply, LauncherXPCServiceCodeTypeKey);
-        
-        error.SetError(errorCode, eErrorTypeGeneric);
-        error.SetErrorStringWithFormat("Problems with launching via XPC. Error type : %i, code : %i", errorType, errorCode);
-        if (log)
+        pid = xpc_dictionary_get_int64(reply, LauncherXPCServiceChildPIDKey);
+        if (pid == 0)
         {
-            error.PutToLog(log.get(), "%s", error.AsCString());
+            int errorType = xpc_dictionary_get_int64(reply, LauncherXPCServiceErrorTypeKey);
+            int errorCode = xpc_dictionary_get_int64(reply, LauncherXPCServiceCodeTypeKey);
+            
+            error.SetError(errorCode, eErrorTypeGeneric);
+            error.SetErrorStringWithFormat("Problems with launching via XPC. Error type : %i, code : %i", errorType, errorCode);
+            if (log)
+            {
+                error.PutToLog(log.get(), "%s", error.AsCString());
+            }
+            
+            if (authorizationRef)
+            {
+                AuthorizationFree(authorizationRef, kAuthorizationFlagDefaults);
+                authorizationRef = NULL;
+            }
         }
-        
-        if (authorizationRef)
+    }
+    else if (returnType == XPC_TYPE_ERROR)
+    {
+        error.SetError(5, eErrorTypeGeneric);
+        error.SetErrorStringWithFormat("Problems with launching via XPC. XPC error : %s", xpc_dictionary_get_string(reply, XPC_ERROR_KEY_DESCRIPTION));
+        if (log)
         {
-            AuthorizationFree(authorizationRef, kAuthorizationFlagDefaults);
-            authorizationRef = NULL;
+            error.PutToLog(log.get(), "%s", error.AsCString());
         }
     }
     

Modified: lldb/branches/windows/source/Host/macosx/Symbols.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Host/macosx/Symbols.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Host/macosx/Symbols.cpp (original)
+++ lldb/branches/windows/source/Host/macosx/Symbols.cpp Tue Jan  8 06:51:53 2013
@@ -83,7 +83,7 @@
     {
         ArchSpec file_arch(eArchTypeMachO, cputype, cpusubtype);
 
-        if (file_arch != *arch)
+        if (!file_arch.IsCompatibleMatch(*arch))
             return false;
     }
 
@@ -181,7 +181,7 @@
         if (arch)
         {
             ArchSpec fat_arch(eArchTypeMachO, arch_cputype, arch_cpusubtype);
-            if (fat_arch != *arch)
+            if (!fat_arch.IsExactMatch(*arch))
                 continue;
         }
 
@@ -797,7 +797,7 @@
                                         ModuleSpec curr_module_spec;
                                         if (GetModuleSpecInfoFromUUIDDictionary (values[i], curr_module_spec))
                                         {
-                                            if (module_spec.GetArchitecture() == curr_module_spec.GetArchitecture())
+                                            if (module_spec.GetArchitecture().IsCompatibleMatch(curr_module_spec.GetArchitecture()))
                                             {
                                                 module_spec = curr_module_spec;
                                                 return true;

Modified: lldb/branches/windows/source/Interpreter/Args.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Interpreter/Args.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Interpreter/Args.cpp (original)
+++ lldb/branches/windows/source/Interpreter/Args.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 // C Includes
 #ifdef _POSIX_SOURCE
 #include <getopt.h>
@@ -22,6 +24,11 @@
 #include "lldb/Core/StreamString.h"
 #include "lldb/Interpreter/Options.h"
 #include "lldb/Interpreter/CommandReturnObject.h"
+#include "lldb/Target/Process.h"
+//#include "lldb/Target/RegisterContext.h"
+#include "lldb/Target/StackFrame.h"
+#include "lldb/Target/Target.h"
+//#include "lldb/Target/Thread.h"
 
 using namespace lldb;
 using namespace lldb_private;
@@ -627,13 +634,16 @@
     {
         if (long_options[i].flag == NULL)
         {
-            sstr << (char)long_options[i].val;
-            switch (long_options[i].has_arg)
+            if (isprint8(long_options[i].val))
             {
-            default:
-            case no_argument:                       break;
-            case required_argument: sstr << ':';    break;
-            case optional_argument: sstr << "::";   break;
+                sstr << (char)long_options[i].val;
+                switch (long_options[i].has_arg)
+                {
+                default:
+                case no_argument:                       break;
+                case required_argument: sstr << ':';    break;
+                case optional_argument: sstr << "::";   break;
+                }
             }
         }
     }
@@ -647,7 +657,10 @@
     while (1)
     {
         int long_options_index = -1;
-        val = ::getopt_long(GetArgumentCount(), GetArgumentVector(), sstr.GetData(), long_options,
+        val = ::getopt_long(GetArgumentCount(),
+                            GetArgumentVector(),
+                            sstr.GetData(),
+                            long_options,
                             &long_options_index);
         if (val == -1)
             break;
@@ -776,26 +789,119 @@
 }
 
 lldb::addr_t
-Args::StringToAddress (const char *s, lldb::addr_t fail_value, bool *success_ptr)
+Args::StringToAddress (const ExecutionContext *exe_ctx, const char *s, lldb::addr_t fail_value, Error *error_ptr)
 {
+    bool error_set = false;
     if (s && s[0])
     {
         char *end = NULL;
         lldb::addr_t addr = ::strtoull (s, &end, 0);
         if (*end == '\0')
         {
-            if (success_ptr) *success_ptr = true;
+            if (error_ptr)
+                error_ptr->Clear();
             return addr; // All characters were used, return the result
         }
         // Try base 16 with no prefix...
         addr = ::strtoull (s, &end, 16);
         if (*end == '\0')
         {
-            if (success_ptr) *success_ptr = true;
+            if (error_ptr)
+                error_ptr->Clear();
             return addr; // All characters were used, return the result
         }
+        
+        if (exe_ctx)
+        {
+            Target *target = exe_ctx->GetTargetPtr();
+            if (target)
+            {
+                lldb::ValueObjectSP valobj_sp;
+                EvaluateExpressionOptions options;
+                options.SetCoerceToId(false);
+                options.SetUnwindOnError(true);
+                options.SetKeepInMemory(false);
+                options.SetRunOthers(true);
+                
+                ExecutionResults expr_result = target->EvaluateExpression(s,
+                                                                          exe_ctx->GetFramePtr(),
+                                                                          valobj_sp,
+                                                                          options);
+
+                bool success = false;
+                if (expr_result == eExecutionCompleted)
+                {
+                    // Get the address to watch.
+                    addr = valobj_sp->GetValueAsUnsigned(fail_value, &success);
+                    if (success)
+                    {
+                        if (error_ptr)
+                            error_ptr->Clear();
+                        return addr;
+                    }
+                    else
+                    {
+                        if (error_ptr)
+                        {
+                            error_set = true;
+                            error_ptr->SetErrorStringWithFormat("address expression \"%s\" resulted in a value whose type can't be converted to an address: %s", s, valobj_sp->GetTypeName().GetCString());
+                        }
+                    }
+                    
+                }
+                else
+                {
+                    // Since the compiler can't handle things like "main + 12" we should
+                    // try to do this for now. The compliler doesn't like adding offsets
+                    // to function pointer types.
+                    RegularExpression symbol_plus_offset_regex("^(.*)([-\\+])[[:space:]]*(0x[0-9A-Fa-f]+|[0-9]+)[[:space:]]*$");
+                    if (symbol_plus_offset_regex.Execute(s, 3))
+                    {
+                        uint64_t offset = 0;
+                        bool add = true;
+                        std::string name;
+                        std::string str;
+                        if (symbol_plus_offset_regex.GetMatchAtIndex(s, 1, name))
+                        {
+                            if (symbol_plus_offset_regex.GetMatchAtIndex(s, 2, str))
+                            {
+                                add = str[0] == '+';
+                                
+                                if (symbol_plus_offset_regex.GetMatchAtIndex(s, 3, str))
+                                {
+                                    offset = Args::StringToUInt64(str.c_str(), 0, 0, &success);
+                                    
+                                    if (success)
+                                    {
+                                        Error error;
+                                        addr = StringToAddress (exe_ctx, name.c_str(), LLDB_INVALID_ADDRESS, &error);
+                                        if (addr != LLDB_INVALID_ADDRESS)
+                                        {
+                                            if (add)
+                                                return addr + offset;
+                                            else
+                                                return addr - offset;
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    }
+                    
+                    if (error_ptr)
+                    {
+                        error_set = true;
+                        error_ptr->SetErrorStringWithFormat("address expression \"%s\" evaluation failed", s);
+                    }
+                }
+            }
+        }
+    }
+    if (error_ptr)
+    {
+        if (!error_set)
+            error_ptr->SetErrorStringWithFormat("invalid address expression \"%s\"", s);
     }
-    if (success_ptr) *success_ptr = false;
     return fail_value;
 }
 
@@ -1094,7 +1200,7 @@
 {
     char short_buffer[3];
     char long_buffer[255];
-    ::snprintf (short_buffer, sizeof (short_buffer), "-%c", (char) long_options[long_options_index].val);
+    ::snprintf (short_buffer, sizeof (short_buffer), "-%c", long_options[long_options_index].val);
     ::snprintf (long_buffer, sizeof (long_buffer),  "--%s", long_options[long_options_index].name);
     size_t end = GetArgumentCount ();
     size_t idx = 0;
@@ -1218,7 +1324,7 @@
         if (long_options_index >= 0)
         {
             StreamString option_str;
-            option_str.Printf ("-%c", (char) val);
+            option_str.Printf ("-%c", val);
 
             switch (long_options[long_options_index].has_arg)
             {
@@ -1258,16 +1364,14 @@
                 }
                 break;
             default:
-                result.AppendErrorWithFormat
-                ("error with options table; invalid value in has_arg field for option '%c'.\n",
-                 (char) val);
+                result.AppendErrorWithFormat ("error with options table; invalid value in has_arg field for option '%c'.\n", val);
                 result.SetStatus (eReturnStatusFailed);
                 break;
             }
         }
         else
         {
-            result.AppendErrorWithFormat ("Invalid option with value '%c'.\n", (char) val);
+            result.AppendErrorWithFormat ("Invalid option with value '%c'.\n", val);
             result.SetStatus (eReturnStatusFailed);
         }
 
@@ -1624,7 +1728,7 @@
     {
         for (const char *p = src; *p != '\0'; ++p)
         {
-            if (isprint(*p))
+            if (isprint8(*p))
                 dst.append(1, *p);
             else
             {

Modified: lldb/branches/windows/source/Interpreter/CommandInterpreter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Interpreter/CommandInterpreter.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Interpreter/CommandInterpreter.cpp (original)
+++ lldb/branches/windows/source/Interpreter/CommandInterpreter.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include <string>
 #include <vector>
 
@@ -279,7 +281,7 @@
         AddOrReplaceAliasOptions ("call", alias_arguments_vector_sp);
 
         alias_arguments_vector_sp.reset (new OptionArgVector);
-        ProcessAliasOptionsArgs (cmd_obj_sp, "-o --", alias_arguments_vector_sp);
+        ProcessAliasOptionsArgs (cmd_obj_sp, "-O --", alias_arguments_vector_sp);
         AddAlias ("po", cmd_obj_sp);
         AddOrReplaceAliasOptions ("po", alias_arguments_vector_sp);
     }
@@ -455,8 +457,10 @@
                                                        "_regexp-attach [<pid>]\n_regexp-attach [<process-name>]", 2));
     if (attach_regex_cmd_ap.get())
     {
-        if (attach_regex_cmd_ap->AddRegexCommand("^([0-9]+)$", "process attach --pid %1") &&
-            attach_regex_cmd_ap->AddRegexCommand("^(.*[^[:space:]])[[:space:]]*$", "process attach --name '%1'"))
+        if (attach_regex_cmd_ap->AddRegexCommand("^([0-9]+)[[:space:]]*$", "process attach --pid %1") &&
+            attach_regex_cmd_ap->AddRegexCommand("^(-.*|.* -.*)$", "process attach %1") && // Any options that are specified get passed to 'process attach'
+            attach_regex_cmd_ap->AddRegexCommand("^(.+)$", "process attach --name '%1'") &&
+            attach_regex_cmd_ap->AddRegexCommand("^$", "process attach"))
         {
             CommandObjectSP attach_regex_cmd_sp(attach_regex_cmd_ap.release());
             m_command_dict[attach_regex_cmd_sp->GetCommandName ()] = attach_regex_cmd_sp;
@@ -2589,8 +2593,6 @@
         case eScriptLanguageNone:
             m_script_interpreter_ap.reset (new ScriptInterpreterNone (*this));
             break;
-        default:
-            break;
     };
     
     return m_script_interpreter_ap.get();

Modified: lldb/branches/windows/source/Interpreter/CommandObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Interpreter/CommandObject.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Interpreter/CommandObject.cpp (original)
+++ lldb/branches/windows/source/Interpreter/CommandObject.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/Interpreter/CommandObject.h"
 
 #include <string>
@@ -754,9 +756,9 @@
     StreamString sstr;
     sstr << "One of the following languages:\n";
     
-    for (LanguageType l = eLanguageTypeUnknown; l < eNumLanguageTypes; l = (LanguageType)((int)l + 1))
+    for (unsigned int l = eLanguageTypeUnknown; l < eNumLanguageTypes; ++l)
     {
-        sstr << "  " << LanguageRuntime::GetNameForLanguageType(l) << "\n";
+        sstr << "  " << LanguageRuntime::GetNameForLanguageType(static_cast<LanguageType>(l)) << "\n";
     }
     
     sstr.Flush();

Modified: lldb/branches/windows/source/Interpreter/CommandObjectRegexCommand.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Interpreter/CommandObjectRegexCommand.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Interpreter/CommandObjectRegexCommand.cpp (original)
+++ lldb/branches/windows/source/Interpreter/CommandObjectRegexCommand.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/Interpreter/CommandObjectRegexCommand.h"
 
 // C Includes

Modified: lldb/branches/windows/source/Interpreter/CommandObjectScript.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Interpreter/CommandObjectScript.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Interpreter/CommandObjectScript.cpp (original)
+++ lldb/branches/windows/source/Interpreter/CommandObjectScript.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "CommandObjectScript.h"
 
 // C Includes
@@ -33,8 +35,7 @@
     CommandObjectRaw (interpreter, 
                       "script",
                       "Pass an expression to the script interpreter for evaluation and return the results. Drop into the interactive interpreter if no expression is given.",
-                      "script [<script-expression-for-evaluation>]"),
-    m_script_lang (script_lang)
+                      "script [<script-expression-for-evaluation>]")
 {
 }
 

Modified: lldb/branches/windows/source/Interpreter/CommandObjectScript.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Interpreter/CommandObjectScript.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Interpreter/CommandObjectScript.h (original)
+++ lldb/branches/windows/source/Interpreter/CommandObjectScript.h Tue Jan  8 06:51:53 2013
@@ -35,9 +35,6 @@
 protected:
     virtual bool
     DoExecute (const char *command, CommandReturnObject &result);
-
-private:
-    lldb::ScriptLanguage m_script_lang;
 };
 
 } // namespace lldb_private

Modified: lldb/branches/windows/source/Interpreter/CommandReturnObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Interpreter/CommandReturnObject.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Interpreter/CommandReturnObject.cpp (original)
+++ lldb/branches/windows/source/Interpreter/CommandReturnObject.cpp Tue Jan  8 06:51:53 2013
@@ -104,24 +104,19 @@
 }
 
 void
-CommandReturnObject::AppendMessage (const char *in_string, int len)
+CommandReturnObject::AppendMessage (const char *in_string)
 {
-    if (!in_string || len == 0)
+    if (!in_string || *in_string == '\0')
         return;
-    if (len < 0)
-	    GetOutputStream().Printf("%s\n", in_string);
-	else
-	    GetOutputStream().Printf("%*.*s\n", len, len, in_string);
+    GetOutputStream().Printf("%s\n", in_string);
 }
 
 void
-CommandReturnObject::AppendWarning (const char *in_string, int len)
+CommandReturnObject::AppendWarning (const char *in_string)
 {
-    if (!in_string)
+    if (!in_string || *in_string == '\0')
         return;
-    if (len < 0)
-        len = ::strlen (in_string);
-    GetErrorStream().Printf("warning: %*.*s\n", len, len, in_string);
+    GetErrorStream().Printf("warning: %s\n", in_string);
 }
 
 // Similar to AppendWarning, but do not prepend 'warning: ' to message, and
@@ -138,13 +133,11 @@
 }
 
 void
-CommandReturnObject::AppendError (const char *in_string, int len)
+CommandReturnObject::AppendError (const char *in_string)
 {
-    if (!in_string)
+    if (!in_string || *in_string == '\0')
         return;
-    if (len < 0)
-        len = ::strlen (in_string);
-    GetErrorStream().Printf ("error: %*.*s\n", len, len, in_string);
+    GetErrorStream().Printf ("error: %s\n", in_string);
 }
 
 void

Modified: lldb/branches/windows/source/Interpreter/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Interpreter/Makefile?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Interpreter/Makefile (original)
+++ lldb/branches/windows/source/Interpreter/Makefile Tue Jan  8 06:51:53 2013
@@ -16,6 +16,13 @@
 include $(LLDB_LEVEL)/Makefile
 -include $(PROJ_OBJ_DIR)/LLDBWrapPython.cpp.d
 
+# Drop -Wfour-char-constants,  which we are not currently clean with.
+EXTRA_OPTIONS += -Wno-four-char-constants
+
+# Drop -Wself-assign, -Wmissing-field-initializers and -Wsometimes-uninitialized,
+# which we are not currently clean with (due to SWIG generated cpp source).
+EXTRA_OPTIONS += -Wno-missing-field-initializers -Wno-self-assign -Wno-sometimes-uninitialized
+
 # edit-swig-python-wrapper-file.py needs $(SRCROOT)
 export SRCROOT := $(PROJ_SRC_DIR)/$(LLDB_LEVEL)
 

Modified: lldb/branches/windows/source/Interpreter/OptionGroupArchitecture.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Interpreter/OptionGroupArchitecture.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Interpreter/OptionGroupArchitecture.cpp (original)
+++ lldb/branches/windows/source/Interpreter/OptionGroupArchitecture.cpp Tue Jan  8 06:51:53 2013
@@ -62,7 +62,7 @@
                                  const char *option_arg)
 {
     Error error;
-    char short_option = (char) g_option_table[option_idx].short_option;
+    const int short_option = g_option_table[option_idx].short_option;
 
     switch (short_option)
     {

Modified: lldb/branches/windows/source/Interpreter/OptionGroupBoolean.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Interpreter/OptionGroupBoolean.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Interpreter/OptionGroupBoolean.cpp (original)
+++ lldb/branches/windows/source/Interpreter/OptionGroupBoolean.cpp Tue Jan  8 06:51:53 2013
@@ -20,7 +20,7 @@
 OptionGroupBoolean::OptionGroupBoolean (uint32_t usage_mask,
                                         bool required,
                                         const char *long_option, 
-                                        char short_option,
+                                        int short_option,
                                         const char *usage_text,
                                         bool default_value,
                                         bool no_argument_toggle_default) :

Modified: lldb/branches/windows/source/Interpreter/OptionGroupFile.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Interpreter/OptionGroupFile.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Interpreter/OptionGroupFile.cpp (original)
+++ lldb/branches/windows/source/Interpreter/OptionGroupFile.cpp Tue Jan  8 06:51:53 2013
@@ -20,7 +20,7 @@
 OptionGroupFile::OptionGroupFile (uint32_t usage_mask,
                                   bool required,
                                   const char *long_option, 
-                                  char short_option,
+                                  int short_option,
                                   uint32_t completion_type,
                                   lldb::CommandArgumentType argument_type,
                                   const char *usage_text) :
@@ -43,8 +43,8 @@
 
 Error
 OptionGroupFile::SetOptionValue (CommandInterpreter &interpreter,
-                                         uint32_t option_idx,
-                                         const char *option_arg)
+                                 uint32_t option_idx,
+                                 const char *option_arg)
 {
     Error error (m_file.SetValueFromCString (option_arg));
     return error;
@@ -60,7 +60,7 @@
 OptionGroupFileList::OptionGroupFileList (uint32_t usage_mask,
                                           bool required,
                                           const char *long_option, 
-                                          char short_option,
+                                          int short_option,
                                           uint32_t completion_type,
                                           lldb::CommandArgumentType argument_type,
                                           const char *usage_text) :
@@ -83,8 +83,8 @@
 
 Error
 OptionGroupFileList::SetOptionValue (CommandInterpreter &interpreter,
-                                 uint32_t option_idx,
-                                 const char *option_arg)
+                                     uint32_t option_idx,
+                                     const char *option_arg)
 {
     Error error (m_file_list.SetValueFromCString (option_arg));
     return error;

Modified: lldb/branches/windows/source/Interpreter/OptionGroupFormat.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Interpreter/OptionGroupFormat.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Interpreter/OptionGroupFormat.cpp (original)
+++ lldb/branches/windows/source/Interpreter/OptionGroupFormat.cpp Tue Jan  8 06:51:53 2013
@@ -13,6 +13,10 @@
 // C++ Includes
 // Other libraries and framework includes
 // Project includes
+#include "lldb/Core/ArchSpec.h"
+#include "lldb/Interpreter/CommandInterpreter.h"
+#include "lldb/Target/ExecutionContext.h"
+#include "lldb/Target/Target.h"
 #include "lldb/Utility/Utils.h"
 
 using namespace lldb;
@@ -67,7 +71,7 @@
                                    const char *option_arg)
 {
     Error error;
-    char short_option = (char) g_option_table[option_idx].short_option;
+    const int short_option = g_option_table[option_idx].short_option;
 
     switch (short_option)
     {
@@ -119,7 +123,7 @@
                 Format format = eFormatDefault;
                 uint32_t byte_size = 0;
                 
-                while (ParserGDBFormatLetter (gdb_format_cstr[0], format, byte_size))
+                while (ParserGDBFormatLetter (interpreter, gdb_format_cstr[0], format, byte_size))
                 {
                     ++gdb_format_cstr;
                 }
@@ -139,7 +143,7 @@
                 // Anything that wasn't set correctly should be set to the
                 // previous default
                 if (format == eFormatInvalid)
-                    ParserGDBFormatLetter (m_prev_gdb_format, format, byte_size);
+                    ParserGDBFormatLetter (interpreter, m_prev_gdb_format, format, byte_size);
                 
                 const bool byte_size_enabled = m_byte_size.GetDefaultValue() < UINT64_MAX;
                 const bool count_enabled = m_count.GetDefaultValue() < UINT64_MAX;
@@ -147,7 +151,7 @@
                 {
                     // Byte size is enabled
                     if (byte_size == 0)
-                        ParserGDBFormatLetter (m_prev_gdb_size, format, byte_size);
+                        ParserGDBFormatLetter (interpreter, m_prev_gdb_size, format, byte_size);
                 }
                 else
                 {
@@ -199,7 +203,7 @@
 }
 
 bool
-OptionGroupFormat::ParserGDBFormatLetter (char format_letter, Format &format, uint32_t &byte_size)
+OptionGroupFormat::ParserGDBFormatLetter (CommandInterpreter &interpreter, char format_letter, Format &format, uint32_t &byte_size)
 {
     switch (format_letter)
     {
@@ -209,7 +213,15 @@
         case 'u': format = eFormatUnsigned;     m_prev_gdb_format = format_letter; return true;
         case 't': format = eFormatBinary;       m_prev_gdb_format = format_letter; return true;
         case 'f': format = eFormatFloat;        m_prev_gdb_format = format_letter; return true;
-        case 'a': format = eFormatAddressInfo;  m_prev_gdb_format = format_letter; return true;
+        case 'a': format = eFormatAddressInfo;
+        {
+            ExecutionContext exe_ctx(interpreter.GetExecutionContext());
+            Target *target = exe_ctx.GetTargetPtr();
+            if (target)
+                byte_size = target->GetArchitecture().GetAddressByteSize();
+            m_prev_gdb_format = format_letter;
+            return true;
+        }
         case 'i': format = eFormatInstruction;  m_prev_gdb_format = format_letter; return true;
         case 'c': format = eFormatChar;         m_prev_gdb_format = format_letter; return true;
         case 's': format = eFormatCString;      m_prev_gdb_format = format_letter; return true;

Modified: lldb/branches/windows/source/Interpreter/OptionGroupOutputFile.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Interpreter/OptionGroupOutputFile.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Interpreter/OptionGroupOutputFile.cpp (original)
+++ lldb/branches/windows/source/Interpreter/OptionGroupOutputFile.cpp Tue Jan  8 06:51:53 2013
@@ -32,7 +32,7 @@
 g_option_table[] =
 {
     { LLDB_OPT_SET_1 , false, "outfile", 'o', required_argument, NULL, 0, eArgTypeFilename , "Specify a path for capturing command output."},
-    { LLDB_OPT_SET_1 , false, "append-outfile" , 'A', no_argument, NULL, 0, eArgTypeNone , "Append to the the file specified with '--outfile <path>'."},
+    { LLDB_OPT_SET_1 , false, "append-outfile" , 'apnd', no_argument, NULL, 0, eArgTypeNone , "Append to the the file specified with '--outfile <path>'."},
 };
 
 uint32_t
@@ -49,11 +49,11 @@
 
 Error
 OptionGroupOutputFile::SetOptionValue (CommandInterpreter &interpreter,
-                                         uint32_t option_idx,
-                                         const char *option_arg)
+                                       uint32_t option_idx,
+                                       const char *option_arg)
 {
     Error error;
-    char short_option = (char) g_option_table[option_idx].short_option;
+    const int short_option = g_option_table[option_idx].short_option;
 
     switch (short_option)
     {
@@ -61,7 +61,7 @@
             error = m_file.SetValueFromCString (option_arg);
             break;
 
-        case 'A':
+        case 'apnd':
             m_append.SetCurrentValue(true);
             break;
 

Modified: lldb/branches/windows/source/Interpreter/OptionGroupPlatform.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Interpreter/OptionGroupPlatform.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Interpreter/OptionGroupPlatform.cpp (original)
+++ lldb/branches/windows/source/Interpreter/OptionGroupPlatform.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/Interpreter/OptionGroupPlatform.h"
 
 // C Includes
@@ -84,7 +86,7 @@
     { LLDB_OPT_SET_ALL, false, "platform", 'p', required_argument, NULL, 0, eArgTypePlatform, "Specify name of the platform to use for this target, creating the platform if necessary."},
     { LLDB_OPT_SET_ALL, false, "version" , 'v', required_argument, NULL, 0, eArgTypeNone, "Specify the initial SDK version to use prior to connecting." },
     { LLDB_OPT_SET_ALL, false, "build"   , 'b', required_argument, NULL, 0, eArgTypeNone, "Specify the initial SDK build number." },
-    { LLDB_OPT_SET_ALL, false, "sysroot" , 's', required_argument, NULL, 0, eArgTypeFilename, "Specify the SDK root directory that contains a root of all remote system files." }
+    { LLDB_OPT_SET_ALL, false, "sysroot" , 'S', required_argument, NULL, 0, eArgTypeFilename, "Specify the SDK root directory that contains a root of all remote system files." }
 };
 
 const OptionDefinition*
@@ -113,7 +115,7 @@
     if (!m_include_platform_option)
         ++option_idx;
     
-    char short_option = (char) g_option_table[option_idx].short_option;
+    const int short_option = g_option_table[option_idx].short_option;
     
     switch (short_option)
     {

Modified: lldb/branches/windows/source/Interpreter/OptionGroupString.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Interpreter/OptionGroupString.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Interpreter/OptionGroupString.cpp (original)
+++ lldb/branches/windows/source/Interpreter/OptionGroupString.cpp Tue Jan  8 06:51:53 2013
@@ -20,7 +20,7 @@
 OptionGroupString::OptionGroupString (uint32_t usage_mask,
                                       bool required,
                                       const char *long_option,
-                                      char short_option,
+                                      int short_option,
                                       uint32_t completion_type,
                                       lldb::CommandArgumentType argument_type,
                                       const char *usage_text,

Modified: lldb/branches/windows/source/Interpreter/OptionGroupUInt64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Interpreter/OptionGroupUInt64.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Interpreter/OptionGroupUInt64.cpp (original)
+++ lldb/branches/windows/source/Interpreter/OptionGroupUInt64.cpp Tue Jan  8 06:51:53 2013
@@ -20,7 +20,7 @@
 OptionGroupUInt64::OptionGroupUInt64 (uint32_t usage_mask,
                                         bool required,
                                         const char *long_option, 
-                                        char short_option,
+                                        int short_option,
                                         uint32_t completion_type,
                                         lldb::CommandArgumentType argument_type,
                                         const char *usage_text,

Modified: lldb/branches/windows/source/Interpreter/OptionGroupUUID.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Interpreter/OptionGroupUUID.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Interpreter/OptionGroupUUID.cpp (original)
+++ lldb/branches/windows/source/Interpreter/OptionGroupUUID.cpp Tue Jan  8 06:51:53 2013
@@ -47,11 +47,11 @@
 
 Error
 OptionGroupUUID::SetOptionValue (CommandInterpreter &interpreter,
-                                         uint32_t option_idx,
-                                         const char *option_arg)
+                                 uint32_t option_idx,
+                                 const char *option_arg)
 {
     Error error;
-    char short_option = (char) g_option_table[option_idx].short_option;
+    const int short_option = g_option_table[option_idx].short_option;
 
     switch (short_option)
     {

Modified: lldb/branches/windows/source/Interpreter/OptionGroupValueObjectDisplay.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Interpreter/OptionGroupValueObjectDisplay.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Interpreter/OptionGroupValueObjectDisplay.cpp (original)
+++ lldb/branches/windows/source/Interpreter/OptionGroupValueObjectDisplay.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/Interpreter/OptionGroupValueObjectDisplay.h"
 
 // C Includes
@@ -31,17 +33,17 @@
 static OptionDefinition
 g_option_table[] =
 {
-    { LLDB_OPT_SET_1, false, "dynamic-type",     'd', required_argument, g_dynamic_value_types, 0, eArgTypeNone,      "Show the object as its full dynamic type, not its static type, if available."},
-    { LLDB_OPT_SET_1, false, "synthetic-type",   'S', required_argument, NULL, 0, eArgTypeBoolean,   "Show the object obeying its synthetic provider, if available."},
-    { LLDB_OPT_SET_1, false, "depth",            'D', required_argument, NULL, 0, eArgTypeCount,     "Set the max recurse depth when dumping aggregate types (default is infinity)."},
-    { LLDB_OPT_SET_1, false, "flat",             'F', no_argument,       NULL, 0, eArgTypeNone,      "Display results in a flat format that uses expression paths for each variable or member."},
-    { LLDB_OPT_SET_1, false, "location",         'L', no_argument,       NULL, 0, eArgTypeNone,      "Show variable location information."},
-    { LLDB_OPT_SET_1, false, "objc",             'O', no_argument,       NULL, 0, eArgTypeNone,      "Print as an Objective-C object."},
-    { LLDB_OPT_SET_1, false, "ptr-depth",        'P', required_argument, NULL, 0, eArgTypeCount,     "The number of pointers to be traversed when dumping values (default is zero)."},
-    { LLDB_OPT_SET_1, false, "show-types",       'T', no_argument,       NULL, 0, eArgTypeNone,      "Show variable types when dumping values."},
-    { LLDB_OPT_SET_1, false, "no-summary-depth", 'Y', optional_argument, NULL, 0, eArgTypeCount,     "Set the depth at which omitting summary information stops (default is 1)."},
-    { LLDB_OPT_SET_1, false, "raw-output",       'R', no_argument,       NULL, 0, eArgTypeNone,      "Don't use formatting options."},
-    { LLDB_OPT_SET_1, false, "show-all-children",'A', no_argument,       NULL, 0, eArgTypeNone,      "Ignore the upper bound on the number of children to show."},
+    { LLDB_OPT_SET_1, false, "dynamic-type",       'd', required_argument, g_dynamic_value_types, 0, eArgTypeNone,      "Show the object as its full dynamic type, not its static type, if available."},
+    { LLDB_OPT_SET_1, false, "synthetic-type",     'S', required_argument, NULL, 0, eArgTypeBoolean,   "Show the object obeying its synthetic provider, if available."},
+    { LLDB_OPT_SET_1, false, "depth",              'D', required_argument, NULL, 0, eArgTypeCount,     "Set the max recurse depth when dumping aggregate types (default is infinity)."},
+    { LLDB_OPT_SET_1, false, "flat",               'F', no_argument,       NULL, 0, eArgTypeNone,      "Display results in a flat format that uses expression paths for each variable or member."},
+    { LLDB_OPT_SET_1, false, "location",           'L', no_argument,       NULL, 0, eArgTypeNone,      "Show variable location information."},
+    { LLDB_OPT_SET_1, false, "object-description", 'O', no_argument,       NULL, 0, eArgTypeNone,      "Print as an Objective-C object."},
+    { LLDB_OPT_SET_1, false, "ptr-depth",          'P', required_argument, NULL, 0, eArgTypeCount,     "The number of pointers to be traversed when dumping values (default is zero)."},
+    { LLDB_OPT_SET_1, false, "show-types",         'T', no_argument,       NULL, 0, eArgTypeNone,      "Show variable types when dumping values."},
+    { LLDB_OPT_SET_1, false, "no-summary-depth",   'Y', optional_argument, NULL, 0, eArgTypeCount,     "Set the depth at which omitting summary information stops (default is 1)."},
+    { LLDB_OPT_SET_1, false, "raw-output",         'R', no_argument,       NULL, 0, eArgTypeNone,      "Don't use formatting options."},
+    { LLDB_OPT_SET_1, false, "show-all-children",  'A', no_argument,       NULL, 0, eArgTypeNone,      "Ignore the upper bound on the number of children to show."},
     { 0, false, NULL, 0, 0, NULL, 0, eArgTypeNone, NULL }
 };
 
@@ -64,7 +66,7 @@
                                                const char *option_arg)
 {
     Error error;
-    char short_option = (char) g_option_table[option_idx].short_option;
+    const int short_option = g_option_table[option_idx].short_option;
     bool success = false;
 
     switch (short_option)

Modified: lldb/branches/windows/source/Interpreter/OptionGroupVariable.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Interpreter/OptionGroupVariable.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Interpreter/OptionGroupVariable.cpp (original)
+++ lldb/branches/windows/source/Interpreter/OptionGroupVariable.cpp Tue Jan  8 06:51:53 2013
@@ -7,12 +7,16 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/Interpreter/OptionGroupVariable.h"
 
 // C Includes
 // C++ Includes
 // Other libraries and framework includes
 // Project includes
+#include "lldb/Core/DataVisualization.h"
+#include "lldb/Core/Error.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Interpreter/CommandInterpreter.h"
 #include "lldb/Utility/Utils.h"
@@ -24,23 +28,42 @@
 static OptionDefinition
 g_option_table[] =
 {
-    { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "no-args",         'a', no_argument,       NULL, 0, eArgTypeNone,    "Omit function arguments."},
-    { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "no-locals",       'l', no_argument,       NULL, 0, eArgTypeNone,    "Omit local variables."},
-    { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "show-globals",    'g', no_argument,       NULL, 0, eArgTypeNone,    "Show the current frame source file global and static variables."},
-    { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "show-declaration",'c', no_argument,       NULL, 0, eArgTypeNone,    "Show variable declaration information (source file and line where the variable was declared)."},
-    { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "regex",           'r', no_argument,       NULL, 0, eArgTypeRegularExpression,    "The <variable-name> argument for name lookups are regular expressions."},
-    { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "scope",           's', no_argument,       NULL, 0, eArgTypeNone,    "Show variable scope (argument, local, global, static)."},
-    { LLDB_OPT_SET_1, false, "summary",         'y', required_argument, NULL, 0, eArgTypeName,  "Specify the summary that the variable output should use."},
-    { LLDB_OPT_SET_2, false, "summary-string",  'z', required_argument, NULL, 0, eArgTypeName,  "Specify a summary string to use to format the variable output."},
+    { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "no-args",         'a', no_argument,       NULL, 0, eArgTypeNone, "Omit function arguments."},
+    { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "no-locals",       'l', no_argument,       NULL, 0, eArgTypeNone, "Omit local variables."},
+    { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "show-globals",    'g', no_argument,       NULL, 0, eArgTypeNone, "Show the current frame source file global and static variables."},
+    { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "show-declaration",'c', no_argument,       NULL, 0, eArgTypeNone, "Show variable declaration information (source file and line where the variable was declared)."},
+    { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "regex",           'r', no_argument,       NULL, 0, eArgTypeRegularExpression, "The <variable-name> argument for name lookups are regular expressions."},
+    { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "scope",           's', no_argument,       NULL, 0, eArgTypeNone, "Show variable scope (argument, local, global, static)."},
+    { LLDB_OPT_SET_1,                  false, "summary",         'y', required_argument, NULL, 0, eArgTypeName, "Specify the summary that the variable output should use."},
+    { LLDB_OPT_SET_2,                  false, "summary-string",  'z', required_argument, NULL, 0, eArgTypeName, "Specify a summary string to use to format the variable output."},
 };
 
+Error OptionGroupVariableNamedSummaryValidator (const char* str,void*) 
+{
+    if (!str || !str[0])
+        return Error("must specify a valid named summary");
+    TypeSummaryImplSP summary_sp;
+    if (DataVisualization::NamedSummaryFormats::GetSummaryFormat(ConstString(str), summary_sp) == false)
+        return Error("must specify a valid named summary");
+    return Error();
+}
+
+Error OptionGroupVariableNamedSummaryStringValidator (const char* str,void*) 
+{
+    if (!str || !str[0])
+        return Error("must specify a non-empty summary string");
+    return Error();
+}
 
 OptionGroupVariable::OptionGroupVariable (bool show_frame_options) :
     OptionGroup(),
-    include_frame_options (show_frame_options)
+    include_frame_options (show_frame_options),
+    summary(OptionGroupVariableNamedSummaryValidator),
+    summary_string(OptionGroupVariableNamedSummaryStringValidator)
 {
 }
 
+
 OptionGroupVariable::~OptionGroupVariable ()
 {
 }
@@ -53,7 +76,7 @@
     Error error;
     if (!include_frame_options)
         option_idx += 3;
-    char short_option = (char) g_option_table[option_idx].short_option;
+    const int short_option = g_option_table[option_idx].short_option;
     switch (short_option)
     {
         case 'r':   use_regex    = true;  break;
@@ -65,10 +88,10 @@
             show_scope = true;
             break;
         case 'y':
-            summary.SetCurrentValue(option_arg);
+            error = summary.SetCurrentValue(option_arg);
             break;
         case 'z':
-            summary_string.SetCurrentValue(option_arg);
+            error = summary_string.SetCurrentValue(option_arg);
             break;
         default:
             error.SetErrorStringWithFormat("unrecognized short option '%c'", short_option);

Modified: lldb/branches/windows/source/Interpreter/OptionGroupWatchpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Interpreter/OptionGroupWatchpoint.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Interpreter/OptionGroupWatchpoint.cpp (original)
+++ lldb/branches/windows/source/Interpreter/OptionGroupWatchpoint.cpp Tue Jan  8 06:51:53 2013
@@ -73,7 +73,7 @@
                                        const char *option_arg)
 {
     Error error;
-    char short_option = (char) g_option_table[option_idx].short_option;
+    const int short_option = g_option_table[option_idx].short_option;
     switch (short_option)
     {
         case 'w':

Modified: lldb/branches/windows/source/Interpreter/OptionValueArch.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Interpreter/OptionValueArch.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Interpreter/OptionValueArch.cpp (original)
+++ lldb/branches/windows/source/Interpreter/OptionValueArch.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/Interpreter/OptionValueArch.h"
 
 // C Includes

Modified: lldb/branches/windows/source/Interpreter/OptionValueArray.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Interpreter/OptionValueArray.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Interpreter/OptionValueArray.cpp (original)
+++ lldb/branches/windows/source/Interpreter/OptionValueArray.cpp Tue Jan  8 06:51:53 2013
@@ -126,9 +126,9 @@
                     if (array_count == 0)
                         error.SetErrorStringWithFormat("index %i is not valid for an empty array", idx);
                     else if (idx > 0)
-                        error.SetErrorStringWithFormat("index %i out of range, valid values are 0 through %llu", idx, (uint64_t)(array_count - 1));
+                        error.SetErrorStringWithFormat("index %i out of range, valid values are 0 through %" PRIu64, idx, (uint64_t)(array_count - 1));
                     else
-                        error.SetErrorStringWithFormat("negative index %i out of range, valid values are -1 through -%llu", idx, (uint64_t)array_count);
+                        error.SetErrorStringWithFormat("negative index %i out of range, valid values are -1 through -%" PRIu64, idx, (uint64_t)array_count);
                 }
             }
         }

Modified: lldb/branches/windows/source/Interpreter/OptionValueDictionary.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Interpreter/OptionValueDictionary.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Interpreter/OptionValueDictionary.cpp (original)
+++ lldb/branches/windows/source/Interpreter/OptionValueDictionary.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/Interpreter/OptionValueDictionary.h"
 
 // C Includes

Modified: lldb/branches/windows/source/Interpreter/OptionValueEnumeration.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Interpreter/OptionValueEnumeration.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Interpreter/OptionValueEnumeration.cpp (original)
+++ lldb/branches/windows/source/Interpreter/OptionValueEnumeration.cpp Tue Jan  8 06:51:53 2013
@@ -50,7 +50,7 @@
                 return;
             }
         }
-        strm.Printf("%llu", (uint64_t)m_current_value);
+        strm.Printf("%" PRIu64, (uint64_t)m_current_value);
     }
 }
 

Modified: lldb/branches/windows/source/Interpreter/OptionValueFileSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Interpreter/OptionValueFileSpec.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Interpreter/OptionValueFileSpec.cpp (original)
+++ lldb/branches/windows/source/Interpreter/OptionValueFileSpec.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/Interpreter/OptionValueFileSpec.h"
 
 // C Includes
@@ -92,8 +94,17 @@
     case eVarSetOperationAssign:
         if (value_cstr && value_cstr[0])
         {
-            m_value_was_set = true;
-            m_current_value.SetFile(value_cstr, value_cstr[0] == '~');
+            Args args(value_cstr);
+            if (args.GetArgumentCount() == 1)
+            {
+                const char *path = args.GetArgumentAtIndex(0);
+                m_value_was_set = true;
+                m_current_value.SetFile(path, true);
+            }
+            else
+            {
+                error.SetErrorString("please supply a single path argument for this file or quote the path if it contains spaces");
+            }
         }
         else
         {

Modified: lldb/branches/windows/source/Interpreter/OptionValueFormat.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Interpreter/OptionValueFormat.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Interpreter/OptionValueFormat.cpp (original)
+++ lldb/branches/windows/source/Interpreter/OptionValueFormat.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/Interpreter/OptionValueFormat.h"
 
 // C Includes

Modified: lldb/branches/windows/source/Interpreter/OptionValueSInt64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Interpreter/OptionValueSInt64.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Interpreter/OptionValueSInt64.cpp (original)
+++ lldb/branches/windows/source/Interpreter/OptionValueSInt64.cpp Tue Jan  8 06:51:53 2013
@@ -22,7 +22,7 @@
 void
 OptionValueSInt64::DumpValue (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask)
 {
-    //printf ("%p: DumpValue (exe_ctx=%p, strm, mask) m_current_value = %lli\n", this, exe_ctx, m_current_value);
+    //printf ("%p: DumpValue (exe_ctx=%p, strm, mask) m_current_value = %" PRIi64 "\n", this, exe_ctx, m_current_value);
     if (dump_mask & eDumpOptionType)
         strm.Printf ("(%s)", GetTypeAsCString ());
 //    if (dump_mask & eDumpOptionName)
@@ -31,7 +31,7 @@
     {
         if (dump_mask & eDumpOptionType)
             strm.PutCString (" = ");
-        strm.Printf ("%lli", m_current_value);
+        strm.Printf ("%" PRIi64, m_current_value);
     }
 }
 
@@ -59,7 +59,7 @@
                         m_current_value = value;
                     }
                     else
-                        error.SetErrorStringWithFormat ("%lli is out of range, valid values must be between %lli and %lli.",
+                        error.SetErrorStringWithFormat ("%" PRIi64 " is out of range, valid values must be between %" PRIi64 " and %" PRIi64 ".",
                                                         value,
                                                         m_min_value,
                                                         m_max_value);

Modified: lldb/branches/windows/source/Interpreter/OptionValueString.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Interpreter/OptionValueString.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Interpreter/OptionValueString.cpp (original)
+++ lldb/branches/windows/source/Interpreter/OptionValueString.cpp Tue Jan  8 06:51:53 2013
@@ -61,20 +61,36 @@
     case eVarSetOperationInsertBefore:
     case eVarSetOperationInsertAfter:
     case eVarSetOperationRemove:
+        if (m_validator)
+        {
+            error = m_validator(value_cstr,m_validator_baton);
+            if (error.Fail())
+                return error;
+        }
         error = OptionValue::SetValueFromCString (value_cstr, op);
         break;
 
     case eVarSetOperationAppend:
+        {
+        std::string new_value(m_current_value);
         if (value_cstr && value_cstr[0])
         {
             if (m_options.Test (eOptionEncodeCharacterEscapeSequences))
             {
                 std::string str;
                 Args::EncodeEscapeSequences (value_cstr, str);
-                m_current_value += str;
+                new_value.append(str);
             }
             else
-                m_current_value += value_cstr;
+                new_value.append(value_cstr);
+        }
+        if (m_validator)
+        {
+            error = m_validator(new_value.c_str(),m_validator_baton);
+            if (error.Fail())
+                return error;
+        }
+        m_current_value.assign(new_value);
         }
         break;
 
@@ -84,6 +100,12 @@
 
     case eVarSetOperationReplace:
     case eVarSetOperationAssign:
+        if (m_validator)
+        {
+            error = m_validator(value_cstr,m_validator_baton);
+            if (error.Fail())
+                return error;
+        }
         m_value_was_set = true;
         if (m_options.Test (eOptionEncodeCharacterEscapeSequences))
         {
@@ -104,3 +126,39 @@
 {
     return OptionValueSP(new OptionValueString(*this));
 }
+
+Error
+OptionValueString::SetCurrentValue (const char *value)
+{
+    if (m_validator)
+    {
+        Error error(m_validator(value,m_validator_baton));
+        if (error.Fail())
+            return error;
+    }
+    if (value && value[0])
+        m_current_value.assign (value);
+    else
+        m_current_value.clear();
+    return Error();
+}
+
+Error
+OptionValueString::AppendToCurrentValue (const char *value)
+{
+    if (value && value[0])
+    {
+        if (m_validator)
+        {
+            std::string new_value(m_current_value);
+            new_value.append(value);
+            Error error(m_validator(value,m_validator_baton));
+            if (error.Fail())
+                return error;
+            m_current_value.assign(new_value);
+        }
+        else
+            m_current_value.append (value);
+    }
+    return Error();
+}

Modified: lldb/branches/windows/source/Interpreter/OptionValueUInt64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Interpreter/OptionValueUInt64.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Interpreter/OptionValueUInt64.cpp (original)
+++ lldb/branches/windows/source/Interpreter/OptionValueUInt64.cpp Tue Jan  8 06:51:53 2013
@@ -39,7 +39,7 @@
     {
         if (dump_mask & eDumpOptionType)
             strm.PutCString (" = ");
-        strm.Printf ("%llu", m_current_value);
+        strm.Printf ("%" PRIu64, m_current_value);
     }
 }
 

Modified: lldb/branches/windows/source/Interpreter/OptionValueUUID.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Interpreter/OptionValueUUID.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Interpreter/OptionValueUUID.cpp (original)
+++ lldb/branches/windows/source/Interpreter/OptionValueUUID.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/Interpreter/OptionValueUUID.h"
 
 // C Includes

Modified: lldb/branches/windows/source/Interpreter/Options.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Interpreter/Options.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Interpreter/Options.cpp (original)
+++ lldb/branches/windows/source/Interpreter/Options.cpp Tue Jan  8 06:51:53 2013
@@ -7,13 +7,15 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/Interpreter/Options.h"
 
 // C Includes
 // C++ Includes
 #include <algorithm>
 #include <bitset>
-#include <set>
+#include <map>
 
 // Other libraries and framework includes
 // Project includes
@@ -58,7 +60,7 @@
 void
 Options::OptionSeen (int option_idx)
 {
-    m_seen_options.insert ((char) option_idx);
+    m_seen_options.insert (option_idx);
 }
 
 // Returns true is set_a is a subset of set_b;  Otherwise returns false.
@@ -266,33 +268,54 @@
             return NULL;
 
         uint32_t i;
-        uint32_t j;
         const OptionDefinition *opt_defs = GetDefinitions();
 
-        std::bitset<256> option_seen;
+        std::map<int, uint32_t> option_seen;
 
         m_getopt_table.resize(num_options + 1);
-        for (i = 0, j = 0; i < num_options; ++i)
+        for (i = 0; i < num_options; ++i)
         {
-            char short_opt = opt_defs[i].short_option;
+            const int short_opt = opt_defs[i].short_option;
 
-            if (option_seen.test(short_opt) == false)
+            m_getopt_table[i].name    = opt_defs[i].long_option;
+            m_getopt_table[i].has_arg = opt_defs[i].option_has_arg;
+            m_getopt_table[i].flag    = NULL;
+            m_getopt_table[i].val     = short_opt;
+
+            if (option_seen.find(short_opt) == option_seen.end())
+            {
+                option_seen[short_opt] = i;
+            }
+            else if (short_opt)
             {
-                m_getopt_table[j].name    = opt_defs[i].long_option;
-                m_getopt_table[j].has_arg = opt_defs[i].option_has_arg;
-                m_getopt_table[j].flag    = NULL;
-                m_getopt_table[j].val     = opt_defs[i].short_option;
-                option_seen.set(short_opt);
-                ++j;
+                m_getopt_table[i].val = 0;
+                std::map<int, uint32_t>::const_iterator pos = option_seen.find(short_opt);
+                StreamString strm;
+                if (isprint8(short_opt))
+                    Host::SystemLog (Host::eSystemLogError, "option[%u] --%s has a short option -%c that conflicts with option[%u] --%s, short option won't be used for --%s\n",
+                                i,
+                                opt_defs[i].long_option,
+                                short_opt,
+                                pos->second,
+                                m_getopt_table[pos->second].name,
+                                opt_defs[i].long_option);
+                else
+                    Host::SystemLog (Host::eSystemLogError, "option[%u] --%s has a short option 0x%x that conflicts with option[%u] --%s, short option won't be used for --%s\n",
+                                i,
+                                opt_defs[i].long_option,
+                                short_opt,
+                                pos->second,
+                                m_getopt_table[pos->second].name,
+                                opt_defs[i].long_option);
             }
         }
 
         //getopt_long requires a NULL final entry in the table:
 
-        m_getopt_table[j].name    = NULL;
-        m_getopt_table[j].has_arg = 0;
-        m_getopt_table[j].flag    = NULL;
-        m_getopt_table[j].val     = 0;
+        m_getopt_table[i].name    = NULL;
+        m_getopt_table[i].has_arg = 0;
+        m_getopt_table[i].flag    = NULL;
+        m_getopt_table[i].val     = 0;
     }
 
     if (m_getopt_table.empty())
@@ -389,6 +412,57 @@
     return false;
 }
 
+enum OptionDisplayType
+{
+    eDisplayBestOption,
+    eDisplayShortOption,
+    eDisplayLongOption
+};
+
+static bool
+PrintOption (const OptionDefinition &opt_def,
+             OptionDisplayType display_type,
+             const char *header,
+             const char *footer,
+             bool show_optional,
+             Stream &strm)
+{
+    const bool has_short_option = isprint8(opt_def.short_option) != 0;
+
+    if (display_type == eDisplayShortOption && !has_short_option)
+        return false;
+
+    if (header && header[0])
+        strm.PutCString(header);
+    
+    if (show_optional && !opt_def.required)
+    strm.PutChar('[');
+    const bool show_short_option = has_short_option && display_type != eDisplayLongOption;
+    if (show_short_option)
+        strm.Printf ("-%c", opt_def.short_option);
+    else
+        strm.Printf ("--%s", opt_def.long_option);
+    switch (opt_def.option_has_arg)
+    {
+        case no_argument:
+            break;
+        case required_argument:
+            strm.Printf (" <%s>", CommandObject::GetArgumentName (opt_def.argument_type));
+            break;
+            
+        case optional_argument:
+            strm.Printf ("%s[<%s>]",
+                         show_short_option ? "" : "=",
+                         CommandObject::GetArgumentName (opt_def.argument_type));
+            break;
+    }
+    if (show_optional && !opt_def.required)
+        strm.PutChar(']');
+    if (footer && footer[0])
+        strm.PutCString(footer);
+    return true;
+}
+
 void
 Options::GenerateOptionUsage
 (
@@ -446,12 +520,12 @@
         // a single string. If a command has "-a" "-b" and "-c", this will show
         // up as [-abc]
 
-        std::set<char> options;
-        std::set<char>::const_iterator options_pos, options_end;
+        std::set<int> options;
+        std::set<int>::const_iterator options_pos, options_end;
         bool first;
         for (i = 0, first = true; i < num_options; ++i)
         {
-            if (opt_defs[i].usage_mask & opt_set_mask)
+            if (opt_defs[i].usage_mask & opt_set_mask && isprint8(opt_defs[i].short_option))
             {
                 // Add current option to the end of out_stream.
 
@@ -472,17 +546,17 @@
                      options_pos != options_end;
                      ++options_pos)
                 {
-                    if (i==0 && ::isupper (*options_pos))
+                    if (i==0 && ::islower (*options_pos))
                         continue;
-                    if (i==1 && ::islower (*options_pos))
+                    if (i==1 && ::isupper (*options_pos))
                         continue;
-                    strm << *options_pos;
+                    strm << (char)*options_pos;
                 }
         }
 
         for (i = 0, options.clear(); i < num_options; ++i)
         {
-            if (opt_defs[i].usage_mask & opt_set_mask)
+            if (opt_defs[i].usage_mask & opt_set_mask && isprint8(opt_defs[i].short_option))
             {
                 // Add current option to the end of out_stream.
 
@@ -503,11 +577,11 @@
                      options_pos != options_end;
                      ++options_pos)
                 {
-                    if (i==0 && ::isupper (*options_pos))
+                    if (i==0 && ::islower (*options_pos))
                         continue;
-                    if (i==1 && ::islower (*options_pos))
+                    if (i==1 && ::isupper (*options_pos))
                         continue;
-                    strm << *options_pos;
+                    strm << (char)*options_pos;
                 }
             strm.PutChar(']');
         }
@@ -516,26 +590,10 @@
         
         for (i = 0; i < num_options; ++i)
         {
-            if (opt_defs[i].usage_mask & opt_set_mask)
+            if (opt_defs[i].usage_mask & opt_set_mask && isprint8(opt_defs[i].short_option))
             {
-                // Add current option to the end of out_stream.
-                CommandArgumentType arg_type = opt_defs[i].argument_type;
-                
-                if (opt_defs[i].required)
-                {
-                    if (opt_defs[i].option_has_arg == required_argument)
-                    {
-                        strm.Printf (" -%c <%s>",
-                                     opt_defs[i].short_option, 
-                                     CommandObject::GetArgumentName (arg_type));
-                    }
-                    else if (opt_defs[i].option_has_arg == optional_argument)
-                    {
-                        strm.Printf (" -%c [<%s>]",
-                                     opt_defs[i].short_option,
-                                     CommandObject::GetArgumentName (arg_type));
-                    }
-                }
+                if (opt_defs[i].required && opt_defs[i].option_has_arg != no_argument)
+                    PrintOption (opt_defs[i], eDisplayBestOption, " ", NULL, true, strm);
             }
         }
 
@@ -547,17 +605,8 @@
             {
                 // Add current option to the end of out_stream.
 
-                CommandArgumentType arg_type = opt_defs[i].argument_type;
-                
-                if (! opt_defs[i].required)
-                {
-                    if (opt_defs[i].option_has_arg == required_argument)
-                        strm.Printf (" [-%c <%s>]", opt_defs[i].short_option,
-                                     CommandObject::GetArgumentName (arg_type));
-                    else if (opt_defs[i].option_has_arg == optional_argument)
-                        strm.Printf (" [-%c [<%s>]]", opt_defs[i].short_option,
-                                     CommandObject::GetArgumentName (arg_type));
-                }
+                if (!opt_defs[i].required && opt_defs[i].option_has_arg != no_argument)
+                    PrintOption (opt_defs[i], eDisplayBestOption, " ", NULL, true, strm);
             }
         }
         
@@ -588,86 +637,69 @@
     // This variable is used to keep track of which options' info we've printed out, because some options can be in
     // more than one usage level, but we only want to print the long form of its information once.
 
-    OptionSet options_seen;
-    OptionSet::iterator pos;
+    std::multimap<int, uint32_t> options_seen;
     strm.IndentMore (5);
 
-    std::vector<char> sorted_options;
-
-
     // Put the unique command options in a vector & sort it, so we can output them alphabetically (by short_option)
     // when writing out detailed help for each option.
 
     for (i = 0; i < num_options; ++i)
-    {
-        pos = options_seen.find (opt_defs[i].short_option);
-        if (pos == options_seen.end())
-        {
-            options_seen.insert (opt_defs[i].short_option);
-            sorted_options.push_back (opt_defs[i].short_option);
-        }
-    }
-
-    std::sort (sorted_options.begin(), sorted_options.end());
+        options_seen.insert(std::make_pair(opt_defs[i].short_option, i));
 
     // Go through the unique'd and alphabetically sorted vector of options, find the table entry for each option
     // and write out the detailed help information for that option.
 
-    int first_option_printed = 1;
-    size_t end = sorted_options.size();
-    for (size_t j = 0; j < end; ++j)
-    {
-        char option = sorted_options[j];
-        bool found = false;
-        for (i = 0; i < num_options && !found; ++i)
+    bool first_option_printed = false;;
+
+    for (auto pos = options_seen.begin(); pos != options_seen.end(); ++pos)
+    {
+        i = pos->second;
+        //Print out the help information for this option.
+
+        // Put a newline separation between arguments
+        if (first_option_printed)
+            strm.EOL();
+        else
+            first_option_printed = true;
+        
+        CommandArgumentType arg_type = opt_defs[i].argument_type;
+        
+        StreamString arg_name_str;
+        arg_name_str.Printf ("<%s>", CommandObject::GetArgumentName (arg_type));
+
+        strm.Indent ();
+        if (opt_defs[i].short_option && isprint8(opt_defs[i].short_option))
+        {
+            PrintOption (opt_defs[i], eDisplayShortOption, NULL, NULL, false, strm);
+            PrintOption (opt_defs[i], eDisplayLongOption, " ( ", " )", false, strm);
+        }
+        else
         {
-            if (opt_defs[i].short_option == option)
+            // Short option is not printable, just print long option
+            PrintOption (opt_defs[i], eDisplayLongOption, NULL, NULL, false, strm);
+        }
+        strm.EOL();
+        
+        strm.IndentMore (5);
+        
+        if (opt_defs[i].usage_text)
+            OutputFormattedUsageText (strm,
+                                      opt_defs[i].usage_text,
+                                      screen_width);
+        if (opt_defs[i].enum_values != NULL)
+        {
+            strm.Indent ();
+            strm.Printf("Values: ");
+            for (int k = 0; opt_defs[i].enum_values[k].string_value != NULL; k++) 
             {
-                found = true;
-                //Print out the help information for this option.
-
-                // Put a newline separation between arguments
-                if (first_option_printed)
-                    first_option_printed = 0;
+                if (k == 0)
+                    strm.Printf("%s", opt_defs[i].enum_values[k].string_value);
                 else
-                    strm.EOL();
-                
-                CommandArgumentType arg_type = opt_defs[i].argument_type;
-                
-                StreamString arg_name_str;
-                arg_name_str.Printf ("<%s>", CommandObject::GetArgumentName (arg_type));
-
-                strm.Indent ();
-                strm.Printf ("-%c", opt_defs[i].short_option);
-                if (arg_type != eArgTypeNone)
-                    strm.Printf (" <%s>",  CommandObject::GetArgumentName (arg_type));
-                strm.Printf ("  ( --%s", opt_defs[i].long_option);
-                if (arg_type != eArgTypeNone)
-                    strm.Printf (" <%s>", CommandObject::GetArgumentName (arg_type));
-                strm.PutCString(" )\n");
-                
-                strm.IndentMore (5);
-                
-                if (opt_defs[i].usage_text)
-                    OutputFormattedUsageText (strm,
-                                              opt_defs[i].usage_text,
-                                              screen_width);
-                if (opt_defs[i].enum_values != NULL)
-                {
-                    strm.Indent ();
-                    strm.Printf("Values: ");
-                    for (int k = 0; opt_defs[i].enum_values[k].string_value != NULL; k++) 
-                    {
-                        if (k == 0)
-                            strm.Printf("%s", opt_defs[i].enum_values[k].string_value);
-                        else
-                            strm.Printf(" | %s", opt_defs[i].enum_values[k].string_value);
-                    }
-                    strm.EOL();
-                }
-                strm.IndentLess (5);
+                    strm.Printf(" | %s", opt_defs[i].enum_values[k].string_value);
             }
+            strm.EOL();
         }
+        strm.IndentLess (5);
     }
 
     // Restore the indent level

Modified: lldb/branches/windows/source/Interpreter/Property.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Interpreter/Property.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Interpreter/Property.cpp (original)
+++ lldb/branches/windows/source/Interpreter/Property.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/Interpreter/Property.h"
 
 // C Includes

Modified: lldb/branches/windows/source/Interpreter/ScriptInterpreter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Interpreter/ScriptInterpreter.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Interpreter/ScriptInterpreter.cpp (original)
+++ lldb/branches/windows/source/Interpreter/ScriptInterpreter.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/Interpreter/ScriptInterpreter.h"
 
 #include <string>

Modified: lldb/branches/windows/source/Interpreter/ScriptInterpreterNone.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Interpreter/ScriptInterpreterNone.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Interpreter/ScriptInterpreterNone.cpp (original)
+++ lldb/branches/windows/source/Interpreter/ScriptInterpreterNone.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/Interpreter/ScriptInterpreterNone.h"
 #include "lldb/Core/Stream.h"
 #include "lldb/Core/StringList.h"

Modified: lldb/branches/windows/source/Interpreter/ScriptInterpreterPython.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Interpreter/ScriptInterpreterPython.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Interpreter/ScriptInterpreterPython.cpp (original)
+++ lldb/branches/windows/source/Interpreter/ScriptInterpreterPython.cpp Tue Jan  8 06:51:53 2013
@@ -150,8 +150,8 @@
         m_tmp_fh = (m_python_interpreter->m_dbg_stdout ? m_python_interpreter->m_dbg_stdout : stdout);
 
     DoAcquireLock();
-    if ( (on_entry & InitSession) == InitSession )
-        DoInitSession();
+    if ((on_entry & InitSession) == InitSession)
+        DoInitSession((on_entry & InitGlobals) == InitGlobals);
 }
 
 bool
@@ -165,11 +165,11 @@
 }
 
 bool
-ScriptInterpreterPython::Locker::DoInitSession()
+ScriptInterpreterPython::Locker::DoInitSession(bool init_lldb_globals)
 {
     if (!m_python_interpreter)
         return false;
-    m_python_interpreter->EnterSession ();
+    m_python_interpreter->EnterSession (init_lldb_globals);
     return true;
 }
 
@@ -308,7 +308,7 @@
                     if (pty_slave_name != NULL && PyThreadState_GetDict() != NULL)
                     {
                         ScriptInterpreterPython::Locker locker(script_interpreter,
-                                                               ScriptInterpreterPython::Locker::AcquireLock | ScriptInterpreterPython::Locker::InitSession,
+                                                               ScriptInterpreterPython::Locker::AcquireLock | ScriptInterpreterPython::Locker::InitSession | ScriptInterpreterPython::Locker::InitGlobals,
                                                                ScriptInterpreterPython::Locker::FreeAcquiredLock);
                         run_string.Printf ("run_one_line (%s, 'save_stderr = sys.stderr')", script_interpreter->m_dictionary_name.c_str());
                         PyRun_SimpleString (run_string.GetData());
@@ -334,7 +334,7 @@
                 if (IS_VALID_LLDB_HOST_THREAD(embedded_interpreter_thread))
                 {
                     if (log)
-                        log->Printf ("ScriptInterpreterPython::NonInteractiveInputReaderCallback, Activate, succeeded in creating thread (thread_t = %p)", embedded_interpreter_thread);
+                        log->Printf ("ScriptInterpreterPython::NonInteractiveInputReaderCallback, Activate, succeeded in creating thread (thread_t = %p)", (void *)embedded_interpreter_thread);
                     Error detach_error;
                     Host::ThreadDetach (embedded_interpreter_thread, &detach_error);
                 }
@@ -371,7 +371,22 @@
             break;
             
         case eInputReaderInterrupt:
-            reader.SetIsDone(true);
+        {
+            PyThreadState* state = _PyThreadState_Current;
+            if (!state)
+                state = script_interpreter->m_command_thread_state;
+            if (state)
+            {
+                long tid = state->thread_id;
+                _PyThreadState_Current = state;
+                int num_threads = PyThreadState_SetAsyncExc(tid, PyExc_KeyboardInterrupt);
+                if (log)
+                    log->Printf("ScriptInterpreterPython::NonInteractiveInputReaderCallback, eInputReaderInterrupt, tid = %ld, num_threads = %d, state = %p",
+                                tid,num_threads,state);
+            }
+            else if (log)
+                log->Printf("ScriptInterpreterPython::NonInteractiveInputReaderCallback, eInputReaderInterrupt, state = NULL");
+        }
             break;
             
         case eInputReaderEndOfFile:
@@ -446,7 +461,8 @@
     m_dictionary_name (interpreter.GetDebugger().GetInstanceName().AsCString()),
     m_terminal_state (),
     m_session_is_active (false),
-    m_valid_session (true)
+    m_valid_session (true),
+    m_command_thread_state (NULL)
 {
 
     static int g_initialized = false;
@@ -493,7 +509,7 @@
         Debugger::Terminate();
 
     run_string.Clear();
-    run_string.Printf ("run_one_line (%s, 'lldb.debugger_unique_id = %llu; pydoc.pager = pydoc.plainpager')", m_dictionary_name.c_str(),
+    run_string.Printf ("run_one_line (%s, 'lldb.debugger_unique_id = %" PRIu64 "; pydoc.pager = pydoc.plainpager')", m_dictionary_name.c_str(),
                        interpreter.GetDebugger().GetID());
     PyRun_SimpleString (run_string.GetData());
     
@@ -602,7 +618,7 @@
 }
 
 void
-ScriptInterpreterPython::EnterSession ()
+ScriptInterpreterPython::EnterSession (bool init_lldb_globals)
 {
     // If we have already entered the session, without having officially 'left' it, then there is no need to 
     // 'enter' it again.
@@ -614,20 +630,23 @@
 
     StreamString run_string;
 
-    run_string.Printf (    "run_one_line (%s, 'lldb.debugger_unique_id = %llu", m_dictionary_name.c_str(), GetCommandInterpreter().GetDebugger().GetID());
-    run_string.Printf (    "; lldb.debugger = lldb.SBDebugger.FindDebuggerWithID (%llu)", GetCommandInterpreter().GetDebugger().GetID());
-    run_string.PutCString ("; lldb.target = lldb.debugger.GetSelectedTarget()");
-    run_string.PutCString ("; lldb.process = lldb.target.GetProcess()");
-    run_string.PutCString ("; lldb.thread = lldb.process.GetSelectedThread ()");
-    run_string.PutCString ("; lldb.frame = lldb.thread.GetSelectedFrame ()");
-    // Make sure STDIN is closed since when we run this as an embedded 
-    // interpreter we don't want someone to call "line = sys.stdin.readline()"
-    // and lock up. We don't have multiple windows and when the interpreter is
-    // embedded we don't know we should be feeding input to the embedded 
-    // interpreter or to the python sys.stdin. We also don't want to let python
-    // play with the real stdin from this process, so we need to close it...
-    //run_string.PutCString ("; sys.stdin.close()");
-    run_string.PutCString ("')");
+    if (init_lldb_globals)
+    {
+        run_string.Printf (    "run_one_line (%s, 'lldb.debugger_unique_id = %" PRIu64, m_dictionary_name.c_str(), GetCommandInterpreter().GetDebugger().GetID());
+        run_string.Printf (    "; lldb.debugger = lldb.SBDebugger.FindDebuggerWithID (%" PRIu64 ")", GetCommandInterpreter().GetDebugger().GetID());
+        run_string.PutCString ("; lldb.target = lldb.debugger.GetSelectedTarget()");
+        run_string.PutCString ("; lldb.process = lldb.target.GetProcess()");
+        run_string.PutCString ("; lldb.thread = lldb.process.GetSelectedThread ()");
+        run_string.PutCString ("; lldb.frame = lldb.thread.GetSelectedFrame ()");
+        run_string.PutCString ("')");
+    }
+    else
+    {
+        // If we aren't initing the globals, we should still always set the debugger (since that is always unique.)
+        run_string.Printf (    "run_one_line (%s, \"lldb.debugger_unique_id = %" PRIu64, m_dictionary_name.c_str(), GetCommandInterpreter().GetDebugger().GetID());
+        run_string.Printf (    "; lldb.debugger = lldb.SBDebugger.FindDebuggerWithID (%" PRIu64 ")", GetCommandInterpreter().GetDebugger().GetID());
+        run_string.PutCString ("\")");
+    }
 
     PyRun_SimpleString (run_string.GetData());
     run_string.Clear();
@@ -720,7 +739,7 @@
     // method to pass the command string directly down to Python.
 
     Locker locker(this,
-                  ScriptInterpreterPython::Locker::AcquireLock | (options.GetSetLLDBGlobals() ? ScriptInterpreterPython::Locker::InitSession : 0),
+                  ScriptInterpreterPython::Locker::AcquireLock | ScriptInterpreterPython::Locker::InitSession | (options.GetSetLLDBGlobals() ? ScriptInterpreterPython::Locker::InitGlobals : 0),
                   ScriptInterpreterPython::Locker::FreeAcquiredLock | (options.GetSetLLDBGlobals() ? ScriptInterpreterPython::Locker::TearDownSession : 0));
 
     bool success = false;
@@ -842,7 +861,9 @@
 
             {
                 ScriptInterpreterPython::Locker locker(script_interpreter,
-                                                       ScriptInterpreterPython::Locker::AcquireLock | ScriptInterpreterPython::Locker::InitSession,
+                                                       ScriptInterpreterPython::Locker::AcquireLock
+                                                       | ScriptInterpreterPython::Locker::InitSession
+                                                       | ScriptInterpreterPython::Locker::InitGlobals,
                                                        ScriptInterpreterPython::Locker::FreeAcquiredLock);
             }
 
@@ -859,7 +880,7 @@
                 if (IS_VALID_LLDB_HOST_THREAD(embedded_interpreter_thread))
                 {
                     if (log)
-                        log->Printf ("ScriptInterpreterPython::InputReaderCallback, Activate, succeeded in creating thread (thread_t = %p)", embedded_interpreter_thread);
+                        log->Printf ("ScriptInterpreterPython::InputReaderCallback, Activate, succeeded in creating thread (thread_t = %p)", (void *)embedded_interpreter_thread);
                     Error detach_error;
                     Host::ThreadDetach (embedded_interpreter_thread, &detach_error);
                 }
@@ -887,7 +908,9 @@
     case eInputReaderReactivate:
         {
             ScriptInterpreterPython::Locker locker(script_interpreter,
-                                                   ScriptInterpreterPython::Locker::AcquireLock | ScriptInterpreterPython::Locker::InitSession,
+                                                   ScriptInterpreterPython::Locker::AcquireLock
+                                                   | ScriptInterpreterPython::Locker::InitSession
+                                                   | ScriptInterpreterPython::Locker::InitGlobals,
                                                    ScriptInterpreterPython::Locker::FreeAcquiredLock);
         }
         break;
@@ -992,7 +1015,9 @@
 {
 
     Locker locker(this,
-                  ScriptInterpreterPython::Locker::AcquireLock | (options.GetSetLLDBGlobals() ? ScriptInterpreterPython::Locker::InitSession : 0),
+                  ScriptInterpreterPython::Locker::AcquireLock
+                  | ScriptInterpreterPython::Locker::InitSession
+                  | (options.GetSetLLDBGlobals() ? ScriptInterpreterPython::Locker::InitGlobals : 0),
                   ScriptInterpreterPython::Locker::FreeAcquiredLock | (options.GetSetLLDBGlobals() ? ScriptInterpreterPython::Locker::TearDownSession : 0));
 
     PyObject *py_return = NULL;
@@ -1129,8 +1154,6 @@
                     success = PyArg_Parse (py_return, format, (char *) ret_value);
                     break;
                 }
-                default:
-                  {}
             }
             Py_DECREF (py_return);
             if (success)
@@ -1161,7 +1184,9 @@
     
     
     Locker locker(this,
-                  ScriptInterpreterPython::Locker::AcquireLock | (options.GetSetLLDBGlobals() ? ScriptInterpreterPython::Locker::InitSession : 0),
+                  ScriptInterpreterPython::Locker::AcquireLock
+                  | ScriptInterpreterPython::Locker::InitSession
+                  | (options.GetSetLLDBGlobals() ? ScriptInterpreterPython::Locker::InitGlobals : 0),
                   ScriptInterpreterPython::Locker::FreeAcquiredLock | (options.GetSetLLDBGlobals() ? ScriptInterpreterPython::Locker::TearDownSession : 0));
 
     bool success = false;
@@ -1584,10 +1609,11 @@
     
     // Wrap everything up inside the function, increasing the indentation.
     
+    auto_generated_function.AppendString("     if True:");
     for (int i = 0; i < num_lines; ++i)
     {
         sstr.Clear ();
-        sstr.Printf ("     %s", input.GetStringAtIndex (i));
+        sstr.Printf ("       %s", input.GetStringAtIndex (i));
         auto_generated_function.AppendString (sstr.GetData());
     }
     auto_generated_function.AppendString ("     for key in new_keys:");  // Iterate over all the keys from session dict
@@ -1677,7 +1703,8 @@
     auto_generated_class.AppendString (sstr.GetData());
         
     // Wrap everything up inside the class, increasing the indentation.
-    
+    // we don't need to play any fancy indentation tricks here because there is no
+    // surrounding code whose indentation we need to honor
     for (int i = 0; i < num_lines; ++i)
     {
         sstr.Clear ();
@@ -2171,7 +2198,7 @@
         // we can just release the GIL after finishing our work.
         // If finer-grained locking is desirable, we can lock and unlock the GIL only when calling a python function.
         Locker locker(script_interpreter,
-                      ScriptInterpreterPython::Locker::AcquireLock | ScriptInterpreterPython::Locker::InitSession,
+                      ScriptInterpreterPython::Locker::AcquireLock | ScriptInterpreterPython::Locker::InitSession | ScriptInterpreterPython::Locker::InitGlobals,
                       ScriptInterpreterPython::Locker::FreeAcquiredLock | ScriptInterpreterPython::Locker::TearDownSession);
 
         run_string.Printf ("run_one_line (%s, 'save_stderr = sys.stderr')", script_interpreter->m_dictionary_name.c_str());
@@ -2383,10 +2410,67 @@
     return ret_val;
 }
 
+static std::string
+ReadPythonBacktrace (PyObject* py_backtrace)
+{
+    PyObject* traceback_module = NULL,
+    *stringIO_module = NULL,
+    *stringIO_builder = NULL,
+    *stringIO_buffer = NULL,
+    *printTB = NULL,
+    *printTB_args = NULL,
+    *printTB_result = NULL,
+    *stringIO_getvalue = NULL,
+    *printTB_string = NULL;
+
+    std::string retval("backtrace unavailable");
+    
+    if (py_backtrace && py_backtrace != Py_None)
+    {
+        traceback_module = PyImport_ImportModule("traceback");
+        stringIO_module = PyImport_ImportModule("StringIO");
+        
+        if (traceback_module && traceback_module != Py_None && stringIO_module && stringIO_module != Py_None)
+        {
+            stringIO_builder = PyObject_GetAttrString(stringIO_module, "StringIO");
+            if (stringIO_builder && stringIO_builder != Py_None)
+            {
+                stringIO_buffer = PyObject_CallObject(stringIO_builder, NULL);
+                if (stringIO_buffer && stringIO_buffer != Py_None)
+                {
+                    printTB = PyObject_GetAttrString(traceback_module, "print_tb");
+                    if (printTB && printTB != Py_None)
+                    {
+                        printTB_args = Py_BuildValue("OOO",py_backtrace,Py_None,stringIO_buffer);
+                        printTB_result = PyObject_CallObject(printTB, printTB_args);
+                        stringIO_getvalue = PyObject_GetAttrString(stringIO_buffer, "getvalue");
+                        if (stringIO_getvalue && stringIO_getvalue != Py_None)
+                        {
+                            printTB_string = PyObject_CallObject (stringIO_getvalue,NULL);
+                            if (printTB_string && printTB_string != Py_None && PyString_Check(printTB_string))
+                                retval.assign(PyString_AsString(printTB_string));
+                        }
+                    }
+                }
+            }
+        }
+    }
+    Py_XDECREF(traceback_module);
+    Py_XDECREF(stringIO_module);
+    Py_XDECREF(stringIO_builder);
+    Py_XDECREF(stringIO_buffer);
+    Py_XDECREF(printTB);
+    Py_XDECREF(printTB_args);
+    Py_XDECREF(printTB_result);
+    Py_XDECREF(stringIO_getvalue);
+    Py_XDECREF(printTB_string);
+    return retval;
+}
+
 bool
 ScriptInterpreterPython::LoadScriptingModule (const char* pathname,
                                               bool can_reload,
-                                              bool init_lldb_globals,
+                                              bool init_session,
                                               lldb_private::Error& error)
 {
     if (!pathname || !pathname[0])
@@ -2419,8 +2503,8 @@
 
         // Before executing Pyton code, lock the GIL.
         Locker py_lock (this,
-                        Locker::AcquireLock      | (init_lldb_globals ? Locker::InitSession     : 0),
-                        Locker::FreeAcquiredLock | (init_lldb_globals ? Locker::TearDownSession : 0));
+                        Locker::AcquireLock      | (init_session ? Locker::InitSession     : 0),
+                        Locker::FreeAcquiredLock | (init_session ? Locker::TearDownSession : 0));
         
         // now make sure that Python has "directory" in the search path
         StreamString command_stream;
@@ -2436,10 +2520,13 @@
         
         // strip .py or .pyc extension
         ConstString extension = target_file.GetFileNameExtension();
-        if (::strcmp(extension.GetCString(), "py") == 0)
-            basename.resize(basename.length()-3);
-        else if(::strcmp(extension.GetCString(), "pyc") == 0)
-            basename.resize(basename.length()-4);
+        if (extension)
+        {
+            if (::strcmp(extension.GetCString(), "py") == 0)
+                basename.resize(basename.length()-3);
+            else if(::strcmp(extension.GetCString(), "pyc") == 0)
+                basename.resize(basename.length()-4);
+        }
         
         // check if the module is already import-ed
         command_stream.Clear();
@@ -2467,34 +2554,30 @@
         {
             if (py_error) // if we have a Python error..
             {
+                PyObject *type = NULL,*value = NULL,*traceback = NULL;
+                PyErr_Fetch (&type,&value,&traceback);
+
                 if (PyErr_GivenExceptionMatches (py_error, PyExc_ImportError)) // and it is an ImportError
                 {
-                    PyObject *type,*value,*traceback;
-                    PyErr_Fetch (&type,&value,&traceback);
-                    
                     if (value && value != Py_None)
                         error.SetErrorString(PyString_AsString(PyObject_Str(value)));
                     else
                         error.SetErrorString("ImportError raised by imported module");
-                    
-                    Py_XDECREF(type);
-                    Py_XDECREF(value);
-                    Py_XDECREF(traceback);
                 }
                 else // any other error
                 {
-                    PyObject *type,*value,*traceback;
-                    PyErr_Fetch (&type,&value,&traceback);
+                    // get the backtrace
+                    std::string bt = ReadPythonBacktrace(traceback);
                     
                     if (value && value != Py_None)
-                        error.SetErrorStringWithFormat("Python error raised while importing module: %s", PyString_AsString(PyObject_Str(value)));
+                        error.SetErrorStringWithFormat("Python error raised while importing module: %s - traceback: %s", PyString_AsString(PyObject_Str(value)),bt.c_str());
                     else
-                        error.SetErrorString("Python raised an error while importing module");
-                    
-                    Py_XDECREF(type);
-                    Py_XDECREF(value);
-                    Py_XDECREF(traceback);
+                        error.SetErrorStringWithFormat("Python raised an error while importing module - traceback: %s",bt.c_str());
                 }
+                
+                Py_XDECREF(type);
+                Py_XDECREF(value);
+                Py_XDECREF(traceback);
             }
             else // we failed but have no error to explain why
             {
@@ -2575,9 +2658,19 @@
     std::string err_msg;
 
     {
-        Locker py_lock(this);
+        Locker py_lock(this,
+                       Locker::AcquireLock | Locker::InitSession | Locker::InitGlobals,
+                       Locker::FreeLock | Locker::TearDownSession);
+
         SynchronicityHandler synch_handler(debugger_sp,
                                            synchronicity);
+
+        // we need to save the thread state when we first start the command
+        // because we might decide to interrupt it while some action is taking
+        // place outside of Python (e.g. printing to screen, waiting for the network, ...)
+        // in that case, _PyThreadState_Current will be NULL - and we would be unable
+        // to set the asynchronous exception - not a desirable situation
+        m_command_thread_state = _PyThreadState_Current;
         
         PythonInputReaderManager py_input(this);
         

Modified: lldb/branches/windows/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp (original)
+++ lldb/branches/windows/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp Tue Jan  8 06:51:53 2013
@@ -332,10 +332,7 @@
     if (!reg_ctx)
         return false;
         
-    addr_t sp = reg_ctx->GetSP(0);
-    
-    if (!sp)
-        return false;
+    addr_t sp = 0;
 
     for (uint32_t value_idx = 0; value_idx < num_values; ++value_idx)
     {
@@ -405,6 +402,14 @@
                 }
                 else
                 {
+                    if (sp == 0)
+                    {
+                        // Read the stack pointer if it already hasn't been read
+                        sp = reg_ctx->GetSP(0);
+                        if (sp == 0)
+                            return false;
+                    }
+
                     // Arguments 5 on up are on the stack
                     const uint32_t arg_byte_size = (bit_width + (8-1)) / 8;
                     Error error;
@@ -421,7 +426,7 @@
 
 ValueObjectSP
 ABIMacOSX_arm::GetReturnValueObjectImpl (Thread &thread,
-                               lldb_private::ClangASTType &ast_type) const
+                                         lldb_private::ClangASTType &ast_type) const
 {
     Value value;
     ValueObjectSP return_valobj_sp;

Modified: lldb/branches/windows/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp (original)
+++ lldb/branches/windows/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp Tue Jan  8 06:51:53 2013
@@ -453,7 +453,6 @@
                 switch (scalar.GetType())
                 {
                 case Scalar::e_void:
-                default:
                     return false;
                 case Scalar::e_sint: 
                 case Scalar::e_uint:
@@ -928,22 +927,24 @@
 bool
 ABIMacOSX_i386::RegisterIsVolatile (const RegisterInfo *reg_info)
 {
-    return RegisterIsCalleeSaved (reg_info);
+    return !RegisterIsCalleeSaved (reg_info);
 }
 
+// v. http://developer.apple.com/library/mac/#documentation/developertools/Conceptual/LowLevelABI/130-IA-32_Function_Calling_Conventions/IA32.html#//apple_ref/doc/uid/TP40002492-SW4
+
 bool
 ABIMacOSX_i386::RegisterIsCalleeSaved (const RegisterInfo *reg_info)
 {
     if (reg_info)
     {
-        // Volatile registers include: ebx, ebp, esi, edi, esp, eip
+        // Saved registers are ebx, ebp, esi, edi, esp, eip
         const char *name = reg_info->name;
         if (name[0] == 'e')
         {
             switch (name[1])
             {
             case 'b': 
-                if (name[2] == 'x') // ebp is volatile in the ABI, but the unwinders can find it
+                if (name[2] == 'x' || name[2] == 'p')
                     return name[3] == '\0';
                 break;
             case 'd':
@@ -960,6 +961,12 @@
                 break;
             }
         }
+        if (name[0] == 's' && name[1] == 'p' && name[2] == '\0')   // sp
+            return true;
+        if (name[0] == 'f' && name[1] == 'p' && name[2] == '\0')   // fp
+            return true;
+        if (name[0] == 'p' && name[1] == 'c' && name[2] == '\0')   // pc
+            return true;
     }
     return false;
 }

Modified: lldb/branches/windows/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp (original)
+++ lldb/branches/windows/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp Tue Jan  8 06:51:53 2013
@@ -318,7 +318,7 @@
     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS));
     
     if (log)
-        log->Printf("ABISysV_x86_64::PrepareTrivialCall\n(\n  thread = %p\n  sp = 0x%llx\n  func_addr = 0x%llx\n  return_addr = 0x%llx\n  arg1_ptr = %p (0x%llx)\n  arg2_ptr = %p (0x%llx)\n  arg3_ptr = %p (0x%llx)\n)",
+        log->Printf("ABISysV_x86_64::PrepareTrivialCall\n(\n  thread = %p\n  sp = 0x%" PRIx64 "\n  func_addr = 0x%" PRIx64 "\n  return_addr = 0x%" PRIx64 "\n  arg1_ptr = %p (0x%" PRIx64 ")\n  arg2_ptr = %p (0x%" PRIx64 ")\n  arg3_ptr = %p (0x%" PRIx64 ")\n)",
                     (void*)&thread,
                     (uint64_t)sp,
                     (uint64_t)func_addr,
@@ -336,7 +336,7 @@
     {
         reg_info = reg_ctx->GetRegisterInfoByName("rdi", 0);
         if (log)
-            log->Printf("About to write arg1 (0x%llx) into %s", (uint64_t)*arg1_ptr, reg_info->name);
+            log->Printf("About to write arg1 (0x%" PRIx64 ") into %s", (uint64_t)*arg1_ptr, reg_info->name);
 
         if (!reg_ctx->WriteRegisterFromUnsigned (reg_info, *arg1_ptr))
             return false;
@@ -345,7 +345,7 @@
         {
             reg_info = reg_ctx->GetRegisterInfoByName("rsi", 0);
             if (log)
-                log->Printf("About to write arg2 (0x%llx) into %s", (uint64_t)*arg2_ptr, reg_info->name);
+                log->Printf("About to write arg2 (0x%" PRIx64 ") into %s", (uint64_t)*arg2_ptr, reg_info->name);
             if (!reg_ctx->WriteRegisterFromUnsigned (reg_info, *arg2_ptr))
                 return false;
 
@@ -353,7 +353,7 @@
             {
                 reg_info = reg_ctx->GetRegisterInfoByName("rdx", 0);
                 if (log)
-                    log->Printf("About to write arg3 (0x%llx) into %s", (uint64_t)*arg3_ptr, reg_info->name);
+                    log->Printf("About to write arg3 (0x%" PRIx64 ") into %s", (uint64_t)*arg3_ptr, reg_info->name);
                 if (!reg_ctx->WriteRegisterFromUnsigned (reg_info, *arg3_ptr))
                     return false;
 
@@ -361,7 +361,7 @@
                 {
                     reg_info = reg_ctx->GetRegisterInfoByName("rcx", 0);
                     if (log)
-                        log->Printf("About to write arg4 (0x%llx) into %s", (uint64_t)*arg4_ptr, reg_info->name);
+                        log->Printf("About to write arg4 (0x%" PRIx64 ") into %s", (uint64_t)*arg4_ptr, reg_info->name);
                     if (!reg_ctx->WriteRegisterFromUnsigned (reg_info, *arg4_ptr))
                         return false;
 
@@ -369,7 +369,7 @@
                     {
                         reg_info = reg_ctx->GetRegisterInfoByName("r8", 0);
                         if (log)
-                            log->Printf("About to write arg5 (0x%llx) into %s", (uint64_t)*arg5_ptr, reg_info->name);
+                            log->Printf("About to write arg5 (0x%" PRIx64 ") into %s", (uint64_t)*arg5_ptr, reg_info->name);
                         if (!reg_ctx->WriteRegisterFromUnsigned (reg_info, *arg5_ptr))
                             return false;
 
@@ -377,7 +377,7 @@
                         {
                             reg_info = reg_ctx->GetRegisterInfoByName("r9", 0);
                             if (log)
-                                log->Printf("About to write arg6 (0x%llx) into %s", (uint64_t)*arg6_ptr, reg_info->name);
+                                log->Printf("About to write arg6 (0x%" PRIx64 ") into %s", (uint64_t)*arg6_ptr, reg_info->name);
                             if (!reg_ctx->WriteRegisterFromUnsigned (reg_info, *arg6_ptr))
                                 return false;
                         }
@@ -391,7 +391,7 @@
     // First, align the SP
 
     if (log)
-        log->Printf("16-byte aligning SP: 0x%llx to 0x%llx", (uint64_t)sp, (uint64_t)(sp & ~0xfull));
+        log->Printf("16-byte aligning SP: 0x%" PRIx64 " to 0x%" PRIx64, (uint64_t)sp, (uint64_t)(sp & ~0xfull));
 
     sp &= ~(0xfull); // 16-byte alignment
 
@@ -402,7 +402,7 @@
     reg_value.SetUInt64 (return_addr);
 
     if (log)
-        log->Printf("Pushing the return address onto the stack: new SP 0x%llx, return address 0x%llx", (uint64_t)sp, (uint64_t)return_addr);
+        log->Printf("Pushing the return address onto the stack: new SP 0x%" PRIx64 ", return address 0x%" PRIx64, (uint64_t)sp, (uint64_t)return_addr);
 
     const RegisterInfo *pc_reg_info = reg_ctx->GetRegisterInfoByName("rip");
     Error error (reg_ctx->WriteRegisterValueToMemory(pc_reg_info, sp, pc_reg_info->byte_size, reg_value));
@@ -412,7 +412,7 @@
     // %rsp is set to the actual stack value.
 
     if (log)
-        log->Printf("Writing SP (0x%llx) down", (uint64_t)sp);
+        log->Printf("Writing SP (0x%" PRIx64 ") down", (uint64_t)sp);
     
     if (!reg_ctx->WriteRegisterFromUnsigned (reg_ctx->GetRegisterInfoByName("rsp"), sp))
         return false;
@@ -420,7 +420,7 @@
     // %rip is set to the address of the called function.
     
     if (log)
-        log->Printf("Writing new IP (0x%llx) down", (uint64_t)func_addr);
+        log->Printf("Writing new IP (0x%" PRIx64 ") down", (uint64_t)func_addr);
 
     if (!reg_ctx->WriteRegisterFromUnsigned (pc_reg_info, func_addr))
         return false;
@@ -1153,14 +1153,23 @@
 
 
 
-
+// See "Register Usage" in the 
+// "System V Application Binary Interface"
+// "AMD64 Architecture Processor Supplement" 
+// (or "x86-64(tm) Architecture Processor Supplement" in earlier revisions)
+// Edited by Michael Matz, Jan Hubicka, Andreas Jaeger, and Mark Mitchell
+// current version is 0.99.6 released 2012-05-15 at http://x86-64.org/documentation/abi.pdf
 
 bool
 ABISysV_x86_64::RegisterIsCalleeSaved (const RegisterInfo *reg_info)
 {
     if (reg_info)
     {
-        // Volatile registers include: rbx, rbp, rsp, r12, r13, r14, r15, rip
+        // Preserved registers are :
+        //    rbx, rsp, rbp, r12, r13, r14, r15
+        //    mxcsr (partially preserved)
+        //    x87 control word
+
         const char *name = reg_info->name;
         if (name[0] == 'r')
         {
@@ -1198,6 +1207,12 @@
 
             }
         }
+        if (name[0] == 's' && name[1] == 'p' && name[2] == '\0')   // sp
+            return true;
+        if (name[0] == 'f' && name[1] == 'p' && name[2] == '\0')   // fp
+            return true;
+        if (name[0] == 'p' && name[1] == 'c' && name[2] == '\0')   // pc
+            return true;
     }
     return false;
 }

Modified: lldb/branches/windows/source/Plugins/Disassembler/llvm/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/Disassembler/llvm/CMakeLists.txt?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/Disassembler/llvm/CMakeLists.txt (original)
+++ lldb/branches/windows/source/Plugins/Disassembler/llvm/CMakeLists.txt Tue Jan  8 06:51:53 2013
@@ -1,6 +1,5 @@
 set(LLVM_NO_RTTI 1)
 
 add_lldb_library(lldbPluginDisassemblerLLVM
-  DisassemblerLLVM.cpp
   DisassemblerLLVMC.cpp
   )

Removed: lldb/branches/windows/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp?rev=171848&view=auto
==============================================================================
--- lldb/branches/windows/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp (original)
+++ lldb/branches/windows/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp (removed)
@@ -1,529 +0,0 @@
-//===-- DisassemblerLLVM.cpp ------------------------------------*- C++ -*-===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include "DisassemblerLLVM.h"
-
-#include "llvm-c/EnhancedDisassembly.h"
-#include "llvm/Support/TargetSelect.h"
-
-#include "lldb/Core/Address.h"
-#include "lldb/Core/DataExtractor.h"
-#include "lldb/Core/Disassembler.h"
-#include "lldb/Core/Module.h"
-#include "lldb/Core/PluginManager.h"
-#include "lldb/Core/Stream.h"
-#include "lldb/Core/StreamString.h"
-#include "lldb/Symbol/SymbolContext.h"
-
-#include "lldb/Target/ExecutionContext.h"
-#include "lldb/Target/Process.h"
-#include "lldb/Target/RegisterContext.h"
-#include "lldb/Target/Target.h"
-
-#include <assert.h>
-
-using namespace lldb;
-using namespace lldb_private;
-
-
-static int 
-DataExtractorByteReader (uint8_t *byte, uint64_t address, void *arg)
-{
-    DataExtractor &extractor = *((DataExtractor *)arg);
-
-    if (extractor.ValidOffset(address))
-    {
-        *byte = *(extractor.GetDataStart() + address);
-        return 0;
-    }
-    else
-    {
-        return -1;
-    }
-}
-
-namespace {
-    struct RegisterReaderArg {
-        const lldb::addr_t instructionPointer;
-        const EDDisassemblerRef disassembler;
-
-        RegisterReaderArg(lldb::addr_t ip,
-                          EDDisassemblerRef dis) :
-            instructionPointer(ip),
-            disassembler(dis)
-        {
-        }
-    };
-}
-
-static int IPRegisterReader(uint64_t *value, unsigned regID, void* arg)
-{
-    uint64_t instructionPointer = ((RegisterReaderArg*)arg)->instructionPointer;
-    EDDisassemblerRef disassembler = ((RegisterReaderArg*)arg)->disassembler;
-
-    if (EDRegisterIsProgramCounter(disassembler, regID)) {
-        *value = instructionPointer;
-        return 0;
-    }
-
-    return -1;
-}
-
-InstructionLLVM::InstructionLLVM (const Address &addr, 
-                                  AddressClass addr_class,
-                                  EDDisassemblerRef disassembler,
-                                  llvm::Triple::ArchType arch_type) :
-    Instruction (addr, addr_class),
-    m_disassembler (disassembler),
-    m_inst (NULL),
-    m_arch_type (arch_type)
-{
-}
-
-InstructionLLVM::~InstructionLLVM()
-{
-    if (m_inst)
-    {
-        EDReleaseInst(m_inst);
-        m_inst = NULL;
-    }
-}
-
-static void
-PadString(Stream *s, const std::string &str, size_t width)
-{
-    int diff = width - str.length();
-
-    if (diff > 0)
-        s->Printf("%s%*.*s", str.c_str(), diff, diff, "");
-    else
-        s->Printf("%s ", str.c_str());
-}
-static void
-AddSymbolicInfo (const ExecutionContext *exe_ctx, 
-                 StreamString &comment, 
-                 uint64_t operand_value, 
-                 const Address &inst_addr)
-{
-    Address so_addr;
-    Target *target = NULL;
-    if (exe_ctx)
-        target = exe_ctx->GetTargetPtr();
-    if (target && !target->GetSectionLoadList().IsEmpty())
-    {
-        if (target->GetSectionLoadList().ResolveLoadAddress(operand_value, so_addr))
-            so_addr.Dump (&comment, 
-                          exe_ctx ? exe_ctx->GetBestExecutionContextScope() : NULL, 
-                          Address::DumpStyleResolvedDescriptionNoModule, 
-                          Address::DumpStyleSectionNameOffset);
-    }
-    else
-    {
-        ModuleSP module_sp (inst_addr.GetModule());
-        if (module_sp)
-        {
-            if (module_sp->ResolveFileAddress(operand_value, so_addr))
-                so_addr.Dump (&comment, 
-                              exe_ctx ? exe_ctx->GetBestExecutionContextScope() : NULL, 
-                              Address::DumpStyleResolvedDescriptionNoModule, 
-                              Address::DumpStyleSectionNameOffset);
-        }
-    }
-}
-
-#include "llvm/ADT/StringRef.h"
-static inline void StripSpaces(llvm::StringRef &Str)
-{
-    while (!Str.empty() && isspace(Str[0]))
-        Str = Str.substr(1);
-    while (!Str.empty() && isspace(Str.back()))
-        Str = Str.substr(0, Str.size()-1);
-}
-static inline void RStrip(llvm::StringRef &Str, char c)
-{
-    if (!Str.empty() && Str.back() == c)
-        Str = Str.substr(0, Str.size()-1);
-}
-// Aligns the raw disassembly (passed as 'str') with the rest of edis'ed disassembly output.
-// This is called from non-raw mode when edis of the current m_inst fails for some reason.
-static void
-Align(Stream *s, const char *str, size_t opcodeColWidth, size_t operandColWidth)
-{
-    llvm::StringRef raw_disasm(str);
-    StripSpaces(raw_disasm);
-    // Split the raw disassembly into opcode and operands.
-    std::pair<llvm::StringRef, llvm::StringRef> p = raw_disasm.split('\t');
-    PadString(s, p.first, opcodeColWidth);
-    if (!p.second.empty())
-        PadString(s, p.second, operandColWidth);
-}
-
-#define AlignPC(pc_val) (pc_val & 0xFFFFFFFC)
-
-void
-InstructionLLVM::CalculateMnemonicOperandsAndComment (const ExecutionContext* exe_ctx)
-{
-    const int num_tokens = EDNumTokens(m_inst);
-    if (num_tokens > 0)
-    {
-        const char *token_cstr = NULL;
-        int currentOpIndex = -1;
-        StreamString comment;
-        uint32_t addr_nibble_size = 8;
-        addr_t base_addr = LLDB_INVALID_ADDRESS;
-        Target *target = exe_ctx ? exe_ctx->GetTargetPtr() : NULL;
-        if (target)
-        {
-            addr_nibble_size = target->GetArchitecture().GetAddressByteSize() * 2;
-            if (!target->GetSectionLoadList().IsEmpty())
-                base_addr = GetAddress().GetLoadAddress (target);
-        }
-        
-        if (base_addr == LLDB_INVALID_ADDRESS)
-            base_addr = GetAddress().GetFileAddress ();
-
-        lldb::addr_t PC = base_addr + EDInstByteSize(m_inst);
-        
-        // When executing an ARM instruction, PC reads as the address of the
-        // current instruction plus 8.  And for Thumb, it is plus 4.
-        if (m_arch_type == llvm::Triple::arm)
-            PC = base_addr + 8;
-        else if (m_arch_type == llvm::Triple::thumb)
-            PC = base_addr + 4;
-        
-        RegisterReaderArg rra(PC, m_disassembler);
-
-        for (int token_idx = 0; token_idx < num_tokens; ++token_idx)
-        {
-            EDTokenRef token;
-            if (EDGetToken(&token, m_inst, token_idx))
-                break;
-            
-            if (EDTokenIsOpcode(token) == 1)
-            {
-                if (EDGetTokenString(&token_cstr, token) == 0) // 0 on success
-                {
-                    if (token_cstr)
-                    m_opcode_name.assign(token_cstr);
-                }
-            }
-            else
-            {                
-                int operandIndex = EDOperandIndexForToken(token);
-
-                if (operandIndex >= 0)
-                {
-                    if (operandIndex != currentOpIndex)
-                    {
-                        currentOpIndex = operandIndex;
-                        EDOperandRef operand;
-                        
-                        if (!EDGetOperand(&operand, m_inst, currentOpIndex))
-                        {
-                            if (EDOperandIsMemory(operand))
-                            {
-                                uint64_t operand_value;
-                                
-                                if (!EDEvaluateOperand(&operand_value, operand, IPRegisterReader, &rra))
-                                {
-                                    comment.Printf("0x%*.*llx ", addr_nibble_size, addr_nibble_size, operand_value);                                    
-                                    AddSymbolicInfo (exe_ctx, comment, operand_value, GetAddress());
-                                }
-                            }
-                        }
-                    }
-                }
-                if (m_mnemocics.empty() && EDTokenIsWhitespace (token) == 1)
-                    continue;
-                if (EDGetTokenString (&token_cstr, token))
-                    break;
-                m_mnemocics.append (token_cstr);
-            }
-        }
-        // FIXME!!!
-        // Workaround for llvm::tB's operands not properly parsed by ARMAsmParser.
-        if (m_arch_type == llvm::Triple::thumb && m_opcode_name.compare("b") == 0) 
-        {
-            const char *inst_str;
-            const char *pos = NULL;
-            comment.Clear();
-            if (EDGetInstString(&inst_str, m_inst) == 0 && (pos = strstr(inst_str, "#")) != NULL) 
-            {
-                uint64_t operand_value = PC + atoi(++pos);
-                // Put the address value into the operands.
-                comment.Printf("0x%*.*llx ", addr_nibble_size, addr_nibble_size, operand_value);
-                AddSymbolicInfo (exe_ctx, comment, operand_value, GetAddress());
-            }
-        }
-        // Yet more workaround for "bl #..." and "blx #...".
-        if ((m_arch_type == llvm::Triple::arm || m_arch_type == llvm::Triple::thumb) &&
-            (m_opcode_name.compare("bl") == 0 || m_opcode_name.compare("blx") == 0)) 
-        {
-            const char *inst_str;
-            const char *pos = NULL;
-            comment.Clear();
-            if (EDGetInstString(&inst_str, m_inst) == 0 && (pos = strstr(inst_str, "#")) != NULL) 
-            {
-                if (m_arch_type == llvm::Triple::thumb && m_opcode_name.compare("blx") == 0)
-                {
-                    // A8.6.23 BLX (immediate)
-                    // Target Address = Align(PC,4) + offset value
-                    PC = AlignPC(PC);
-                }
-                uint64_t operand_value = PC + atoi(++pos);
-                // Put the address value into the comment.
-                comment.Printf("0x%*.*llx ", addr_nibble_size, addr_nibble_size, operand_value);
-                // And the original token string into the operands.
-//                llvm::StringRef Str(pos - 1);
-//                RStrip(Str, '\n');
-//                operands.PutCString(Str.str().c_str());
-                AddSymbolicInfo (exe_ctx, comment, operand_value, GetAddress());
-            }
-        }
-        // END of workaround.
-
-        m_comment.swap (comment.GetString());
-    }
-}
-
-bool
-InstructionLLVM::DoesBranch() const
-{
-    return EDInstIsBranch(m_inst);
-}
-
-size_t
-InstructionLLVM::Decode (const Disassembler &disassembler, 
-                         const lldb_private::DataExtractor &data,
-                         uint32_t data_offset)
-{
-    if (EDCreateInsts(&m_inst, 1, m_disassembler, DataExtractorByteReader, data_offset, (void*)(&data)))
-    {
-        const int byte_size = EDInstByteSize(m_inst);
-        uint32_t offset = data_offset;
-        // Make a copy of the opcode in m_opcode
-        switch (disassembler.GetArchitecture().GetMachine())
-        {
-        case llvm::Triple::x86:
-        case llvm::Triple::x86_64:
-            m_opcode.SetOpcodeBytes (data.PeekData (data_offset, byte_size), byte_size);
-            break;
-
-        case llvm::Triple::arm:
-        case llvm::Triple::thumb:
-            switch (byte_size)
-            {
-            case 2: 
-                m_opcode.SetOpcode16 (data.GetU16 (&offset)); 
-                break;
-
-            case 4:
-                {
-                if (GetAddressClass() ==  eAddressClassCodeAlternateISA)
-                {
-                    // If it is a 32-bit THUMB instruction, we need to swap the upper & lower halves.
-                    uint32_t orig_bytes = data.GetU32 (&offset);
-                    uint16_t upper_bits = (orig_bytes >> 16) & ((1u << 16) - 1);
-                    uint16_t lower_bits = orig_bytes & ((1u << 16) - 1);
-                    uint32_t swapped = (lower_bits << 16) | upper_bits;
-                    m_opcode.SetOpcode32 (swapped);
-                }
-                else
-                    m_opcode.SetOpcode32 (data.GetU32 (&offset));
-                }
-                break;
-
-            default:
-                assert (!"Invalid ARM opcode size");
-                break;
-            }
-            break;
-
-        default:
-            assert (!"This shouldn't happen since we control the architecture we allow DisassemblerLLVM to be created for");
-            break;
-        }
-        return byte_size;
-    }
-    else
-        return 0;
-}
-
-static inline EDAssemblySyntax_t
-SyntaxForArchSpec (const ArchSpec &arch)
-{
-    switch (arch.GetMachine ())
-    {
-    case llvm::Triple::x86:
-    case llvm::Triple::x86_64:
-        return kEDAssemblySyntaxX86ATT;
-    case llvm::Triple::arm:
-    case llvm::Triple::thumb:
-        return kEDAssemblySyntaxARMUAL;
-    default:
-        break;
-    }
-    return (EDAssemblySyntax_t)0;   // default
-}
-
-Disassembler *
-DisassemblerLLVM::CreateInstance(const ArchSpec &arch)
-{
-    std::auto_ptr<DisassemblerLLVM> disasm_ap (new DisassemblerLLVM(arch));
- 
-    if (disasm_ap.get() && disasm_ap->IsValid())
-        return disasm_ap.release();
-
-    return NULL;
-}
-
-DisassemblerLLVM::DisassemblerLLVM(const ArchSpec &arch) :
-    Disassembler (arch),
-    m_disassembler (NULL),
-    m_disassembler_thumb (NULL) // For ARM only
-{
-    // Initialize the LLVM objects needed to use the disassembler.
-    static struct InitializeLLVM {
-        InitializeLLVM() {
-            llvm::InitializeAllTargetInfos();
-            llvm::InitializeAllTargetMCs();
-            llvm::InitializeAllAsmParsers();
-            llvm::InitializeAllDisassemblers();
-        }
-    } InitializeLLVM;
-
-    const std::string &arch_triple = arch.GetTriple().str();
-    if (!arch_triple.empty())
-    {
-        if (EDGetDisassembler(&m_disassembler, arch_triple.c_str(), SyntaxForArchSpec (arch)))
-            m_disassembler = NULL;
-        llvm::Triple::ArchType llvm_arch = arch.GetTriple().getArch();
-		// Don't have the lldb::Triple::thumb architecture here. If someone specifies
-		// "thumb" as the architecture, we want a thumb only disassembler. But if any
-		// architecture starting with "arm" if specified, we want to auto detect the
-		// arm/thumb code automatically using the AddressClass from section offset 
-		// addresses.
-        if (llvm_arch == llvm::Triple::arm)
-        {
-            ArchSpec thumb_arch(arch);
-            thumb_arch.GetTriple().setArchName(llvm::StringRef("thumbv7"));
-            std::string thumb_triple(thumb_arch.GetTriple().getTriple());
-            if (EDGetDisassembler(&m_disassembler_thumb, thumb_triple.c_str(), kEDAssemblySyntaxARMUAL))
-                m_disassembler_thumb = NULL;
-        }
-    }
-}
-
-DisassemblerLLVM::~DisassemblerLLVM()
-{
-}
-
-size_t
-DisassemblerLLVM::DecodeInstructions
-(
-    const Address &base_addr,
-    const DataExtractor& data,
-    uint32_t data_offset,
-    uint32_t num_instructions,
-    bool append
-)
-{
-    if (m_disassembler == NULL)
-        return 0;
-
-    size_t total_inst_byte_size = 0;
-
-    if (!append)
-        m_instruction_list.Clear();
-
-    while (data.ValidOffset(data_offset) && num_instructions)
-    {
-        Address inst_addr (base_addr);
-        inst_addr.Slide(data_offset);
-
-        bool use_thumb = false;
-        // If we have a thumb disassembler, then we have an ARM architecture
-        // so we need to check what the instruction address class is to make
-        // sure we shouldn't be disassembling as thumb...
-        AddressClass inst_address_class = eAddressClassInvalid;
-        if (m_disassembler_thumb)
-        {
-            inst_address_class = inst_addr.GetAddressClass ();
-            if (inst_address_class == eAddressClassCodeAlternateISA)
-                use_thumb = true;
-        }
-        
-        InstructionSP inst_sp (new InstructionLLVM (inst_addr, 
-                                                    inst_address_class,
-                                                    use_thumb ? m_disassembler_thumb : m_disassembler,
-                                                    use_thumb ? llvm::Triple::thumb : m_arch.GetMachine()));
-
-        size_t inst_byte_size = inst_sp->Decode (*this, data, data_offset);
-
-        if (inst_byte_size == 0)
-            break;
-
-        m_instruction_list.Append (inst_sp);
-
-        total_inst_byte_size += inst_byte_size;
-        data_offset += inst_byte_size;
-        num_instructions--;
-    }
-
-    return total_inst_byte_size;
-}
-
-void
-DisassemblerLLVM::Initialize()
-{
-    PluginManager::RegisterPlugin (GetPluginNameStatic(),
-                                   GetPluginDescriptionStatic(),
-                                   CreateInstance);
-}
-
-void
-DisassemblerLLVM::Terminate()
-{
-    PluginManager::UnregisterPlugin (CreateInstance);
-}
-
-
-const char *
-DisassemblerLLVM::GetPluginNameStatic()
-{
-    return "llvm-edis";
-}
-
-const char *
-DisassemblerLLVM::GetPluginDescriptionStatic()
-{
-    return "Disassembler that uses the LLVM enhanced disassembler to disassemble i386, x86_64 and ARM.";
-}
-
-//------------------------------------------------------------------
-// PluginInterface protocol
-//------------------------------------------------------------------
-const char *
-DisassemblerLLVM::GetPluginName()
-{
-    return "DisassemblerLLVM";
-}
-
-const char *
-DisassemblerLLVM::GetShortPluginName()
-{
-    return GetPluginNameStatic();
-}
-
-uint32_t
-DisassemblerLLVM::GetPluginVersion()
-{
-    return 1;
-}
-

Removed: lldb/branches/windows/source/Plugins/Disassembler/llvm/DisassemblerLLVM.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/Disassembler/llvm/DisassemblerLLVM.h?rev=171848&view=auto
==============================================================================
--- lldb/branches/windows/source/Plugins/Disassembler/llvm/DisassemblerLLVM.h (original)
+++ lldb/branches/windows/source/Plugins/Disassembler/llvm/DisassemblerLLVM.h (removed)
@@ -1,105 +0,0 @@
-//===-- DisassemblerLLVM.h --------------------------------------*- C++ -*-===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef liblldb_DisassemblerLLVM_h_
-#define liblldb_DisassemblerLLVM_h_
-
-
-#include "llvm-c/EnhancedDisassembly.h"
-
-#include "lldb/Core/Disassembler.h"
-#include "lldb/Host/Mutex.h"
-
-class InstructionLLVM : public lldb_private::Instruction
-{
-public:
-    InstructionLLVM (const lldb_private::Address &addr,
-                     lldb::AddressClass addr_class,
-                     EDDisassemblerRef disassembler,
-                     llvm::Triple::ArchType arch_type);
-    
-    virtual
-    ~InstructionLLVM();
-    
-    virtual bool
-    DoesBranch () const;
-    
-    virtual size_t
-    Decode (const lldb_private::Disassembler &disassembler,
-            const lldb_private::DataExtractor &data,
-            uint32_t data_offset);
-    
-    virtual void
-    CalculateMnemonicOperandsAndComment (const lldb_private::ExecutionContext* exe_ctx);
-    
-protected:
-    EDDisassemblerRef m_disassembler;
-    EDInstRef m_inst;
-    llvm::Triple::ArchType m_arch_type;
-};
-
-
-class DisassemblerLLVM : public lldb_private::Disassembler
-{
-public:
-    //------------------------------------------------------------------
-    // Static Functions
-    //------------------------------------------------------------------
-    static void
-    Initialize();
-
-    static void
-    Terminate();
-
-    static const char *
-    GetPluginNameStatic();
-
-    static const char *
-    GetPluginDescriptionStatic();
-
-    static lldb_private::Disassembler *
-    CreateInstance(const lldb_private::ArchSpec &arch);
-
-
-    DisassemblerLLVM(const lldb_private::ArchSpec &arch);
-
-    virtual
-    ~DisassemblerLLVM();
-
-    size_t
-    DecodeInstructions (const lldb_private::Address &base_addr,
-                        const lldb_private::DataExtractor& data,
-                        uint32_t data_offset,
-                        uint32_t num_instructions,
-                        bool append);
-    
-    //------------------------------------------------------------------
-    // PluginInterface protocol
-    //------------------------------------------------------------------
-    virtual const char *
-    GetPluginName();
-
-    virtual const char *
-    GetShortPluginName();
-
-    virtual uint32_t
-    GetPluginVersion();
-
-protected:
-    bool
-    IsValid() const
-    {
-        return m_disassembler != NULL;
-    }
-
-    EDDisassemblerRef m_disassembler;
-    EDDisassemblerRef m_disassembler_thumb;
-};
-
-#endif  // liblldb_DisassemblerLLVM_h_

Modified: lldb/branches/windows/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp (original)
+++ lldb/branches/windows/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp Tue Jan  8 06:51:53 2013
@@ -271,7 +271,7 @@
                             const uint64_t uval64 = data.GetU64(&offset);
                             m_opcode.SetOpcode64(uval64);
                             m_opcode_name.assign (".quad");
-                            mnemonic_strm.Printf("0x%16.16llx", uval64);
+                            mnemonic_strm.Printf("0x%16.16" PRIx64, uval64);
                         }
                         break;
                     default:
@@ -645,7 +645,7 @@
                     m_inst->AppendComment(ss.GetString());
                 }
             }
-            //printf ("DisassemblerLLVMC::SymbolLookup (value=0x%16.16llx, type=%llu, pc=0x%16.16llx, name=\"%s\") m_exe_ctx=%p, m_inst=%p\n", value, *type_ptr, pc, remove_this_prior_to_checkin.c_str(), m_exe_ctx, m_inst);
+            //printf ("DisassemblerLLVMC::SymbolLookup (value=0x%16.16" PRIx64 ", type=%" PRIu64 ", pc=0x%16.16" PRIx64 ", name=\"%s\") m_exe_ctx=%p, m_inst=%p\n", value, *type_ptr, pc, remove_this_prior_to_checkin.c_str(), m_exe_ctx, m_inst);
         }
     }
 

Modified: lldb/branches/windows/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp (original)
+++ lldb/branches/windows/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/Breakpoint/StoppointCallbackContext.h"
 #include "lldb/Core/DataBuffer.h"
 #include "lldb/Core/DataBufferHeap.h"
@@ -321,25 +323,36 @@
                 {
                     module_sp = target.GetSharedModule (module_spec);
                 }
+
+                // If we managed to find a module, append it to the target's list of images
+                if (module_sp && module_sp->GetUUID() == memory_module_sp->GetUUID())
+                {
+                    target.GetImages().Append(module_sp);
+                    if (memory_module_is_kernel && target.GetExecutableModulePointer() != module_sp.get())
+                    {
+                        target.SetExecutableModule (module_sp, false);
+                    }
+                }
             }
         }
     }
     
 
+    static ConstString g_section_name_LINKEDIT ("__LINKEDIT");
+
     if (memory_module_sp && module_sp)
     {
         if (module_sp->GetUUID() == memory_module_sp->GetUUID())
         {
-            target.GetImages().Append(module_sp);
-            if (memory_module_is_kernel && target.GetExecutableModulePointer() != module_sp.get())
-            {
-                target.SetExecutableModule (module_sp, false);
-            }
-
             ObjectFile *ondisk_object_file = module_sp->GetObjectFile();
             ObjectFile *memory_object_file = memory_module_sp->GetObjectFile();
+            
             if (memory_object_file && ondisk_object_file)
             {
+                // Kexts are classified with a type of ObjectFile::eTypeSharedLibrary and
+                // a strata of ObjectFile::eStrataKernel. Ignore __LINKEDIT for kexts
+                const bool ignore_linkedit = ondisk_object_file->GetType() == ObjectFile::eTypeSharedLibrary;
+                
                 SectionList *ondisk_section_list = ondisk_object_file->GetSectionList ();
                 SectionList *memory_section_list = memory_object_file->GetSectionList ();
                 if (memory_section_list && ondisk_section_list)
@@ -361,6 +374,14 @@
                         SectionSP ondisk_section_sp(ondisk_section_list->GetSectionAtIndex(sect_idx));
                         if (ondisk_section_sp)
                         {
+                            // Don't ever load __LINKEDIT as it may or may not be actually
+                            // mapped into memory and there is no current way to tell.
+                            // I filed rdar://problem/12851706 to track being able to tell
+                            // if the __LINKEDIT is actually mapped, but until then, we need
+                            // to not load the __LINKEDIT
+                            if (ignore_linkedit && ondisk_section_sp->GetName() == g_section_name_LINKEDIT)
+                                continue;
+
                             const Section *memory_section = memory_section_list->FindSectionByName(ondisk_section_sp->GetName()).get();
                             if (memory_section)
                             {
@@ -402,7 +423,7 @@
         {
             char uuidbuf[64];
             s->Printf ("Kernel UUID: %s\n", module_sp->GetUUID().GetAsCString(uuidbuf, sizeof (uuidbuf)));
-            s->Printf ("Load Address: 0x%llx\n", address);
+            s->Printf ("Load Address: 0x%" PRIx64 "\n", address);
             if (module_sp->GetFileSpec().GetDirectory().IsEmpty())
             {
                 s->Printf ("Loaded kernel file %s\n", module_sp->GetFileSpec().GetFilename().AsCString());
@@ -723,14 +744,6 @@
             {
                 image_infos[i].reference_list = 0;
             }
-//            printf ("[%3u] %*.*s: address=0x%16.16llx, size=0x%16.16llx, version=0x%16.16llx, load_tag=0x%8.8x, flags=0x%8.8x\n", 
-//                    i,
-//                    KERNEL_MODULE_MAX_NAME, KERNEL_MODULE_MAX_NAME,  (char *)name_data, 
-//                    image_infos[i].address, 
-//                    image_infos[i].size,
-//                    image_infos[i].version,
-//                    image_infos[i].load_tag,
-//                    image_infos[i].flags);
         }
         if (i < image_infos.size())
             image_infos.resize(i);
@@ -793,7 +806,7 @@
     {
         if (u)
         {
-            log->Printf("\taddr=0x%16.16llx size=0x%16.16llx version=0x%16.16llx load-tag=0x%8.8x flags=0x%8.8x ref-list=0x%16.16llx uuid=%2.2X%2.2X%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X%2.2X%2.2X%2.2X%2.2X name=\"%s\"",
+            log->Printf("\taddr=0x%16.16" PRIx64 " size=0x%16.16" PRIx64 " version=0x%16.16" PRIx64 " load-tag=0x%8.8x flags=0x%8.8x ref-list=0x%16.16" PRIx64 " uuid=%2.2X%2.2X%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X%2.2X%2.2X%2.2X%2.2X name=\"%s\"",
                         address, size, version, load_tag, flags, reference_list,
                         u[ 0], u[ 1], u[ 2], u[ 3], u[ 4], u[ 5], u[ 6], u[ 7],
                         u[ 8], u[ 9], u[10], u[11], u[12], u[13], u[14], u[15],
@@ -801,7 +814,7 @@
         }
         else
         {
-            log->Printf("\t[0x%16.16llx - 0x%16.16llx) version=0x%16.16llx load-tag=0x%8.8x flags=0x%8.8x ref-list=0x%16.16llx name=\"%s\"",
+            log->Printf("\t[0x%16.16" PRIx64 " - 0x%16.16" PRIx64 ") version=0x%16.16" PRIx64 " load-tag=0x%8.8x flags=0x%8.8x ref-list=0x%16.16" PRIx64 " name=\"%s\"",
                         address, address+size, version, load_tag, flags, reference_list,
                         name);
         }
@@ -819,7 +832,7 @@
         return;
 
     Mutex::Locker locker(m_mutex);
-    log->Printf("gLoadedKextSummaries = 0x%16.16llx { version=%u, entry_size=%u, entry_count=%u }",
+    log->Printf("gLoadedKextSummaries = 0x%16.16" PRIx64 " { version=%u, entry_size=%u, entry_count=%u }",
                 m_kext_summary_header_addr.GetFileAddress(),
                 m_kext_summary_header.version,
                 m_kext_summary_header.entry_size,
@@ -895,9 +908,6 @@
     case eStateCrashed:
     case eStateSuspended:
         break;
-
-    default:
-        break;
     }
 }
 

Modified: lldb/branches/windows/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp (original)
+++ lldb/branches/windows/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp Tue Jan  8 06:51:53 2013
@@ -139,7 +139,8 @@
     m_break_id(LLDB_INVALID_BREAK_ID),
     m_dyld_image_infos(),
     m_dyld_image_infos_stop_id (UINT32_MAX),
-    m_mutex(Mutex::eMutexTypeRecursive)
+    m_mutex(Mutex::eMutexTypeRecursive),
+    m_process_image_addr_is_all_images_infos (false)
 {
 }
 
@@ -179,6 +180,54 @@
     SetNotificationBreakpoint ();
 }
 
+bool
+DynamicLoaderMacOSXDYLD::ProcessDidExec ()
+{
+    if (m_process)
+    {
+        // If we are stopped after an exec, we will have only one thread...
+        if (m_process->GetThreadList().GetSize() == 1)
+        {
+            // We know if a process has exec'ed if our "m_dyld_all_image_infos_addr"
+            // value differs from the Process' image info address. When a process
+            // execs itself it might cause a change if ASLR is enabled.
+            const addr_t shlib_addr = m_process->GetImageInfoAddress ();
+            if (m_process_image_addr_is_all_images_infos == true && shlib_addr != m_dyld_all_image_infos_addr)
+            {
+                // The image info address from the process is the 'dyld_all_image_infos'
+                // address and it has changed.
+                return true;
+            }
+            
+            if (m_process_image_addr_is_all_images_infos == false && shlib_addr == m_dyld.address)
+            {
+                // The image info address from the process is the mach_header
+                // address for dyld and it has changed.
+                return true;
+            }
+            
+            // ASLR might be disabled and dyld could have ended up in the same
+            // location. We should try and detect if we are stopped at '_dyld_start'
+            ThreadSP thread_sp (m_process->GetThreadList().GetThreadAtIndex(0));
+            if (thread_sp)
+            {
+                lldb::StackFrameSP frame_sp (thread_sp->GetStackFrameAtIndex(0));
+                if (frame_sp)
+                {
+                    const Symbol *symbol = frame_sp->GetSymbolContext(eSymbolContextSymbol).symbol;
+                    if (symbol)
+                    {
+                        if (symbol->GetName() == ConstString("_dyld_start"))
+                            return true;
+                    }
+                }
+            }
+        }
+    }
+    return false;
+}
+
+
 
 //----------------------------------------------------------------------
 // Clear out the state of this class.
@@ -224,7 +273,6 @@
         // mach header for dyld, or it might point to the 
         // dyld_all_image_infos struct
         const addr_t shlib_addr = m_process->GetImageInfoAddress ();
-
         ByteOrder byte_order = m_process->GetTarget().GetArchitecture().GetByteOrder();
         uint8_t buf[4];
         DataExtractor data (buf, sizeof(buf), byte_order, 4);
@@ -239,6 +287,7 @@
             case llvm::MachO::HeaderMagic64:
             case llvm::MachO::HeaderMagic32Swapped:
             case llvm::MachO::HeaderMagic64Swapped:
+                m_process_image_addr_is_all_images_infos = false;
                 return ReadDYLDInfoFromMemoryAndSetNotificationCallback(shlib_addr);
                 
             default:
@@ -247,6 +296,7 @@
         }
         // Maybe it points to the all image infos?
         m_dyld_all_image_infos_addr = shlib_addr;
+        m_process_image_addr_is_all_images_infos = true;
     }
 
     if (m_dyld_all_image_infos_addr != LLDB_INVALID_ADDRESS)
@@ -365,9 +415,16 @@
             // it again (since Target::SetExecutableModule() will clear the
             // images). So append the dyld module back to the list if it is
             /// unique!
-            if (dyld_module_sp && m_process->GetTarget().GetImages().AppendIfNeeded (dyld_module_sp))
-                UpdateImageLoadAddress(dyld_module_sp.get(), m_dyld);
+            if (dyld_module_sp)
+            {
+                if (m_process->GetTarget().GetImages().AppendIfNeeded (dyld_module_sp))
+                    UpdateImageLoadAddress(dyld_module_sp.get(), m_dyld);
 
+                // At this point we should have read in dyld's module, and so we should set breakpoints in it:
+                ModuleList modules;
+                modules.Append(dyld_module_sp);
+                m_process->GetTarget().ModulesDidLoad(modules);
+            }
             return true;
         }
     }
@@ -469,7 +526,7 @@
                         else
                         {
                             Host::SystemLog (Host::eSystemLogWarning, 
-                                             "warning: unable to find and load segment named '%s' at 0x%llx in '%s/%s' in macosx dynamic loader plug-in.\n",
+                                             "warning: unable to find and load segment named '%s' at 0x%" PRIx64 " in '%s/%s' in macosx dynamic loader plug-in.\n",
                                              info.segments[i].name.AsCString("<invalid>"),
                                              (uint64_t)new_section_load_addr,
                                              image_object_file->GetFileSpec().GetDirectory().AsCString(),
@@ -795,7 +852,7 @@
     {
         if (log)
         {
-            log->Printf ("Adding new image at address=0x%16.16llx.", image_infos[idx].address);
+            log->Printf ("Adding new image at address=0x%16.16" PRIx64 ".", image_infos[idx].address);
             image_infos[idx].PutToLog (log.get());
         }
         
@@ -907,7 +964,7 @@
     {        
         if (log)
         {
-            log->Printf ("Removing module at address=0x%16.16llx.", image_infos[idx].address);
+            log->Printf ("Removing module at address=0x%16.16" PRIx64 ".", image_infos[idx].address);
             image_infos[idx].PutToLog (log.get());
         }
             
@@ -1051,7 +1108,7 @@
             if (!AddModulesUsingImageInfosAddress (m_dyld_all_image_infos.dylib_info_addr, 
                                                    m_dyld_all_image_infos.dylib_info_count))
             {
-                DEBUG_PRINTF( "unable to read all data for all_dylib_infos.");
+                DEBUG_PRINTF("%s", "unable to read all data for all_dylib_infos.");
                 m_dyld_image_infos.clear();
             }
         }
@@ -1376,12 +1433,12 @@
     if (log)
     {
         if (slide == 0)
-            log->Printf ("\t\t%16s [0x%16.16llx - 0x%16.16llx)", 
+            log->Printf ("\t\t%16s [0x%16.16" PRIx64 " - 0x%16.16" PRIx64 ")",
                          name.AsCString(""), 
                          vmaddr + slide, 
                          vmaddr + slide + vmsize);
         else
-            log->Printf ("\t\t%16s [0x%16.16llx - 0x%16.16llx) slide = 0x%llx", 
+            log->Printf ("\t\t%16s [0x%16.16" PRIx64 " - 0x%16.16" PRIx64 ") slide = 0x%" PRIx64,
                          name.AsCString(""), 
                          vmaddr + slide, 
                          vmaddr + slide + vmsize, 
@@ -1416,7 +1473,7 @@
     {
         if (u)
         {
-            log->Printf("\t                           modtime=0x%8.8llx uuid=%2.2X%2.2X%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X%2.2X%2.2X%2.2X%2.2X path='%s/%s' (UNLOADED)",
+            log->Printf("\t                           modtime=0x%8.8" PRIx64 " uuid=%2.2X%2.2X%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X%2.2X%2.2X%2.2X%2.2X path='%s/%s' (UNLOADED)",
                         mod_date,
                         u[ 0], u[ 1], u[ 2], u[ 3],
                         u[ 4], u[ 5], u[ 6], u[ 7],
@@ -1426,7 +1483,7 @@
                         file_spec.GetFilename().AsCString());
         }
         else
-            log->Printf("\t                           modtime=0x%8.8llx path='%s/%s' (UNLOADED)",
+            log->Printf("\t                           modtime=0x%8.8" PRIx64 " path='%s/%s' (UNLOADED)",
                         mod_date,
                         file_spec.GetDirectory().AsCString(),
                         file_spec.GetFilename().AsCString());
@@ -1435,7 +1492,7 @@
     {
         if (u)
         {
-            log->Printf("\taddress=0x%16.16llx modtime=0x%8.8llx uuid=%2.2X%2.2X%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X%2.2X%2.2X%2.2X%2.2X path='%s/%s'",
+            log->Printf("\taddress=0x%16.16" PRIx64 " modtime=0x%8.8" PRIx64 " uuid=%2.2X%2.2X%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X%2.2X%2.2X%2.2X%2.2X path='%s/%s'",
                         address,
                         mod_date,
                         u[ 0], u[ 1], u[ 2], u[ 3],
@@ -1447,7 +1504,7 @@
         }
         else
         {
-            log->Printf("\taddress=0x%16.16llx modtime=0x%8.8llx path='%s/%s'",
+            log->Printf("\taddress=0x%16.16" PRIx64 " modtime=0x%8.8" PRIx64 " path='%s/%s'",
                         address,
                         mod_date,
                         file_spec.GetDirectory().AsCString(),
@@ -1470,7 +1527,7 @@
         return;
 
     Mutex::Locker locker(m_mutex);
-    log->Printf("dyld_all_image_infos = { version=%d, count=%d, addr=0x%8.8llx, notify=0x%8.8llx }",
+    log->Printf("dyld_all_image_infos = { version=%d, count=%d, addr=0x%8.8" PRIx64 ", notify=0x%8.8" PRIx64 " }",
                     m_dyld_all_image_infos.version,
                     m_dyld_all_image_infos.dylib_info_count,
                     (uint64_t)m_dyld_all_image_infos.dylib_info_addr,
@@ -1555,9 +1612,6 @@
     case eStateCrashed:
     case eStateSuspended:
         break;
-
-    default:
-        break;
     }
 }
 

Modified: lldb/branches/windows/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h (original)
+++ lldb/branches/windows/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h Tue Jan  8 06:51:53 2013
@@ -62,6 +62,9 @@
     virtual void
     DidLaunch ();
 
+    virtual bool
+    ProcessDidExec ();
+
     virtual lldb::ThreadPlanSP
     GetStepThroughTrampolinePlan (lldb_private::Thread &thread,
                                   bool stop_others);
@@ -372,6 +375,7 @@
     uint32_t m_dyld_image_infos_stop_id;    // The process stop ID that "m_dyld_image_infos" is valid for
     mutable lldb_private::Mutex m_mutex;
     lldb_private::Process::Notifications m_notification_callbacks;
+    bool m_process_image_addr_is_all_images_infos;
 
 private:
     DISALLOW_COPY_AND_ASSIGN (DynamicLoaderMacOSXDYLD);

Modified: lldb/branches/windows/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.cpp (original)
+++ lldb/branches/windows/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.cpp Tue Jan  8 06:51:53 2013
@@ -113,7 +113,7 @@
     log->PutCString("AuxVector: ");
     for (iterator I = begin(); I != end(); ++I)
     {
-        log->Printf("   %s [%llu]: %llx", GetEntryName(*I), I->type, I->value);
+        log->Printf("   %s [%" PRIu64 "]: %" PRIx64, GetEntryName(*I), I->type, I->value);
     }
 }
 
@@ -125,10 +125,6 @@
 #define ENTRY_NAME(_type) _type: name = #_type
     switch (type) 
     {
-    default:
-        name = "unkown";
-        break;
-
     case ENTRY_NAME(AT_NULL);   break;
     case ENTRY_NAME(AT_IGNORE); break;
     case ENTRY_NAME(AT_EXECFD); break;

Modified: lldb/branches/windows/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp (original)
+++ lldb/branches/windows/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp Tue Jan  8 06:51:53 2013
@@ -303,11 +303,11 @@
         return;
 
     log->PutCString("DYLDRendezvous:");
-    log->Printf("   Address: %llx", GetRendezvousAddress());
+    log->Printf("   Address: %" PRIx64, GetRendezvousAddress());
     log->Printf("   Version: %d",  GetVersion());
-    log->Printf("   Link   : %llx", GetLinkMapAddress());
-    log->Printf("   Break  : %llx", GetBreakAddress());
-    log->Printf("   LDBase : %llx", GetLDBase());
+    log->Printf("   Link   : %" PRIx64, GetLinkMapAddress());
+    log->Printf("   Break  : %" PRIx64, GetBreakAddress());
+    log->Printf("   LDBase : %" PRIx64, GetLDBase());
     log->Printf("   State  : %s", 
                 (state == eConsistent) ? "consistent" :
                 (state == eAdd)        ? "add"        :
@@ -322,10 +322,10 @@
     for (int i = 1; I != E; ++I, ++i) 
     {
         log->Printf("\n   SOEntry [%d] %s", i, I->path.c_str());
-        log->Printf("      Base : %llx", I->base_addr);
-        log->Printf("      Path : %llx", I->path_addr);
-        log->Printf("      Dyn  : %llx", I->dyn_addr);
-        log->Printf("      Next : %llx", I->next);
-        log->Printf("      Prev : %llx", I->prev);
+        log->Printf("      Base : %" PRIx64, I->base_addr);
+        log->Printf("      Path : %" PRIx64, I->path_addr);
+        log->Printf("      Dyn  : %" PRIx64, I->dyn_addr);
+        log->Printf("      Next : %" PRIx64, I->next);
+        log->Printf("      Prev : %" PRIx64, I->prev);
     }
 }

Modified: lldb/branches/windows/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp (original)
+++ lldb/branches/windows/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp Tue Jan  8 06:51:53 2013
@@ -13001,7 +13001,6 @@
 {
     switch (m_opcode_mode)
     {
-    default:
     case eModeInvalid:
         break;
 

Modified: lldb/branches/windows/source/Plugins/Instruction/ARM/EmulateInstructionARM.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/Instruction/ARM/EmulateInstructionARM.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/Instruction/ARM/EmulateInstructionARM.h (original)
+++ lldb/branches/windows/source/Plugins/Instruction/ARM/EmulateInstructionARM.h Tue Jan  8 06:51:53 2013
@@ -89,9 +89,6 @@
                 
             case eInstructionTypeAll:
                 return false;
-                
-            default:
-                break;
         }
         return false;
     }

Modified: lldb/branches/windows/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp (original)
+++ lldb/branches/windows/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp Tue Jan  8 06:51:53 2013
@@ -111,7 +111,7 @@
                     {
                         LogSP log (lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_OBJECT));
                         if (log)
-                            log->Printf ("0x%16.16llx: static-type = '%s' has vtable symbol '%s'\n",
+                            log->Printf ("0x%16.16" PRIx64 ": static-type = '%s' has vtable symbol '%s'\n",
                                          original_ptr,
                                          in_value.GetTypeName().GetCString(),
                                          name);
@@ -149,14 +149,14 @@
                         if (num_matches == 0)
                         {
                             if (log)
-                                log->Printf("0x%16.16llx: is not dynamic\n", original_ptr);
+                                log->Printf("0x%16.16" PRIx64 ": is not dynamic\n", original_ptr);
                             return false;
                         }
                         if (num_matches == 1)
                         {
                             type_sp = class_types.GetTypeAtIndex(0);
                             if (log)
-                                log->Printf ("0x%16.16llx: static-type = '%s' has dynamic type: uid={0x%llx}, type-name='%s'\n",
+                                log->Printf ("0x%16.16" PRIx64 ": static-type = '%s' has dynamic type: uid={0x%" PRIx64 "}, type-name='%s'\n",
                                              original_ptr,
                                              in_value.GetTypeName().AsCString(),
                                              type_sp->GetID(),
@@ -175,7 +175,7 @@
                                     if (type_sp)
                                     {
                                         if (log)
-                                            log->Printf ("0x%16.16llx: static-type = '%s' has multiple matching dynamic types: uid={0x%llx}, type-name='%s'\n",
+                                            log->Printf ("0x%16.16" PRIx64 ": static-type = '%s' has multiple matching dynamic types: uid={0x%" PRIx64 "}, type-name='%s'\n",
                                                          original_ptr,
                                                          in_value.GetTypeName().AsCString(),
                                                          type_sp->GetID(),
@@ -192,7 +192,7 @@
                                     if (ClangASTContext::IsCXXClassType(type_sp->GetClangFullType()))
                                     {
                                         if (log)
-                                            log->Printf ("0x%16.16llx: static-type = '%s' has multiple matching dynamic types, picking this one: uid={0x%llx}, type-name='%s'\n",
+                                            log->Printf ("0x%16.16" PRIx64 ": static-type = '%s' has multiple matching dynamic types, picking this one: uid={0x%" PRIx64 "}, type-name='%s'\n",
                                                          original_ptr,
                                                          in_value.GetTypeName().AsCString(),
                                                          type_sp->GetID(),
@@ -206,7 +206,7 @@
                             if (i == num_matches)
                             {
                                 if (log)
-                                    log->Printf ("0x%16.16llx: static-type = '%s' has multiple matching dynamic types, didn't find a C++ match\n",
+                                    log->Printf ("0x%16.16" PRIx64 ": static-type = '%s' has multiple matching dynamic types, didn't find a C++ match\n",
                                                  original_ptr,
                                                  in_value.GetTypeName().AsCString());
                                 return false;

Modified: lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp (original)
+++ lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp Tue Jan  8 06:51:53 2013
@@ -9,6 +9,7 @@
 
 #include "AppleObjCRuntimeV1.h"
 #include "AppleObjCTrampolineHandler.h"
+#include "AppleObjCTypeVendor.h"
 
 #include "llvm/Support/MachO.h"
 #include "clang/AST/Type.h"
@@ -294,6 +295,15 @@
     return ObjCLanguageRuntime::ClassDescriptorSP(new AppleObjCRuntimeV1::ClassDescriptorV1(m_parent_isa,process_sp));
 }
 
+bool
+AppleObjCRuntimeV1::ClassDescriptorV1::Describe (std::function <void (ObjCLanguageRuntime::ObjCISA)> const &superclass_func,
+                                                 std::function <bool (const char *, const char *)> const &instance_method_func,
+                                                 std::function <bool (const char *, const char *)> const &class_method_func,
+                                                 std::function <bool (const char *, const char *, lldb::addr_t, uint64_t)> const &ivar_func)
+{
+    return false;
+}
+
 lldb::addr_t
 AppleObjCRuntimeV1::GetISAHashTablePointer ()
 {
@@ -413,7 +423,7 @@
                                         ClassDescriptorSP descriptor_sp (new ClassDescriptorV1(isa, process_sp));
                                         
                                         if (log && log->GetVerbose())
-                                            log->Printf("AppleObjCRuntimeV1 added (ObjCISA)0x%llx from _objc_debug_class_hash to isa->descriptor cache", isa);
+                                            log->Printf("AppleObjCRuntimeV1 added (ObjCISA)0x%" PRIx64 " from _objc_debug_class_hash to isa->descriptor cache", isa);
                                         
                                         m_isa_to_descriptor_cache[isa] = descriptor_sp;
                                     }
@@ -435,7 +445,7 @@
                                             ClassDescriptorSP descriptor_sp (new ClassDescriptorV1(isa, process_sp));
                                             
                                             if (log && log->GetVerbose())
-                                                log->Printf("AppleObjCRuntimeV1 added (ObjCISA)0x%llx from _objc_debug_class_hash to isa->descriptor cache", isa);
+                                                log->Printf("AppleObjCRuntimeV1 added (ObjCISA)0x%" PRIx64 " from _objc_debug_class_hash to isa->descriptor cache", isa);
                                             
                                             m_isa_to_descriptor_cache[isa] = descriptor_sp;
                                         }
@@ -454,3 +464,11 @@
     }
 }
 
+TypeVendor *
+AppleObjCRuntimeV1::GetTypeVendor()
+{
+    if (!m_type_vendor_ap.get())
+        m_type_vendor_ap.reset(new AppleObjCTypeVendor(*this));
+    
+    return m_type_vendor_ap.get();
+}

Modified: lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h (original)
+++ lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h Tue Jan  8 06:51:53 2013
@@ -64,6 +64,12 @@
             return m_isa;
         }
         
+        virtual bool
+        Describe (std::function <void (ObjCLanguageRuntime::ObjCISA)> const &superclass_func,
+                  std::function <bool (const char *, const char *)> const &instance_method_func,
+                  std::function <bool (const char *, const char *)> const &class_method_func,
+                  std::function <bool (const char *, const char *, lldb::addr_t, uint64_t)> const &ivar_func);
+        
         virtual
         ~ClassDescriptorV1 ()
         {}
@@ -125,6 +131,9 @@
     
     virtual void
     UpdateISAToDescriptorMapIfNeeded();
+    
+    virtual TypeVendor *
+    GetTypeVendor();
 
 protected:
     virtual lldb::BreakpointResolverSP
@@ -173,6 +182,7 @@
     
     HashTableSignature m_hash_signature;
     lldb::addr_t m_isa_hash_table_ptr;
+    std::auto_ptr<TypeVendor> m_type_vendor_ap;
 private:
     AppleObjCRuntimeV1(Process *process);
 };

Modified: lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp (original)
+++ lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
 
 #include <string>
 #include <vector>
@@ -728,7 +729,7 @@
         m_process(process),
         m_end_iterator(*this, -1ll),
         m_load_addr(load_addr),
-        m_classheader_size((sizeof(int32_t) * 2))
+        m_classheader_size(sizeof(int32_t) * 2)
     {
         lldb::addr_t cursor = load_addr;
         
@@ -848,7 +849,7 @@
             return *this;
         }
         
-        const ObjCLanguageRuntime::ObjCISA operator*() const
+        ObjCLanguageRuntime::ObjCISA operator*() const
         {
             if (m_index == -1)
                 return 0;
@@ -958,10 +959,10 @@
 private:
     // The constructor should only be invoked by the runtime as it builds its caches
     // or populates them.  A ClassDescriptorV2 should only ever exist in a cache.
-    ClassDescriptorV2 (AppleObjCRuntimeV2 &runtime, ObjCLanguageRuntime::ObjCISA isa) :
+    ClassDescriptorV2 (AppleObjCRuntimeV2 &runtime, ObjCLanguageRuntime::ObjCISA isa, const char *name) :
         m_runtime (runtime),
         m_objc_class_ptr (isa),
-        m_name ()
+        m_name (name)
     {
     }
     
@@ -1093,7 +1094,7 @@
         
         if (class_method_func)
         {
-            ClassDescriptorV2 metaclass(m_runtime, objc_class->m_isa); // The metaclass is not in the cache
+            ClassDescriptorV2 metaclass(m_runtime, objc_class->m_isa, NULL); // The metaclass is not in the cache
             
             // We don't care about the metaclass's superclass, or its class methods.  Its instance methods are
             // our class methods.
@@ -1801,7 +1802,7 @@
                     {
                         lldb::LogSP log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
                         if (log)
-                            log->Printf("0x%llx: AppleObjCRuntimeV2::GetClassDescriptor() ISA was not in class descriptor cache 0x%llx",
+                            log->Printf("0x%" PRIx64 ": AppleObjCRuntimeV2::GetClassDescriptor() ISA was not in class descriptor cache 0x%" PRIx64,
                                         isa_pointer,
                                         isa);
                     }
@@ -1874,10 +1875,10 @@
                     if (m_isa_to_descriptor_cache.count(elt.second))
                         continue;
                     
-                    ClassDescriptorSP descriptor_sp = ClassDescriptorSP(new ClassDescriptorV2(*this, elt.second));
+                    ClassDescriptorSP descriptor_sp = ClassDescriptorSP(new ClassDescriptorV2(*this, elt.second, elt.first.AsCString()));
                     
                     if (log && log->GetVerbose())
-                        log->Printf("AppleObjCRuntimeV2 added (ObjCISA)0x%llx (%s) from dynamic table to isa->descriptor cache", elt.second, elt.first.AsCString());
+                        log->Printf("AppleObjCRuntimeV2 added (ObjCISA)0x%" PRIx64 " (%s) from dynamic table to isa->descriptor cache", elt.second, elt.first.AsCString());
                     
                     m_isa_to_descriptor_cache[elt.second] = descriptor_sp;
                 }
@@ -1915,10 +1916,10 @@
                                             if (m_isa_to_descriptor_cache.count(objc_isa))
                                                 continue;
                                             
-                                            ClassDescriptorSP descriptor_sp = ClassDescriptorSP(new ClassDescriptorV2(*this, objc_isa));
+                                            ClassDescriptorSP descriptor_sp = ClassDescriptorSP(new ClassDescriptorV2(*this, objc_isa, NULL));
                                             
                                             if (log && log->GetVerbose())
-                                                log->Printf("AppleObjCRuntimeV2 added (ObjCISA)0x%llx (%s) from static table to isa->descriptor cache", objc_isa, descriptor_sp->GetClassName().AsCString());
+                                                log->Printf("AppleObjCRuntimeV2 added (ObjCISA)0x%" PRIx64 " (%s) from static table to isa->descriptor cache", objc_isa, descriptor_sp->GetClassName().AsCString());
                                             
                                             m_isa_to_descriptor_cache[objc_isa] = descriptor_sp;
                                         }
@@ -2013,7 +2014,7 @@
                     const ConstString ivar_name_cs(class_and_ivar.second);
                     const char *ivar_name_cstr = ivar_name_cs.AsCString();
                     
-                    auto ivar_func = [&ret, ivar_name_cstr](const char *name, const char *type, lldb::addr_t offset_addr, uint64_t size) -> bool 
+                    auto ivar_func = [&ret, ivar_name_cstr](const char *name, const char *type, lldb::addr_t offset_addr, uint64_t size) -> lldb::addr_t
                     {
                         if (!strcmp(name, ivar_name_cstr))
                         {

Modified: lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp (original)
+++ lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "AppleObjCTrampolineHandler.h"
 
 // C Includes
@@ -301,13 +303,13 @@
 void
 AppleObjCTrampolineHandler::AppleObjCVTables::VTableRegion::Dump (Stream &s)
 {
-    s.Printf ("Header addr: 0x%llx Code start: 0x%llx Code End: 0x%llx Next: 0x%llx\n", 
+    s.Printf ("Header addr: 0x%" PRIx64 " Code start: 0x%" PRIx64 " Code End: 0x%" PRIx64 " Next: 0x%" PRIx64 "\n",
               m_header_addr, m_code_start_addr, m_code_end_addr, m_next_region);
     size_t num_elements = m_descriptors.size();
     for (size_t i = 0; i < num_elements; i++)
     {
         s.Indent();
-        s.Printf ("Code start: 0x%llx Flags: %d\n", m_descriptors[i].code_start, m_descriptors[i].flags);
+        s.Printf ("Code start: 0x%" PRIx64 " Flags: %d\n", m_descriptors[i].code_start, m_descriptors[i].flags);
     }
 }
         
@@ -616,7 +618,7 @@
                     impl_code_address = sc.symbol->GetAddress();
                     
                 //lldb::addr_t addr = impl_code_address.GetOpcodeLoadAddress (exe_ctx.GetTargetPtr());
-                //printf ("Getting address for our_utility_function: 0x%llx.\n", addr);
+                //printf ("Getting address for our_utility_function: 0x%" PRIx64 ".\n", addr);
             }
             else
             {
@@ -882,7 +884,7 @@
         {
             if (log)
             {
-                log->Printf("Resolving call for class - 0x%llx and selector - 0x%llx",
+                log->Printf("Resolving call for class - 0x%" PRIx64 " and selector - 0x%" PRIx64,
                             isa_addr, sel_addr);
             }
             ObjCLanguageRuntime *objc_runtime = m_process_sp->GetObjCLanguageRuntime ();
@@ -896,7 +898,7 @@
             // Yup, it was in the cache, so we can run to that address directly.
             
             if (log)
-                log->Printf ("Found implementation address in cache: 0x%llx", impl_addr);
+                log->Printf ("Found implementation address in cache: 0x%" PRIx64, impl_addr);
                  
             ret_plan_sp.reset (new ThreadPlanRunToAddress (thread, impl_addr, stop_others));
         }

Modified: lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeVendor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeVendor.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeVendor.cpp (original)
+++ lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeVendor.cpp Tue Jan  8 06:51:53 2013
@@ -126,6 +126,8 @@
             ASTDumper dumper((clang::Decl*)interface_decl);
             dumper.ToLog(log, "    [CT] ");
         }
+        
+        m_type_vendor.FinishDecl(interface_decl);
                 
         if (log)
         {
@@ -197,6 +199,7 @@
     m_external_source->SetMetadata((uintptr_t)new_iface_decl, meta_data);
     
     new_iface_decl->setHasExternalVisibleStorage();
+    new_iface_decl->setHasExternalLexicalStorage();
     
     ast_ctx->getTranslationUnitDecl()->addDecl(new_iface_decl);
     
@@ -344,7 +347,7 @@
         
         while (*name_cursor != '\0')
         {
-            char *colon_loc = (char*)strchr(name_cursor, ':');
+            const char *colon_loc = strchr(name_cursor, ':');
             if (!colon_loc)
             {
                 selector_components.push_back(&ast_ctx.Idents.get(llvm::StringRef(name_cursor)));
@@ -422,6 +425,8 @@
                 clang::QualType target_type = BuildType(ast_ctx, type+1);
                 if (target_type.isNull())
                     return clang::QualType();
+                else if (target_type == ast_ctx.UnknownAnyTy)
+                    return ast_ctx.UnknownAnyTy;
                 else
                     return ast_ctx.getConstType(target_type);
             }
@@ -430,6 +435,8 @@
             clang::QualType target_type = BuildType(ast_ctx, type+1);
             if (target_type.isNull())
                 return clang::QualType();
+            else if (target_type == ast_ctx.UnknownAnyTy)
+                return ast_ctx.UnknownAnyTy;
             else
                 return ast_ctx.getPointerType(target_type);
         }
@@ -504,6 +511,7 @@
     interface_decl->startDefinition();
     
     interface_decl->setHasExternalVisibleStorage(false);
+    interface_decl->setHasExternalLexicalStorage(false);
     
     ObjCLanguageRuntime::ClassDescriptorSP descriptor = m_runtime.GetClassDescriptor(objc_isa);
     
@@ -608,9 +616,9 @@
         
         clang::DeclContext::lookup_const_result lookup_result = ast_ctx->getTranslationUnitDecl()->lookup(decl_name);
         
-        if (lookup_result.first != lookup_result.second)
+        if (!lookup_result.empty())
         {
-            if (const clang::ObjCInterfaceDecl *result_iface_decl = llvm::dyn_cast<clang::ObjCInterfaceDecl>(*lookup_result.first))
+            if (const clang::ObjCInterfaceDecl *result_iface_decl = llvm::dyn_cast<clang::ObjCInterfaceDecl>(lookup_result[0]))
             {
                 clang::QualType result_iface_type = ast_ctx->getObjCInterfaceType(result_iface_decl);
                 
@@ -623,7 +631,7 @@
                     if (metadata)
                         isa_value = metadata->GetISAPtr();
                     
-                    log->Printf("AOCTV::FT [%u] Found %s (isa 0x%llx) in the ASTContext",
+                    log->Printf("AOCTV::FT [%u] Found %s (isa 0x%" PRIx64 ") in the ASTContext",
                                 current_id,
                                 dumper.GetCString(),
                                 isa_value);
@@ -666,7 +674,7 @@
         if (!iface_decl)
         {
             if (log)
-                log->Printf("AOCTV::FT [%u] Couldn't get the Objective-C interface for isa 0x%llx",
+                log->Printf("AOCTV::FT [%u] Couldn't get the Objective-C interface for isa 0x%" PRIx64,
                             current_id,
                             (uint64_t)isa);
             
@@ -678,7 +686,7 @@
         if (log)
         {
             ASTDumper dumper(new_iface_type);
-            log->Printf("AOCTV::FT [%u] Created %s (isa 0x%llx)",
+            log->Printf("AOCTV::FT [%u] Created %s (isa 0x%" PRIx64 ")",
                         current_id,
                         dumper.GetCString(),
                         (uint64_t)isa);

Modified: lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeVendor.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeVendor.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeVendor.h (original)
+++ lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeVendor.h Tue Jan  8 06:51:53 2013
@@ -38,6 +38,12 @@
                uint32_t max_matches,
                std::vector <ClangASTType> &types);
     
+    virtual clang::ASTContext *
+    GetClangASTContext ()
+    {
+        return m_ast_ctx.getASTContext();
+    }
+    
     friend class AppleObjCExternalASTSource;
 private:
     clang::ObjCInterfaceDecl   *GetDeclForISA(ObjCLanguageRuntime::ObjCISA isa);

Modified: lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp (original)
+++ lldb/branches/windows/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp Tue Jan  8 06:51:53 2013
@@ -86,7 +86,6 @@
         ExecutionContext exc_ctx;
         m_thread.CalculateExecutionContext(exc_ctx);
         m_func_sp.reset(m_impl_function->GetThreadPlanToCallFunction (exc_ctx, m_args_addr, errors, m_stop_others));
-        m_func_sp->SetPrivate(true);
         m_func_sp->SetOkayToDiscard(true);
         m_thread.QueueThreadPlan (m_func_sp, false);
     }
@@ -108,8 +107,8 @@
         s->Printf("Step through ObjC trampoline");
     else
     {
-        s->Printf ("Stepping to implementation of ObjC method - obj: 0x%llx, isa: 0x%llx, sel: 0x%llx",
-        m_input_values.GetValueAtIndex(0)->GetScalar().ULongLong(), m_isa_addr, m_sel_addr);
+        s->Printf ("Stepping to implementation of ObjC method - obj: 0x%llx, isa: 0x%" PRIx64 ", sel: 0x%" PRIx64,
+                   m_input_values.GetValueAtIndex(0)->GetScalar().ULongLong(), m_isa_addr, m_sel_addr);
     }
 }
                 
@@ -178,7 +177,7 @@
         if (m_trampoline_handler->AddrIsMsgForward(target_addr))
         {
             if (log)
-                log->Printf ("Implementation lookup returned msgForward function: 0x%llx, stopping.", target_addr);
+                log->Printf ("Implementation lookup returned msgForward function: 0x%" PRIx64 ", stopping.", target_addr);
 
             SymbolContext sc = m_thread.GetStackFrameAtIndex(0)->GetSymbolContext(eSymbolContextEverything);
             m_run_to_sp.reset(new ThreadPlanStepOut (m_thread, 
@@ -194,13 +193,13 @@
         }
         
         if (log)
-            log->Printf("Running to ObjC method implementation: 0x%llx", target_addr);
+            log->Printf("Running to ObjC method implementation: 0x%" PRIx64, target_addr);
         
         ObjCLanguageRuntime *objc_runtime = GetThread().GetProcess()->GetObjCLanguageRuntime();
         assert (objc_runtime != NULL);
         objc_runtime->AddToMethodCache (m_isa_addr, m_sel_addr, target_addr);
         if (log)
-            log->Printf("Adding {isa-addr=0x%llx, sel-addr=0x%llx} = addr=0x%llx to cache.", m_isa_addr, m_sel_addr, target_addr);
+            log->Printf("Adding {isa-addr=0x%" PRIx64 ", sel-addr=0x%" PRIx64 "} = addr=0x%" PRIx64 " to cache.", m_isa_addr, m_sel_addr, target_addr);
 
         // Extract the target address from the value:
         

Modified: lldb/branches/windows/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp (original)
+++ lldb/branches/windows/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp Tue Jan  8 06:51:53 2013
@@ -181,7 +181,7 @@
     // delete an archive entry...
     while (pos != archive_map.end() && pos->first == file)
     {
-        if (pos->second->GetArchitecture() == arch)
+        if (pos->second->GetArchitecture().IsCompatibleMatch(arch))
         {
             if (pos->second->GetModificationTime() == time)
             {
@@ -289,7 +289,7 @@
     if (file && data_sp && ObjectContainerBSDArchive::MagicBytesMatch(data))
     {
         Timer scoped_timer (__PRETTY_FUNCTION__,
-                            "ObjectContainerBSDArchive::CreateInstance (module = %s/%s, file = %p, file_offset = 0x%8.8llx, file_size = 0x%8.8llx)",
+                            "ObjectContainerBSDArchive::CreateInstance (module = %s/%s, file = %p, file_offset = 0x%8.8" PRIx64 ", file_size = 0x%8.8" PRIx64 ")",
                             module_sp->GetFileSpec().GetDirectory().AsCString(),
                             module_sp->GetFileSpec().GetFilename().AsCString(),
                             file, (uint64_t) offset, (uint64_t) length);

Modified: lldb/branches/windows/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp (original)
+++ lldb/branches/windows/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp Tue Jan  8 06:51:53 2013
@@ -1186,9 +1186,9 @@
     DumpELFHeader_e_type(s, header.e_type);
     s->Printf("\ne_machine   = 0x%4.4x\n", header.e_machine);
     s->Printf("e_version   = 0x%8.8x\n", header.e_version);
-    s->Printf("e_entry     = 0x%8.8llx\n", header.e_entry);
-    s->Printf("e_phoff     = 0x%8.8llx\n", header.e_phoff);
-    s->Printf("e_shoff     = 0x%8.8llx\n", header.e_shoff);
+    s->Printf("e_entry     = 0x%8.8" PRIx64 "\n", header.e_entry);
+    s->Printf("e_phoff     = 0x%8.8" PRIx64 "\n", header.e_phoff);
+    s->Printf("e_shoff     = 0x%8.8" PRIx64 "\n", header.e_shoff);
     s->Printf("e_flags     = 0x%8.8x\n", header.e_flags);
     s->Printf("e_ehsize    = 0x%4.4x\n", header.e_ehsize);
     s->Printf("e_phentsize = 0x%4.4x\n", header.e_phentsize);
@@ -1246,11 +1246,11 @@
 ObjectFileELF::DumpELFProgramHeader(Stream *s, const ELFProgramHeader &ph)
 {
     DumpELFProgramHeader_p_type(s, ph.p_type);
-    s->Printf(" %8.8llx %8.8llx %8.8llx", ph.p_offset, ph.p_vaddr, ph.p_paddr);
-    s->Printf(" %8.8llx %8.8llx %8.8x (", ph.p_filesz, ph.p_memsz, ph.p_flags);
+    s->Printf(" %8.8" PRIx64 " %8.8" PRIx64 " %8.8" PRIx64, ph.p_offset, ph.p_vaddr, ph.p_paddr);
+    s->Printf(" %8.8" PRIx64 " %8.8" PRIx64 " %8.8x (", ph.p_filesz, ph.p_memsz, ph.p_flags);
 
     DumpELFProgramHeader_p_flags(s, ph.p_flags);
-    s->Printf(") %8.8llx", ph.p_align);
+    s->Printf(") %8.8" PRIx64, ph.p_align);
 }
 
 //----------------------------------------------------------------------
@@ -1331,11 +1331,11 @@
 {
     s->Printf("%8.8x ", sh.sh_name);
     DumpELFSectionHeader_sh_type(s, sh.sh_type);
-    s->Printf(" %8.8llx (", sh.sh_flags);
+    s->Printf(" %8.8" PRIx64 " (", sh.sh_flags);
     DumpELFSectionHeader_sh_flags(s, sh.sh_flags);
-    s->Printf(") %8.8llx %8.8llx %8.8llx", sh.sh_addr, sh.sh_offset, sh.sh_size);
+    s->Printf(") %8.8" PRIx64 " %8.8" PRIx64 " %8.8" PRIx64, sh.sh_addr, sh.sh_offset, sh.sh_size);
     s->Printf(" %8.8x %8.8x", sh.sh_link, sh.sh_info);
-    s->Printf(" %8.8llx %8.8llx", sh.sh_addralign, sh.sh_entsize);
+    s->Printf(" %8.8" PRIx64 " %8.8" PRIx64, sh.sh_addralign, sh.sh_entsize);
 }
 
 //----------------------------------------------------------------------

Modified: lldb/branches/windows/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)
+++ lldb/branches/windows/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Tue Jan  8 06:51:53 2013
@@ -565,7 +565,7 @@
             
             // Check if the module has a required architecture
             const ArchSpec &module_arch = module_sp->GetArchitecture();
-            if (module_arch.IsValid() && !module_arch.IsExactMatch(mach_arch))
+            if (module_arch.IsValid() && !module_arch.IsCompatibleMatch(mach_arch))
                 return false;
 
             if (SetModulesArchitecture (mach_arch))
@@ -1642,6 +1642,7 @@
                                             uint32_t symbol_byte_size = 0;
                                             bool add_nlist = true;
                                             bool is_debug = ((nlist.n_type & NlistMaskStab) != 0);
+                                            bool demangled_is_synthesized = false;
 
                                             assert (sym_idx < num_syms);
 
@@ -2036,68 +2037,67 @@
                                                         break;
 
                                                     case NListTypeSection:          // N_SECT
-                                                    {
-                                                        symbol_section = section_info.GetSection (nlist.n_sect, nlist.n_value);
-
-                                                        if (symbol_section == NULL)
                                                         {
-                                                            // TODO: warn about this?
-                                                            add_nlist = false;
-                                                            break;
-                                                        }
+                                                            symbol_section = section_info.GetSection (nlist.n_sect, nlist.n_value);
 
-                                                        if (TEXT_eh_frame_sectID == nlist.n_sect)
-                                                        {
-                                                            type = eSymbolTypeException;
-                                                        }
-                                                        else
-                                                        {
-                                                            uint32_t section_type = symbol_section->Get() & SectionFlagMaskSectionType;
-                                                            
-                                                            switch (section_type)
+                                                            if (symbol_section == NULL)
                                                             {
-                                                                case SectionTypeRegular:                     break; // regular section
-                                                                                                                    //case SectionTypeZeroFill:                 type = eSymbolTypeData;    break; // zero fill on demand section
-                                                                case SectionTypeCStringLiterals:            type = eSymbolTypeData;    break; // section with only literal C strings
-                                                                case SectionType4ByteLiterals:              type = eSymbolTypeData;    break; // section with only 4 byte literals
-                                                                case SectionType8ByteLiterals:              type = eSymbolTypeData;    break; // section with only 8 byte literals
-                                                                case SectionTypeLiteralPointers:            type = eSymbolTypeTrampoline; break; // section with only pointers to literals
-                                                                case SectionTypeNonLazySymbolPointers:      type = eSymbolTypeTrampoline; break; // section with only non-lazy symbol pointers
-                                                                case SectionTypeLazySymbolPointers:         type = eSymbolTypeTrampoline; break; // section with only lazy symbol pointers
-                                                                case SectionTypeSymbolStubs:                type = eSymbolTypeTrampoline; break; // section with only symbol stubs, byte size of stub in the reserved2 field
-                                                                case SectionTypeModuleInitFunctionPointers: type = eSymbolTypeCode;    break; // section with only function pointers for initialization
-                                                                case SectionTypeModuleTermFunctionPointers: type = eSymbolTypeCode;    break; // section with only function pointers for termination
-                                                                                                                                              //case SectionTypeCoalesced:                type = eSymbolType;    break; // section contains symbols that are to be coalesced
-                                                                                                                                              //case SectionTypeZeroFillLarge:            type = eSymbolTypeData;    break; // zero fill on demand section (that can be larger than 4 gigabytes)
-                                                                case SectionTypeInterposing:                type = eSymbolTypeTrampoline;  break; // section with only pairs of function pointers for interposing
-                                                                case SectionType16ByteLiterals:             type = eSymbolTypeData;    break; // section with only 16 byte literals
-                                                                case SectionTypeDTraceObjectFormat:         type = eSymbolTypeInstrumentation; break;
-                                                                case SectionTypeLazyDylibSymbolPointers:    type = eSymbolTypeTrampoline; break;
-                                                                default: break;
+                                                                // TODO: warn about this?
+                                                                add_nlist = false;
+                                                                break;
                                                             }
-                                                            
-                                                            if (type == eSymbolTypeInvalid)
+
+                                                            if (TEXT_eh_frame_sectID == nlist.n_sect)
+                                                            {
+                                                                type = eSymbolTypeException;
+                                                            }
+                                                            else
                                                             {
-                                                                const char *symbol_sect_name = symbol_section->GetName().AsCString();
-                                                                if (symbol_section->IsDescendant (text_section_sp.get()))
+                                                                uint32_t section_type = symbol_section->Get() & SectionFlagMaskSectionType;
+                                                                
+                                                                switch (section_type)
                                                                 {
-                                                                    if (symbol_section->IsClear(SectionAttrUserPureInstructions | 
-                                                                                                SectionAttrUserSelfModifyingCode | 
-                                                                                                SectionAttrSytemSomeInstructions))
-                                                                        type = eSymbolTypeData;
-                                                                    else
-                                                                        type = eSymbolTypeCode;
+                                                                    case SectionTypeRegular:                     break; // regular section
+                                                                                                                        //case SectionTypeZeroFill:                 type = eSymbolTypeData;    break; // zero fill on demand section
+                                                                    case SectionTypeCStringLiterals:            type = eSymbolTypeData;    break; // section with only literal C strings
+                                                                    case SectionType4ByteLiterals:              type = eSymbolTypeData;    break; // section with only 4 byte literals
+                                                                    case SectionType8ByteLiterals:              type = eSymbolTypeData;    break; // section with only 8 byte literals
+                                                                    case SectionTypeLiteralPointers:            type = eSymbolTypeTrampoline; break; // section with only pointers to literals
+                                                                    case SectionTypeNonLazySymbolPointers:      type = eSymbolTypeTrampoline; break; // section with only non-lazy symbol pointers
+                                                                    case SectionTypeLazySymbolPointers:         type = eSymbolTypeTrampoline; break; // section with only lazy symbol pointers
+                                                                    case SectionTypeSymbolStubs:                type = eSymbolTypeTrampoline; break; // section with only symbol stubs, byte size of stub in the reserved2 field
+                                                                    case SectionTypeModuleInitFunctionPointers: type = eSymbolTypeCode;    break; // section with only function pointers for initialization
+                                                                    case SectionTypeModuleTermFunctionPointers: type = eSymbolTypeCode;    break; // section with only function pointers for termination
+                                                                                                                                                  //case SectionTypeCoalesced:                type = eSymbolType;    break; // section contains symbols that are to be coalesced
+                                                                                                                                                  //case SectionTypeZeroFillLarge:            type = eSymbolTypeData;    break; // zero fill on demand section (that can be larger than 4 gigabytes)
+                                                                    case SectionTypeInterposing:                type = eSymbolTypeTrampoline;  break; // section with only pairs of function pointers for interposing
+                                                                    case SectionType16ByteLiterals:             type = eSymbolTypeData;    break; // section with only 16 byte literals
+                                                                    case SectionTypeDTraceObjectFormat:         type = eSymbolTypeInstrumentation; break;
+                                                                    case SectionTypeLazyDylibSymbolPointers:    type = eSymbolTypeTrampoline; break;
+                                                                    default: break;
                                                                 }
-                                                                else
-                                                                    if (symbol_section->IsDescendant(data_section_sp.get()))
+                                                                
+                                                                if (type == eSymbolTypeInvalid)
+                                                                {
+                                                                    const char *symbol_sect_name = symbol_section->GetName().AsCString();
+                                                                    if (symbol_section->IsDescendant (text_section_sp.get()))
+                                                                    {
+                                                                        if (symbol_section->IsClear(SectionAttrUserPureInstructions |
+                                                                                                    SectionAttrUserSelfModifyingCode |
+                                                                                                    SectionAttrSytemSomeInstructions))
+                                                                            type = eSymbolTypeData;
+                                                                        else
+                                                                            type = eSymbolTypeCode;
+                                                                    }
+                                                                    else if (symbol_section->IsDescendant(data_section_sp.get()))
                                                                     {
                                                                         if (symbol_sect_name && ::strstr (symbol_sect_name, "__objc") == symbol_sect_name)
                                                                         {
                                                                             type = eSymbolTypeRuntime;
                                                                             
-                                                                            if (symbol_name && 
-                                                                                symbol_name[0] == '_' && 
-                                                                                symbol_name[1] == 'O' && 
+                                                                            if (symbol_name &&
+                                                                                symbol_name[0] == '_' &&
+                                                                                symbol_name[1] == 'O' &&
                                                                                 symbol_name[2] == 'B')
                                                                             {
                                                                                 llvm::StringRef symbol_name_ref(symbol_name);
@@ -2109,55 +2109,56 @@
                                                                                     symbol_name_non_abi_mangled = symbol_name + 1;
                                                                                     symbol_name = symbol_name + g_objc_v2_prefix_class.size();
                                                                                     type = eSymbolTypeObjCClass;
+                                                                                    demangled_is_synthesized = true;
                                                                                 }
                                                                                 else if (symbol_name_ref.startswith(g_objc_v2_prefix_metaclass))
                                                                                 {
                                                                                     symbol_name_non_abi_mangled = symbol_name + 1;
                                                                                     symbol_name = symbol_name + g_objc_v2_prefix_metaclass.size();
                                                                                     type = eSymbolTypeObjCMetaClass;
+                                                                                    demangled_is_synthesized = true;
                                                                                 }
                                                                                 else if (symbol_name_ref.startswith(g_objc_v2_prefix_ivar))
                                                                                 {
                                                                                     symbol_name_non_abi_mangled = symbol_name + 1;
                                                                                     symbol_name = symbol_name + g_objc_v2_prefix_ivar.size();
                                                                                     type = eSymbolTypeObjCIVar;
+                                                                                    demangled_is_synthesized = true;
                                                                                 }
                                                                             }
                                                                         }
-                                                                        else
-                                                                            if (symbol_sect_name && ::strstr (symbol_sect_name, "__gcc_except_tab") == symbol_sect_name)
-                                                                            {
-                                                                                type = eSymbolTypeException;
-                                                                            }
-                                                                            else
-                                                                            {
-                                                                                type = eSymbolTypeData;
-                                                                            }
-                                                                    }
-                                                                    else
-                                                                        if (symbol_sect_name && ::strstr (symbol_sect_name, "__IMPORT") == symbol_sect_name)
+                                                                        else if (symbol_sect_name && ::strstr (symbol_sect_name, "__gcc_except_tab") == symbol_sect_name)
                                                                         {
-                                                                            type = eSymbolTypeTrampoline;
+                                                                            type = eSymbolTypeException;
                                                                         }
                                                                         else
-                                                                            if (symbol_section->IsDescendant(objc_section_sp.get()))
+                                                                        {
+                                                                            type = eSymbolTypeData;
+                                                                        }
+                                                                    }
+                                                                    else if (symbol_sect_name && ::strstr (symbol_sect_name, "__IMPORT") == symbol_sect_name)
+                                                                    {
+                                                                        type = eSymbolTypeTrampoline;
+                                                                    }
+                                                                    else if (symbol_section->IsDescendant(objc_section_sp.get()))
+                                                                    {
+                                                                        type = eSymbolTypeRuntime;
+                                                                        if (symbol_name && symbol_name[0] == '.')
+                                                                        {
+                                                                            llvm::StringRef symbol_name_ref(symbol_name);
+                                                                            static const llvm::StringRef g_objc_v1_prefix_class (".objc_class_name_");
+                                                                            if (symbol_name_ref.startswith(g_objc_v1_prefix_class))
                                                                             {
-                                                                                type = eSymbolTypeRuntime;
-                                                                                if (symbol_name && symbol_name[0] == '.')
-                                                                                {
-                                                                                    llvm::StringRef symbol_name_ref(symbol_name);
-                                                                                    static const llvm::StringRef g_objc_v1_prefix_class (".objc_class_name_");
-                                                                                    if (symbol_name_ref.startswith(g_objc_v1_prefix_class))
-                                                                                    {
-                                                                                        symbol_name_non_abi_mangled = symbol_name;
-                                                                                        symbol_name = symbol_name + g_objc_v1_prefix_class.size();
-                                                                                        type = eSymbolTypeObjCClass;
-                                                                                    }
-                                                                                }
+                                                                                symbol_name_non_abi_mangled = symbol_name;
+                                                                                symbol_name = symbol_name + g_objc_v1_prefix_class.size();
+                                                                                type = eSymbolTypeObjCClass;
+                                                                                demangled_is_synthesized = true;
                                                                             }
+                                                                        }
+                                                                    }
+                                                                }
                                                             }
                                                         }
-                                                    }
                                                         break;
                                                 }                            
                                             }
@@ -2293,6 +2294,8 @@
                                                 if (symbol_byte_size > 0)
                                                     sym[sym_idx].SetByteSize(symbol_byte_size);
 
+                                                if (demangled_is_synthesized)
+                                                    sym[sym_idx].SetDemangledNameIsSynthesized(true);
                                                 ++sym_idx;
                                             }
                                             else
@@ -2383,6 +2386,7 @@
             uint32_t symbol_byte_size = 0;
             bool add_nlist = true;
             bool is_debug = ((nlist.n_type & NlistMaskStab) != 0);
+            bool demangled_is_synthesized = false;
 
             assert (sym_idx < num_syms);
 
@@ -2851,18 +2855,21 @@
                                                 symbol_name_non_abi_mangled = symbol_name + 1;
                                                 symbol_name = symbol_name + g_objc_v2_prefix_class.size();
                                                 type = eSymbolTypeObjCClass;
+                                                demangled_is_synthesized = true;
                                             }
                                             else if (symbol_name_ref.startswith(g_objc_v2_prefix_metaclass))
                                             {
                                                 symbol_name_non_abi_mangled = symbol_name + 1;
                                                 symbol_name = symbol_name + g_objc_v2_prefix_metaclass.size();
                                                 type = eSymbolTypeObjCMetaClass;
+                                                demangled_is_synthesized = true;
                                             }
                                             else if (symbol_name_ref.startswith(g_objc_v2_prefix_ivar))
                                             {
                                                 symbol_name_non_abi_mangled = symbol_name + 1;
                                                 symbol_name = symbol_name + g_objc_v2_prefix_ivar.size();
                                                 type = eSymbolTypeObjCIVar;
+                                                demangled_is_synthesized = true;
                                             }
                                         }
                                     }
@@ -2894,6 +2901,7 @@
                                             symbol_name_non_abi_mangled = symbol_name;
                                             symbol_name = symbol_name + g_objc_v1_prefix_class.size();
                                             type = eSymbolTypeObjCClass;
+                                            demangled_is_synthesized = true;
                                         }
                                     }
                                 }
@@ -3030,6 +3038,9 @@
                 if (symbol_byte_size > 0)
                     sym[sym_idx].SetByteSize(symbol_byte_size);
 
+                if (demangled_is_synthesized)
+                    sym[sym_idx].SetDemangledNameIsSynthesized(true);
+
                 ++sym_idx;
             }
             else

Modified: lldb/branches/windows/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp (original)
+++ lldb/branches/windows/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp Tue Jan  8 06:51:53 2013
@@ -790,7 +790,7 @@
     s->Printf ("  entry                   = 0x%8.8x\n", header.entry);
     s->Printf ("  code_offset             = 0x%8.8x\n", header.code_offset);
     s->Printf ("  data_offset             = 0x%8.8x\n", header.data_offset);
-    s->Printf ("  image_base              = 0x%16.16llx\n", header.image_base);
+    s->Printf ("  image_base              = 0x%16.16" PRIx64 "\n", header.image_base);
     s->Printf ("  sect_alignment          = 0x%8.8x\n", header.sect_alignment);
     s->Printf ("  file_alignment          = 0x%8.8x\n", header.file_alignment);
     s->Printf ("  major_os_system_version = 0x%4.4x\n", header.major_os_system_version);
@@ -805,10 +805,10 @@
     s->Printf ("  checksum                = 0x%8.8x\n", header.checksum);
     s->Printf ("  subsystem               = 0x%4.4x\n", header.subsystem);
     s->Printf ("  dll_flags               = 0x%4.4x\n", header.dll_flags);
-    s->Printf ("  stack_reserve_size      = 0x%16.16llx\n", header.stack_reserve_size);
-    s->Printf ("  stack_commit_size       = 0x%16.16llx\n", header.stack_commit_size);
-    s->Printf ("  heap_reserve_size       = 0x%16.16llx\n", header.heap_reserve_size);
-    s->Printf ("  heap_commit_size        = 0x%16.16llx\n", header.heap_commit_size);
+    s->Printf ("  stack_reserve_size      = 0x%16.16" PRIx64 "\n", header.stack_reserve_size);
+    s->Printf ("  stack_commit_size       = 0x%16.16" PRIx64 "\n", header.stack_commit_size);
+    s->Printf ("  heap_reserve_size       = 0x%16.16" PRIx64 "\n", header.heap_reserve_size);
+    s->Printf ("  heap_commit_size        = 0x%16.16" PRIx64 "\n", header.heap_commit_size);
     s->Printf ("  loader_flags            = 0x%8.8x\n", header.loader_flags);
     s->Printf ("  num_data_dir_entries    = 0x%8.8zx\n", header.data_dirs.size());
     uint32_t i;

Modified: lldb/branches/windows/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp (original)
+++ lldb/branches/windows/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp Tue Jan  8 06:51:53 2013
@@ -6,6 +6,9 @@
 // License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
+
+#include "lldb/lldb-python.h"
+
 #ifndef LLDB_DISABLE_PYTHON
 
 #include "OperatingSystemPython.h"
@@ -133,7 +136,7 @@
         LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS));
         
         if (log)
-            log->Printf ("OperatingSystemPython::GetDynamicRegisterInfo() fetching thread register definitions from python for pid %llu", m_process->GetID());
+            log->Printf ("OperatingSystemPython::GetDynamicRegisterInfo() fetching thread register definitions from python for pid %" PRIu64, m_process->GetID());
         
         auto object_sp = m_interpreter->OSPlugin_QueryForRegisterInfo(m_interpreter->MakeScriptObject(m_python_object));
         if (!object_sp)
@@ -175,16 +178,22 @@
 OperatingSystemPython::UpdateThreadList (ThreadList &old_thread_list, ThreadList &new_thread_list)
 {
     if (!m_interpreter || !m_python_object)
-        return NULL;
+        return false;
     
     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS));
     
+    // First thing we have to do is get the API lock, and the run lock.  We're going to change the thread
+    // content of the process, and we're going to use python, which requires the API lock to do it.
+    // So get & hold that.  This is a recursive lock so we can grant it to any Python code called on the stack below us.
+    Target &target = m_process->GetTarget();
+    Mutex::Locker api_locker (target.GetAPIMutex());
+    
     if (log)
-        log->Printf ("OperatingSystemPython::UpdateThreadList() fetching thread data from python for pid %llu", m_process->GetID());
+        log->Printf ("OperatingSystemPython::UpdateThreadList() fetching thread data from python for pid %" PRIu64, m_process->GetID());
 
     auto object_sp = m_interpreter->OSPlugin_QueryForThreadsInfo(m_interpreter->MakeScriptObject(m_python_object));
     if (!object_sp)
-        return NULL;
+        return false;
     PythonDataObject pyobj((PyObject*)object_sp->GetObject());
     PythonDataArray threads_array (pyobj.GetArrayObject());
     if (threads_array)
@@ -248,6 +257,12 @@
     if (!m_interpreter || !m_python_object || !thread)
         return RegisterContextSP();
     
+    // First thing we have to do is get the API lock, and the run lock.  We're going to change the thread
+    // content of the process, and we're going to use python, which requires the API lock to do it.
+    // So get & hold that.  This is a recursive lock so we can grant it to any Python code called on the stack below us.
+    Target &target = m_process->GetTarget();
+    Mutex::Locker api_locker (target.GetAPIMutex());
+
     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_THREAD));
 
     if (reg_data_addr != LLDB_INVALID_ADDRESS)
@@ -255,7 +270,7 @@
         // The registers data is in contiguous memory, just create the register
         // context using the address provided
         if (log)
-            log->Printf ("OperatingSystemPython::CreateRegisterContextForThread (tid = 0x%llx, reg_data_addr = 0x%llx) creating memory register context", thread->GetID(), reg_data_addr);
+            log->Printf ("OperatingSystemPython::CreateRegisterContextForThread (tid = 0x%" PRIx64 ", reg_data_addr = 0x%" PRIx64 ") creating memory register context", thread->GetID(), reg_data_addr);
         reg_ctx_sp.reset (new RegisterContextMemory (*thread, 0, *GetDynamicRegisterInfo (), reg_data_addr));
     }
     else
@@ -263,7 +278,7 @@
         // No register data address is provided, query the python plug-in to let
         // it make up the data as it sees fit
         if (log)
-            log->Printf ("OperatingSystemPython::CreateRegisterContextForThread (tid = 0x%llx) fetching register data from python", thread->GetID());
+            log->Printf ("OperatingSystemPython::CreateRegisterContextForThread (tid = 0x%" PRIx64 ") fetching register data from python", thread->GetID());
 
         auto object_sp = m_interpreter->OSPlugin_QueryForRegisterContextData (m_interpreter->MakeScriptObject(m_python_object),
                                                                               thread->GetID());

Modified: lldb/branches/windows/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp (original)
+++ lldb/branches/windows/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "PlatformFreeBSD.h"
 
 // C Includes
@@ -628,7 +630,7 @@
     {
         ArchSpec platform_arch (Host::GetArchitecture (Host::eSystemDefaultArchitecture));
         ArchSpec platform_arch64 (Host::GetArchitecture (Host::eSystemDefaultArchitecture64));
-        if (platform_arch == platform_arch64)
+        if (platform_arch.IsExactMatch(platform_arch64))
         {
             // This freebsd platform supports both 32 and 64 bit. Since we already
             // returned the 64 bit arch for idx == 0, return the 32 bit arch

Modified: lldb/branches/windows/source/Plugins/Platform/Linux/PlatformLinux.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/Platform/Linux/PlatformLinux.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/Platform/Linux/PlatformLinux.cpp (original)
+++ lldb/branches/windows/source/Plugins/Platform/Linux/PlatformLinux.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "PlatformLinux.h"
 
 // C Includes

Modified: lldb/branches/windows/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp (original)
+++ lldb/branches/windows/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "PlatformDarwin.h"
 
 // C Includes
@@ -52,10 +54,22 @@
 PlatformDarwin::LocateExecutableScriptingResource (const ModuleSpec &module_spec)
 {
     const FileSpec *exec_fspec = module_spec.GetFileSpecPtr();
+    // APIs such as NSLinkModule() allow us to attach a library without a filename
+    // make sure we do not crash under those circumstances
+    if (!exec_fspec)
+        return FileSpec();
+
+    // if the arch and uuid are ever used for anything other than display purposes
+    // make sure they are not NULL before proceeding
     const ArchSpec *arch = module_spec.GetArchitecturePtr();
     const UUID *uuid = module_spec.GetUUIDPtr();
     
     const char* module_directory = exec_fspec->GetDirectory().GetCString();
+
+    // NB some extensions might be meaningful and should not be stripped - "this.binary.file"
+    // should not lose ".file" but GetFileNameStrippingExtension() will do precisely that.
+    // Ideally, we should have a per-platform list of extensions (".exe", ".app", ".dSYM", ".framework")
+    // which should be stripped while leaving "this.binary.file" as-is.
     const char* module_basename = exec_fspec->GetFileNameStrippingExtension().GetCString();
     
     if (!module_directory || !module_basename)
@@ -67,6 +81,21 @@
                         arch ? arch->GetArchitectureName() : "<NULL>",
                         uuid);
     
+    // FIXME: for Python, we cannot allow dots in the middle of the filenames we import.
+    // Theoretically, different scripting languages may have different sets of
+    // forbidden tokens in filenames, and that should be dealt with by each ScriptInterpreter.
+    // For now, we just replace dots with underscores, but if we ever support anything
+    // other than Python we will need to rework this
+    std::auto_ptr<char> module_basename_fixed_ap(new char[strlen(module_basename)+1]);
+    char* module_basename_fixed = module_basename_fixed_ap.get();
+    strcpy(module_basename_fixed, module_basename);
+    while (*module_basename_fixed)
+    {
+        if (*module_basename_fixed == '.')
+            *module_basename_fixed = '_';
+        module_basename_fixed++;
+    }
+    module_basename_fixed = module_basename_fixed_ap.get();
     
     FileSpec symbol_fspec (Symbols::LocateExecutableSymbolFile(module_spec));
     
@@ -78,7 +107,7 @@
     {
         // for OSX we are going to be in .dSYM/Contents/Resources/DWARF/<basename>
         // let us go to .dSYM/Contents/Resources/Python/<basename>.py and see if the file exists
-        path_string.Printf("%s/../Python/%s.py",symbol_fspec.GetDirectory().AsCString(""),module_basename);
+        path_string.Printf("%s/../Python/%s.py",symbol_fspec.GetDirectory().AsCString(""),module_basename_fixed);
         script_fspec.SetFile(path_string.GetData(), true);
         if (!script_fspec.Exists())
             script_fspec.Clear();
@@ -94,7 +123,7 @@
             // we are going to be in foo.framework/Versions/X/foo
             path_string.Clear();
             // let's go to foo.framework/Versions/X/Resources/Python/foo.py
-            path_string.Printf("%s/Resources/Python/%s.py",module_directory,module_basename);
+            path_string.Printf("%s/Resources/Python/%s.py",module_directory,module_basename_fixed);
             script_fspec.SetFile(path_string.GetData(), true);
             if (!script_fspec.Exists())
                 script_fspec.Clear();
@@ -676,7 +705,7 @@
     {
         ArchSpec platform_arch (Host::GetArchitecture (Host::eSystemDefaultArchitecture));
         ArchSpec platform_arch64 (Host::GetArchitecture (Host::eSystemDefaultArchitecture64));
-        if (platform_arch == platform_arch64)
+        if (platform_arch.IsExactMatch(platform_arch64))
         {
             // This macosx platform supports both 32 and 64 bit. Since we already
             // returned the 64 bit arch for idx == 0, return the 32 bit arch 

Modified: lldb/branches/windows/source/Plugins/Platform/Windows/PlatformWindows.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/Platform/Windows/PlatformWindows.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/Platform/Windows/PlatformWindows.cpp (original)
+++ lldb/branches/windows/source/Plugins/Platform/Windows/PlatformWindows.cpp Tue Jan  8 06:51:53 2013
@@ -621,7 +621,7 @@
     {
         ArchSpec platform_arch (Host::GetArchitecture (Host::eSystemDefaultArchitecture));
         ArchSpec platform_arch64 (Host::GetArchitecture (Host::eSystemDefaultArchitecture64));
-        if (platform_arch == platform_arch64)
+        if (platform_arch.IsExactMatch(platform_arch64))
         {
             // This freebsd platform supports both 32 and 64 bit. Since we already
             // returned the 64 bit arch for idx == 0, return the 32 bit arch

Modified: lldb/branches/windows/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp (original)
+++ lldb/branches/windows/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "PlatformRemoteGDBServer.h"
 
 // C Includes

Modified: lldb/branches/windows/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp (original)
+++ lldb/branches/windows/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp Tue Jan  8 06:51:53 2013
@@ -502,8 +502,8 @@
 class SiginfoOperation : public Operation
 {
 public:
-    SiginfoOperation(lldb::tid_t tid, void *info, bool &result)
-        : m_tid(tid), m_info(info), m_result(result) { }
+    SiginfoOperation(lldb::tid_t tid, void *info, bool &result, int &ptrace_err)
+        : m_tid(tid), m_info(info), m_result(result), m_err(ptrace_err) { }
 
     void Execute(ProcessMonitor *monitor);
 
@@ -511,6 +511,7 @@
     lldb::tid_t m_tid;
     void *m_info;
     bool &m_result;
+    int &m_err;
 };
 
 void
@@ -518,9 +519,10 @@
 {
     struct ptrace_lwpinfo plwp;
 
-    if (PTRACE(PT_LWPINFO, m_tid, (caddr_t)&plwp, sizeof(plwp)))
+    if (PTRACE(PT_LWPINFO, m_tid, (caddr_t)&plwp, sizeof(plwp))) {
         m_result = false;
-    else {
+        m_err = errno;
+    } else {
         memcpy(m_info, &plwp.pl_siginfo, sizeof(siginfo_t));
         m_result = true;
     }
@@ -1060,8 +1062,9 @@
     ProcessFreeBSD *process = monitor->m_process;
     bool stop_monitoring;
     siginfo_t info;
+    int ptrace_err;
 
-    if (!monitor->GetSignalInfo(pid, &info))
+    if (!monitor->GetSignalInfo(pid, &info, ptrace_err))
         stop_monitoring = true; // pid is gone.  Bail.
     else {
         switch (info.si_signo)
@@ -1407,7 +1410,8 @@
 }
 
 bool
-ProcessMonitor::ReadRegisterValue(unsigned offset, unsigned size, RegisterValue &value)
+ProcessMonitor::ReadRegisterValue(lldb::tid_t tid, unsigned offset,
+                                  unsigned size, RegisterValue &value)
 {
     bool result;
     ReadRegOperation op(offset, size, value, result);
@@ -1416,7 +1420,8 @@
 }
 
 bool
-ProcessMonitor::WriteRegisterValue(unsigned offset, const RegisterValue &value)
+ProcessMonitor::WriteRegisterValue(lldb::tid_t tid, unsigned offset,
+                                   const RegisterValue &value)
 {
     bool result;
     WriteRegOperation op(offset, value, result);
@@ -1425,7 +1430,7 @@
 }
 
 bool
-ProcessMonitor::ReadGPR(void *buf)
+ProcessMonitor::ReadGPR(lldb::tid_t tid, void *buf)
 {
     bool result;
     ReadGPROperation op(buf, result);
@@ -1434,7 +1439,7 @@
 }
 
 bool
-ProcessMonitor::ReadFPR(void *buf)
+ProcessMonitor::ReadFPR(lldb::tid_t tid, void *buf)
 {
     bool result;
     ReadFPROperation op(buf, result);
@@ -1443,7 +1448,7 @@
 }
 
 bool
-ProcessMonitor::WriteGPR(void *buf)
+ProcessMonitor::WriteGPR(lldb::tid_t tid, void *buf)
 {
     bool result;
     WriteGPROperation op(buf, result);
@@ -1452,7 +1457,7 @@
 }
 
 bool
-ProcessMonitor::WriteFPR(void *buf)
+ProcessMonitor::WriteFPR(lldb::tid_t tid, void *buf)
 {
     bool result;
     WriteFPROperation op(buf, result);
@@ -1488,10 +1493,10 @@
 }
 
 bool
-ProcessMonitor::GetSignalInfo(lldb::tid_t tid, void *siginfo)
+ProcessMonitor::GetSignalInfo(lldb::tid_t tid, void *siginfo, int &ptrace_err)
 {
     bool result;
-    SiginfoOperation op(tid, siginfo, result);
+    SiginfoOperation op(tid, siginfo, result, ptrace_err);
     DoOperation(&op);
     return result;
 }

Modified: lldb/branches/windows/source/Plugins/Process/FreeBSD/ProcessMonitor.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/Process/FreeBSD/ProcessMonitor.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/Process/FreeBSD/ProcessMonitor.h (original)
+++ lldb/branches/windows/source/Plugins/Process/FreeBSD/ProcessMonitor.h Tue Jan  8 06:51:53 2013
@@ -103,36 +103,50 @@
     /// dependent) offset.
     ///
     /// This method is provided for use by RegisterContextFreeBSD derivatives.
+    /// FIXME: The FreeBSD implementation of this function should use tid in order
+    ///        to enable support for debugging threaded programs.
     bool
-    ReadRegisterValue(unsigned offset, unsigned size, lldb_private::RegisterValue &value);
+    ReadRegisterValue(lldb::tid_t tid, unsigned offset,
+                      unsigned size, lldb_private::RegisterValue &value);
 
     /// Writes the given value to the register identified by the given
     /// (architecture dependent) offset.
     ///
     /// This method is provided for use by RegisterContextFreeBSD derivatives.
+    /// FIXME: The FreeBSD implementation of this function should use tid in order
+    ///        to enable support for debugging threaded programs.
     bool
-    WriteRegisterValue(unsigned offset, const lldb_private::RegisterValue &value);
+    WriteRegisterValue(lldb::tid_t tid, unsigned offset,
+                       const lldb_private::RegisterValue &value);
 
     /// Reads all general purpose registers into the specified buffer.
+    /// FIXME: The FreeBSD implementation of this function should use tid in order
+    ///        to enable support for debugging threaded programs.
     bool
-    ReadGPR(void *buf);
+    ReadGPR(lldb::tid_t tid, void *buf);
 
     /// Reads all floating point registers into the specified buffer.
+    /// FIXME: The FreeBSD implementation of this function should use tid in order
+    ///        to enable support for debugging threaded programs.
     bool
-    ReadFPR(void *buf);
+    ReadFPR(lldb::tid_t tid, void *buf);
 
     /// Writes all general purpose registers into the specified buffer.
+    /// FIXME: The FreeBSD implementation of this function should use tid in order
+    ///        to enable support for debugging threaded programs.
     bool
-    WriteGPR(void *buf);
+    WriteGPR(lldb::tid_t tid, void *buf);
 
     /// Writes all floating point registers into the specified buffer.
+    /// FIXME: The FreeBSD implementation of this function should use tid in order
+    ///        to enable support for debugging threaded programs.
     bool
-    WriteFPR(void *buf);
+    WriteFPR(lldb::tid_t tid, void *buf);
 
     /// Writes a siginfo_t structure corresponding to the given thread ID to the
     /// memory region pointed to by @p siginfo.
     bool
-    GetSignalInfo(lldb::tid_t tid, void *siginfo);
+    GetSignalInfo(lldb::tid_t tid, void *siginfo, int &errno);
 
     /// Writes the raw event message code (vis-a-vis PTRACE_GETEVENTMSG)
     /// corresponding to the given thread IDto the memory pointed to by @p

Modified: lldb/branches/windows/source/Plugins/Process/Linux/ProcessLinux.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/Process/Linux/ProcessLinux.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/Process/Linux/ProcessLinux.cpp (original)
+++ lldb/branches/windows/source/Plugins/Process/Linux/ProcessLinux.cpp Tue Jan  8 06:51:53 2013
@@ -99,7 +99,7 @@
 {
     LogSP log (ProcessPOSIXLog::GetLogIfAllCategoriesSet (POSIX_LOG_THREAD));
     if (log && log->GetMask().Test(POSIX_LOG_VERBOSE))
-        log->Printf ("ProcessLinux::%s() (pid = %i)", __FUNCTION__, GetID());
+        log->Printf ("ProcessLinux::%s() (pid = %" PRIu64 ")", __FUNCTION__, GetID());
 
     // Update the process thread list with this new thread.
     // FIXME: We should be using tid, not pid.
@@ -110,7 +110,7 @@
     }
 
     if (log && log->GetMask().Test(POSIX_LOG_VERBOSE))
-        log->Printf ("ProcessLinux::%s() updated pid = %i", __FUNCTION__, GetID());
+        log->Printf ("ProcessLinux::%s() updated pid = %" PRIu64, __FUNCTION__, GetID());
     new_thread_list.AddThread(thread_sp);
 
     return new_thread_list.GetSize(false) > 0;

Modified: lldb/branches/windows/source/Plugins/Process/Linux/ProcessMonitor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/Process/Linux/ProcessMonitor.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/Process/Linux/ProcessMonitor.cpp (original)
+++ lldb/branches/windows/source/Plugins/Process/Linux/ProcessMonitor.cpp Tue Jan  8 06:51:53 2013
@@ -7,10 +7,13 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 // C Includes
 #include <errno.h>
 #include <poll.h>
 #include <string.h>
+#include <stdint.h>
 #include <unistd.h>
 #include <sys/ptrace.h>
 #include <sys/socket.h>
@@ -177,7 +180,7 @@
     if (log)
         ProcessPOSIXLog::IncNestLevel();
     if (log && ProcessPOSIXLog::AtTopNestLevel() && log->GetMask().Test(POSIX_LOG_MEMORY))
-        log->Printf ("ProcessMonitor::%s(%d, %d, %p, %p, %d, _)", __FUNCTION__,
+        log->Printf ("ProcessMonitor::%s(%" PRIu64 ", %d, %p, %p, %zd, _)", __FUNCTION__,
                      pid, word_size, (void*)vm_addr, buf, size);
 
     assert(sizeof(data) >= word_size);
@@ -197,8 +200,6 @@
         remainder = remainder > word_size ? word_size : remainder;
 
         // Copy the data into our buffer
-        if (log)
-            memset(dst, 0, sizeof(dst));
         for (unsigned i = 0; i < remainder; ++i)
             dst[i] = ((data >> i*8) & 0xFF);
 
@@ -206,8 +207,14 @@
             (log->GetMask().Test(POSIX_LOG_MEMORY_DATA_LONG) ||
              (log->GetMask().Test(POSIX_LOG_MEMORY_DATA_SHORT) &&
               size <= POSIX_LOG_MEMORY_SHORT_BYTES)))
-            log->Printf ("ProcessMonitor::%s() [%p]:0x%lx (0x%lx)", __FUNCTION__,
-                         (void*)vm_addr, *(unsigned long*)dst, (unsigned long)data);
+            {
+                uintptr_t print_dst = 0;
+                // Format bytes from data by moving into print_dst for log output
+                for (unsigned i = 0; i < remainder; ++i)
+                    print_dst |= (((data >> i*8) & 0xFF) << i*8);
+                log->Printf ("ProcessMonitor::%s() [%p]:0x%lx (0x%lx)", __FUNCTION__,
+                             (void*)vm_addr, print_dst, (unsigned long)data);
+            }
 
         vm_addr += word_size;
         dst += word_size;
@@ -232,7 +239,7 @@
     if (log)
         ProcessPOSIXLog::IncNestLevel();
     if (log && ProcessPOSIXLog::AtTopNestLevel() && log->GetMask().Test(POSIX_LOG_MEMORY))
-        log->Printf ("ProcessMonitor::%s(%d, %d, %p, %p, %d, _)", __FUNCTION__,
+        log->Printf ("ProcessMonitor::%s(%" PRIu64 ", %d, %p, %p, %zd, _)", __FUNCTION__,
                      pid, word_size, (void*)vm_addr, buf, size);
 
     for (bytes_written = 0; bytes_written < size; bytes_written += remainder)
@@ -405,14 +412,17 @@
 class ReadRegOperation : public Operation
 {
 public:
-    ReadRegOperation(unsigned offset, RegisterValue &value, bool &result)
-        : m_offset(offset), m_value(value), m_result(result)
+    ReadRegOperation(lldb::tid_t tid, unsigned offset,
+                     RegisterValue &value, bool &result)
+        : m_tid(tid), m_offset(offset),
+          m_value(value), m_result(result)
         { }
 
     void Execute(ProcessMonitor *monitor);
 
 private:
-    unsigned m_offset;
+    lldb::tid_t m_tid;
+    uintptr_t m_offset;
     RegisterValue &m_value;
     bool &m_result;
 };
@@ -420,12 +430,11 @@
 void
 ReadRegOperation::Execute(ProcessMonitor *monitor)
 {
-    lldb::pid_t pid = monitor->GetPID();
     LogSP log (ProcessPOSIXLog::GetLogIfAllCategoriesSet (POSIX_LOG_REGISTERS));
 
     // Set errno to zero so that we can detect a failed peek.
     errno = 0;
-    lldb::addr_t data = PTRACE(PTRACE_PEEKUSER, pid, (void*)m_offset, NULL);
+    lldb::addr_t data = PTRACE(PTRACE_PEEKUSER, m_tid, (void*)m_offset, NULL);
     if (data == -1UL && errno)
         m_result = false;
     else
@@ -434,7 +443,7 @@
         m_result = true;
     }
     if (log)
-        log->Printf ("ProcessMonitor::%s() reg %s: 0x%x", __FUNCTION__,
+        log->Printf ("ProcessMonitor::%s() reg %s: 0x%" PRIx64, __FUNCTION__,
                      POSIXThread::GetRegisterNameFromOffset(m_offset), data);
 }
 
@@ -444,14 +453,17 @@
 class WriteRegOperation : public Operation
 {
 public:
-    WriteRegOperation(unsigned offset, const RegisterValue &value, bool &result)
-        : m_offset(offset), m_value(value), m_result(result)
+    WriteRegOperation(lldb::tid_t tid, unsigned offset,
+                      const RegisterValue &value, bool &result)
+        : m_tid(tid), m_offset(offset),
+          m_value(value), m_result(result)
         { }
 
     void Execute(ProcessMonitor *monitor);
 
 private:
-    unsigned m_offset;
+    lldb::tid_t m_tid;
+    uintptr_t m_offset;
     const RegisterValue &m_value;
     bool &m_result;
 };
@@ -460,21 +472,18 @@
 WriteRegOperation::Execute(ProcessMonitor *monitor)
 {
     void* buf;
-    lldb::pid_t pid = monitor->GetPID();
     LogSP log (ProcessPOSIXLog::GetLogIfAllCategoriesSet (POSIX_LOG_REGISTERS));
 
-    if (sizeof(void*) == sizeof(uint64_t))
-        buf = (void*) m_value.GetAsUInt64();
-    else
-    {
-        assert(sizeof(void*) == sizeof(uint32_t));
-        buf = (void*) m_value.GetAsUInt32();
-    }
+#if __WORDSIZE == 32
+    buf = (void*) m_value.GetAsUInt32();
+#else
+    buf = (void*) m_value.GetAsUInt64();
+#endif
 
     if (log)
         log->Printf ("ProcessMonitor::%s() reg %s: %p", __FUNCTION__,
                      POSIXThread::GetRegisterNameFromOffset(m_offset), buf);
-    if (PTRACE(PTRACE_POKEUSER, pid, (void*)m_offset, buf))
+    if (PTRACE(PTRACE_POKEUSER, m_tid, (void*)m_offset, buf))
         m_result = false;
     else
         m_result = true;
@@ -486,13 +495,14 @@
 class ReadGPROperation : public Operation
 {
 public:
-    ReadGPROperation(void *buf, bool &result)
-        : m_buf(buf), m_result(result)
+    ReadGPROperation(lldb::tid_t tid, void *buf, bool &result)
+        : m_tid(tid), m_buf(buf), m_result(result)
         { }
 
     void Execute(ProcessMonitor *monitor);
 
 private:
+    lldb::tid_t m_tid;
     void *m_buf;
     bool &m_result;
 };
@@ -500,7 +510,7 @@
 void
 ReadGPROperation::Execute(ProcessMonitor *monitor)
 {
-    if (PTRACE(PTRACE_GETREGS, monitor->GetPID(), NULL, m_buf) < 0)
+    if (PTRACE(PTRACE_GETREGS, m_tid, NULL, m_buf) < 0)
         m_result = false;
     else
         m_result = true;
@@ -512,13 +522,14 @@
 class ReadFPROperation : public Operation
 {
 public:
-    ReadFPROperation(void *buf, bool &result)
-        : m_buf(buf), m_result(result)
+    ReadFPROperation(lldb::tid_t tid, void *buf, bool &result)
+        : m_tid(tid), m_buf(buf), m_result(result)
         { }
 
     void Execute(ProcessMonitor *monitor);
 
 private:
+    lldb::tid_t m_tid;
     void *m_buf;
     bool &m_result;
 };
@@ -526,7 +537,7 @@
 void
 ReadFPROperation::Execute(ProcessMonitor *monitor)
 {
-    if (PTRACE(PTRACE_GETFPREGS, monitor->GetPID(), NULL, m_buf) < 0)
+    if (PTRACE(PTRACE_GETFPREGS, m_tid, NULL, m_buf) < 0)
         m_result = false;
     else
         m_result = true;
@@ -538,13 +549,14 @@
 class WriteGPROperation : public Operation
 {
 public:
-    WriteGPROperation(void *buf, bool &result)
-        : m_buf(buf), m_result(result)
+    WriteGPROperation(lldb::tid_t tid, void *buf, bool &result)
+        : m_tid(tid), m_buf(buf), m_result(result)
         { }
 
     void Execute(ProcessMonitor *monitor);
 
 private:
+    lldb::tid_t m_tid;
     void *m_buf;
     bool &m_result;
 };
@@ -552,7 +564,7 @@
 void
 WriteGPROperation::Execute(ProcessMonitor *monitor)
 {
-    if (PTRACE(PTRACE_SETREGS, monitor->GetPID(), NULL, m_buf) < 0)
+    if (PTRACE(PTRACE_SETREGS, m_tid, NULL, m_buf) < 0)
         m_result = false;
     else
         m_result = true;
@@ -564,13 +576,14 @@
 class WriteFPROperation : public Operation
 {
 public:
-    WriteFPROperation(void *buf, bool &result)
-        : m_buf(buf), m_result(result)
+    WriteFPROperation(lldb::tid_t tid, void *buf, bool &result)
+        : m_tid(tid), m_buf(buf), m_result(result)
         { }
 
     void Execute(ProcessMonitor *monitor);
 
 private:
+    lldb::tid_t m_tid;
     void *m_buf;
     bool &m_result;
 };
@@ -578,7 +591,7 @@
 void
 WriteFPROperation::Execute(ProcessMonitor *monitor)
 {
-    if (PTRACE(PTRACE_SETFPREGS, monitor->GetPID(), NULL, m_buf) < 0)
+    if (PTRACE(PTRACE_SETFPREGS, m_tid, NULL, m_buf) < 0)
         m_result = false;
     else
         m_result = true;
@@ -604,7 +617,7 @@
 void
 ResumeOperation::Execute(ProcessMonitor *monitor)
 {
-    int data = 0;
+    intptr_t data = 0;
 
     if (m_signo != LLDB_INVALID_SIGNAL_NUMBER)
         data = m_signo;
@@ -635,7 +648,7 @@
 void
 SingleStepOperation::Execute(ProcessMonitor *monitor)
 {
-    int data = 0;
+    intptr_t data = 0;
 
     if (m_signo != LLDB_INVALID_SIGNAL_NUMBER)
         data = m_signo;
@@ -652,8 +665,8 @@
 class SiginfoOperation : public Operation
 {
 public:
-    SiginfoOperation(lldb::tid_t tid, void *info, bool &result)
-        : m_tid(tid), m_info(info), m_result(result) { }
+    SiginfoOperation(lldb::tid_t tid, void *info, bool &result, int &ptrace_err)
+        : m_tid(tid), m_info(info), m_result(result), m_err(ptrace_err) { }
 
     void Execute(ProcessMonitor *monitor);
 
@@ -661,13 +674,16 @@
     lldb::tid_t m_tid;
     void *m_info;
     bool &m_result;
+    int &m_err;
 };
 
 void
 SiginfoOperation::Execute(ProcessMonitor *monitor)
 {
-    if (PTRACE(PTRACE_GETSIGINFO, m_tid, NULL, m_info))
+    if (PTRACE(PTRACE_GETSIGINFO, m_tid, NULL, m_info)) {
         m_result = false;
+        m_err = errno;
+    }
     else
         m_result = true;
 }
@@ -981,7 +997,7 @@
         goto FINISH;
     }
 
-    if ((pid = terminal.Fork(err_str, err_len)) < 0)
+    if ((pid = terminal.Fork(err_str, err_len)) == -1)
     {
         args->m_error.SetErrorToGenericError();
         args->m_error.SetErrorString("Process fork failed.");
@@ -1095,7 +1111,7 @@
     // FIXME: by using pids instead of tids, we can only support one thread.
     inferior.reset(new POSIXThread(process, pid));
     if (log)
-        log->Printf ("ProcessMonitor::%s() adding pid = %i", __FUNCTION__, pid);
+        log->Printf ("ProcessMonitor::%s() adding pid = %" PRIu64, __FUNCTION__, pid);
     process.GetThreadList().AddThread(inferior);
 
     // Let our process instance know the thread has stopped.
@@ -1180,7 +1196,7 @@
     // Update the process thread list with the attached thread.
     inferior.reset(new POSIXThread(process, pid));
     if (log)
-        log->Printf ("ProcessMonitor::%s() adding tid = %i", __FUNCTION__, pid);
+        log->Printf ("ProcessMonitor::%s() adding tid = %" PRIu64, __FUNCTION__, pid);
     process.GetThreadList().AddThread(inferior);
 
     // Let our process instance know the thread has stopped.
@@ -1203,9 +1219,22 @@
     assert(process);
     bool stop_monitoring;
     siginfo_t info;
+    int ptrace_err;
 
-    if (!monitor->GetSignalInfo(pid, &info))
-        stop_monitoring = true; // pid is gone.  Bail.
+    if (!monitor->GetSignalInfo(pid, &info, ptrace_err)) {
+        if (ptrace_err == EINVAL) {
+            // inferior process is in 'group-stop', so deliver SIGSTOP signal
+            if (!monitor->Resume(pid, SIGSTOP)) {
+              assert(0 && "SIGSTOP delivery failed while in 'group-stop' state");
+            }
+            stop_monitoring = false;
+        } else {
+            // ptrace(GETSIGINFO) failed (but not due to group-stop). Most likely,
+            // this means the child pid is gone (or not being debugged) therefore
+            // stop the monitor thread.
+            stop_monitoring = true;
+        }
+    }
     else {
         switch (info.si_signo)
         {
@@ -1219,7 +1248,7 @@
         }
 
         process->SendMessage(message);
-        stop_monitoring = message.GetKind() == ProcessMessage::eExitMessage;
+        stop_monitoring = !process->IsAlive();
     }
 
     return stop_monitoring;
@@ -1551,55 +1580,55 @@
 }
 
 bool
-ProcessMonitor::ReadRegisterValue(unsigned offset, unsigned size, RegisterValue &value)
+ProcessMonitor::ReadRegisterValue(lldb::tid_t tid, unsigned offset, unsigned size, RegisterValue &value)
 {
     bool result;
-    ReadRegOperation op(offset, value, result);
+    ReadRegOperation op(tid, offset, value, result);
     DoOperation(&op);
     return result;
 }
 
 bool
-ProcessMonitor::WriteRegisterValue(unsigned offset, const RegisterValue &value)
+ProcessMonitor::WriteRegisterValue(lldb::tid_t tid, unsigned offset, const RegisterValue &value)
 {
     bool result;
-    WriteRegOperation op(offset, value, result);
+    WriteRegOperation op(tid, offset, value, result);
     DoOperation(&op);
     return result;
 }
 
 bool
-ProcessMonitor::ReadGPR(void *buf)
+ProcessMonitor::ReadGPR(lldb::tid_t tid, void *buf)
 {
     bool result;
-    ReadGPROperation op(buf, result);
+    ReadGPROperation op(tid, buf, result);
     DoOperation(&op);
     return result;
 }
 
 bool
-ProcessMonitor::ReadFPR(void *buf)
+ProcessMonitor::ReadFPR(lldb::tid_t tid, void *buf)
 {
     bool result;
-    ReadFPROperation op(buf, result);
+    ReadFPROperation op(tid, buf, result);
     DoOperation(&op);
     return result;
 }
 
 bool
-ProcessMonitor::WriteGPR(void *buf)
+ProcessMonitor::WriteGPR(lldb::tid_t tid, void *buf)
 {
     bool result;
-    WriteGPROperation op(buf, result);
+    WriteGPROperation op(tid, buf, result);
     DoOperation(&op);
     return result;
 }
 
 bool
-ProcessMonitor::WriteFPR(void *buf)
+ProcessMonitor::WriteFPR(lldb::tid_t tid, void *buf)
 {
     bool result;
-    WriteFPROperation op(buf, result);
+    WriteFPROperation op(tid, buf, result);
     DoOperation(&op);
     return result;
 }
@@ -1632,10 +1661,10 @@
 }
 
 bool
-ProcessMonitor::GetSignalInfo(lldb::tid_t tid, void *siginfo)
+ProcessMonitor::GetSignalInfo(lldb::tid_t tid, void *siginfo, int &ptrace_err)
 {
     bool result;
-    SiginfoOperation op(tid, siginfo, result);
+    SiginfoOperation op(tid, siginfo, result, ptrace_err);
     DoOperation(&op);
     return result;
 }
@@ -1657,7 +1686,6 @@
         DetachOperation op(error);
         DoOperation(&op);
     }
-    StopMonitor();
     return error;
 }
 
@@ -1705,6 +1733,7 @@
 
     Host::ThreadCancel(m_operation_thread, NULL);
     Host::ThreadJoin(m_operation_thread, &result, NULL);
+    m_operation_thread = LLDB_INVALID_HOST_THREAD;
 }
 
 void

Modified: lldb/branches/windows/source/Plugins/Process/Linux/ProcessMonitor.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/Process/Linux/ProcessMonitor.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/Process/Linux/ProcessMonitor.h (original)
+++ lldb/branches/windows/source/Plugins/Process/Linux/ProcessMonitor.h Tue Jan  8 06:51:53 2013
@@ -106,35 +106,37 @@
     ///
     /// This method is provided for use by RegisterContextLinux derivatives.
     bool
-    ReadRegisterValue(unsigned offset, unsigned size, lldb_private::RegisterValue &value);
+    ReadRegisterValue(lldb::tid_t tid, unsigned offset,
+                      unsigned size, lldb_private::RegisterValue &value);
 
     /// Writes the given value to the register identified by the given
     /// (architecture dependent) offset.
     ///
     /// This method is provided for use by RegisterContextLinux derivatives.
     bool
-    WriteRegisterValue(unsigned offset, const lldb_private::RegisterValue &value);
+    WriteRegisterValue(lldb::tid_t tid, unsigned offset,
+                       const lldb_private::RegisterValue &value);
 
     /// Reads all general purpose registers into the specified buffer.
     bool
-    ReadGPR(void *buf);
+    ReadGPR(lldb::tid_t tid, void *buf);
 
     /// Reads all floating point registers into the specified buffer.
     bool
-    ReadFPR(void *buf);
+    ReadFPR(lldb::tid_t tid, void *buf);
 
     /// Writes all general purpose registers into the specified buffer.
     bool
-    WriteGPR(void *buf);
+    WriteGPR(lldb::tid_t tid, void *buf);
 
     /// Writes all floating point registers into the specified buffer.
     bool
-    WriteFPR(void *buf);
+    WriteFPR(lldb::tid_t tid, void *buf);
 
     /// Writes a siginfo_t structure corresponding to the given thread ID to the
     /// memory region pointed to by @p siginfo.
     bool
-    GetSignalInfo(lldb::tid_t tid, void *siginfo);
+    GetSignalInfo(lldb::tid_t tid, void *siginfo, int &ptrace_err);
 
     /// Writes the raw event message code (vis-a-vis PTRACE_GETEVENTMSG)
     /// corresponding to the given thread IDto the memory pointed to by @p

Modified: lldb/branches/windows/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp (original)
+++ lldb/branches/windows/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp Tue Jan  8 06:51:53 2013
@@ -166,7 +166,7 @@
             return true;
         
         if (log)
-            log->Printf ("error: failed to send packet entire packet %llu of %llu bytes sent", (uint64_t)bytes_written, (uint64_t)packet_size);
+            log->Printf ("error: failed to send packet entire packet %" PRIu64 " of %" PRIu64 " bytes sent", (uint64_t)bytes_written, (uint64_t)packet_size);
     }
     return false;
 }
@@ -210,7 +210,7 @@
         size_t bytes_read = Read (buffer, sizeof(buffer), timeout_usec, status, &error);
         
         if (log)
-            log->Printf ("%s: Read (buffer, (sizeof(buffer), timeout_usec = 0x%x, status = %s, error = %s) => bytes_read = %llu",
+            log->Printf ("%s: Read (buffer, (sizeof(buffer), timeout_usec = 0x%x, status = %s, error = %s) => bytes_read = %" PRIu64,
                          __PRETTY_FUNCTION__,
                          timeout_usec, 
                          Communication::ConnectionStatusAsCString (status),
@@ -876,7 +876,7 @@
                                 const addr_t region_addr = packet.GetPointer (&offset);
                                 const uint32_t region_size = packet.GetU32 (&offset);
                                 const uint32_t region_prot = packet.GetU32 (&offset);
-                                s.Printf("\n\tregion[%llu] = { range = [0x%16.16llx - 0x%16.16llx), size = 0x%8.8x, prot = %s }", region_addr, region_addr, region_addr + region_size, region_size, GetPermissionsAsCString (region_prot)); 
+                                s.Printf("\n\tregion[%" PRIu64 "] = { range = [0x%16.16" PRIx64 " - 0x%16.16" PRIx64 "), size = 0x%8.8x, prot = %s }", region_addr, region_addr, region_addr + region_size, region_size, GetPermissionsAsCString (region_prot));
                             }
                         }
                         break;
@@ -997,7 +997,7 @@
                         {
                             const uint64_t addr = packet.GetU64 (&offset);
                             const uint32_t size = packet.GetU32 (&offset);
-                            s.Printf(" (addr = 0x%16.16llx, size = %u)", addr, size);
+                            s.Printf(" (addr = 0x%16.16" PRIx64 ", size = %u)", addr, size);
                             m_last_read_memory_addr = addr;
                         }
                         break;
@@ -1006,7 +1006,7 @@
                         {
                             const uint64_t addr = packet.GetU64 (&offset);
                             const uint32_t size = packet.GetU32 (&offset);
-                            s.Printf(" (addr = 0x%16.16llx, size = %u, bytes = \n", addr, size);
+                            s.Printf(" (addr = 0x%16.16" PRIx64 ", size = %u, bytes = \n", addr, size);
                             if (size > 0)
                                 DataExtractor::DumpHexBytes(&s, packet.GetData(&offset, size), size, 32, addr);
                         }
@@ -1051,7 +1051,7 @@
                     case KDP_BREAKPOINT_REMOVE64:
                         {
                             const uint64_t addr = packet.GetU64 (&offset);
-                            s.Printf(" (addr = 0x%16.16llx)", addr);
+                            s.Printf(" (addr = 0x%16.16" PRIx64 ")", addr);
                         }
                         break;
 

Modified: lldb/branches/windows/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp (original)
+++ lldb/branches/windows/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp Tue Jan  8 06:51:53 2013
@@ -448,7 +448,7 @@
     // locker will keep a mutex locked until it goes out of scope
     LogSP log (ProcessKDPLog::GetLogIfAllCategoriesSet (KDP_LOG_THREAD));
     if (log && log->GetMask().Test(KDP_LOG_VERBOSE))
-        log->Printf ("ProcessKDP::%s (pid = %llu)", __FUNCTION__, GetID());
+        log->Printf ("ProcessKDP::%s (pid = %" PRIu64 ")", __FUNCTION__, GetID());
     
     // Even though there is a CPU mask, it doesn't mean to can see each CPU
     // indivudually, there is really only one. Lets call this thread 1.
@@ -650,7 +650,7 @@
 }
 
 Error
-ProcessKDP::EnableWatchpoint (Watchpoint *wp)
+ProcessKDP::EnableWatchpoint (Watchpoint *wp, bool notify)
 {
     Error error;
     error.SetErrorString ("watchpoints are not suppported in kdp remote debugging");
@@ -658,7 +658,7 @@
 }
 
 Error
-ProcessKDP::DisableWatchpoint (Watchpoint *wp)
+ProcessKDP::DisableWatchpoint (Watchpoint *wp, bool notify)
 {
     Error error;
     error.SetErrorString ("watchpoints are not suppported in kdp remote debugging");
@@ -744,7 +744,7 @@
 
     LogSP log (ProcessKDPLog::GetLogIfAllCategoriesSet (KDP_LOG_PROCESS));
     if (log)
-        log->Printf ("ProcessKDP::AsyncThread (arg = %p, pid = %llu) thread starting...", arg, pid);
+        log->Printf ("ProcessKDP::AsyncThread (arg = %p, pid = %" PRIu64 ") thread starting...", arg, pid);
     
     Listener listener ("ProcessKDP::AsyncThread");
     EventSP event_sp;
@@ -758,13 +758,13 @@
         while (!done)
         {
             if (log)
-                log->Printf ("ProcessKDP::AsyncThread (pid = %llu) listener.WaitForEvent (NULL, event_sp)...",
+                log->Printf ("ProcessKDP::AsyncThread (pid = %" PRIu64 ") listener.WaitForEvent (NULL, event_sp)...",
                              pid);
             if (listener.WaitForEvent (NULL, event_sp))
             {
                 uint32_t event_type = event_sp->GetType();
                 if (log)
-                    log->Printf ("ProcessKDP::AsyncThread (pid = %llu) Got an event of type: %d...",
+                    log->Printf ("ProcessKDP::AsyncThread (pid = %" PRIu64 ") Got an event of type: %d...",
                                  pid,
                                  event_type);
                 
@@ -806,7 +806,7 @@
                             
                     case eBroadcastBitAsyncThreadShouldExit:
                         if (log)
-                            log->Printf ("ProcessKDP::AsyncThread (pid = %llu) got eBroadcastBitAsyncThreadShouldExit...",
+                            log->Printf ("ProcessKDP::AsyncThread (pid = %" PRIu64 ") got eBroadcastBitAsyncThreadShouldExit...",
                                          pid);
                         done = true;
                         is_running = false;
@@ -814,7 +814,7 @@
                             
                     default:
                         if (log)
-                            log->Printf ("ProcessKDP::AsyncThread (pid = %llu) got unknown event 0x%8.8x",
+                            log->Printf ("ProcessKDP::AsyncThread (pid = %" PRIu64 ") got unknown event 0x%8.8x",
                                          pid,
                                          event_type);
                         done = true;
@@ -826,7 +826,7 @@
             else
             {
                 if (log)
-                    log->Printf ("ProcessKDP::AsyncThread (pid = %llu) listener.WaitForEvent (NULL, event_sp) => false",
+                    log->Printf ("ProcessKDP::AsyncThread (pid = %" PRIu64 ") listener.WaitForEvent (NULL, event_sp) => false",
                                  pid);
                 done = true;
             }
@@ -834,7 +834,7 @@
     }
     
     if (log)
-        log->Printf ("ProcessKDP::AsyncThread (arg = %p, pid = %llu) thread exiting...",
+        log->Printf ("ProcessKDP::AsyncThread (arg = %p, pid = %" PRIu64 ") thread exiting...",
                      arg,
                      pid);
     
@@ -965,7 +965,7 @@
                 }
                 else
                 {
-                    result.AppendErrorWithFormat ("invalid command byte 0x%llx, valid values are 1 - 255", command_byte);
+                    result.AppendErrorWithFormat ("invalid command byte 0x%" PRIx64 ", valid values are 1 - 255", command_byte);
                     result.SetStatus (eReturnStatusFailed);
                 }
             }

Modified: lldb/branches/windows/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h (original)
+++ lldb/branches/windows/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h Tue Jan  8 06:51:53 2013
@@ -183,10 +183,10 @@
     // Process Watchpoints
     //----------------------------------------------------------------------
     virtual lldb_private::Error
-    EnableWatchpoint (lldb_private::Watchpoint *wp);
+    EnableWatchpoint (lldb_private::Watchpoint *wp, bool notify = true);
     
     virtual lldb_private::Error
-    DisableWatchpoint (lldb_private::Watchpoint *wp);
+    DisableWatchpoint (lldb_private::Watchpoint *wp, bool notify = true);
     
     CommunicationKDP &
     GetCommunication()

Modified: lldb/branches/windows/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp (original)
+++ lldb/branches/windows/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp Tue Jan  8 06:51:53 2013
@@ -78,7 +78,7 @@
 
     lldb::LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_STEP));
     if (log)
-        log->Printf ("Resuming thread: %4.4llx with state: %s.", GetID(), StateAsCString(resume_state));
+        log->Printf ("Resuming thread: %4.4" PRIx64 " with state: %s.", GetID(), StateAsCString(resume_state));
 
     return true;
 }

Modified: lldb/branches/windows/source/Plugins/Process/POSIX/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/Process/POSIX/Makefile?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/Process/POSIX/Makefile (original)
+++ lldb/branches/windows/source/Plugins/Process/POSIX/Makefile Tue Jan  8 06:51:53 2013
@@ -18,6 +18,10 @@
 
 ifeq ($(HOST_OS),Linux)
 CPPFLAGS += -I$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/source/Plugins/Process/Linux
+
+# Disable warning for now as offsetof is used with an index into a structure member array
+# in defining register info tables.
+CPPFLAGS += -Wno-extended-offsetof
 endif
 
 ifeq ($(HOST_OS),FreeBSD)

Modified: lldb/branches/windows/source/Plugins/Process/POSIX/POSIXStopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/Process/POSIX/POSIXStopInfo.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/Process/POSIX/POSIXStopInfo.cpp (original)
+++ lldb/branches/windows/source/Plugins/Process/POSIX/POSIXStopInfo.cpp Tue Jan  8 06:51:53 2013
@@ -21,7 +21,7 @@
 lldb::StopReason
 POSIXLimboStopInfo::GetStopReason() const
 {
-    return lldb::eStopReasonTrace;
+    return lldb::eStopReasonThreadExiting;
 }
 
 const char *
@@ -33,13 +33,13 @@
 bool
 POSIXLimboStopInfo::ShouldStop(Event *event_ptr)
 {
-    return true;
+    return false;
 }
 
 bool
 POSIXLimboStopInfo::ShouldNotify(Event *event_ptr)
 {
-    return true;
+    return false;
 }
 
 //===----------------------------------------------------------------------===//

Modified: lldb/branches/windows/source/Plugins/Process/POSIX/POSIXThread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/Process/POSIX/POSIXThread.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/Process/POSIX/POSIXThread.cpp (original)
+++ lldb/branches/windows/source/Plugins/Process/POSIX/POSIXThread.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 // C Includes
 #include <errno.h>
 
@@ -39,7 +41,7 @@
 {
     LogSP log (ProcessPOSIXLog::GetLogIfAllCategoriesSet (POSIX_LOG_THREAD));
     if (log && log->GetMask().Test(POSIX_LOG_VERBOSE))
-        log->Printf ("POSIXThread::%s (tid = %i)", __FUNCTION__, tid);
+        log->Printf ("POSIXThread::%s (tid = %" PRIi64 ")", __FUNCTION__, tid);
 }
 
 POSIXThread::~POSIXThread()
@@ -242,7 +244,7 @@
     assert(GetRegisterContext());
     lldb::addr_t pc = GetRegisterContext()->GetPC();
     if (log)
-        log->Printf ("POSIXThread::%s () PC=0x%8.8llx", __FUNCTION__, pc);
+        log->Printf ("POSIXThread::%s () PC=0x%8.8" PRIx64, __FUNCTION__, pc);
     lldb::BreakpointSiteSP bp_site(GetProcess()->GetBreakpointSiteList().FindByAddress(pc));
     assert(bp_site);
     lldb::break_id_t bp_id = bp_site->GetID();
@@ -279,8 +281,7 @@
 {
     int signo = message.GetSignal();
 
-    // Just treat debugger generated signal events like breakpoints for now.
-    m_stop_info = StopInfo::CreateStopReasonToTrace(*this);
+    m_stop_info = StopInfo::CreateStopReasonWithSignal(*this, signo);
     SetResumeSignal(signo);
 }
 

Modified: lldb/branches/windows/source/Plugins/Process/POSIX/ProcessMessage.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/Process/POSIX/ProcessMessage.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/Process/POSIX/ProcessMessage.cpp (original)
+++ lldb/branches/windows/source/Plugins/Process/POSIX/ProcessMessage.cpp Tue Jan  8 06:51:53 2013
@@ -102,10 +102,6 @@
 
     switch (reason)
     {
-    default:
-        assert(false && "invalid CrashReason");
-        break;
-
         case eInvalidCrashReason:
             str = "eInvalidCrashReason";
             break;
@@ -204,10 +200,6 @@
 
     switch (kind)
     {
-    default:
-        assert(false && "invalid Kind");
-        break;
-
     case eInvalidMessage:
         str = "eInvalidMessage";
         break;

Modified: lldb/branches/windows/source/Plugins/Process/POSIX/ProcessPOSIX.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/Process/POSIX/ProcessPOSIX.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/Process/POSIX/ProcessPOSIX.cpp (original)
+++ lldb/branches/windows/source/Plugins/Process/POSIX/ProcessPOSIX.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 // C Includes
 #include <errno.h>
 
@@ -106,7 +108,7 @@
 
     LogSP log (ProcessPOSIXLog::GetLogIfAllCategoriesSet (POSIX_LOG_PROCESS));
     if (log && log->GetMask().Test(POSIX_LOG_VERBOSE))
-        log->Printf ("ProcessPOSIX::%s(pid = %i)", __FUNCTION__, GetID());
+        log->Printf ("ProcessPOSIX::%s(pid = %" PRIi64 ")", __FUNCTION__, GetID());
 
     m_monitor = new ProcessMonitor(this, pid, error);
 
@@ -320,10 +322,6 @@
 
     switch (message.GetKind())
     {
-    default:
-        assert(false && "Unexpected process message!");
-        break;
-
     case ProcessMessage::eInvalidMessage:
         return;
 
@@ -355,7 +353,8 @@
         break;
 
     case ProcessMessage::eCrashMessage:
-        SetPrivateState(eStateCrashed);
+        // FIXME: Update stop reason as per bugzilla 14598
+        SetPrivateState(eStateStopped);
         break;
     }
 
@@ -380,7 +379,7 @@
     // fixed when this code is fixed to handle multiple threads.
     lldb::tid_t tid = message.GetTID();
     if (log)
-        log->Printf ("ProcessPOSIX::%s() pid = %i", __FUNCTION__, tid);
+        log->Printf ("ProcessPOSIX::%s() pid = %" PRIi64, __FUNCTION__, tid);
     POSIXThread *thread = static_cast<POSIXThread*>(
         GetThreadList().FindThreadByID(tid, false).get());
 
@@ -448,7 +447,7 @@
         InferiorCallMunmap(this, addr, pos->second))
         m_addr_to_mmap_size.erase (pos);
     else
-        error.SetErrorStringWithFormat("unable to deallocate memory at 0x%llx", addr);
+        error.SetErrorStringWithFormat("unable to deallocate memory at 0x%" PRIx64, addr);
 
     return error;
 }
@@ -503,7 +502,7 @@
 {
     LogSP log (ProcessPOSIXLog::GetLogIfAllCategoriesSet (POSIX_LOG_THREAD));
     if (log && log->GetMask().Test(POSIX_LOG_VERBOSE))
-        log->Printf ("ProcessPOSIX::%s() (pid = %i)", __FUNCTION__, GetID());
+        log->Printf ("ProcessPOSIX::%s() (pid = %" PRIi64 ")", __FUNCTION__, GetID());
 
     // Update the process thread list with this new thread.
     // FIXME: We should be using tid, not pid.
@@ -514,7 +513,7 @@
     }
 
     if (log && log->GetMask().Test(POSIX_LOG_VERBOSE))
-        log->Printf ("ProcessPOSIX::%s() updated pid = %i", __FUNCTION__, GetID());
+        log->Printf ("ProcessPOSIX::%s() updated pid = %" PRIi64, __FUNCTION__, GetID());
     new_thread_list.AddThread(thread_sp);
 
     return new_thread_list.GetSize(false) > 0;

Modified: lldb/branches/windows/source/Plugins/Process/POSIX/RegisterContext_i386.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/Process/POSIX/RegisterContext_i386.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/Process/POSIX/RegisterContext_i386.cpp (original)
+++ lldb/branches/windows/source/Plugins/Process/POSIX/RegisterContext_i386.cpp Tue Jan  8 06:51:53 2013
@@ -437,7 +437,7 @@
 {
     const uint32_t reg = reg_info->kinds[eRegisterKindLLDB];
     ProcessMonitor &monitor = GetMonitor();
-    return monitor.ReadRegisterValue(GetRegOffset(reg), GetRegSize(reg), value);
+    return monitor.ReadRegisterValue(m_thread.GetID(), GetRegOffset(reg), GetRegSize(reg), value);
 }
 
 bool
@@ -451,7 +451,7 @@
 {
     const uint32_t reg = reg_info->kinds[eRegisterKindLLDB];
     ProcessMonitor &monitor = GetMonitor();
-    return monitor.WriteRegisterValue(GetRegOffset(reg), value);
+    return monitor.WriteRegisterValue(m_thread.GetID(), GetRegOffset(reg), value);
 }
 
 bool
@@ -620,7 +620,7 @@
         for (uint32_t i=0; i<k_num_gpr_registers; i++)
         {
             uint32_t reg = gpr_eax + i;
-            log->Printf("%12s = 0x%8.8x", g_register_infos[reg].name, (&user.regs)[reg]);
+            log->Printf("%12s = 0x%8.8" PRIx64, g_register_infos[reg].name, ((uint64_t*)&user.regs)[reg]);
         }
     }
 }
@@ -631,7 +631,7 @@
     bool result;
 
     ProcessMonitor &monitor = GetMonitor();
-    result = monitor.ReadGPR(&user.regs);
+    result = monitor.ReadGPR(m_thread.GetID(), &user.regs);
     LogGPR("RegisterContext_i386::ReadGPR()");
     return result;
 }
@@ -640,5 +640,5 @@
 RegisterContext_i386::ReadFPR()
 {
     ProcessMonitor &monitor = GetMonitor();
-    return monitor.ReadFPR(&user.i387);
+    return monitor.ReadFPR(m_thread.GetID(), &user.i387);
 }

Modified: lldb/branches/windows/source/Plugins/Process/POSIX/RegisterContext_x86_64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/Process/POSIX/RegisterContext_x86_64.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/Process/POSIX/RegisterContext_x86_64.cpp (original)
+++ lldb/branches/windows/source/Plugins/Process/POSIX/RegisterContext_x86_64.cpp Tue Jan  8 06:51:53 2013
@@ -511,7 +511,7 @@
     }
     else {
         ProcessMonitor &monitor = GetMonitor();
-        return monitor.ReadRegisterValue(GetRegOffset(reg),GetRegSize(reg), value);
+        return monitor.ReadRegisterValue(m_thread.GetID(), GetRegOffset(reg),GetRegSize(reg), value);
     }
 
     if (reg_info->encoding == eEncodingVector) {
@@ -585,7 +585,7 @@
 {
     const uint32_t reg = reg_info->kinds[eRegisterKindLLDB];
     ProcessMonitor &monitor = GetMonitor();
-    return monitor.WriteRegisterValue(GetRegOffset(reg), value);
+    return monitor.WriteRegisterValue(m_thread.GetID(), GetRegOffset(reg), value);
 }
 
 bool
@@ -788,26 +788,26 @@
 RegisterContext_x86_64::ReadGPR()
 {
      ProcessMonitor &monitor = GetMonitor();
-     return monitor.ReadGPR(&user.regs);
+     return monitor.ReadGPR(m_thread.GetID(), &user.regs);
 }
 
 bool
 RegisterContext_x86_64::ReadFPR()
 {
     ProcessMonitor &monitor = GetMonitor();
-    return monitor.ReadFPR(&user.i387);
+    return monitor.ReadFPR(m_thread.GetID(), &user.i387);
 }
 
 bool
 RegisterContext_x86_64::WriteGPR()
 {
      ProcessMonitor &monitor = GetMonitor();
-     return monitor.WriteGPR(&user.regs);
+     return monitor.WriteGPR(m_thread.GetID(), &user.regs);
 }
 
 bool
 RegisterContext_x86_64::WriteFPR()
 {
     ProcessMonitor &monitor = GetMonitor();
-    return monitor.WriteFPR(&user.i387);
+    return monitor.WriteFPR(m_thread.GetID(), &user.i387);
 }

Modified: lldb/branches/windows/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp (original)
+++ lldb/branches/windows/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp Tue Jan  8 06:51:53 2013
@@ -8,6 +8,8 @@
 //===----------------------------------------------------------------------===//
 #ifndef LLDB_DISABLE_PYTHON
 
+#include "lldb/lldb-python.h"
+
 #include "DynamicRegisterInfo.h"
 
 // C Includes

Modified: lldb/branches/windows/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp (original)
+++ lldb/branches/windows/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp Tue Jan  8 06:51:53 2013
@@ -491,7 +491,7 @@
         for (uint32_t i=0; i<k_num_gpr_registers; i++)
         {
             uint32_t reg = gpr_rax + i;
-            log->Printf("%12s = 0x%16.16llx", g_register_infos[reg].name, (&gpr.rax)[reg]);
+            log->Printf("%12s = 0x%16.16" PRIx64, g_register_infos[reg].name, (&gpr.rax)[reg]);
         }
     }
 }

Modified: lldb/branches/windows/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/Process/Utility/RegisterContextLLDB.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/Process/Utility/RegisterContextLLDB.cpp (original)
+++ lldb/branches/windows/source/Plugins/Process/Utility/RegisterContextLLDB.cpp Tue Jan  8 06:51:53 2013
@@ -87,6 +87,7 @@
 void
 RegisterContextLLDB::InitializeZerothFrame()
 {
+    LogSP log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_UNWIND));
     ExecutionContext exe_ctx(m_thread.shared_from_this());
     RegisterContextSP reg_ctx_sp = m_thread.GetRegisterContext();
 
@@ -214,8 +215,8 @@
 
     m_cfa = cfa_regval + cfa_offset;
 
-    UnwindLogMsg ("cfa_regval = 0x%16.16llx (cfa_regval = 0x%16.16llx, cfa_offset = %i)", m_cfa, cfa_regval, cfa_offset);
-    UnwindLogMsg ("initialized frame current pc is 0x%llx cfa is 0x%llx using %s UnwindPlan",
+    UnwindLogMsg ("cfa_regval = 0x%16.16" PRIx64 " (cfa_regval = 0x%16.16" PRIx64 ", cfa_offset = %i)", m_cfa, cfa_regval, cfa_offset);
+    UnwindLogMsg ("initialized frame current pc is 0x%" PRIx64 " cfa is 0x%" PRIx64 " using %s UnwindPlan",
             (uint64_t) m_current_pc.GetLoadAddress (exe_ctx.GetTargetPtr()),
             (uint64_t) m_cfa,
             m_full_unwind_plan_sp->GetSourceName().GetCString());
@@ -255,12 +256,12 @@
 
     if (log)
     {
-        UnwindLogMsg ("pc = 0x%16.16llx", pc);
+        UnwindLogMsg ("pc = 0x%16.16" PRIx64, pc);
         addr_t reg_val;
         if (ReadGPRValue (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_FP, reg_val))
-            UnwindLogMsg ("fp = 0x%16.16llx", reg_val);
+            UnwindLogMsg ("fp = 0x%16.16" PRIx64, reg_val);
         if (ReadGPRValue (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_SP, reg_val))
-            UnwindLogMsg ("sp = 0x%16.16llx", reg_val);
+            UnwindLogMsg ("sp = 0x%16.16" PRIx64, reg_val);
     }
 
     // A pc of 0x0 means it's the end of the stack crawl
@@ -298,7 +299,7 @@
             // pc and see if we can get any further.
             if (GetNextFrame().get() && GetNextFrame()->IsValid() && GetNextFrame()->IsFrameZero())
             {
-                UnwindLogMsg ("had a pc of 0x%llx which is not in executable memory but on frame 1 -- allowing it once.",
+                UnwindLogMsg ("had a pc of 0x%" PRIx64 " which is not in executable memory but on frame 1 -- allowing it once.",
                          (uint64_t) pc);
                 m_frame_type = eSkipFrame;
             }
@@ -364,7 +365,7 @@
                 return;
             }
 
-            UnwindLogMsg ("initialized frame cfa is 0x%llx", (uint64_t) m_cfa);
+            UnwindLogMsg ("initialized frame cfa is 0x%" PRIx64, (uint64_t) m_cfa);
             return;
         }
         m_frame_type = eNotAValidFrame;
@@ -507,7 +508,7 @@
 
     m_cfa = cfa_regval + cfa_offset;
 
-    UnwindLogMsg ("cfa_regval = 0x%16.16llx (cfa_regval = 0x%16.16llx, cfa_offset = %i)", m_cfa, cfa_regval, cfa_offset);
+    UnwindLogMsg ("cfa_regval = 0x%16.16" PRIx64 " (cfa_regval = 0x%16.16" PRIx64 ", cfa_offset = %i)", m_cfa, cfa_regval, cfa_offset);
 
     // A couple of sanity checks..
     if (cfa_regval == LLDB_INVALID_ADDRESS || cfa_regval == 0 || cfa_regval == 1)
@@ -545,7 +546,7 @@
         }
     }
 
-    UnwindLogMsg ("initialized frame current pc is 0x%llx cfa is 0x%llx",
+    UnwindLogMsg ("initialized frame current pc is 0x%" PRIx64 " cfa is 0x%" PRIx64,
             (uint64_t) m_current_pc.GetLoadAddress (exe_ctx.GetTargetPtr()), (uint64_t) m_cfa);
 }
 

Modified: lldb/branches/windows/source/Plugins/Process/Utility/StopInfoMachException.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/Process/Utility/StopInfoMachException.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/Process/Utility/StopInfoMachException.cpp (original)
+++ lldb/branches/windows/source/Plugins/Process/Utility/StopInfoMachException.cpp Tue Jan  8 06:51:53 2013
@@ -16,6 +16,8 @@
 #include "lldb/Breakpoint/Watchpoint.h"
 #include "lldb/Core/ArchSpec.h"
 #include "lldb/Core/StreamString.h"
+#include "lldb/Symbol/Symbol.h"
+#include "lldb/Target/DynamicLoader.h"
 #include "lldb/Target/ExecutionContext.h"
 #include "lldb/Target/Process.h"
 #include "lldb/Target/RegisterContext.h"
@@ -215,14 +217,14 @@
         if (exc_desc)
             strm.PutCString(exc_desc);
         else
-            strm.Printf("EXC_??? (%llu)", m_value);
+            strm.Printf("EXC_??? (%" PRIu64 ")", m_value);
 
         if (m_exc_data_count >= 1)
         {
             if (code_desc)
                 strm.Printf(" (%s=%s", code_label, code_desc);
             else
-                strm.Printf(" (%s=%llu", code_label, m_exc_code);
+                strm.Printf(" (%s=%" PRIu64, code_label, m_exc_code);
         }
 
         if (m_exc_data_count >= 2)
@@ -230,7 +232,7 @@
             if (subcode_desc)
                 strm.Printf(", %s=%s", subcode_label, subcode_desc);
             else
-                strm.Printf(", %s=0x%llx", subcode_label, m_exc_subcode);
+                strm.Printf(", %s=0x%" PRIx64, subcode_label, m_exc_subcode);
         }
         
         if (m_exc_data_count > 0)
@@ -300,7 +302,39 @@
 
         case 5: // EXC_SOFTWARE
             if (exc_code == 0x10003) // EXC_SOFT_SIGNAL
+            {
+                if (exc_sub_code == 5)
+                {
+                    // On MacOSX, a SIGTRAP can signify that a process has called
+                    // exec, so we should check with our dynamic loader to verify.
+                    ProcessSP process_sp (thread.GetProcess());
+                    if (process_sp)
+                    {
+                        DynamicLoader *dynamic_loader = process_sp->GetDynamicLoader();
+                        if (dynamic_loader && dynamic_loader->ProcessDidExec())
+                        {
+                            // The program was re-exec'ed
+                            return StopInfo::CreateStopReasonWithExec (thread);
+                        }
+//                        if (!process_did_exec)
+//                        {
+//                            // We have a SIGTRAP, make sure we didn't exec by checking
+//                            // for the PC being at "_dyld_start"...
+//                            lldb::StackFrameSP frame_sp (thread.GetStackFrameAtIndex(0));
+//                            if (frame_sp)
+//                            {
+//                                const Symbol *symbol = frame_sp->GetSymbolContext(eSymbolContextSymbol).symbol;
+//                                if (symbol)
+//                                {
+//                                    if (symbol->GetName() == ConstString("_dyld_start"))
+//                                        process_did_exec = true;
+//                                }
+//                            }
+//                        }
+                    }
+                }
                 return StopInfo::CreateStopReasonWithSignal (thread, exc_sub_code);
+            }
             break;
         
         case 6: // EXC_BREAKPOINT

Modified: lldb/branches/windows/source/Plugins/Process/Utility/UnwindLLDB.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/Process/Utility/UnwindLLDB.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/Process/Utility/UnwindLLDB.cpp (original)
+++ lldb/branches/windows/source/Plugins/Process/Utility/UnwindLLDB.cpp Tue Jan  8 06:51:53 2013
@@ -53,7 +53,7 @@
             {
                 TimeValue now(TimeValue::Now());
                 uint64_t delta_t = now - time_value;
-                printf ("%u frames in %llu.%09llu ms (%g frames/sec)\n", 
+                printf ("%u frames in %" PRIu64 ".%09llu ms (%g frames/sec)\n",
                         FRAME_COUNT,
                         delta_t / TimeValue::NanoSecPerSec, 
                         delta_t % TimeValue::NanoSecPerSec,

Modified: lldb/branches/windows/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.cpp (original)
+++ lldb/branches/windows/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.cpp Tue Jan  8 06:51:53 2013
@@ -176,7 +176,7 @@
 //    printf("      ------------------ ------------------ \n");
 //    for (i=0; i<m_cursors.size(); ++i)
 //    {
-//        printf("[%3u] 0x%16.16llx 0x%16.16llx\n", i, m_cursors[i].pc, m_cursors[i].fp);
+//        printf("[%3u] 0x%16.16" PRIx64 " 0x%16.16" PRIx64 "\n", i, m_cursors[i].pc, m_cursors[i].fp);
 //    }
     return m_cursors.size();
 }

Modified: lldb/branches/windows/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp (original)
+++ lldb/branches/windows/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp Tue Jan  8 06:51:53 2013
@@ -92,7 +92,7 @@
         const Entry &entry = m_packets[idx];
         if (entry.type == ePacketTypeInvalid || entry.packet.empty())
             break;
-        strm.Printf ("history[%u] tid=0x%4.4llx <%4u> %s packet: %s\n",
+        strm.Printf ("history[%u] tid=0x%4.4" PRIx64 " <%4u> %s packet: %s\n",
                      entry.packet_idx,
                      entry.tid,
                      entry.bytes_transmitted,
@@ -116,7 +116,7 @@
             const Entry &entry = m_packets[idx];
             if (entry.type == ePacketTypeInvalid || entry.packet.empty())
                 break;
-            log->Printf ("history[%u] tid=0x%4.4llx <%4u> %s packet: %s",
+            log->Printf ("history[%u] tid=0x%4.4" PRIx64 " <%4u> %s packet: %s",
                          entry.packet_idx,
                          entry.tid,
                          entry.bytes_transmitted,
@@ -298,7 +298,7 @@
         size_t bytes_read = Read (buffer, sizeof(buffer), timeout_usec, status, &error);
         
         if (log)
-            log->Printf ("%s: Read (buffer, (sizeof(buffer), timeout_usec = 0x%x, status = %s, error = %s) => bytes_read = %llu",
+            log->Printf ("%s: Read (buffer, (sizeof(buffer), timeout_usec = 0x%x, status = %s, error = %s) => bytes_read = %" PRIu64,
                          __PRETTY_FUNCTION__,
                          timeout_usec, 
                          Communication::ConnectionStatusAsCString (status),

Modified: lldb/branches/windows/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp (original)
+++ lldb/branches/windows/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp Tue Jan  8 06:51:53 2013
@@ -50,6 +50,7 @@
     m_supports_vCont_s (eLazyBoolCalculate),
     m_supports_vCont_S (eLazyBoolCalculate),
     m_qHostInfo_is_valid (eLazyBoolCalculate),
+    m_qProcessInfo_is_valid (eLazyBoolCalculate),
     m_supports_alloc_dealloc_memory (eLazyBoolCalculate),
     m_supports_memory_region_info  (eLazyBoolCalculate),
     m_supports_watchpoint_support_info  (eLazyBoolCalculate),
@@ -75,6 +76,7 @@
     m_async_response (),
     m_async_signal (-1),
     m_host_arch(),
+    m_process_arch(),
     m_os_version_major (UINT32_MAX),
     m_os_version_minor (UINT32_MAX),
     m_os_version_update (UINT32_MAX)
@@ -191,6 +193,7 @@
     m_supports_vCont_s = eLazyBoolCalculate;
     m_supports_vCont_S = eLazyBoolCalculate;
     m_qHostInfo_is_valid = eLazyBoolCalculate;
+    m_qProcessInfo_is_valid = eLazyBoolCalculate;
     m_supports_alloc_dealloc_memory = eLazyBoolCalculate;
     m_supports_memory_region_info = eLazyBoolCalculate;
     m_prepare_for_reg_writing_reply = eLazyBoolCalculate;
@@ -207,6 +210,7 @@
     m_supports_z3 = true;
     m_supports_z4 = true;
     m_host_arch.Clear();
+    m_process_arch.Clear();
 }
 
 
@@ -967,6 +971,14 @@
     return ArchSpec();
 }
 
+const lldb_private::ArchSpec &
+GDBRemoteCommunicationClient::GetProcessArchitecture ()
+{
+    if (m_qProcessInfo_is_valid == eLazyBoolCalculate)
+        GetCurrentProcessInfo ();
+    return m_process_arch;
+}
+
 
 bool
 GDBRemoteCommunicationClient::GetHostInfo (bool force)
@@ -1202,7 +1214,7 @@
     if (pid != LLDB_INVALID_PROCESS_ID)
     {
         char packet[64];
-        const int packet_len = ::snprintf (packet, sizeof(packet), "vAttach;%llx", pid);
+        const int packet_len = ::snprintf (packet, sizeof(packet), "vAttach;%" PRIx64, pid);
         assert (packet_len < sizeof(packet));
         if (SendPacketAndWaitForResponse (packet, packet_len, response, false))
         {
@@ -1229,7 +1241,7 @@
     {
         m_supports_alloc_dealloc_memory = eLazyBoolYes;
         char packet[64];
-        const int packet_len = ::snprintf (packet, sizeof(packet), "_M%llx,%s%s%s",
+        const int packet_len = ::snprintf (packet, sizeof(packet), "_M%" PRIx64 ",%s%s%s",
                                            (uint64_t)size,
                                            permissions & lldb::ePermissionsReadable ? "r" : "",
                                            permissions & lldb::ePermissionsWritable ? "w" : "",
@@ -1256,7 +1268,7 @@
     {
         m_supports_alloc_dealloc_memory = eLazyBoolYes;
         char packet[64];
-        const int packet_len = ::snprintf(packet, sizeof(packet), "_m%llx", (uint64_t)addr);
+        const int packet_len = ::snprintf(packet, sizeof(packet), "_m%" PRIx64, (uint64_t)addr);
         assert (packet_len < sizeof(packet));
         StringExtractorGDBRemote response;
         if (SendPacketAndWaitForResponse (packet, packet_len, response, false))
@@ -1289,7 +1301,7 @@
     {
         m_supports_memory_region_info = eLazyBoolYes;
         char packet[64];
-        const int packet_len = ::snprintf(packet, sizeof(packet), "qMemoryRegionInfo:%llx", (uint64_t)addr);
+        const int packet_len = ::snprintf(packet, sizeof(packet), "qMemoryRegionInfo:%" PRIx64, (uint64_t)addr);
         assert (packet_len < sizeof(packet));
         StringExtractorGDBRemote response;
         if (SendPacketAndWaitForResponse (packet, packet_len, response, false))
@@ -1622,7 +1634,7 @@
     if (m_supports_qProcessInfoPID)
     {
         char packet[32];
-        const int packet_len = ::snprintf (packet, sizeof (packet), "qProcessInfoPID:%llu", pid);
+        const int packet_len = ::snprintf (packet, sizeof (packet), "qProcessInfoPID:%" PRIu64, pid);
         assert (packet_len < sizeof(packet));
         StringExtractorGDBRemote response;
         if (SendPacketAndWaitForResponse (packet, packet_len, response, false))
@@ -1638,6 +1650,100 @@
     return false;
 }
 
+bool
+GDBRemoteCommunicationClient::GetCurrentProcessInfo ()
+{
+    if (m_qProcessInfo_is_valid == eLazyBoolYes)
+        return true;
+    if (m_qProcessInfo_is_valid == eLazyBoolNo)
+        return false;
+
+    GetHostInfo ();
+
+    StringExtractorGDBRemote response;
+    if (SendPacketAndWaitForResponse ("qProcessInfo", response, false))
+    {
+        if (response.IsNormalResponse())
+        {
+            std::string name;
+            std::string value;
+            uint32_t cpu = LLDB_INVALID_CPUTYPE;
+            uint32_t sub = 0;
+            std::string arch_name;
+            std::string os_name;
+            std::string vendor_name;
+            std::string triple;
+            uint32_t pointer_byte_size = 0;
+            StringExtractor extractor;
+            ByteOrder byte_order = eByteOrderInvalid;
+            uint32_t num_keys_decoded = 0;
+            while (response.GetNameColonValue(name, value))
+            {
+                if (name.compare("cputype") == 0)
+                {
+                    cpu = Args::StringToUInt32 (value.c_str(), LLDB_INVALID_CPUTYPE, 16);
+                    if (cpu != LLDB_INVALID_CPUTYPE)
+                        ++num_keys_decoded;
+                }
+                else if (name.compare("cpusubtype") == 0)
+                {
+                    sub = Args::StringToUInt32 (value.c_str(), 0, 16);
+                    if (sub != 0)
+                        ++num_keys_decoded;
+                }
+                else if (name.compare("ostype") == 0)
+                {
+                    os_name.swap (value);
+                    ++num_keys_decoded;
+                }
+                else if (name.compare("vendor") == 0)
+                {
+                    vendor_name.swap(value);
+                    ++num_keys_decoded;
+                }
+                else if (name.compare("endian") == 0)
+                {
+                    ++num_keys_decoded;
+                    if (value.compare("little") == 0)
+                        byte_order = eByteOrderLittle;
+                    else if (value.compare("big") == 0)
+                        byte_order = eByteOrderBig;
+                    else if (value.compare("pdp") == 0)
+                        byte_order = eByteOrderPDP;
+                    else
+                        --num_keys_decoded;
+                }
+                else if (name.compare("ptrsize") == 0)
+                {
+                    pointer_byte_size = Args::StringToUInt32 (value.c_str(), 0, 16);
+                    if (pointer_byte_size != 0)
+                        ++num_keys_decoded;
+                }
+            }
+            if (num_keys_decoded > 0)
+                m_qProcessInfo_is_valid = eLazyBoolYes;
+            if (cpu != LLDB_INVALID_CPUTYPE && !os_name.empty() && !vendor_name.empty())
+            {
+                m_process_arch.SetArchitecture (eArchTypeMachO, cpu, sub);
+                if (pointer_byte_size)
+                {
+                    assert (pointer_byte_size == m_process_arch.GetAddressByteSize());
+                }
+                m_host_arch.GetTriple().setVendorName (llvm::StringRef (vendor_name));
+                m_host_arch.GetTriple().setOSName (llvm::StringRef (os_name));
+                return true;
+            }
+        }
+    }
+    else
+    {
+        m_qProcessInfo_is_valid = eLazyBoolNo;
+    }
+
+    return false;
+}
+
+
 uint32_t
 GDBRemoteCommunicationClient::FindProcesses (const ProcessInstanceInfoMatch &match_info,
                                              ProcessInstanceInfoList &process_infos)
@@ -1692,9 +1798,9 @@
             }
             
             if (match_info.GetProcessInfo().ProcessIDIsValid())
-                packet.Printf("pid:%llu;",match_info.GetProcessInfo().GetProcessID());
+                packet.Printf("pid:%" PRIu64 ";",match_info.GetProcessInfo().GetProcessID());
             if (match_info.GetProcessInfo().ParentProcessIDIsValid())
-                packet.Printf("parent_pid:%llu;",match_info.GetProcessInfo().GetParentProcessID());
+                packet.Printf("parent_pid:%" PRIu64 ";",match_info.GetProcessInfo().GetParentProcessID());
             if (match_info.GetProcessInfo().UserIDIsValid())
                 packet.Printf("uid:%u;",match_info.GetProcessInfo().GetUserID());
             if (match_info.GetProcessInfo().GroupIDIsValid())
@@ -1817,7 +1923,7 @@
                 end_time = TimeValue::Now();
                 total_time_nsec = end_time.GetAsNanoSecondsSinceJan1_1970() - start_time.GetAsNanoSecondsSinceJan1_1970();
                 packets_per_second = (((float)num_packets)/(float)total_time_nsec) * (float)TimeValue::NanoSecPerSec;
-                printf ("%u qSpeedTest(send=%-5u, recv=%-5u) in %llu.%9.9llu sec for %f packets/sec.\n", 
+                printf ("%u qSpeedTest(send=%-5u, recv=%-5u) in %" PRIu64 ".%9.9" PRIu64 " sec for %f packets/sec.\n",
                         num_packets, 
                         send_size,
                         recv_size,
@@ -1841,7 +1947,7 @@
         end_time = TimeValue::Now();
         total_time_nsec = end_time.GetAsNanoSecondsSinceJan1_1970() - start_time.GetAsNanoSecondsSinceJan1_1970();
         packets_per_second = (((float)num_packets)/(float)total_time_nsec) * (float)TimeValue::NanoSecPerSec;
-        printf ("%u 'qC' packets packets in 0x%llu%9.9llu sec for %f packets/sec.\n", 
+        printf ("%u 'qC' packets packets in 0x%" PRIu64 "%9.9" PRIu64 " sec for %f packets/sec.\n",
                 num_packets, 
                 total_time_nsec / TimeValue::NanoSecPerSec, 
                 total_time_nsec % TimeValue::NanoSecPerSec, 
@@ -1961,7 +2067,7 @@
     if (m_supports_qThreadStopInfo)
     {
         char packet[256];
-        int packet_len = ::snprintf(packet, sizeof(packet), "qThreadStopInfo%llx", tid);
+        int packet_len = ::snprintf(packet, sizeof(packet), "qThreadStopInfo%" PRIx64, tid);
         assert (packet_len < sizeof(packet));
         if (SendPacketAndWaitForResponse(packet, packet_len, response, false))
         {
@@ -1991,13 +2097,12 @@
     case eWatchpointWrite:      if (!m_supports_z2) return UINT8_MAX; break;
     case eWatchpointRead:       if (!m_supports_z3) return UINT8_MAX; break;
     case eWatchpointReadWrite:  if (!m_supports_z4) return UINT8_MAX; break;
-    default:                    return UINT8_MAX;
     }
 
     char packet[64];
     const int packet_len = ::snprintf (packet, 
                                        sizeof(packet), 
-                                       "%c%i,%llx,%x", 
+                                       "%c%i,%" PRIx64 ",%x",
                                        insert ? 'Z' : 'z', 
                                        type, 
                                        addr, 
@@ -2021,7 +2126,6 @@
             case eWatchpointWrite:      m_supports_z2 = false; break;
             case eWatchpointRead:       m_supports_z3 = false; break;
             case eWatchpointReadWrite:  m_supports_z4 = false; break;
-            default:                    break;
         }
     }
 

Modified: lldb/branches/windows/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h (original)
+++ lldb/branches/windows/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h Tue Jan  8 06:51:53 2013
@@ -217,7 +217,10 @@
 
     const lldb_private::ArchSpec &
     GetHostArchitecture ();
-    
+
+    const lldb_private::ArchSpec &
+    GetProcessArchitecture ();
+
     bool
     GetVContSupported (char flavor);
 
@@ -307,7 +310,6 @@
         case eWatchpointWrite:      return m_supports_z2;
         case eWatchpointRead:       return m_supports_z3;
         case eWatchpointReadWrite:  return m_supports_z4;
-        default:                    break;
         }
         return false;
     }
@@ -354,6 +356,9 @@
     }
 protected:
 
+    bool
+    GetCurrentProcessInfo ();
+
     //------------------------------------------------------------------
     // Classes that inherit from GDBRemoteCommunicationClient can see and modify these
     //------------------------------------------------------------------
@@ -367,6 +372,7 @@
     lldb_private::LazyBool m_supports_vCont_s;
     lldb_private::LazyBool m_supports_vCont_S;
     lldb_private::LazyBool m_qHostInfo_is_valid;
+    lldb_private::LazyBool m_qProcessInfo_is_valid;
     lldb_private::LazyBool m_supports_alloc_dealloc_memory;
     lldb_private::LazyBool m_supports_memory_region_info;
     lldb_private::LazyBool m_supports_watchpoint_support_info;
@@ -403,6 +409,7 @@
     bool m_interrupt_sent;
     
     lldb_private::ArchSpec m_host_arch;
+    lldb_private::ArchSpec m_process_arch;
     uint32_t m_os_version_major;
     uint32_t m_os_version_minor;
     uint32_t m_os_version_update;

Modified: lldb/branches/windows/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp (original)
+++ lldb/branches/windows/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp Tue Jan  8 06:51:53 2013
@@ -280,7 +280,7 @@
 static void
 CreateProcessInfoResponse (const ProcessInstanceInfo &proc_info, StreamString &response)
 {
-    response.Printf ("pid:%llu;ppid:%llu;uid:%i;gid:%i;euid:%i;egid:%i;", 
+    response.Printf ("pid:%" PRIu64 ";ppid:%" PRIu64 ";uid:%i;gid:%i;euid:%i;egid:%i;",
                      proc_info.GetProcessID(),
                      proc_info.GetParentProcessID(),
                      proc_info.GetUserID(),
@@ -646,7 +646,7 @@
 {
     lldb::pid_t pid = m_process_launch_info.GetProcessID();
     StreamString response;
-    response.Printf("QC%llx", pid);
+    response.Printf("QC%" PRIx64, pid);
     if (m_is_platform)
     {
         // If we launch a process and this GDB server is acting as a platform, 
@@ -716,7 +716,7 @@
                         {
                             uint16_t port = (intptr_t)accept_thread_result;
                             char response[256];
-                            const int response_len = ::snprintf (response, sizeof(response), "pid:%llu;port:%u;", debugserver_pid, port);
+                            const int response_len = ::snprintf (response, sizeof(response), "pid:%" PRIu64 ";port:%u;", debugserver_pid, port);
                             assert (response_len < sizeof(response));
                             //m_port_to_pid_map[port] = debugserver_launch_info.GetProcessID();
                             success = SendPacketNoLock (response, response_len) > 0;

Modified: lldb/branches/windows/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp (original)
+++ lldb/branches/windows/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp Tue Jan  8 06:51:53 2013
@@ -155,7 +155,7 @@
     int packet_len = 0;
     const uint32_t reg = reg_info->kinds[eRegisterKindLLDB];
     if (gdb_comm.GetThreadSuffixSupported())
-        packet_len = ::snprintf (packet, sizeof(packet), "p%x;thread:%4.4llx;", reg, m_thread.GetID());
+        packet_len = ::snprintf (packet, sizeof(packet), "p%x;thread:%4.4" PRIx64 ";", reg, m_thread.GetID());
     else
         packet_len = ::snprintf (packet, sizeof(packet), "p%x", reg);
     assert (packet_len < (sizeof(packet) - 1));
@@ -196,7 +196,7 @@
                 {
                     // Get all registers in one packet
                     if (thread_suffix_supported)
-                        packet_len = ::snprintf (packet, sizeof(packet), "g;thread:%4.4llx;", m_thread.GetID());
+                        packet_len = ::snprintf (packet, sizeof(packet), "g;thread:%4.4" PRIx64 ";", m_thread.GetID());
                     else
                         packet_len = ::snprintf (packet, sizeof(packet), "g");
                     assert (packet_len < (sizeof(packet) - 1));
@@ -311,7 +311,7 @@
                               lldb::endian::InlHostByteOrder());
 
     if (gdb_comm.GetThreadSuffixSupported())
-        packet.Printf (";thread:%4.4llx;", m_thread.GetID());
+        packet.Printf (";thread:%4.4" PRIx64 ";", m_thread.GetID());
 
     // Invalidate just this register
     m_reg_valid[reg] = false;
@@ -337,7 +337,7 @@
 
     StreamString packet;
     StringExtractorGDBRemote response;
-    packet.Printf ("QSyncThreadState:%4.4llx;", m_thread.GetID());
+    packet.Printf ("QSyncThreadState:%4.4" PRIx64 ";", m_thread.GetID());
     if (gdb_comm.SendPacketAndWaitForResponse(packet.GetString().c_str(),
                                               packet.GetString().size(),
                                               response,
@@ -397,7 +397,7 @@
                                               lldb::endian::InlHostByteOrder());
 
                     if (thread_suffix_supported)
-                        packet.Printf (";thread:%4.4llx;", m_thread.GetID());
+                        packet.Printf (";thread:%4.4" PRIx64 ";", m_thread.GetID());
 
                     // Invalidate all register values
                     InvalidateIfNeeded (true);
@@ -510,7 +510,7 @@
         {
             int packet_len = 0;
             if (thread_suffix_supported)
-                packet_len = ::snprintf (packet, sizeof(packet), "g;thread:%4.4llx", m_thread.GetID());
+                packet_len = ::snprintf (packet, sizeof(packet), "g;thread:%4.4" PRIx64, m_thread.GetID());
             else
                 packet_len = ::snprintf (packet, sizeof(packet), "g");
             assert (packet_len < (sizeof(packet) - 1));
@@ -527,7 +527,7 @@
                     if (thread_suffix_supported)
                     {
                         char thread_id_cstr[64];
-                        ::snprintf (thread_id_cstr, sizeof(thread_id_cstr), ";thread:%4.4llx;", m_thread.GetID());
+                        ::snprintf (thread_id_cstr, sizeof(thread_id_cstr), ";thread:%4.4" PRIx64 ";", m_thread.GetID());
                         response_str.append (thread_id_cstr);
                     }
                     data_sp.reset (new DataBufferHeap (response_str.c_str(), response_str.size()));
@@ -650,7 +650,7 @@
                                                           lldb::endian::InlHostByteOrder());
 
                                 if (thread_suffix_supported)
-                                    packet.Printf (";thread:%4.4llx;", m_thread.GetID());
+                                    packet.Printf (";thread:%4.4" PRIx64 ";", m_thread.GetID());
 
                                 m_reg_valid[reg] = false;
                                 if (gdb_comm.SendPacketAndWaitForResponse(packet.GetString().c_str(),

Modified: lldb/branches/windows/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original)
+++ lldb/branches/windows/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 // C Includes
 #include <errno.h>
 
@@ -404,7 +406,16 @@
     bool from_scratch = (reg_num == 0);
 
     const ArchSpec &target_arch = GetTarget().GetArchitecture();
-    const ArchSpec &remote_arch = m_gdb_comm.GetHostArchitecture();
+    const ArchSpec &remote_host_arch = m_gdb_comm.GetHostArchitecture();
+    const ArchSpec &remote_process_arch = m_gdb_comm.GetProcessArchitecture();
+
+    // Use the process' architecture instead of the host arch, if available
+    ArchSpec remote_arch;
+    if (remote_process_arch.IsValid ())
+        remote_arch = remote_process_arch;
+    else
+        remote_arch = remote_host_arch;
+
     if (!target_arch.IsValid())
     {
         if (remote_arch.IsValid()
@@ -481,17 +492,21 @@
                 SetPrivateState (state);
             }
             else
-                error.SetErrorStringWithFormat ("Process %llu was reported after connecting to '%s', but state was not stopped: %s", pid, remote_url, StateAsCString (state));
+                error.SetErrorStringWithFormat ("Process %" PRIu64 " was reported after connecting to '%s', but state was not stopped: %s", pid, remote_url, StateAsCString (state));
         }
         else
-            error.SetErrorStringWithFormat ("Process %llu was reported after connecting to '%s', but no stop reply packet was received", pid, remote_url);
+            error.SetErrorStringWithFormat ("Process %" PRIu64 " was reported after connecting to '%s', but no stop reply packet was received", pid, remote_url);
     }
 
     if (error.Success() 
         && !GetTarget().GetArchitecture().IsValid()
         && m_gdb_comm.GetHostArchitecture().IsValid())
     {
-        GetTarget().SetArchitecture(m_gdb_comm.GetHostArchitecture());
+        // Prefer the *process'* architecture over that of the *host*, if available.
+        if (m_gdb_comm.GetProcessArchitecture().IsValid())
+            GetTarget().SetArchitecture(m_gdb_comm.GetProcessArchitecture());
+        else
+            GetTarget().SetArchitecture(m_gdb_comm.GetHostArchitecture());
     }
 
     return error;
@@ -577,7 +592,7 @@
         if (DoReadMemory (0xffffff8000002010ULL, buf, 8, error) == 8)
         {   
             uint32_t offset = 0; 
-            kernel_addr = data8.GetU32(&offset);
+            kernel_addr = data8.GetU64(&offset);
             memory_module_sp = ReadModuleFromMemory (FileSpec("mach_kernel", false), kernel_addr, false, false);
             if (!memory_module_sp.get()
                 || !memory_module_sp->GetUUID().IsValid()
@@ -877,7 +892,15 @@
 
         // See if the GDB server supports the qHostInfo information
 
-        const ArchSpec &gdb_remote_arch = m_gdb_comm.GetHostArchitecture();
+        ArchSpec gdb_remote_arch = m_gdb_comm.GetHostArchitecture();
+
+        // See if the GDB server supports the qProcessInfo packet, if so
+        // prefer that over the Host information as it will be more specific
+        // to our process.
+
+        if (m_gdb_comm.GetProcessArchitecture().IsValid())
+            gdb_remote_arch = m_gdb_comm.GetProcessArchitecture();
+
         if (gdb_remote_arch.IsValid())
         {
             ArchSpec &target_arch = GetTarget().GetArchitecture();
@@ -973,7 +996,7 @@
         if (error.Success())
         {
             char packet[64];
-            const int packet_len = ::snprintf (packet, sizeof(packet), "vAttach;%llx", attach_pid);
+            const int packet_len = ::snprintf (packet, sizeof(packet), "vAttach;%" PRIx64, attach_pid);
             SetID (attach_pid);            
             m_async_broadcaster.BroadcastEvent (eBroadcastBitAsyncContinue, new EventDataBytes (packet, packet_len));
         }
@@ -1071,6 +1094,17 @@
     DidLaunchOrAttach ();
 }
 
+void
+ProcessGDBRemote::DoDidExec ()
+{
+    // The process exec'ed itself, figure out the dynamic loader, etc...
+    BuildDynamicRegisterInfo (true);
+    m_gdb_comm.ResetDiscoverableSettings();
+    DidLaunchOrAttach ();
+}
+
+
+
 Error
 ProcessGDBRemote::WillResume ()
 {
@@ -1105,7 +1139,7 @@
                 if (m_gdb_comm.GetVContSupported ('c'))
                 {
                     for (tid_collection::const_iterator t_pos = m_continue_c_tids.begin(), t_end = m_continue_c_tids.end(); t_pos != t_end; ++t_pos)
-                        continue_packet.Printf(";c:%4.4llx", *t_pos);
+                        continue_packet.Printf(";c:%4.4" PRIx64, *t_pos);
                 }
                 else 
                     continue_packet_error = true;
@@ -1116,7 +1150,7 @@
                 if (m_gdb_comm.GetVContSupported ('C'))
                 {
                     for (tid_sig_collection::const_iterator s_pos = m_continue_C_tids.begin(), s_end = m_continue_C_tids.end(); s_pos != s_end; ++s_pos)
-                        continue_packet.Printf(";C%2.2x:%4.4llx", s_pos->second, s_pos->first);
+                        continue_packet.Printf(";C%2.2x:%4.4" PRIx64, s_pos->second, s_pos->first);
                 }
                 else 
                     continue_packet_error = true;
@@ -1127,7 +1161,7 @@
                 if (m_gdb_comm.GetVContSupported ('s'))
                 {
                     for (tid_collection::const_iterator t_pos = m_continue_s_tids.begin(), t_end = m_continue_s_tids.end(); t_pos != t_end; ++t_pos)
-                        continue_packet.Printf(";s:%4.4llx", *t_pos);
+                        continue_packet.Printf(";s:%4.4" PRIx64, *t_pos);
                 }
                 else 
                     continue_packet_error = true;
@@ -1138,7 +1172,7 @@
                 if (m_gdb_comm.GetVContSupported ('S'))
                 {
                     for (tid_sig_collection::const_iterator s_pos = m_continue_S_tids.begin(), s_end = m_continue_S_tids.end(); s_pos != s_end; ++s_pos)
-                        continue_packet.Printf(";S%2.2x:%4.4llx", s_pos->second, s_pos->first);
+                        continue_packet.Printf(";S%2.2x:%4.4" PRIx64, s_pos->second, s_pos->first);
                 }
                 else
                     continue_packet_error = true;
@@ -1344,7 +1378,7 @@
     // locker will keep a mutex locked until it goes out of scope
     LogSP log (ProcessGDBRemoteLog::GetLogIfAllCategoriesSet (GDBR_LOG_THREAD));
     if (log && log->GetMask().Test(GDBR_LOG_VERBOSE))
-        log->Printf ("ProcessGDBRemote::%s (pid = %llu)", __FUNCTION__, GetID());
+        log->Printf ("ProcessGDBRemote::%s (pid = %" PRIu64 ")", __FUNCTION__, GetID());
     
     size_t num_thread_ids = m_thread_ids.size();
     // The "m_thread_ids" thread ID list should always be updated after each stop
@@ -1897,7 +1931,7 @@
                             || reason == eStopReasonException)
                         {
                             if (log)
-                                log->Printf ("ProcessGDBRemote::DoDestroy() - thread: %lld stopped with reason: %s.",
+                                log->Printf ("ProcessGDBRemote::DoDestroy() - thread: %" PRId64 " stopped with reason: %s.",
                                              thread_sp->GetID(),
                                              stop_info_sp->GetDescription());
                             stop_looks_like_crash = true;
@@ -1932,7 +1966,7 @@
                                 && reason != eStopReasonException)
                             {
                                 if (log)
-                                    log->Printf ("ProcessGDBRemote::DoDestroy() - Suspending thread: %lld before running.",
+                                    log->Printf ("ProcessGDBRemote::DoDestroy() - Suspending thread: %" PRId64 " before running.",
                                                  thread_sp->GetID());
                                 thread_sp->SetResumeState(eStateSuspended);
                             }
@@ -2043,7 +2077,7 @@
     }
 
     char packet[64];
-    const int packet_len = ::snprintf (packet, sizeof(packet), "m%llx,%llx", (uint64_t)addr, (uint64_t)size);
+    const int packet_len = ::snprintf (packet, sizeof(packet), "m%" PRIx64 ",%" PRIx64, (uint64_t)addr, (uint64_t)size);
     assert (packet_len + 1 < sizeof(packet));
     StringExtractorGDBRemote response;
     if (m_gdb_comm.SendPacketAndWaitForResponse(packet, packet_len, response, true))
@@ -2054,7 +2088,7 @@
             return response.GetHexBytes(buf, size, '\xdd');
         }
         else if (response.IsErrorResponse())
-            error.SetErrorString("memory read failed");
+            error.SetErrorStringWithFormat("memory read failed for 0x%" PRIx64, addr);
         else if (response.IsUnsupportedResponse())
             error.SetErrorStringWithFormat("GDB server does not support reading memory");
         else
@@ -2079,7 +2113,7 @@
     }
 
     StreamString packet;
-    packet.Printf("M%llx,%llx:", addr, (uint64_t)size);
+    packet.Printf("M%" PRIx64 ",%" PRIx64 ":", addr, (uint64_t)size);
     packet.PutBytesAsRawHex8(buf, size, lldb::endian::InlHostByteOrder(), lldb::endian::InlHostByteOrder());
     StringExtractorGDBRemote response;
     if (m_gdb_comm.SendPacketAndWaitForResponse(packet.GetData(), packet.GetSize(), response, true))
@@ -2090,7 +2124,7 @@
             return size;
         }
         else if (response.IsErrorResponse())
-            error.SetErrorString("memory write failed");
+            error.SetErrorStringWithFormat("memory write failed for 0x%" PRIx64, addr);
         else if (response.IsUnsupportedResponse())
             error.SetErrorStringWithFormat("GDB server does not support writing memory");
         else
@@ -2136,7 +2170,7 @@
     }
     
     if (allocated_addr == LLDB_INVALID_ADDRESS)
-        error.SetErrorStringWithFormat("unable to allocate %llu bytes of memory with permissions %s", (uint64_t)size, GetPermissionsAsCString (permissions));
+        error.SetErrorStringWithFormat("unable to allocate %" PRIu64 " bytes of memory with permissions %s", (uint64_t)size, GetPermissionsAsCString (permissions));
     else
         error.Clear();
     return allocated_addr;
@@ -2182,7 +2216,7 @@
 
         case eLazyBoolYes:
             if (!m_gdb_comm.DeallocateMemory (addr))
-                error.SetErrorStringWithFormat("unable to deallocate memory at 0x%llx", addr);
+                error.SetErrorStringWithFormat("unable to deallocate memory at 0x%" PRIx64, addr);
             break;
             
         case eLazyBoolNo:
@@ -2193,7 +2227,7 @@
                     InferiorCallMunmap(this, addr, pos->second))
                     m_addr_to_mmap_size.erase (pos);
                 else
-                    error.SetErrorStringWithFormat("unable to deallocate memory at 0x%llx", addr);
+                    error.SetErrorStringWithFormat("unable to deallocate memory at 0x%" PRIx64, addr);
             }
             break;
     }
@@ -2226,12 +2260,12 @@
     user_id_t site_id = bp_site->GetID();
     const addr_t addr = bp_site->GetLoadAddress();
     if (log)
-        log->Printf ("ProcessGDBRemote::EnableBreakpoint (size_id = %llu) address = 0x%llx", site_id, (uint64_t)addr);
+        log->Printf ("ProcessGDBRemote::EnableBreakpoint (size_id = %" PRIu64 ") address = 0x%" PRIx64, site_id, (uint64_t)addr);
 
     if (bp_site->IsEnabled())
     {
         if (log)
-            log->Printf ("ProcessGDBRemote::EnableBreakpoint (size_id = %llu) address = 0x%llx -- SUCCESS (already enabled)", site_id, (uint64_t)addr);
+            log->Printf ("ProcessGDBRemote::EnableBreakpoint (size_id = %" PRIu64 ") address = 0x%" PRIx64 " -- SUCCESS (already enabled)", site_id, (uint64_t)addr);
         return error;
     }
     else
@@ -2269,7 +2303,7 @@
     if (log)
     {
         const char *err_string = error.AsCString();
-        log->Printf ("ProcessGDBRemote::EnableBreakpoint() error for breakpoint at 0x%8.8llx: %s",
+        log->Printf ("ProcessGDBRemote::EnableBreakpoint() error for breakpoint at 0x%8.8" PRIx64 ": %s",
                      bp_site->GetLoadAddress(),
                      err_string ? err_string : "NULL");
     }
@@ -2288,7 +2322,7 @@
     user_id_t site_id = bp_site->GetID();
     LogSP log (ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_BREAKPOINTS));
     if (log)
-        log->Printf ("ProcessGDBRemote::DisableBreakpoint (site_id = %llu) addr = 0x%8.8llx", site_id, (uint64_t)addr);
+        log->Printf ("ProcessGDBRemote::DisableBreakpoint (site_id = %" PRIu64 ") addr = 0x%8.8" PRIx64, site_id, (uint64_t)addr);
 
     if (bp_site->IsEnabled())
     {
@@ -2317,7 +2351,7 @@
     else
     {
         if (log)
-            log->Printf ("ProcessGDBRemote::DisableBreakpoint (site_id = %llu) addr = 0x%8.8llx -- SUCCESS (already disabled)", site_id, (uint64_t)addr);
+            log->Printf ("ProcessGDBRemote::DisableBreakpoint (site_id = %" PRIu64 ") addr = 0x%8.8" PRIx64 " -- SUCCESS (already disabled)", site_id, (uint64_t)addr);
         return error;
     }
 
@@ -2345,7 +2379,7 @@
 }
 
 Error
-ProcessGDBRemote::EnableWatchpoint (Watchpoint *wp)
+ProcessGDBRemote::EnableWatchpoint (Watchpoint *wp, bool notify)
 {
     Error error;
     if (wp)
@@ -2354,11 +2388,11 @@
         addr_t addr = wp->GetLoadAddress();
         LogSP log (ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_WATCHPOINTS));
         if (log)
-            log->Printf ("ProcessGDBRemote::EnableWatchpoint(watchID = %llu)", watchID);
+            log->Printf ("ProcessGDBRemote::EnableWatchpoint(watchID = %" PRIu64 ")", watchID);
         if (wp->IsEnabled())
         {
             if (log)
-                log->Printf("ProcessGDBRemote::EnableWatchpoint(watchID = %llu) addr = 0x%8.8llx: watchpoint already enabled.", watchID, (uint64_t)addr);
+                log->Printf("ProcessGDBRemote::EnableWatchpoint(watchID = %" PRIu64 ") addr = 0x%8.8" PRIx64 ": watchpoint already enabled.", watchID, (uint64_t)addr);
             return error;
         }
 
@@ -2368,7 +2402,7 @@
         {
             if (m_gdb_comm.SendGDBStoppointTypePacket(type, true, addr, wp->GetByteSize()) == 0)
             {
-                wp->SetEnabled(true);
+                wp->SetEnabled(true, notify);
                 return error;
             }
             else
@@ -2387,7 +2421,7 @@
 }
 
 Error
-ProcessGDBRemote::DisableWatchpoint (Watchpoint *wp)
+ProcessGDBRemote::DisableWatchpoint (Watchpoint *wp, bool notify)
 {
     Error error;
     if (wp)
@@ -2397,17 +2431,18 @@
         LogSP log (ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_WATCHPOINTS));
 
         addr_t addr = wp->GetLoadAddress();
+
         if (log)
-            log->Printf ("ProcessGDBRemote::DisableWatchpoint (watchID = %llu) addr = 0x%8.8llx", watchID, (uint64_t)addr);
+            log->Printf ("ProcessGDBRemote::DisableWatchpoint (watchID = %" PRIu64 ") addr = 0x%8.8" PRIx64, watchID, (uint64_t)addr);
 
         if (!wp->IsEnabled())
         {
             if (log)
-                log->Printf ("ProcessGDBRemote::DisableWatchpoint (watchID = %llu) addr = 0x%8.8llx -- SUCCESS (already disabled)", watchID, (uint64_t)addr);
+                log->Printf ("ProcessGDBRemote::DisableWatchpoint (watchID = %" PRIu64 ") addr = 0x%8.8" PRIx64 " -- SUCCESS (already disabled)", watchID, (uint64_t)addr);
             // See also 'class WatchpointSentry' within StopInfo.cpp.
             // This disabling attempt might come from the user-supplied actions, we'll route it in order for
             // the watchpoint object to intelligently process this action.
-            wp->SetEnabled(false);
+            wp->SetEnabled(false, notify);
             return error;
         }
         
@@ -2417,7 +2452,7 @@
             // Pass down an appropriate z/Z packet...
             if (m_gdb_comm.SendGDBStoppointTypePacket(type, false, addr, wp->GetByteSize()) == 0)
             {
-                wp->SetEnabled(false);
+                wp->SetEnabled(false, notify);
                 return error;
             }
             else
@@ -2597,7 +2632,7 @@
                 m_debugserver_pid = LLDB_INVALID_PROCESS_ID;
 
             if (error.Fail() || log)
-                error.PutToLog(log.get(), "Host::LaunchProcess (launch_info) => pid=%llu, path='%s'", m_debugserver_pid, debugserver_path);
+                error.PutToLog(log.get(), "Host::LaunchProcess (launch_info) => pid=%" PRIu64 ", path='%s'", m_debugserver_pid, debugserver_path);
         }
         else
         {
@@ -2642,7 +2677,7 @@
     TargetSP target_sp (Debugger::FindTargetWithProcess(process));
 
     if (log)
-        log->Printf ("ProcessGDBRemote::MonitorDebugserverProcess (baton=%p, pid=%llu, signo=%i (0x%x), exit_status=%i)", callback_baton, debugserver_pid, signo, signo, exit_status);
+        log->Printf ("ProcessGDBRemote::MonitorDebugserverProcess (baton=%p, pid=%" PRIu64 ", signo=%i (0x%x), exit_status=%i)", callback_baton, debugserver_pid, signo, signo, exit_status);
 
     if (target_sp)
     {
@@ -2807,7 +2842,7 @@
 
     LogSP log (ProcessGDBRemoteLog::GetLogIfAllCategoriesSet (GDBR_LOG_PROCESS));
     if (log)
-        log->Printf ("ProcessGDBRemote::%s (arg = %p, pid = %llu) thread starting...", __FUNCTION__, arg, process->GetID());
+        log->Printf ("ProcessGDBRemote::%s (arg = %p, pid = %" PRIu64 ") thread starting...", __FUNCTION__, arg, process->GetID());
 
     Listener listener ("ProcessGDBRemote::AsyncThread");
     EventSP event_sp;
@@ -2822,14 +2857,14 @@
         while (!done)
         {
             if (log)
-                log->Printf ("ProcessGDBRemote::%s (arg = %p, pid = %llu) listener.WaitForEvent (NULL, event_sp)...", __FUNCTION__, arg, process->GetID());
+                log->Printf ("ProcessGDBRemote::%s (arg = %p, pid = %" PRIu64 ") listener.WaitForEvent (NULL, event_sp)...", __FUNCTION__, arg, process->GetID());
             if (listener.WaitForEvent (NULL, event_sp))
             {
                 const uint32_t event_type = event_sp->GetType();
                 if (event_sp->BroadcasterIs (&process->m_async_broadcaster))
                 {
                     if (log)
-                        log->Printf ("ProcessGDBRemote::%s (arg = %p, pid = %llu) Got an event of type: %d...", __FUNCTION__, arg, process->GetID(), event_type);
+                        log->Printf ("ProcessGDBRemote::%s (arg = %p, pid = %" PRIu64 ") Got an event of type: %d...", __FUNCTION__, arg, process->GetID(), event_type);
 
                     switch (event_type)
                     {
@@ -2842,7 +2877,7 @@
                                     const char *continue_cstr = (const char *)continue_packet->GetBytes ();
                                     const size_t continue_cstr_len = continue_packet->GetByteSize ();
                                     if (log)
-                                        log->Printf ("ProcessGDBRemote::%s (arg = %p, pid = %llu) got eBroadcastBitAsyncContinue: %s", __FUNCTION__, arg, process->GetID(), continue_cstr);
+                                        log->Printf ("ProcessGDBRemote::%s (arg = %p, pid = %" PRIu64 ") got eBroadcastBitAsyncContinue: %s", __FUNCTION__, arg, process->GetID(), continue_cstr);
 
                                     if (::strstr (continue_cstr, "vAttach") == NULL)
                                         process->SetPrivateState(eStateRunning);
@@ -2886,13 +2921,13 @@
 
                         case eBroadcastBitAsyncThreadShouldExit:
                             if (log)
-                                log->Printf ("ProcessGDBRemote::%s (arg = %p, pid = %llu) got eBroadcastBitAsyncThreadShouldExit...", __FUNCTION__, arg, process->GetID());
+                                log->Printf ("ProcessGDBRemote::%s (arg = %p, pid = %" PRIu64 ") got eBroadcastBitAsyncThreadShouldExit...", __FUNCTION__, arg, process->GetID());
                             done = true;
                             break;
 
                         default:
                             if (log)
-                                log->Printf ("ProcessGDBRemote::%s (arg = %p, pid = %llu) got unknown event 0x%8.8x", __FUNCTION__, arg, process->GetID(), event_type);
+                                log->Printf ("ProcessGDBRemote::%s (arg = %p, pid = %" PRIu64 ") got unknown event 0x%8.8x", __FUNCTION__, arg, process->GetID(), event_type);
                             done = true;
                             break;
                     }
@@ -2909,14 +2944,14 @@
             else
             {
                 if (log)
-                    log->Printf ("ProcessGDBRemote::%s (arg = %p, pid = %llu) listener.WaitForEvent (NULL, event_sp) => false", __FUNCTION__, arg, process->GetID());
+                    log->Printf ("ProcessGDBRemote::%s (arg = %p, pid = %" PRIu64 ") listener.WaitForEvent (NULL, event_sp) => false", __FUNCTION__, arg, process->GetID());
                 done = true;
             }
         }
     }
 
     if (log)
-        log->Printf ("ProcessGDBRemote::%s (arg = %p, pid = %llu) thread exiting...", __FUNCTION__, arg, process->GetID());
+        log->Printf ("ProcessGDBRemote::%s (arg = %p, pid = %" PRIu64 ") thread exiting...", __FUNCTION__, arg, process->GetID());
 
     process->m_async_thread = LLDB_INVALID_HOST_THREAD;
     return NULL;
@@ -3171,33 +3206,21 @@
         ProcessGDBRemote *process = (ProcessGDBRemote *)m_interpreter.GetExecutionContext().GetProcessPtr();
         if (process)
         {
-            const StateType state = process->GetState();
-
-            if (StateIsStoppedState (state, true))
-            {
-                for (size_t i=0; i<argc; ++ i)
-                {
-                    const char *packet_cstr = command.GetArgumentAtIndex(0);
-                    bool send_async = false;
-                    StringExtractorGDBRemote response;
-                    process->GetGDBRemote().SendPacketAndWaitForResponse(packet_cstr, response, send_async);
-                    result.SetStatus (eReturnStatusSuccessFinishResult);
-                    Stream &output_strm = result.GetOutputStream();
-                    output_strm.Printf ("  packet: %s\n", packet_cstr);
-                    const std::string &response_str = response.GetStringRef();
-                    if (response_str.empty())
-                        output_strm.PutCString ("response: \nerror: UNIMPLEMENTED\n");
-                    else
-                        output_strm.Printf ("response: %s\n", response.GetStringRef().c_str());
-                }
-            }
-            else
+            for (size_t i=0; i<argc; ++ i)
             {
-                result.AppendErrorWithFormat ("process must be stopped in order to send GDB remote packets, state is %s", StateAsCString (state));
-                result.SetStatus (eReturnStatusFailed);
-                return false;
+                const char *packet_cstr = command.GetArgumentAtIndex(0);
+                bool send_async = true;
+                StringExtractorGDBRemote response;
+                process->GetGDBRemote().SendPacketAndWaitForResponse(packet_cstr, response, send_async);
+                result.SetStatus (eReturnStatusSuccessFinishResult);
+                Stream &output_strm = result.GetOutputStream();
+                output_strm.Printf ("  packet: %s\n", packet_cstr);
+                const std::string &response_str = response.GetStringRef();
+                if (response_str.empty())
+                    output_strm.PutCString ("response: \nerror: UNIMPLEMENTED\n");
+                else
+                    output_strm.Printf ("response: %s\n", response.GetStringRef().c_str());
             }
-
         }
         return true;
     }

Modified: lldb/branches/windows/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h (original)
+++ lldb/branches/windows/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h Tue Jan  8 06:51:53 2013
@@ -113,6 +113,9 @@
     virtual void
     DidAttach ();
 
+    virtual void
+    DoDidExec ();
+
     //------------------------------------------------------------------
     // PluginInterface protocol
     //------------------------------------------------------------------
@@ -199,10 +202,10 @@
     // Process Watchpoints
     //----------------------------------------------------------------------
     virtual lldb_private::Error
-    EnableWatchpoint (lldb_private::Watchpoint *wp);
+    EnableWatchpoint (lldb_private::Watchpoint *wp, bool notify = true);
 
     virtual lldb_private::Error
-    DisableWatchpoint (lldb_private::Watchpoint *wp);
+    DisableWatchpoint (lldb_private::Watchpoint *wp, bool notify = true);
 
     virtual lldb_private::Error
     GetWatchpointSupportInfo (uint32_t &num);

Modified: lldb/branches/windows/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp (original)
+++ lldb/branches/windows/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp Tue Jan  8 06:51:53 2013
@@ -97,7 +97,7 @@
     int signo = GetResumeSignal();
     lldb::LogSP log(lldb_private::GetLogIfAnyCategoriesSet (GDBR_LOG_THREAD));
     if (log)
-        log->Printf ("Resuming thread: %4.4llx with state: %s.", GetID(), StateAsCString(resume_state));
+        log->Printf ("Resuming thread: %4.4" PRIx64 " with state: %s.", GetID(), StateAsCString(resume_state));
 
     ProcessSP process_sp (GetProcess());
     if (process_sp)

Modified: lldb/branches/windows/source/Plugins/Process/mach-core/ProcessMachCore.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/Process/mach-core/ProcessMachCore.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/Process/mach-core/ProcessMachCore.cpp (original)
+++ lldb/branches/windows/source/Plugins/Process/mach-core/ProcessMachCore.cpp Tue Jan  8 06:51:53 2013
@@ -163,7 +163,7 @@
     }
 
     // TODO: swap header if needed...
-    //printf("0x%16.16llx: magic = 0x%8.8x, file_type= %u\n", vaddr, header.magic, header.filetype);
+    //printf("0x%16.16" PRIx64 ": magic = 0x%8.8x, file_type= %u\n", vaddr, header.magic, header.filetype);
     if (header.magic == llvm::MachO::HeaderMagic32 ||
         header.magic == llvm::MachO::HeaderMagic64)
     {
@@ -175,14 +175,14 @@
         switch (header.filetype)
         {
         case llvm::MachO::HeaderFileTypeDynamicLinkEditor:
-            //printf("0x%16.16llx: file_type = MH_DYLINKER\n", vaddr);
+            //printf("0x%16.16" PRIx64 ": file_type = MH_DYLINKER\n", vaddr);
             // Address of dyld "struct mach_header" in the core file
             m_dyld_plugin_name = DynamicLoaderMacOSXDYLD::GetPluginNameStatic();
             m_dyld_addr = addr;
             return true;
 
         case llvm::MachO::HeaderFileTypeExecutable:
-            //printf("0x%16.16llx: file_type = MH_EXECUTE\n", vaddr);
+            //printf("0x%16.16" PRIx64 ": file_type = MH_EXECUTE\n", vaddr);
             // Check MH_EXECUTABLE file types to see if the dynamic link object flag
             // is NOT set. If it isn't, then we have a mach_kernel.
             if ((header.flags & llvm::MachO::HeaderFlagBitIsDynamicLinkObject) == 0)
@@ -256,7 +256,7 @@
                 ranges_are_sorted = false;
             vm_addr = section->GetFileAddress();
             VMRangeToFileOffset::Entry *last_entry = m_core_aranges.Back();
-//            printf ("LC_SEGMENT[%u] arange=[0x%16.16llx - 0x%16.16llx), frange=[0x%8.8x - 0x%8.8x)\n", 
+//            printf ("LC_SEGMENT[%u] arange=[0x%16.16" PRIx64 " - 0x%16.16" PRIx64 "), frange=[0x%8.8x - 0x%8.8x)\n",
 //                    i, 
 //                    range_entry.GetRangeBase(),
 //                    range_entry.GetRangeEnd(),
@@ -413,7 +413,7 @@
         }
         else
         {
-            error.SetErrorStringWithFormat ("core file does not contain 0x%llx", addr);
+            error.SetErrorStringWithFormat ("core file does not contain 0x%" PRIx64, addr);
         }
     }
     return 0;

Modified: lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp (original)
+++ lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp Tue Jan  8 06:51:53 2013
@@ -13,6 +13,8 @@
 #include "lldb/Core/Module.h"
 #include "lldb/Core/Stream.h"
 #include "lldb/Core/Timer.h"
+#include "lldb/Symbol/CompileUnit.h"
+#include "lldb/Symbol/LineTable.h"
 #include "lldb/Symbol/ObjectFile.h"
 #include "lldb/Target/ObjCLanguageRuntime.h"
 
@@ -43,7 +45,10 @@
     m_length        (0),
     m_version       (0),
     m_addr_size     (DWARFCompileUnit::GetDefaultAddressSize()),
-    m_producer      (eProducerInvalid)
+    m_producer      (eProducerInvalid),
+    m_producer_version_major (0),
+    m_producer_version_minor (0),
+    m_producer_version_update (0)
 {
 }
 
@@ -390,6 +395,31 @@
     if (die)
         die->BuildAddressRangeTable(dwarf2Data, this, debug_aranges);
     
+    if (debug_aranges->IsEmpty())
+    {
+        // We got nothing from the functions, maybe we have a line tables only
+        // situation. Check the line tables and build the arange table from this.
+        SymbolContext sc;
+        sc.comp_unit = dwarf2Data->GetCompUnitForDWARFCompUnit(this);
+        if (sc.comp_unit)
+        {
+            LineTable *line_table = sc.comp_unit->GetLineTable();
+
+            if (line_table)
+            {
+                LineTable::FileAddressRanges file_ranges;
+                const bool append = true;
+                const size_t num_ranges = line_table->GetContiguousFileAddressRanges (file_ranges, append);
+                for (uint32_t idx=0; idx<num_ranges; ++idx)
+                {
+                    const LineTable::FileAddressRanges::Entry &range = file_ranges.GetEntryRef(idx);
+                    debug_aranges->AppendRange(GetOffset(), range.GetRangeBase(), range.GetRangeEnd());
+                    printf ("0x%8.8x: [0x%16.16llx - 0x%16.16llx)\n", GetOffset(), range.GetRangeBase(), range.GetRangeEnd());
+                }
+            }
+        }
+    }
+    
     // Keep memory down by clearing DIEs if this generate function
     // caused them to be parsed
     if (clear_dies)
@@ -654,6 +684,7 @@
 //                    break;
 
                 case DW_AT_MIPS_linkage_name:
+                case DW_AT_linkage_name:
                     if (attributes.ExtractFormValueAtIndex(m_dwarf2Data, i, form_value))
                         mangled_cstr = form_value.AsCString(debug_str);                        
                     break;
@@ -883,9 +914,23 @@
 }
 
 bool
+DWARFCompileUnit::Supports_unnamed_objc_bitfields ()
+{
+    if (GetProducer() == eProducerClang)
+    {
+        const uint32_t major_version = GetProducerVersionMajor();
+        if (major_version > 425 || (major_version == 425 && GetProducerVersionUpdate() >= 13))
+            return true;
+        else
+            return false;
+    }
+    return true; // Assume all other compilers didn't have incorrect ObjC bitfield info
+}
+
+bool
 DWARFCompileUnit::Supports_DW_AT_APPLE_objc_complete_type ()
 {
-    if (GetProducer() == eProcucerLLVMGCC)
+    if (GetProducer() == eProducerLLVMGCC)
         return false;
     return true;
 }
@@ -895,34 +940,81 @@
 {
     // llvm-gcc makes completely invalid decl file attributes and won't ever
     // be fixed, so we need to know to ignore these.
-    return GetProducer() == eProcucerLLVMGCC;
+    return GetProducer() == eProducerLLVMGCC;
 }
 
-DWARFCompileUnit::Producer
-DWARFCompileUnit::GetProducer ()
+void
+DWARFCompileUnit::ParseProducerInfo ()
 {
-    if (m_producer == eProducerInvalid)
+    m_producer_version_major = UINT32_MAX;
+    m_producer_version_minor = UINT32_MAX;
+    m_producer_version_update = UINT32_MAX;
+
+    const DWARFDebugInfoEntry *die = GetCompileUnitDIEOnly();
+    if (die)
     {
-        const DWARFDebugInfoEntry *die = GetCompileUnitDIEOnly();
-        if (die)
+
+        const char *producer_cstr = die->GetAttributeValueAsString(m_dwarf2Data, this, DW_AT_producer, NULL);
+        if (producer_cstr)
         {
-            const char *producer_cstr = die->GetAttributeValueAsString(m_dwarf2Data, this, DW_AT_producer, NULL);
-            if (producer_cstr)
+            RegularExpression llvm_gcc_regex("^4\\.[012]\\.[01] \\(Based on Apple Inc\\. build [0-9]+\\) \\(LLVM build [\\.0-9]+\\)$");
+            if (llvm_gcc_regex.Execute (producer_cstr))
+            {
+                m_producer = eProducerLLVMGCC;
+            }
+            else if (strstr(producer_cstr, "clang"))
             {
-                RegularExpression g_llvm_gcc_regex("^4\\.[012]\\.[01] \\(Based on Apple Inc\\. build [0-9]+\\) \\(LLVM build [\\.0-9]+\\)$");
-                if (g_llvm_gcc_regex.Execute (producer_cstr))
-                    m_producer = eProcucerLLVMGCC;
-                else if (strstr(producer_cstr, "clang"))
-                    m_producer = eProducerClang;
-                else if (strstr(producer_cstr, "GNU"))
-                    m_producer = eProducerGCC;
+                RegularExpression clang_regex("clang-([0-9]+)\\.([0-9]+)\\.([0-9]+)");
+                if (clang_regex.Execute (producer_cstr, 3))
+                {
+                    std::string str;
+                    if (clang_regex.GetMatchAtIndex (producer_cstr, 1, str))
+                        m_producer_version_major = Args::StringToUInt32(str.c_str(), UINT32_MAX, 10);
+                    if (clang_regex.GetMatchAtIndex (producer_cstr, 2, str))
+                        m_producer_version_minor = Args::StringToUInt32(str.c_str(), UINT32_MAX, 10);
+                    if (clang_regex.GetMatchAtIndex (producer_cstr, 3, str))
+                        m_producer_version_update = Args::StringToUInt32(str.c_str(), UINT32_MAX, 10);
+                }
+                m_producer = eProducerClang;
             }
+            else if (strstr(producer_cstr, "GNU"))
+                m_producer = eProducerGCC;
         }
-        if (m_producer == eProducerInvalid)
-            m_producer = eProcucerOther;
     }
+    if (m_producer == eProducerInvalid)
+        m_producer = eProcucerOther;
+}
+
+DWARFCompileUnit::Producer
+DWARFCompileUnit::GetProducer ()
+{
+    if (m_producer == eProducerInvalid)
+        ParseProducerInfo ();
     return m_producer;
 }
 
 
+uint32_t
+DWARFCompileUnit::GetProducerVersionMajor()
+{
+    if (m_producer_version_major == 0)
+        ParseProducerInfo ();
+    return m_producer_version_major;
+}
+
+uint32_t
+DWARFCompileUnit::GetProducerVersionMinor()
+{
+    if (m_producer_version_minor == 0)
+        ParseProducerInfo ();
+    return m_producer_version_minor;
+}
+
+uint32_t
+DWARFCompileUnit::GetProducerVersionUpdate()
+{
+    if (m_producer_version_update == 0)
+        ParseProducerInfo ();
+    return m_producer_version_update;
+}
 

Modified: lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h (original)
+++ lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h Tue Jan  8 06:51:53 2013
@@ -23,7 +23,7 @@
         eProducerInvalid = 0,
         eProducerClang,
         eProducerGCC,
-        eProcucerLLVMGCC,
+        eProducerLLVMGCC,
         eProcucerOther
     };
 
@@ -144,6 +144,9 @@
     bool
     DW_AT_decl_file_attributes_are_invalid();
 
+    bool
+    Supports_unnamed_objc_bitfields ();
+
 //    void
 //    AddGlobalDIEByIndex (uint32_t die_idx);
 //
@@ -173,6 +176,14 @@
     Producer
     GetProducer ();
     
+    uint32_t
+    GetProducerVersionMajor();
+
+    uint32_t
+    GetProducerVersionMinor();
+    
+    uint32_t
+    GetProducerVersionUpdate();
 
 protected:
     SymbolFileDWARF*    m_dwarf2Data;
@@ -186,6 +197,12 @@
     uint16_t            m_version;
     uint8_t             m_addr_size;
     Producer            m_producer;
+    uint32_t            m_producer_version_major;
+    uint32_t            m_producer_version_minor;
+    uint32_t            m_producer_version_update;
+    
+    void
+    ParseProducerInfo ();
 private:
     DISALLOW_COPY_AND_ASSIGN (DWARFCompileUnit);
 };

Modified: lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp (original)
+++ lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp Tue Jan  8 06:51:53 2013
@@ -243,7 +243,7 @@
     DescriptorConstIter pos;
     DescriptorConstIter end = m_arange_descriptors.end();
     for (pos = m_arange_descriptors.begin(); pos != end; ++pos)
-        s->Printf("[0x%*.*llx - 0x%*.*llx)\n",
+        s->Printf("[0x%*.*" PRIx64 " - 0x%*.*" PRIx64 ")\n",
             hex_width, hex_width, pos->address,
             hex_width, hex_width, pos->end_address());
 }

Modified: lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp (original)
+++ lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp Tue Jan  8 06:51:53 2013
@@ -118,7 +118,7 @@
     {
         const RangeToDIE::Entry *entry = m_aranges.GetEntryAtIndex(i);
         if (entry)
-            log->Printf ("0x%8.8x: [0x%llx - 0x%llx)", 
+            log->Printf ("0x%8.8x: [0x%" PRIx64 " - 0x%" PRIx64 ")",
                          entry->data,
                          entry->GetRangeBase(),
                          entry->GetRangeEnd());
@@ -143,7 +143,7 @@
     if (log)
     {
         orig_arange_size = m_aranges.GetSize();
-        log->Printf ("DWARFDebugAranges::Sort(minimize = %u) with %llu entries", minimize, (uint64_t)orig_arange_size);
+        log->Printf ("DWARFDebugAranges::Sort(minimize = %u) with %" PRIu64 " entries", minimize, (uint64_t)orig_arange_size);
     }
 
     m_aranges.Sort();
@@ -155,7 +155,7 @@
         {
             const size_t new_arange_size = m_aranges.GetSize();
             const size_t delta = orig_arange_size - new_arange_size;
-            log->Printf ("DWARFDebugAranges::Sort() %llu entries after minimizing (%llu entries combined for %llu bytes saved)", 
+            log->Printf ("DWARFDebugAranges::Sort() %" PRIu64 " entries after minimizing (%" PRIu64 " entries combined for %" PRIu64 " bytes saved)",
                          (uint64_t)new_arange_size,
                          (uint64_t)delta,
                          (uint64_t)delta * sizeof(Range));

Modified: lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp (original)
+++ lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp Tue Jan  8 06:51:53 2013
@@ -798,6 +798,7 @@
                     break;
 
                 case DW_AT_MIPS_linkage_name:
+                case DW_AT_linkage_name:
                     if (mangled == NULL)
                         mangled = form_value.AsCString(&dwarf2Data->get_debug_str_data());
                     break;
@@ -1077,7 +1078,7 @@
     {
     case DW_AT_stmt_list:
         if ( verbose ) s.PutCString(" ( ");
-        s.Printf( "0x%8.8llx", form_value.Unsigned());
+        s.Printf( "0x%8.8" PRIx64, form_value.Unsigned());
         if ( verbose ) s.PutCString(" )");
         break;
 
@@ -1488,6 +1489,9 @@
     if (GetAttributeValue(dwarf2Data, cu, DW_AT_MIPS_linkage_name, form_value))
         name = form_value.AsCString(&dwarf2Data->get_debug_str_data());
 
+    if (GetAttributeValue(dwarf2Data, cu, DW_AT_linkage_name, form_value))
+        name = form_value.AsCString(&dwarf2Data->get_debug_str_data());
+
     if (substitute_name_allowed && name == NULL)
     {
         if (GetAttributeValue(dwarf2Data, cu, DW_AT_name, form_value))
@@ -1518,6 +1522,8 @@
 
     if (GetAttributeValue(dwarf2Data, cu, DW_AT_MIPS_linkage_name, form_value))
         name = form_value.AsCString(&dwarf2Data->get_debug_str_data());
+    else if (GetAttributeValue(dwarf2Data, cu, DW_AT_linkage_name, form_value))
+        name = form_value.AsCString(&dwarf2Data->get_debug_str_data());
     else if (GetAttributeValue(dwarf2Data, cu, DW_AT_name, form_value))
         name = form_value.AsCString(&dwarf2Data->get_debug_str_data());
     else if (GetAttributeValue(dwarf2Data, cu, DW_AT_specification, form_value))
@@ -1761,7 +1767,7 @@
                 hi_pc = GetAttributeValueAsUnsigned(dwarf2Data, cu, DW_AT_high_pc, DW_INVALID_ADDRESS);
             if (hi_pc != DW_INVALID_ADDRESS)
             {
-            //  printf("BuildAddressRangeTable() 0x%8.8x: [0x%16.16llx - 0x%16.16llx)\n", m_offset, lo_pc, hi_pc); // DEBUG ONLY
+            //  printf("BuildAddressRangeTable() 0x%8.8x: [0x%16.16" PRIx64 " - 0x%16.16" PRIx64 ")\n", m_offset, lo_pc, hi_pc); // DEBUG ONLY
                 debug_aranges->AppendRange (GetOffset(), lo_pc, hi_pc);
             }
         }

Modified: lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp (original)
+++ lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp Tue Jan  8 06:51:53 2013
@@ -100,7 +100,7 @@
     }
     else
     {
-        log->Printf( "0x%16.16llx %6u %6u %6u%s\n", state.address, state.line, state.column, state.file, state.end_sequence ? " END" : "");
+        log->Printf( "0x%16.16" PRIx64 " %6u %6u %6u%s\n", state.address, state.line, state.column, state.file, state.end_sequence ? " END" : "");
     }
 }
 
@@ -236,7 +236,7 @@
                     case DW_LNE_set_address     :
                         {
                             row.address = debug_line_data.GetMaxU64(&offset, arg_size);
-                            log->Printf( "0x%8.8x: DW_LNE_set_address (0x%llx)", op_offset, row.address);
+                            log->Printf( "0x%8.8x: DW_LNE_set_address (0x%" PRIx64 ")", op_offset, row.address);
                         }
                         break;
 
@@ -314,7 +314,7 @@
                 {
                     uint8_t adjust_opcode = 255 - prologue.opcode_base;
                     dw_addr_t addr_offset = (adjust_opcode / prologue.line_range) * prologue.min_inst_length;
-                    log->Printf( "0x%8.8x: DW_LNS_const_add_pc (0x%8.8llx)", op_offset, addr_offset);
+                    log->Printf( "0x%8.8x: DW_LNS_const_add_pc (0x%8.8" PRIx64 ")", op_offset, addr_offset);
                     row.address += addr_offset;
                 }
                 break;
@@ -362,7 +362,7 @@
                     uint8_t adjust_opcode = opcode - prologue.opcode_base;
                     dw_addr_t addr_offset = (adjust_opcode / prologue.line_range) * prologue.min_inst_length;
                     int32_t line_offset = prologue.line_base + (adjust_opcode % prologue.line_range);
-                    log->Printf("0x%8.8x: address += 0x%llx,  line += %i\n", op_offset, (uint64_t)addr_offset, line_offset);
+                    log->Printf("0x%8.8x: address += 0x%" PRIx64 ",  line += %i\n", op_offset, (uint64_t)addr_offset, line_offset);
                     row.address += addr_offset;
                     row.line += line_offset;
                     row.Dump (log);
@@ -1127,7 +1127,7 @@
 void
 DWARFDebugLine::Row::Dump(Log *log) const
 {
-    log->Printf( "0x%16.16llx %6u %6u %6u %3u %s%s%s%s%s",
+    log->Printf( "0x%16.16" PRIx64 " %6u %6u %6u %3u %s%s%s%s%s",
                 address,
                 line,
                 column,

Modified: lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp (original)
+++ lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp Tue Jan  8 06:51:53 2013
@@ -32,11 +32,11 @@
 DWARFDebugPubnames::Extract(const DataExtractor& data)
 {
     Timer scoped_timer (__PRETTY_FUNCTION__,
-                        "DWARFDebugPubnames::Extract (byte_size = %llu)",
+                        "DWARFDebugPubnames::Extract (byte_size = %" PRIu64 ")",
                         (uint64_t)data.GetByteSize());
     LogSP log (LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_PUBNAMES));
     if (log)
-        log->Printf("DWARFDebugPubnames::Extract (byte_size = %llu)", (uint64_t)data.GetByteSize());
+        log->Printf("DWARFDebugPubnames::Extract (byte_size = %" PRIu64 ")", (uint64_t)data.GetByteSize());
 
     if (data.ValidOffset(0))
     {
@@ -124,6 +124,7 @@
                             break;
 
                         case DW_AT_MIPS_linkage_name:
+                        case DW_AT_linkage_name:
                             if (attributes.ExtractFormValueAtIndex(dwarf2Data, i, form_value))
                                 mangled = form_value.AsCString(debug_str);
                             break;

Modified: lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp (original)
+++ lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp Tue Jan  8 06:51:53 2013
@@ -295,7 +295,7 @@
             switch (m_form)
             {
             case DW_FORM_exprloc:
-            case DW_FORM_block:  s.Printf("<0x%llx> ", uvalue);                break;
+            case DW_FORM_block:  s.Printf("<0x%" PRIx64 "> ", uvalue);                break;
             case DW_FORM_block1: s.Printf("<0x%2.2x> ", (uint8_t)uvalue);      break;
             case DW_FORM_block2: s.Printf("<0x%4.4x> ", (uint16_t)uvalue);     break;
             case DW_FORM_block4: s.Printf("<0x%8.8x> ", (uint32_t)uvalue);     break;
@@ -343,8 +343,8 @@
     case DW_FORM_ref1:      cu_relative_offset = true;  if (verbose) s.Printf("cu + 0x%2.2x", (uint8_t)uvalue); break;
     case DW_FORM_ref2:      cu_relative_offset = true;  if (verbose) s.Printf("cu + 0x%4.4x", (uint16_t)uvalue); break;
     case DW_FORM_ref4:      cu_relative_offset = true;  if (verbose) s.Printf("cu + 0x%4.4x", (uint32_t)uvalue); break;
-    case DW_FORM_ref8:      cu_relative_offset = true;  if (verbose) s.Printf("cu + 0x%8.8llx", uvalue); break;
-    case DW_FORM_ref_udata: cu_relative_offset = true;  if (verbose) s.Printf("cu + 0x%llx", uvalue); break;
+    case DW_FORM_ref8:      cu_relative_offset = true;  if (verbose) s.Printf("cu + 0x%8.8" PRIx64, uvalue); break;
+    case DW_FORM_ref_udata: cu_relative_offset = true;  if (verbose) s.Printf("cu + 0x%" PRIx64, uvalue); break;
 
     // All DW_FORM_indirect attributes should be resolved prior to calling this function
     case DW_FORM_indirect:  s.PutCString("DW_FORM_indirect"); break;
@@ -359,7 +359,7 @@
         if (verbose)
             s.PutCString(" => ");
 
-        s.Printf("{0x%8.8llx}", (uvalue + (cu ? cu->GetOffset() : 0)));
+        s.Printf("{0x%8.8" PRIx64 "}", (uvalue + (cu ? cu->GetOffset() : 0)));
     }
 }
 

Modified: lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFLocationDescription.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFLocationDescription.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFLocationDescription.cpp (original)
+++ lldb/branches/windows/source/Plugins/SymbolFile/DWARF/DWARFLocationDescription.cpp Tue Jan  8 06:51:53 2013
@@ -71,7 +71,7 @@
     {
         uint = data.GetULEB128(offset_ptr);
         sint = data.GetSLEB128(offset_ptr);
-        s.Printf("%llu %lli", uint, sint);
+        s.Printf("%" PRIu64 " %" PRIi64, uint, sint);
         return 0;
     }
     if (opcode_class != DRC_ONEOPERAND)
@@ -156,16 +156,16 @@
 
     switch (size)
     {
-    case -1:    sint = (int8_t)     data.GetU8(offset_ptr);     s.Printf("%+lli", sint); break;
-    case -2:    sint = (int16_t)    data.GetU16(offset_ptr);    s.Printf("%+lli", sint); break;
-    case -4:    sint = (int32_t)    data.GetU32(offset_ptr);    s.Printf("%+lli", sint); break;
-    case -8:    sint = (int64_t)    data.GetU64(offset_ptr);    s.Printf("%+lli", sint); break;
-    case -128:  sint = data.GetSLEB128(offset_ptr);             s.Printf("%+lli", sint); break;
-    case 1:     uint = data.GetU8(offset_ptr);                  s.Printf("0x%2.2llx", uint); break;
-    case 2:     uint = data.GetU16(offset_ptr);                 s.Printf("0x%4.4llx", uint); break;
-    case 4:     uint = data.GetU32(offset_ptr);                 s.Printf("0x%8.8llx", uint); break;
-    case 8:     uint = data.GetU64(offset_ptr);                 s.Printf("0x%16.16llx", uint); break;
-    case 128:   uint = data.GetULEB128(offset_ptr);             s.Printf("0x%llx", uint); break;
+    case -1:    sint = (int8_t)     data.GetU8(offset_ptr);     s.Printf("%+" PRIi64, sint); break;
+    case -2:    sint = (int16_t)    data.GetU16(offset_ptr);    s.Printf("%+" PRIi64, sint); break;
+    case -4:    sint = (int32_t)    data.GetU32(offset_ptr);    s.Printf("%+" PRIi64, sint); break;
+    case -8:    sint = (int64_t)    data.GetU64(offset_ptr);    s.Printf("%+" PRIi64, sint); break;
+    case -128:  sint = data.GetSLEB128(offset_ptr);             s.Printf("%+" PRIi64, sint); break;
+    case 1:     uint = data.GetU8(offset_ptr);                  s.Printf("0x%2.2" PRIx64, uint); break;
+    case 2:     uint = data.GetU16(offset_ptr);                 s.Printf("0x%4.4" PRIx64, uint); break;
+    case 4:     uint = data.GetU32(offset_ptr);                 s.Printf("0x%8.8" PRIx64, uint); break;
+    case 8:     uint = data.GetU64(offset_ptr);                 s.Printf("0x%16.16" PRIx64, uint); break;
+    case 128:   uint = data.GetULEB128(offset_ptr);             s.Printf("0x%" PRIx64, uint); break;
     }
 
     return 0;





More information about the lldb-commits mailing list