[Lldb-commits] [lldb] r160654 - in /lldb/branches/lldb-platform-work: ./ examples/darwin/heap_find/ examples/darwin/heap_find/heap/ examples/python/ examples/summaries/ examples/summaries/cocoa/ include/lldb/ include/lldb/API/ include/lldb/Core/ include/lldb/Expression/ include/lldb/Interpreter/ include/lldb/Symbol/ include/lldb/Target/ include/lldb/Utility/ lldb.xcodeproj/ lldb.xcodeproj/xcshareddata/xcschemes/ resources/ scripts/ scripts/Python/interface/ source/API/ source/Commands/ source/Core/ source/Expression/ s...

Johnny Chen johnny.chen at apple.com
Mon Jul 23 17:12:49 PDT 2012


Author: johnny
Date: Mon Jul 23 19:12:48 2012
New Revision: 160654

URL: http://llvm.org/viewvc/llvm-project?rev=160654&view=rev
Log:
Merge changes from ToT trunk.

Added:
    lldb/branches/lldb-platform-work/examples/python/globals.py
      - copied unchanged from r160596, lldb/trunk/examples/python/globals.py
    lldb/branches/lldb-platform-work/test/functionalities/data-formatter/rdar-11628688/
      - copied from r160596, lldb/trunk/test/functionalities/data-formatter/rdar-11628688/
    lldb/branches/lldb-platform-work/test/functionalities/data-formatter/rdar-11628688/Makefile
      - copied unchanged from r160596, lldb/trunk/test/functionalities/data-formatter/rdar-11628688/Makefile
    lldb/branches/lldb-platform-work/test/functionalities/data-formatter/rdar-11628688/TestFormattersBoolRefPtr.py
      - copied unchanged from r160596, lldb/trunk/test/functionalities/data-formatter/rdar-11628688/TestFormattersBoolRefPtr.py
    lldb/branches/lldb-platform-work/test/functionalities/data-formatter/rdar-11628688/main.mm
      - copied unchanged from r160596, lldb/trunk/test/functionalities/data-formatter/rdar-11628688/main.mm
    lldb/branches/lldb-platform-work/test/functionalities/data-formatter/rdar-11773899/
      - copied from r160596, lldb/trunk/test/functionalities/data-formatter/rdar-11773899/
    lldb/branches/lldb-platform-work/test/functionalities/data-formatter/rdar-11773899/Makefile
      - copied unchanged from r160596, lldb/trunk/test/functionalities/data-formatter/rdar-11773899/Makefile
    lldb/branches/lldb-platform-work/test/functionalities/data-formatter/rdar-11773899/TestFormattersBoolRefPtr.py
      - copied unchanged from r160596, lldb/trunk/test/functionalities/data-formatter/rdar-11773899/TestFormattersBoolRefPtr.py
    lldb/branches/lldb-platform-work/test/functionalities/data-formatter/rdar-11773899/main.mm
      - copied unchanged from r160596, lldb/trunk/test/functionalities/data-formatter/rdar-11773899/main.mm
    lldb/branches/lldb-platform-work/test/functionalities/process_launch/my_working_dir/.keep
      - copied unchanged from r160596, lldb/trunk/test/functionalities/process_launch/my_working_dir/.keep
Modified:
    lldb/branches/lldb-platform-work/   (props changed)
    lldb/branches/lldb-platform-work/examples/darwin/heap_find/heap.py
    lldb/branches/lldb-platform-work/examples/darwin/heap_find/heap/heap_find.cpp
    lldb/branches/lldb-platform-work/examples/python/crashlog.py
    lldb/branches/lldb-platform-work/examples/python/symbolication.py
    lldb/branches/lldb-platform-work/examples/summaries/cocoa/NSNumber.py
    lldb/branches/lldb-platform-work/examples/summaries/objc.py
    lldb/branches/lldb-platform-work/include/lldb/API/SBProcess.h
    lldb/branches/lldb-platform-work/include/lldb/API/SBTarget.h
    lldb/branches/lldb-platform-work/include/lldb/Core/Address.h
    lldb/branches/lldb-platform-work/include/lldb/Core/ConnectionFileDescriptor.h
    lldb/branches/lldb-platform-work/include/lldb/Core/EmulateInstruction.h
    lldb/branches/lldb-platform-work/include/lldb/Core/Mangled.h
    lldb/branches/lldb-platform-work/include/lldb/Core/Module.h
    lldb/branches/lldb-platform-work/include/lldb/Core/ModuleList.h
    lldb/branches/lldb-platform-work/include/lldb/Core/ValueObject.h
    lldb/branches/lldb-platform-work/include/lldb/Core/ValueObjectConstResult.h
    lldb/branches/lldb-platform-work/include/lldb/Core/ValueObjectDynamicValue.h
    lldb/branches/lldb-platform-work/include/lldb/Expression/ClangUserExpression.h
    lldb/branches/lldb-platform-work/include/lldb/Expression/IRForTarget.h
    lldb/branches/lldb-platform-work/include/lldb/Interpreter/CommandInterpreter.h
    lldb/branches/lldb-platform-work/include/lldb/Symbol/Block.h
    lldb/branches/lldb-platform-work/include/lldb/Symbol/ClangASTContext.h
    lldb/branches/lldb-platform-work/include/lldb/Symbol/DWARFCallFrameInfo.h
    lldb/branches/lldb-platform-work/include/lldb/Symbol/SymbolContext.h
    lldb/branches/lldb-platform-work/include/lldb/Symbol/UnwindPlan.h
    lldb/branches/lldb-platform-work/include/lldb/Symbol/UnwindTable.h
    lldb/branches/lldb-platform-work/include/lldb/Symbol/VariableList.h
    lldb/branches/lldb-platform-work/include/lldb/Target/Process.h
    lldb/branches/lldb-platform-work/include/lldb/Target/SectionLoadList.h
    lldb/branches/lldb-platform-work/include/lldb/Target/StackFrame.h
    lldb/branches/lldb-platform-work/include/lldb/Target/StackFrameList.h
    lldb/branches/lldb-platform-work/include/lldb/Target/StopInfo.h
    lldb/branches/lldb-platform-work/include/lldb/Target/Target.h
    lldb/branches/lldb-platform-work/include/lldb/Target/Thread.h
    lldb/branches/lldb-platform-work/include/lldb/Utility/CleanUp.h
    lldb/branches/lldb-platform-work/include/lldb/lldb-private-enumerations.h
    lldb/branches/lldb-platform-work/lldb.xcodeproj/project.pbxproj
    lldb/branches/lldb-platform-work/lldb.xcodeproj/xcshareddata/xcschemes/LLDB.xcscheme
    lldb/branches/lldb-platform-work/lldb.xcodeproj/xcshareddata/xcschemes/darwin-debug.xcscheme
    lldb/branches/lldb-platform-work/lldb.xcodeproj/xcshareddata/xcschemes/launcherRootXPCService.xcscheme
    lldb/branches/lldb-platform-work/lldb.xcodeproj/xcshareddata/xcschemes/launcherXPCService.xcscheme
    lldb/branches/lldb-platform-work/lldb.xcodeproj/xcshareddata/xcschemes/lldb-tool.xcscheme
    lldb/branches/lldb-platform-work/llvm.zip
    lldb/branches/lldb-platform-work/resources/LLDB-Info.plist
    lldb/branches/lldb-platform-work/scripts/Python/interface/SBAddress.i
    lldb/branches/lldb-platform-work/scripts/Python/interface/SBBlock.i
    lldb/branches/lldb-platform-work/scripts/Python/interface/SBCompileUnit.i
    lldb/branches/lldb-platform-work/scripts/Python/interface/SBData.i
    lldb/branches/lldb-platform-work/scripts/Python/interface/SBError.i
    lldb/branches/lldb-platform-work/scripts/Python/interface/SBFileSpec.i
    lldb/branches/lldb-platform-work/scripts/Python/interface/SBFrame.i
    lldb/branches/lldb-platform-work/scripts/Python/interface/SBFunction.i
    lldb/branches/lldb-platform-work/scripts/Python/interface/SBInstruction.i
    lldb/branches/lldb-platform-work/scripts/Python/interface/SBInstructionList.i
    lldb/branches/lldb-platform-work/scripts/Python/interface/SBLineEntry.i
    lldb/branches/lldb-platform-work/scripts/Python/interface/SBModule.i
    lldb/branches/lldb-platform-work/scripts/Python/interface/SBProcess.i
    lldb/branches/lldb-platform-work/scripts/Python/interface/SBSection.i
    lldb/branches/lldb-platform-work/scripts/Python/interface/SBSymbol.i
    lldb/branches/lldb-platform-work/scripts/Python/interface/SBSymbolContext.i
    lldb/branches/lldb-platform-work/scripts/Python/interface/SBSymbolContextList.i
    lldb/branches/lldb-platform-work/scripts/Python/interface/SBTarget.i
    lldb/branches/lldb-platform-work/scripts/Python/interface/SBThread.i
    lldb/branches/lldb-platform-work/scripts/Python/interface/SBType.i
    lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeCategory.i
    lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeFilter.i
    lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeFormat.i
    lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeNameSpecifier.i
    lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeSummary.i
    lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeSynthetic.i
    lldb/branches/lldb-platform-work/scripts/Python/interface/SBValue.i
    lldb/branches/lldb-platform-work/scripts/clang.amalgamated.diff
    lldb/branches/lldb-platform-work/scripts/llvm.amalgamated.diff
    lldb/branches/lldb-platform-work/source/API/SBCommandInterpreter.cpp
    lldb/branches/lldb-platform-work/source/API/SBFrame.cpp
    lldb/branches/lldb-platform-work/source/API/SBProcess.cpp
    lldb/branches/lldb-platform-work/source/API/SBTarget.cpp
    lldb/branches/lldb-platform-work/source/Commands/CommandObjectBreakpoint.cpp
    lldb/branches/lldb-platform-work/source/Commands/CommandObjectBreakpointCommand.cpp
    lldb/branches/lldb-platform-work/source/Commands/CommandObjectExpression.cpp
    lldb/branches/lldb-platform-work/source/Commands/CommandObjectFrame.cpp
    lldb/branches/lldb-platform-work/source/Commands/CommandObjectMemory.cpp
    lldb/branches/lldb-platform-work/source/Commands/CommandObjectProcess.cpp
    lldb/branches/lldb-platform-work/source/Commands/CommandObjectTarget.cpp
    lldb/branches/lldb-platform-work/source/Commands/CommandObjectThread.cpp
    lldb/branches/lldb-platform-work/source/Commands/CommandObjectWatchpoint.cpp
    lldb/branches/lldb-platform-work/source/Core/Address.cpp
    lldb/branches/lldb-platform-work/source/Core/ConnectionFileDescriptor.cpp
    lldb/branches/lldb-platform-work/source/Core/DataExtractor.cpp
    lldb/branches/lldb-platform-work/source/Core/Debugger.cpp
    lldb/branches/lldb-platform-work/source/Core/FormatManager.cpp
    lldb/branches/lldb-platform-work/source/Core/InputReader.cpp
    lldb/branches/lldb-platform-work/source/Core/Listener.cpp
    lldb/branches/lldb-platform-work/source/Core/Mangled.cpp
    lldb/branches/lldb-platform-work/source/Core/Module.cpp
    lldb/branches/lldb-platform-work/source/Core/ModuleList.cpp
    lldb/branches/lldb-platform-work/source/Core/SearchFilter.cpp
    lldb/branches/lldb-platform-work/source/Core/Section.cpp
    lldb/branches/lldb-platform-work/source/Core/UserSettingsController.cpp
    lldb/branches/lldb-platform-work/source/Core/ValueObject.cpp
    lldb/branches/lldb-platform-work/source/Core/ValueObjectConstResult.cpp
    lldb/branches/lldb-platform-work/source/Expression/ClangExpressionDeclMap.cpp
    lldb/branches/lldb-platform-work/source/Expression/ClangUserExpression.cpp
    lldb/branches/lldb-platform-work/source/Expression/IRDynamicChecks.cpp
    lldb/branches/lldb-platform-work/source/Expression/IRForTarget.cpp
    lldb/branches/lldb-platform-work/source/Expression/IRInterpreter.cpp
    lldb/branches/lldb-platform-work/source/Host/common/Mutex.cpp
    lldb/branches/lldb-platform-work/source/Host/common/Terminal.cpp
    lldb/branches/lldb-platform-work/source/Host/macosx/Host.mm
    lldb/branches/lldb-platform-work/source/Host/macosx/Symbols.cpp
    lldb/branches/lldb-platform-work/source/Host/macosx/launcherXPCService/LauncherRootXPCService-Info.plist
    lldb/branches/lldb-platform-work/source/Host/macosx/launcherXPCService/LauncherXPCService-Info.plist
    lldb/branches/lldb-platform-work/source/Interpreter/Args.cpp
    lldb/branches/lldb-platform-work/source/Interpreter/CommandInterpreter.cpp
    lldb/branches/lldb-platform-work/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp
    lldb/branches/lldb-platform-work/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp
    lldb/branches/lldb-platform-work/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp
    lldb/branches/lldb-platform-work/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
    lldb/branches/lldb-platform-work/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
    lldb/branches/lldb-platform-work/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
    lldb/branches/lldb-platform-work/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp
    lldb/branches/lldb-platform-work/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
    lldb/branches/lldb-platform-work/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
    lldb/branches/lldb-platform-work/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
    lldb/branches/lldb-platform-work/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
    lldb/branches/lldb-platform-work/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
    lldb/branches/lldb-platform-work/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
    lldb/branches/lldb-platform-work/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp
    lldb/branches/lldb-platform-work/source/Plugins/Process/Utility/ARMUtils.h
    lldb/branches/lldb-platform-work/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
    lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
    lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
    lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
    lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
    lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
    lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
    lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
    lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp
    lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h
    lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
    lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
    lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
    lldb/branches/lldb-platform-work/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp
    lldb/branches/lldb-platform-work/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
    lldb/branches/lldb-platform-work/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h
    lldb/branches/lldb-platform-work/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp
    lldb/branches/lldb-platform-work/source/Symbol/Block.cpp
    lldb/branches/lldb-platform-work/source/Symbol/ClangASTContext.cpp
    lldb/branches/lldb-platform-work/source/Symbol/ClangASTImporter.cpp
    lldb/branches/lldb-platform-work/source/Symbol/DWARFCallFrameInfo.cpp
    lldb/branches/lldb-platform-work/source/Symbol/Function.cpp
    lldb/branches/lldb-platform-work/source/Symbol/Symbol.cpp
    lldb/branches/lldb-platform-work/source/Symbol/SymbolContext.cpp
    lldb/branches/lldb-platform-work/source/Symbol/UnwindPlan.cpp
    lldb/branches/lldb-platform-work/source/Symbol/UnwindTable.cpp
    lldb/branches/lldb-platform-work/source/Symbol/Variable.cpp
    lldb/branches/lldb-platform-work/source/Symbol/VariableList.cpp
    lldb/branches/lldb-platform-work/source/Target/Process.cpp
    lldb/branches/lldb-platform-work/source/Target/SectionLoadList.cpp
    lldb/branches/lldb-platform-work/source/Target/StackFrame.cpp
    lldb/branches/lldb-platform-work/source/Target/StackFrameList.cpp
    lldb/branches/lldb-platform-work/source/Target/StopInfo.cpp
    lldb/branches/lldb-platform-work/source/Target/Target.cpp
    lldb/branches/lldb-platform-work/source/Target/Thread.cpp
    lldb/branches/lldb-platform-work/source/Target/ThreadPlanStepInRange.cpp
    lldb/branches/lldb-platform-work/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py
    lldb/branches/lldb-platform-work/test/functionalities/data-formatter/data-formatter-objc/main.m
    lldb/branches/lldb-platform-work/test/functionalities/process_launch/TestProcessLaunch.py
    lldb/branches/lldb-platform-work/test/lang/c/struct_types/main.c
    lldb/branches/lldb-platform-work/test/lldbutil.py
    lldb/branches/lldb-platform-work/tools/darwin-debug/darwin-debug.cpp
    lldb/branches/lldb-platform-work/tools/debugserver/debugserver.xcodeproj/project.pbxproj
    lldb/branches/lldb-platform-work/tools/debugserver/debugserver.xcodeproj/xcshareddata/xcschemes/debugserver.xcscheme
    lldb/branches/lldb-platform-work/tools/debugserver/source/ChangeLog
    lldb/branches/lldb-platform-work/tools/debugserver/source/DNB.cpp
    lldb/branches/lldb-platform-work/tools/debugserver/source/DNB.h
    lldb/branches/lldb-platform-work/tools/debugserver/source/MacOSX/MachException.cpp
    lldb/branches/lldb-platform-work/tools/debugserver/source/MacOSX/MachProcess.cpp
    lldb/branches/lldb-platform-work/tools/debugserver/source/MacOSX/MachThreadList.cpp
    lldb/branches/lldb-platform-work/tools/debugserver/source/RNBRemote.cpp
    lldb/branches/lldb-platform-work/tools/debugserver/source/RNBRemote.h
    lldb/branches/lldb-platform-work/tools/debugserver/source/debugserver.cpp
    lldb/branches/lldb-platform-work/tools/driver/Driver.cpp
    lldb/branches/lldb-platform-work/tools/driver/IOChannel.cpp
    lldb/branches/lldb-platform-work/www/python-reference.html

Propchange: lldb/branches/lldb-platform-work/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Jul 23 19:12:48 2012
@@ -1 +1 @@
-/lldb/trunk:154223-159391
+/lldb/trunk:154223-160596

Modified: lldb/branches/lldb-platform-work/examples/darwin/heap_find/heap.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/examples/darwin/heap_find/heap.py?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/examples/darwin/heap_find/heap.py (original)
+++ lldb/branches/lldb-platform-work/examples/darwin/heap_find/heap.py Mon Jul 23 19:12:48 2012
@@ -13,6 +13,7 @@
 import optparse
 import os
 import os.path
+import re
 import shlex
 import string
 import tempfile
@@ -77,14 +78,59 @@
     if lldb.target.FindModule(libheap_dylib_spec):
         return None # success, 'libheap.dylib' already loaded
     return 'error: failed to load "%s"' % libheap_dylib_path
+
+def get_member_types_for_offset(value_type, offset, member_list):
+    member = value_type.GetFieldAtIndex(0)
+    search_bases = False
+    if member:
+        if member.GetOffsetInBytes() <= offset:
+            for field_idx in range (value_type.GetNumberOfFields()):
+                member = value_type.GetFieldAtIndex(field_idx)
+                member_byte_offset = member.GetOffsetInBytes()
+                member_end_byte_offset = member_byte_offset + member.type.size
+                if member_byte_offset <= offset and offset < member_end_byte_offset:
+                    member_list.append(member)
+                    get_member_types_for_offset (member.type, offset - member_byte_offset, member_list)
+                    return
+        else:
+            search_bases = True
+    else:
+        search_bases = True
+    if search_bases:
+        for field_idx in range (value_type.GetNumberOfDirectBaseClasses()):
+            member = value_type.GetDirectBaseClassAtIndex(field_idx)
+            member_byte_offset = member.GetOffsetInBytes()
+            member_end_byte_offset = member_byte_offset + member.type.size
+            if member_byte_offset <= offset and offset < member_end_byte_offset:
+                member_list.append(member)
+                get_member_types_for_offset (member.type, offset - member_byte_offset, member_list)
+                return
+        for field_idx in range (value_type.GetNumberOfVirtualBaseClasses()):
+            member = value_type.GetVirtualBaseClassAtIndex(field_idx)
+            member_byte_offset = member.GetOffsetInBytes()
+            member_end_byte_offset = member_byte_offset + member.type.size
+            if member_byte_offset <= offset and offset < member_end_byte_offset:
+                member_list.append(member)
+                get_member_types_for_offset (member.type, offset - member_byte_offset, member_list)
+                return
+
+def append_regex_callback(option, opt, value, parser):
+    try:
+        ivar_regex = re.compile(value)
+        parser.values.ivar_regex_blacklist.append(ivar_regex)
+    except:
+        print 'error: an exception was thrown when compiling the ivar regular expression for "%s"' % value
     
 def add_common_options(parser):
     parser.add_option('-v', '--verbose', action='store_true', dest='verbose', help='display verbose debug info', default=False)
+    parser.add_option('-t', '--type', action='store_true', dest='print_type', help='print the full value of the type for each matching malloc block', default=False)
     parser.add_option('-o', '--po', action='store_true', dest='print_object_description', help='print the object descriptions for any matches', default=False)
     parser.add_option('-m', '--memory', action='store_true', dest='memory', help='dump the memory for each matching block', default=False)
     parser.add_option('-f', '--format', type='string', dest='format', help='the format to use when dumping memory if --memory is specified', default=None)
+    parser.add_option('-I', '--omit-ivar-regex', type='string', action='callback', callback=append_regex_callback, dest='ivar_regex_blacklist', default=[], help='specify one or more regular expressions used to backlist any matches that are in ivars')
     parser.add_option('-s', '--stack', action='store_true', dest='stack', help='gets the stack that allocated each malloc block if MallocStackLogging is enabled', default=False)
     parser.add_option('-S', '--stack-history', action='store_true', dest='stack_history', help='gets the stack history for all allocations whose start address matches each malloc block if MallocStackLogging is enabled', default=False)
+    parser.add_option('-M', '--max-matches', type='int', dest='max_matches', help='the maximum number of matches to print', default=256)
 
 def dump_stack_history_entry(stack_history_entry, idx):
     address = int(stack_history_entry.address)
@@ -137,126 +183,113 @@
                 dump_stack_history_entry(stack_history_entry, idx)
                 idx = idx + 1
                 stack_history_entry = expr_value[idx]
-        else:
-            print 'error: expression returned => %s' % (expr_sbvalue)
     else:
         print 'error: expression failed "%s" => %s' % (expr, expr_sbvalue.error)
     
-    
-def heap_search(options, arg_str):
-    dylid_load_err = load_dylib()
-    if dylid_load_err:
-        print dylid_load_err
-        return
-    expr = None
-    arg_str_description = arg_str
-    default_memory_format = "Y" # 'Y' is "bytes with ASCII" format
-    #memory_chunk_size = 1
-    if options.type == 'pointer':
-        expr = 'find_pointer_in_heap((void *)%s)' % (arg_str)
-        arg_str_description = 'malloc block containing pointer %s' % arg_str
-        default_memory_format = "A" # 'A' is "address" format
-        #memory_chunk_size = lldb.process.GetAddressByteSize()
-    elif options.type == 'cstr':
-        expr = 'find_cstring_in_heap("%s")' % arg_str
-        arg_str_description = 'malloc block containing "%s"' % arg_str
-    elif options.type == 'addr':
-        expr = 'find_block_for_address((void *)%s)' % arg_str
-        arg_str_description = 'malloc block for %s' % arg_str
-    else:
-        print 'error: invalid type "%s"\nvalid values are "pointer", "cstr"' % options.type
-        return
-    
-    expr_sbvalue = lldb.frame.EvaluateExpression (expr)
+
+def display_match_results (options, arg_str_description, expr_sbvalue, print_no_matches = True):
     if expr_sbvalue.error.Success():
         if expr_sbvalue.unsigned:
             match_value = lldb.value(expr_sbvalue)  
             i = 0
             while 1:
+                print_entry = True
                 match_entry = match_value[i]; i += 1
+                if i >= options.max_matches:
+                    print 'error: the max number of matches (%u) was reached, use the --max-matches option to get more results' % (options.max_matches)
+                    break
                 malloc_addr = match_entry.addr.sbvalue.unsigned
                 if malloc_addr == 0:
                     break
                 malloc_size = int(match_entry.size)
                 offset = int(match_entry.offset)
+                match_addr = malloc_addr + offset
                 dynamic_value = match_entry.addr.sbvalue.GetDynamicValue(lldb.eDynamicCanRunTarget)
-                # If the type is still 'void *' then we weren't able to figure
-                # out a dynamic type for the malloc_addr
-                type_name = dynamic_value.type.name
                 description = '[%u] %s: addr = 0x%x' % (i, arg_str_description, malloc_addr)
                 if offset != 0:
                     description += ' + %u' % (offset)
                 description += ', size = %u' % (malloc_size)
-                if type_name == 'void *':
+                derefed_dynamic_value = None
+                if dynamic_value.type.name == 'void *':
                     if options.type == 'pointer' and malloc_size == 4096:
                         error = lldb.SBError()
                         data = bytearray(lldb.process.ReadMemory(malloc_addr, 16, error))
                         if data == '\xa1\xa1\xa1\xa1AUTORELEASE!':
                             description += ', type = (AUTORELEASE!)'
-                    print description
                 else:
-                    description += ', type = %s' % (type_name)
                     derefed_dynamic_value = dynamic_value.deref
-                    ivar_member = None
-                    if derefed_dynamic_value:
+                    if derefed_dynamic_value:                        
                         derefed_dynamic_type = derefed_dynamic_value.type
-                        member = derefed_dynamic_type.GetFieldAtIndex(0)
-                        search_bases = False
-                        if member:
-                            if member.GetOffsetInBytes() <= offset:
-                                for field_idx in range (derefed_dynamic_type.GetNumberOfFields()):
-                                    member = derefed_dynamic_type.GetFieldAtIndex(field_idx)
-                                    member_byte_offset = member.GetOffsetInBytes()
-                                    if member_byte_offset == offset:
-                                        ivar_member = member
-                                        break
-                            else:
-                                search_bases = True
-                        else:
-                            search_bases = True
-
-                        if not ivar_member and search_bases:
-                            for field_idx in range (derefed_dynamic_type.GetNumberOfDirectBaseClasses()):
-                                member = derefed_dynamic_type.GetDirectBaseClassAtIndex(field_idx)
-                                member_byte_offset = member.GetOffsetInBytes()
-                                if member_byte_offset == offset:
-                                    ivar_member = member
-                                    break
-                            if not ivar_member:
-                                for field_idx in range (derefed_dynamic_type.GetNumberOfVirtualBaseClasses()):
-                                    member = derefed_dynamic_type.GetVirtualBaseClassAtIndex(field_idx)
-                                    member_byte_offset = member.GetOffsetInBytes()
-                                    if member_byte_offset == offset:
-                                        ivar_member = member
-                                        break
-                    if ivar_member:
-                        description +=', ivar = %s' % (ivar_member.name)
-
-                    print description
-                    if derefed_dynamic_value:
-                        print derefed_dynamic_value
-                    if options.print_object_description:
-                        desc = dynamic_value.GetObjectDescription()
-                        if desc:
-                            print '  (%s) 0x%x %s\n' % (type_name, malloc_addr, desc)
-                if options.memory:
-                    memory_format = options.format
-                    if not memory_format:
-                        memory_format = default_memory_format
-                    cmd_result = lldb.SBCommandReturnObject()
-                    #count = malloc_size / memory_chunk_size
-                    memory_command = "memory read -f %s 0x%x 0x%x" % (memory_format, malloc_addr, malloc_addr + malloc_size)
-                    lldb.debugger.GetCommandInterpreter().HandleCommand(memory_command, cmd_result)
-                    print cmd_result.GetOutput()
-                if options.stack_history:
-                    dump_stack_history_entries(malloc_addr, 1)
-                elif options.stack:
-                    dump_stack_history_entries(malloc_addr, 0)
-        else:
-            print '%s %s was not found in any malloc blocks' % (options.type, arg_str)
+                        derefed_dynamic_type_size = derefed_dynamic_type.size
+                        derefed_dynamic_type_name = derefed_dynamic_type.name
+                        description += ', type = %s <%u>' % (derefed_dynamic_type_name, derefed_dynamic_type_size)
+                        if offset < derefed_dynamic_type_size:
+                            member_list = list();
+                            get_member_types_for_offset (derefed_dynamic_type, offset, member_list)
+                            if member_list:
+                                member_path = ''
+                                for member in member_list:
+                                    member_name = member.name
+                                    if member_name: 
+                                        if member_path:
+                                            member_path += '.'
+                                        member_path += member_name
+                                if member_path:
+                                    if options.ivar_regex_blacklist:
+                                        for ivar_regex in options.ivar_regex_blacklist:
+                                            if ivar_regex.match(member_path):
+                                                print_entry = False
+                                    description += ', ivar = %s' % (member_path)
+                if print_entry:
+                    if description:
+                        print description
+                        if options.print_type and derefed_dynamic_value:
+                            print derefed_dynamic_value
+                        if options.print_object_description and dynamic_value:
+                            desc = dynamic_value.GetObjectDescription()
+                            if desc:
+                                print '  (%s) 0x%x %s\n' % (type_name, malloc_addr, desc)
+                    if options.memory:
+                        cmd_result = lldb.SBCommandReturnObject()
+                        memory_command = "memory read -f %s 0x%x 0x%x" % (options.format, malloc_addr, malloc_addr + malloc_size)
+                        lldb.debugger.GetCommandInterpreter().HandleCommand(memory_command, cmd_result)
+                        print cmd_result.GetOutput()
+                    if options.stack_history:
+                        dump_stack_history_entries(malloc_addr, 1)
+                    elif options.stack:
+                        dump_stack_history_entries(malloc_addr, 0)
+            return i
+        elif print_no_matches:
+            print 'no matches found for %s' % (arg_str_description)
     else:
         print expr_sbvalue.error
-    print     
+    return 0
+    
+def heap_search(options, arg_str):
+    dylid_load_err = load_dylib()
+    if dylid_load_err:
+        print dylid_load_err
+        return
+    expr = None
+    arg_str_description = arg_str
+    if options.format == None: 
+        options.format = "Y" # 'Y' is "bytes with ASCII" format
+    if options.type == 'pointer':
+        expr = 'find_pointer_in_heap((void *)%s)' % (arg_str)
+        arg_str_description = 'malloc block containing pointer %s' % arg_str
+        if options.format == None: 
+            options.format = "A" # 'A' is "address" format
+    elif options.type == 'cstr':
+        expr = 'find_cstring_in_heap("%s")' % arg_str
+        arg_str_description = 'malloc block containing "%s"' % arg_str
+    elif options.type == 'addr':
+        expr = 'find_block_for_address((void *)%s)' % arg_str
+        arg_str_description = 'malloc block for %s' % arg_str
+    else:
+        print 'error: invalid type "%s"\nvalid values are "pointer", "cstr"' % options.type
+        return
+    
+    display_match_results (options, arg_str_description, lldb.frame.EvaluateExpression (expr))
     
 def ptr_refs(debugger, command, result, dict):
     command_args = shlex.split(command)
@@ -351,6 +384,52 @@
         else:
             print 'error: no address expressions were specified'
 
+def section_ptr_refs(debugger, command, result, dict):
+    command_args = shlex.split(command)
+    usage = "usage: %prog [options] <EXPR> [EXPR ...]"
+    description='''Searches section contents for pointer values in darwin user space programs.'''
+    parser = optparse.OptionParser(description=description, prog='section_ptr_refs',usage=usage)
+    add_common_options(parser)
+    parser.add_option('--section', action='append', type='string', dest='section_names', help='section name to search', default=list())
+    try:
+        (options, args) = parser.parse_args(command_args)
+    except:
+        return
+
+    options.type = 'pointer'
+    
+    sections = list()
+    section_modules = list()
+    if not options.section_names:
+        print 'error: at least one section must be specified with the --section option'
+        return
+
+    for module in lldb.target.modules:
+        for section_name in options.section_names:
+            section = module.section[section_name]
+            if section:
+                sections.append (section)
+                section_modules.append (module)
+    if sections:
+        dylid_load_err = load_dylib()
+        if dylid_load_err:
+            print dylid_load_err
+            return
+        for expr_str in args:
+            for (idx, section) in enumerate(sections):
+                expr = 'find_pointer_in_memory(0x%xllu, %ullu, (void *)%s)' % (section.addr.load_addr, section.size, expr_str)
+                arg_str_description = 'section %s.%s containing "%s"' % (section_modules[idx].file.fullpath, section.name, expr_str)
+                num_matches = display_match_results (options, arg_str_description, lldb.frame.EvaluateExpression (expr), False)
+                if num_matches:
+                    if num_matches < options.max_matches:
+                        options.max_matches = options.max_matches - num_matches
+                    else:
+                        options.max_matches = 0
+                if options.max_matches == 0:
+                    return
+    else:
+        print 'error: no sections were found that match any of %s' % (', '.join(options.section_names))
+
 if __name__ == '__main__':
     lldb.debugger = lldb.SBDebugger.Create()
 
@@ -360,7 +439,8 @@
 lldb.debugger.HandleCommand('command script add -f lldb.macosx.heap.cstr_refs cstr_refs')
 lldb.debugger.HandleCommand('command script add -f lldb.macosx.heap.malloc_info malloc_info')
 lldb.debugger.HandleCommand('command script add -f lldb.macosx.heap.malloc_history malloc_history')
-print '"ptr_refs", "cstr_refs", "malloc_info", and "malloc_history" commands have been installed, use the "--help" options on these commands for detailed help.'
+lldb.debugger.HandleCommand('command script add -f lldb.macosx.heap.section_ptr_refs section_ptr_refs')
+print '"ptr_refs", "cstr_refs", "malloc_info", "malloc_history" and "section_ptr_refs" commands have been installed, use the "--help" options on these commands for detailed help.'
 
 
 

Modified: lldb/branches/lldb-platform-work/examples/darwin/heap_find/heap/heap_find.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/examples/darwin/heap_find/heap/heap_find.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/examples/darwin/heap_find/heap/heap_find.cpp (original)
+++ lldb/branches/lldb-platform-work/examples/darwin/heap_find/heap/heap_find.cpp Mon Jul 23 19:12:48 2012
@@ -416,6 +416,33 @@
     return g_matches.data();
 }
 
+//----------------------------------------------------------------------
+// find_pointer_in_memory
+//
+// Finds a pointer value inside one or more currently valid malloc
+// blocks.
+//----------------------------------------------------------------------
+malloc_match *
+find_pointer_in_memory (uint64_t memory_addr, uint64_t memory_size, const void * addr)
+{
+    g_matches.clear();
+    // Setup "info" to look for a malloc block that contains data
+    // that is the a pointer 
+    range_contains_data_callback_info_t data_info;
+    data_info.type = eDataTypeContainsData;      // Check each block for data
+    g_lookup_addr = addr;
+    data_info.data.buffer = (uint8_t *)&addr;    // What data? The pointer value passed in
+    data_info.data.size = sizeof(addr);          // How many bytes? The byte size of a pointer
+    data_info.data.align = sizeof(addr);         // Align to a pointer byte size
+    data_info.match_count = 0;                   // Initialize the match count to zero
+    data_info.done = false;                      // Set done to false so searching doesn't stop
+    range_info_callback (mach_task_self(), &data_info, stack_logging_type_generic, memory_addr, memory_size);
+    if (g_matches.empty())
+        return NULL;
+    malloc_match match = { NULL, 0, 0 };
+    g_matches.push_back(match);
+    return g_matches.data();
+}
 
 //----------------------------------------------------------------------
 // find_cstring_in_heap

Modified: lldb/branches/lldb-platform-work/examples/python/crashlog.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/examples/python/crashlog.py?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/examples/python/crashlog.py (original)
+++ lldb/branches/lldb-platform-work/examples/python/crashlog.py Mon Jul 23 19:12:48 2012
@@ -64,6 +64,7 @@
         def __init__(self, index):
             self.index = index
             self.frames = list()
+            self.idents = list()
             self.registers = dict()
             self.reason = None
             self.queue = None
@@ -79,6 +80,10 @@
                 for reg in self.registers.keys():
                     print "%s    %-5s = %#16.16x" % (prefix, reg, self.registers[reg])
         
+        def add_ident(self, ident):
+            if not ident in self.idents:
+                self.idents.append(ident)
+            
         def did_crash(self):
             return self.reason != None
         
@@ -280,6 +285,7 @@
                 frame_match = self.frame_regex.search(line)
                 if frame_match:
                     ident = frame_match.group(2)
+                    thread.add_ident(ident)
                     if not ident in self.idents:
                         self.idents.append(ident)
                     thread.frames.append (CrashLog.Frame(int(frame_match.group(1)), int(frame_match.group(3), 0), frame_match.group(4)))
@@ -370,6 +376,7 @@
     
     def __init__(self, crash_logs):
         cmd.Cmd.__init__(self)
+        self.use_rawinput = False
         self.intro = 'Interactive crashlogs prompt, type "help" to see a list of supported commands.'
         self.crash_logs = crash_logs
         self.prompt = '% '
@@ -398,12 +405,18 @@
         except:
             return
 
-        for idx_str in args:
-            idx = int(idx_str)
-            if idx < len(self.crash_logs):
-                SymbolicateCrashLog (self.crash_logs[idx], options)
-            else:
-                print 'error: crash log index %u is out of range' % (idx)
+        if args:
+            # We have arguments, they must valid be crash log file indexes
+            for idx_str in args:
+                idx = int(idx_str)
+                if idx < len(self.crash_logs):
+                    SymbolicateCrashLog (self.crash_logs[idx], options)
+                else:
+                    print 'error: crash log index %u is out of range' % (idx)
+        else:
+            # No arguments, symbolicate all crash logs using the options provided
+            for idx in range(len(self.crash_logs)):
+                SymbolicateCrashLog (self.crash_logs[idx], options)                
     
     def do_list(self, line=None):
         '''Dump a list of all crash logs that are currently loaded.
@@ -414,12 +427,9 @@
             print '[%u] = %s' % (crash_log_idx, crash_log.path)
 
     def do_image(self, line):
-        '''Dump information about an image in the crash log given an image basename.
-        
-        USAGE: image <basename>'''
+        '''Dump information about one or more binary images in the crash log given an image basename, or all images if no arguments are provided.'''
         usage = "usage: %prog [options] <PATH> [PATH ...]"
-        description='''Dump information about one or more images in all crash logs. The <PATH>
-        can be a full path or a image basename.'''
+        description='''Dump information about one or more images in all crash logs. The <PATH> can be a full path, image basename, or partial path. Searches are done in this order.'''
         command_args = shlex.split(line)
         if not self.image_option_parser:
             self.image_option_parser = optparse.OptionParser(description=description, prog='image',usage=usage)
@@ -432,23 +442,23 @@
         if args:
             for image_path in args:
                 fullpath_search = image_path[0] == '/'
-                for crash_log in self.crash_logs:
+                for (crash_log_idx, crash_log) in enumerate(self.crash_logs):
                     matches_found = 0
                     for (image_idx, image) in enumerate(crash_log.images):
                         if fullpath_search:
                             if image.get_resolved_path() == image_path:
                                 matches_found += 1
-                                print image
+                                print '[%u] ' % (crash_log_idx), image
                         else:
                             image_basename = image.get_resolved_path_basename()
                             if image_basename == image_path:
                                 matches_found += 1
-                                print image
+                                print '[%u] ' % (crash_log_idx), image
                     if matches_found == 0:
                         for (image_idx, image) in enumerate(crash_log.images):
                             resolved_image_path = image.get_resolved_path()
                             if resolved_image_path and string.find(image.get_resolved_path(), image_path) >= 0:
-                                print image
+                                print '[%u] ' % (crash_log_idx), image
         else:
             for crash_log in self.crash_logs:
                 for (image_idx, image) in enumerate(crash_log.images):
@@ -588,13 +598,24 @@
             images_to_load.append(image)
     else:
         # Only load the images found in stack frames for the crashed threads
-        for ident in crash_log.idents:
-            images = crash_log.find_images_with_identifier (ident)
-            if images:
-                for image in images:
-                    images_to_load.append(image)
-            else:
-                print 'error: can\'t find image for identifier "%s"' % ident
+        if options.crashed_only:
+            for thread in crash_log.threads:
+                if thread.did_crash():
+                    for ident in thread.idents:
+                        images = crash_log.find_images_with_identifier (ident)
+                        if images:
+                            for image in images:
+                                images_to_load.append(image)
+                        else:
+                            print 'error: can\'t find image for identifier "%s"' % ident
+        else:
+            for ident in crash_log.idents:
+                images = crash_log.find_images_with_identifier (ident)
+                if images:
+                    for image in images:
+                        images_to_load.append(image)
+                else:
+                    print 'error: can\'t find image for identifier "%s"' % ident
 
     for image in images_to_load:
         if image in loaded_images:
@@ -613,6 +634,7 @@
             continue
         print "%s" % thread
         #prev_frame_index = -1
+        display_frame_idx = -1
         for frame_idx, frame in enumerate(thread.frames):
             disassemble = (this_thread_crashed or options.disassemble_all_threads) and frame_idx < options.disassemble_depth;
             if frame_idx == 0:
@@ -624,8 +646,21 @@
             if symbolicated_frame_addresses:
                 symbolicated_frame_address_idx = 0
                 for symbolicated_frame_address in symbolicated_frame_addresses:
+                    display_frame_idx += 1
                     print '[%3u] %s' % (frame_idx, symbolicated_frame_address)
-                
+                    if (options.source_all or thread.did_crash()) and display_frame_idx < options.source_frames and options.source_context:
+                        source_context = options.source_context
+                        line_entry = symbolicated_frame_address.get_symbol_context().line_entry
+                        if line_entry.IsValid():
+                            strm = lldb.SBStream()
+                            if line_entry:
+                                lldb.debugger.GetSourceManager().DisplaySourceLinesWithLineNumbers(line_entry.file, line_entry.line, source_context, source_context, "->", strm)
+                            source_text = strm.GetData()
+                            if source_text:
+                                # Indent the source a bit
+                                indent_str = '    '
+                                join_str = '\n' + indent_str
+                                print '%s%s' % (indent_str, join_str.join(source_text.split('\n')))
                     if symbolicated_frame_address_idx == 0:
                         if disassemble:
                             instructions = symbolicated_frame_address.get_instructions()
@@ -650,16 +685,19 @@
 def CreateSymbolicateCrashLogOptions(command_name, description, add_interactive_options):
     usage = "usage: %prog [options] <FILE> [FILE ...]"
     option_parser = optparse.OptionParser(description=description, prog='crashlog',usage=usage)
-    option_parser.add_option('-v', '--verbose', action='store_true', dest='verbose', help='display verbose debug info', default=False)
-    option_parser.add_option('-g', '--debug', action='store_true', dest='debug', help='display verbose debug logging', default=False)
-    option_parser.add_option('-a', '--load-all', action='store_true', dest='load_all_images', help='load all executable images, not just the images found in the crashed stack frames', default=False)
-    option_parser.add_option('--images', action='store_true', dest='dump_image_list', help='show image list', default=False)
-    option_parser.add_option('--debug-delay', type='int', dest='debug_delay', metavar='NSEC', help='pause for NSEC seconds for debugger', default=0)
-    option_parser.add_option('-c', '--crashed-only', action='store_true', dest='crashed_only', help='only symbolicate the crashed thread', default=False)
-    option_parser.add_option('-d', '--disasm-depth', type='int', dest='disassemble_depth', help='set the depth in stack frames that should be disassembled (default is 1)', default=1)
-    option_parser.add_option('-D', '--disasm-all', action='store_true', dest='disassemble_all_threads', help='enabled disassembly of frames on all threads (not just the crashed thread)', default=False)
-    option_parser.add_option('-B', '--disasm-before', type='int', dest='disassemble_before', help='the number of instructions to disassemble before the frame PC', default=4)
-    option_parser.add_option('-A', '--disasm-after', type='int', dest='disassemble_after', help='the number of instructions to disassemble after the frame PC', default=4)
+    option_parser.add_option('--verbose'       , '-v', action='store_true', dest='verbose', help='display verbose debug info', default=False)
+    option_parser.add_option('--debug'         , '-g', action='store_true', dest='debug', help='display verbose debug logging', default=False)
+    option_parser.add_option('--load-all'      , '-a', action='store_true', dest='load_all_images', help='load all executable images, not just the images found in the crashed stack frames', default=False)
+    option_parser.add_option('--images'        ,       action='store_true', dest='dump_image_list', help='show image list', default=False)
+    option_parser.add_option('--debug-delay'   ,       type='int', dest='debug_delay', metavar='NSEC', help='pause for NSEC seconds for debugger', default=0)
+    option_parser.add_option('--crashed-only'  , '-c', action='store_true', dest='crashed_only', help='only symbolicate the crashed thread', default=False)
+    option_parser.add_option('--disasm-depth'  , '-d', type='int', dest='disassemble_depth', help='set the depth in stack frames that should be disassembled (default is 1)', default=1)
+    option_parser.add_option('--disasm-all'    , '-D',  action='store_true', dest='disassemble_all_threads', help='enabled disassembly of frames on all threads (not just the crashed thread)', default=False)
+    option_parser.add_option('--disasm-before' , '-B', type='int', dest='disassemble_before', help='the number of instructions to disassemble before the frame PC', default=4)
+    option_parser.add_option('--disasm-after'  , '-A', type='int', dest='disassemble_after', help='the number of instructions to disassemble after the frame PC', default=4)
+    option_parser.add_option('--source-context', '-C', type='int', metavar='NLINES', dest='source_context', help='show NLINES source lines of source context (default = 4)', default=4)
+    option_parser.add_option('--source-frames' ,       type='int', metavar='NFRAMES', dest='source_frames', help='show source for NFRAMES (default = 4)', default=4)
+    option_parser.add_option('--source-all'    ,       action='store_true', dest='source_all', help='show source for all threads, not just the crashed thread', default=False)
     if add_interactive_options:
         option_parser.add_option('-i', '--interactive', action='store_true', help='parse all crash logs and enter interactive mode', default=False)
     return option_parser

Modified: lldb/branches/lldb-platform-work/examples/python/symbolication.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/examples/python/symbolication.py?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/examples/python/symbolication.py (original)
+++ lldb/branches/lldb-platform-work/examples/python/symbolication.py Mon Jul 23 19:12:48 2012
@@ -408,31 +408,30 @@
             image = self.find_image_containing_load_addr (load_addr)
             if image:
                 image.add_module (self.target)
-                symbolicated_address = Address(self.target, load_addr)
-                if symbolicated_address.symbolicate (verbose):
+            symbolicated_address = Address(self.target, load_addr)
+            if symbolicated_address.symbolicate (verbose):
+                if symbolicated_address.so_addr:
+                    symbolicated_addresses = list()
+                    symbolicated_addresses.append(symbolicated_address)
+                    # See if we were able to reconstruct anything?
+                    while 1:
+                        inlined_parent_so_addr = lldb.SBAddress()
+                        inlined_parent_sym_ctx = symbolicated_address.sym_ctx.GetParentOfInlinedScope (symbolicated_address.so_addr, inlined_parent_so_addr)
+                        if not inlined_parent_sym_ctx:
+                            break
+                        if not inlined_parent_so_addr:
+                            break
+
+                        symbolicated_address = Address(self.target, inlined_parent_so_addr.GetLoadAddress(self.target))
+                        symbolicated_address.sym_ctx = inlined_parent_sym_ctx
+                        symbolicated_address.so_addr = inlined_parent_so_addr
+                        symbolicated_address.symbolicate (verbose)
             
-                    if symbolicated_address.so_addr:
-                        symbolicated_addresses = list()
-                        symbolicated_addresses.append(symbolicated_address)
-                        # See if we were able to reconstruct anything?
-                        while 1:
-                            inlined_parent_so_addr = lldb.SBAddress()
-                            inlined_parent_sym_ctx = symbolicated_address.sym_ctx.GetParentOfInlinedScope (symbolicated_address.so_addr, inlined_parent_so_addr)
-                            if not inlined_parent_sym_ctx:
-                                break
-                            if not inlined_parent_so_addr:
-                                break
-
-                            symbolicated_address = Address(self.target, inlined_parent_so_addr.GetLoadAddress(self.target))
-                            symbolicated_address.sym_ctx = inlined_parent_sym_ctx
-                            symbolicated_address.so_addr = inlined_parent_so_addr
-                            symbolicated_address.symbolicate (verbose)
-                
-                            # push the new frame onto the new frame stack
-                            symbolicated_addresses.append (symbolicated_address)
-            
-                        if symbolicated_addresses:
-                            return symbolicated_addresses
+                        # push the new frame onto the new frame stack
+                        symbolicated_addresses.append (symbolicated_address)
+        
+                    if symbolicated_addresses:
+                        return symbolicated_addresses
         else:
             print 'error: no target in Symbolicator'
         return None

Modified: lldb/branches/lldb-platform-work/examples/summaries/cocoa/NSNumber.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/examples/summaries/cocoa/NSNumber.py?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/examples/summaries/cocoa/NSNumber.py (original)
+++ lldb/branches/lldb-platform-work/examples/summaries/cocoa/NSNumber.py Mon Jul 23 19:12:48 2012
@@ -45,13 +45,13 @@
 		# unfortunately, the original type information appears to be lost
 		# so we try to at least recover the proper magnitude of the data
 		if self.info_bits == 0:
-			return '(char)' + str(self.data % 256)
+			return '(char)' + str(ord(ctypes.c_char(chr(self.data % 256)).value))
 		if self.info_bits == 4:
-			return '(short)' + str(self.data % (256*256))
+			return '(short)' + str(ctypes.c_short(self.data % (256*256)).value)
 		if self.info_bits == 8:
-			return '(int)' + str(self.data % (256*256*256*256))
+			return '(int)' + str(ctypes.c_int(self.data % (256*256*256*256)).value)
 		if self.info_bits == 12:
-			return '(long)' + str(self.data)
+			return '(long)' + str(ctypes.c_long(self.data).value)
 		else:
 			return 'absurd value:(info=' + str(self.info_bits) + ", value = " + str(self.data) + ')'
 
@@ -106,13 +106,13 @@
 								data_offset,
 								self.sys_params.types_cache.char)
 			statistics.metric_hit('code_notrun',self.valobj)
-			return '(char)' + str(data_vo.GetValueAsUnsigned(0))
+			return '(char)' + str(ord(ctypes.c_char(chr(data_vo.GetValueAsUnsigned(0))).value))
 		elif data_type == 0B0010:
 			data_vo = self.valobj.CreateChildAtOffset("data",
 								data_offset,
 								self.sys_params.types_cache.short)
 			statistics.metric_hit('code_notrun',self.valobj)
-			return '(short)' + str(data_vo.GetValueAsUnsigned(0) % (256*256))
+			return '(short)' + str(ctypes.c_short(data_vo.GetValueAsUnsigned(0) % (256*256)).value)
 		# IF tagged pointers are possible on 32bit+v2 runtime
 		# (of which the only existing instance should be iOS)
 		# then values of this type might be tagged
@@ -121,7 +121,7 @@
 								data_offset,
 								self.sys_params.types_cache.int)
 			statistics.metric_hit('code_notrun',self.valobj)
-			return '(int)' + str(data_vo.GetValueAsUnsigned(0) % (256*256*256*256))
+			return '(int)' + str(ctypes.c_int(data_vo.GetValueAsUnsigned(0)% (256*256*256*256)).value)
 		# apparently, on is_64_bit architectures, these are the only values that will ever
 		# be represented by a non tagged pointers
 		elif data_type == 0B10001:
@@ -130,7 +130,7 @@
 								data_offset,
 								self.sys_params.types_cache.longlong)
 			statistics.metric_hit('code_notrun',self.valobj)
-			return '(long)' + str(data_vo.GetValueAsUnsigned(0))
+			return '(long)' + str(ctypes.c_long(data_vo.GetValueAsUnsigned(0)).value)
 		elif data_type == 0B0100:
 			if self.sys_params.is_64_bit:
 				data_offset = data_offset + self.sys_params.pointer_size
@@ -138,7 +138,7 @@
 								data_offset,
 								self.sys_params.types_cache.longlong)
 			statistics.metric_hit('code_notrun',self.valobj)
-			return '(long)' + str(data_vo.GetValueAsUnsigned(0))
+			return '(long)' + str(ctypes.c_long(data_vo.GetValueAsUnsigned(0)).value)
 		elif data_type == 0B0101:
 			data_vo = self.valobj.CreateChildAtOffset("data",
 								data_offset,
@@ -216,7 +216,9 @@
 			return provider.message()
 		try:
 			summary = provider.value();
-		except:
+		except Exception as foo:
+			print foo
+#		except:
 			summary = None
 		logger >> "got summary " + str(summary)
 		if summary == None:

Modified: lldb/branches/lldb-platform-work/examples/summaries/objc.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/examples/summaries/objc.py?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/examples/summaries/objc.py (original)
+++ lldb/branches/lldb-platform-work/examples/summaries/objc.py Mon Jul 23 19:12:48 2012
@@ -2,8 +2,15 @@
 # to be generated fit into this file
 
 def BOOL_SummaryProvider (valobj,dict):
+	if  not (valobj.IsValid()):
+		return "<invalid>"
 	if valobj.GetValueAsUnsigned() == 0:
 		return "NO"
 	else:
 		return "YES"
-		
+
+def BOOLRef_SummaryProvider (valobj, dict):
+	return  BOOL_SummaryProvider (valobj.GetChildAtIndex(0),dict)
+
+def BOOLPtr_SummaryProvider (valobj,dict):
+	return BOOL_SummaryProvider (valobj.Dereference(),dict)

Modified: lldb/branches/lldb-platform-work/include/lldb/API/SBProcess.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/API/SBProcess.h?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/API/SBProcess.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/API/SBProcess.h Mon Jul 23 19:12:48 2012
@@ -105,6 +105,9 @@
     GetThreadByID (lldb::tid_t sb_thread_id);
 
     lldb::SBThread
+    GetThreadByIndexID (uint32_t index_id);
+
+    lldb::SBThread
     GetSelectedThread () const;
 
     bool
@@ -112,6 +115,9 @@
 
     bool
     SetSelectedThreadByID (uint32_t tid);
+    
+    bool
+    SetSelectedThreadByIndexID (uint32_t index_id);
 
     //------------------------------------------------------------------
     // Stepping related functions
@@ -216,7 +222,7 @@
     void
     SetSP (const lldb::ProcessSP &process_sp);
 
-    lldb::ProcessSP m_opaque_sp;
+    lldb::ProcessWP m_opaque_wp;
 };
 
 }  // namespace lldb

Modified: lldb/branches/lldb-platform-work/include/lldb/API/SBTarget.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/API/SBTarget.h?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/API/SBTarget.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/API/SBTarget.h Mon Jul 23 19:12:48 2012
@@ -15,6 +15,7 @@
 #include "lldb/API/SBBroadcaster.h"
 #include "lldb/API/SBFileSpec.h"
 #include "lldb/API/SBFileSpecList.h"
+#include "lldb/API/SBSymbolContextList.h"
 #include "lldb/API/SBType.h"
 #include "lldb/API/SBWatchpoint.h"
 
@@ -151,6 +152,12 @@
     void
     SetWaitForLaunch (bool b);
     
+    bool
+    GetIgnoreExisting ();
+    
+    void
+    SetIgnoreExisting (bool b);
+    
     uint32_t
     GetResumeCount ();
     

Modified: lldb/branches/lldb-platform-work/include/lldb/Core/Address.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Core/Address.h?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Core/Address.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Core/Address.h Mon Jul 23 19:12:48 2012
@@ -86,8 +86,10 @@
                                         ///< and file and line), to information about what the pointer points to
                                         ///< if the address is in a section (section of pointers, c strings, etc).
         DumpStyleResolvedDescriptionNoModule,
-        DumpStyleDetailedSymbolContext  ///< Detailed symbol context information for an address for all symbol
+        DumpStyleDetailedSymbolContext, ///< Detailed symbol context information for an address for all symbol
                                         ///< context members.
+        DumpStyleResolvedPointerDescription ///< Dereference a pointer at the current address and then lookup the
+                                             ///< dereferenced address using DumpStyleResolvedDescription
     } DumpStyle;
 
     //------------------------------------------------------------------

Modified: lldb/branches/lldb-platform-work/include/lldb/Core/ConnectionFileDescriptor.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Core/ConnectionFileDescriptor.h?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Core/ConnectionFileDescriptor.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Core/ConnectionFileDescriptor.h Mon Jul 23 19:12:48 2012
@@ -20,6 +20,7 @@
 // Project includes
 #include "lldb/Core/Connection.h"
 #include "lldb/Host/Mutex.h"
+#include "lldb/Host/Predicate.h"
 #include "lldb/Host/SocketAddress.h"
 
 namespace lldb_private {
@@ -70,6 +71,12 @@
 
 protected:
     
+    void
+    InitializeCommandFileDescriptor ();
+    
+    void
+    CloseCommandFileDescriptor ();
+
     lldb::ConnectionStatus
     BytesAvailable (uint32_t timeout_usec, Error *error_ptr);
     
@@ -105,7 +112,11 @@
     SocketAddress m_udp_send_sockaddr;
     bool m_should_close_fd; // True if this class should close the file descriptor when it goes away.
     uint32_t m_socket_timeout_usec;
-    Mutex m_mutex;
+    int m_command_fd_send;       // A pipe that we select on the reading end of along with
+    int m_command_fd_receive;    // m_fd_recv so we can force ourselves out of the select.
+    Mutex m_mutex;          
+    bool m_shutting_down;        // This marks that we are shutting down so if we get woken up from BytesAvailable
+                                 // to disconnect, we won't try to read again.
     
     static in_port_t
     GetSocketPort (int fd);

Modified: lldb/branches/lldb-platform-work/include/lldb/Core/EmulateInstruction.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Core/EmulateInstruction.h?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Core/EmulateInstruction.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Core/EmulateInstruction.h Mon Jul 23 19:12:48 2012
@@ -57,26 +57,26 @@
 /// Instruction Set Architecture (ISA) will be emulated. 
 ///
 /// Subclasses at the very least should implement the instructions that
-/// save and restore regiters onto the stack and adjustment to the stack
+/// save and restore registers onto the stack and adjustment to the stack
 /// pointer. By just implementing a few instructions for an ISA that are
 /// the typical prologue opcodes, you can then generate CFI using a 
 /// class that will soon be available.
 /// 
-/// Implmenting all of the instructions that affect the PC can then
+/// Implementing all of the instructions that affect the PC can then
 /// allow single step prediction support.
 ///
-/// Implmenting all of the instructions allows for emulation of opcodes
+/// Implementing all of the instructions allows for emulation of opcodes
 /// for breakpoint traps and will pave the way for "thread centric"
 /// debugging. The current debugging model is "process centric" where
-/// all threads must be stopped when any thread is stopped since when
-/// hitting software breakpoints once must disable the breakpoint by
+/// all threads must be stopped when any thread is stopped; when
+/// hitting software breakpoints we must disable the breakpoint by
 /// restoring the original breakpoint opcde, single stepping and 
 /// restoring the breakpoint trap. If all threads were allowed to run
 /// then other threads could miss the breakpoint. 
 ///
 /// This class centralizes the code that usually is done in separate 
 /// code paths in a debugger (single step prediction, finding save
-/// restore locations of registers for unwinding stack frame variables,
+/// restore locations of registers for unwinding stack frame variables)
 /// and emulating the intruction is just a bonus.
 //----------------------------------------------------------------------
 
@@ -98,7 +98,7 @@
         // Read an instruciton opcode from memory
         eContextReadOpcode,
         
-        // Usually used for writing a register value whose source value in an 
+        // Usually used for writing a register value whose source value is an 
         // immediate
         eContextImmediate,
 

Modified: lldb/branches/lldb-platform-work/include/lldb/Core/Mangled.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Core/Mangled.h?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Core/Mangled.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Core/Mangled.h Mon Jul 23 19:12:48 2012
@@ -33,24 +33,6 @@
 class Mangled
 {
 public:
-
-    //------------------------------------------------------------------
-    /// Token type enumerations.
-    //------------------------------------------------------------------
-    enum TokenType
-    {
-        eInvalid,       ///< Invalid token value (unitialized value)
-        eNameSpace,     ///< The token is a namespace name.
-        eMethodName,    ///< The token is a global or class method name
-        eType,          ///< The token is a language type
-        eTemplate,      ///< The token is a template class
-        eTemplateBeg,   ///< The token that indicates the start of a template parameters
-        eTemplateEnd,   ///< The token that indicates the end of a template parameters
-        eParamsBeg,     ///< The start of a method's parameters (the open parenthesis)
-        eParamsEnd,     ///< The end of a method's parameters (the open parenthesis)
-        eQualifier,     ///< A language qualifier
-        eError          ///< The token failed to parse
-    };
     
     enum NamePreference
     {
@@ -58,224 +40,6 @@
         ePreferDemangled
     };
 
-    //------------------------------------------------------------------
-    /// Mangled::Token structure
-    ///
-    /// As demangled names get tokenized, they get broken up into chunks
-    /// that have type enumerations (TokenType) and string values. Some of
-    /// the tokens are scopes (eTemplateBeg, eTemplateEnd, eParamsBeg,
-    /// eParamsEnd) that can indicate depth and searches can take
-    /// advantage of these to match using wildcards.
-    ///
-    /// For example the mangled string:
-    ///
-    ///     "_ZNSbIhSt11char_traitsIhESaIhEE5eraseEmm"
-    ///
-    /// Demangles to:
-    ///
-    ///     "std::basic_string<unsigned char, std::char_traits<unsigned char>, std::allocator<unsigned char> >::erase(unsigned long, unsigned long)"
-    ///
-    /// And tokenizes to:
-    ///     @li eNameSpace ("std")
-    ///     @li eTemplate ("basic_string")
-    ///     @li eTemplateBeg ()
-    ///     @li eType ("unsigned char")
-    ///     @li eNameSpace ("std")
-    ///     @li eTemplate ("char_traits")
-    ///     @li eTemplateBeg ()
-    ///     @li eType ("unsigned char")
-    ///     @li eTemplateEnd ()
-    ///     @li eNameSpace ("std")
-    ///     @li eTemplate ("allocator")
-    ///     @li eTemplateBeg ()
-    ///     @li eType ("unsigned char"
-    ///     @li eTemplateEnd ()
-    ///     @li eTemplateEnd ()
-    ///     @li eMethodName ("erase")
-    ///     @li eParamsBeg ()
-    ///     @li eType ("unsigned long")
-    ///     @li eType ("unsigned long")
-    ///     @li eParamsEnd ()
-    ///------------------------------------------------------------------
-    struct Token
-    {
-        //--------------------------------------------------------------
-        /// Default constructor.
-        ///
-        /// Constructs this objet with an invalid token type and an
-        /// empty string.
-        //--------------------------------------------------------------
-        Token();
-
-        //--------------------------------------------------------------
-        /// Equal to operator.
-        ///
-        /// Tests if this object is equal to \a rhs.
-        ///
-        /// @param[in] rhs
-        ///     A const Mangled::Token object reference to compare
-        ///     this object to.
-        ///
-        /// @return
-        ///     \b true if this object is equal to \a rhs, \b false
-        ///     otherwise.
-        //--------------------------------------------------------------
-        bool
-        operator== (const Token& rhs) const;
-
-        //--------------------------------------------------------------
-        /// Dump a description of this object to a Stream \a s.
-        ///
-        /// @param[in] s
-        ///     The stream to which to dump the object descripton.
-        //--------------------------------------------------------------
-        void
-        Dump (Stream *s) const;
-
-        //--------------------------------------------------------------
-        /// Test if this token is a wildcard token.
-        ///
-        /// @return
-        ///     Returns \b true if this token is a wildcard, \b false
-        ///     otherwise.
-        //--------------------------------------------------------------
-        bool
-        IsWildcard() const;
-
-        //--------------------------------------------------------------
-        /// Members
-        //--------------------------------------------------------------
-        TokenType       type;   ///< The type of the token (Mangled::TokenType)
-        ConstString value;  ///< The ConstString value associated with this token
-    };
-
-    //------------------------------------------------------------------
-    /// A collection of tokens.
-    ///
-    /// This class can be instantiated with a demangled names that can
-    /// be used as a query using the
-    /// Mangled::TokenList::MatchesQuery(const TokenList&) const
-    /// function.
-    //------------------------------------------------------------------
-    class TokenList
-    {
-    public:
-        //--------------------------------------------------------------
-        /// Construct with a demangled name.
-        ///
-        /// If demangled is valid the token list will parse up the
-        /// demangled string it is given, else the object will
-        /// initialize an empty token list.
-        //--------------------------------------------------------------
-        TokenList (const char *demangled = NULL);
-
-        //--------------------------------------------------------------
-        /// Destructor
-        //--------------------------------------------------------------
-        ~TokenList ();
-
-        //--------------------------------------------------------------
-        /// Clear the token list.
-        //--------------------------------------------------------------
-        void
-        Clear ();
-
-        //--------------------------------------------------------------
-        /// Dump a description of this object to a Stream \a s.
-        ///
-        /// @param[in] s
-        ///     The stream to which to dump the object descripton.
-        //--------------------------------------------------------------
-        void
-        Dump (Stream *s) const;
-
-        //--------------------------------------------------------------
-        /// Find a token by Mangled::TokenType.
-        ///
-        /// Find the first token in the list that has \a token_type as
-        /// its type.
-        //--------------------------------------------------------------
-        const Token*
-        Find (TokenType token_type) const;
-
-        //--------------------------------------------------------------
-        /// Get a token by index.
-        ///
-        /// @return
-        ///     The token at index \a idx, or NULL if the index is out
-        ///     of range.
-        //--------------------------------------------------------------
-        const Token*
-        GetTokenAtIndex (uint32_t idx) const;
-
-        //--------------------------------------------------------------
-        /// Given a token list, see if it matches this object's tokens.
-        /// \a token_list can contain wild card values to enable powerful
-        /// matching. Matching the std::string::erase(*) example that was
-        /// tokenized above we could use a token list such as:
-        ///
-        ///     token           name
-        ///     -----------     ----------------------------------------
-        ///     eNameSpace      "std"
-        ///     eTemplate       "basic_string"
-        ///     eTemplateBeg
-        ///     eInvalid        "*"
-        ///     eTemplateEnd
-        ///     eMethodName     "erase"
-        ///     eParamsBeg
-        ///     eInvalid        "*"
-        ///     eParamsEnd
-        ///
-        /// @return
-        ///     Returns \b true if it \a token_list matches this
-        ///     object's tokens, \b false otherwise.
-        //--------------------------------------------------------------
-        bool
-        MatchesQuery (const TokenList& token_list) const;
-
-        //--------------------------------------------------------------
-        /// Parses \a demangled into tokens.
-        ///
-        /// This allows complex comparisons to be done on demangled names. Comparisons can
-        /// include wildcards at the namespace, method name, template,
-        /// and template and parameter type levels.
-        ///
-        /// Example queries include:
-        /// "std::basic_string<*>"  // Find all std::basic_string variants
-        /// "std::basic_string<*>::erase(*)"    // Find all std::basic_string::erase variants with any number of parameters
-        /// "*::clear()"            // Find all functions with a method name of
-        ///                         // "clear" that are in any namespace that
-        ///                         // have no parameters
-        /// "::printf"      // Find the printf function in the global namespace
-        /// "printf"        // Ditto
-        /// "foo::*(int)"   // Find all functions in the class or namespace "foo" that take a single integer argument
-        ///
-        /// @return
-        ///     The number of tokens that were decoded, or zero if
-        ///     decoding fails.
-        //--------------------------------------------------------------
-        size_t
-        Parse (const char *demangled);
-
-        //--------------------------------------------------------------
-        /// Get the number of tokens in the list.
-        ///
-        /// @return
-        ///     The number of tokens in the token list.
-        //--------------------------------------------------------------
-        size_t
-        Size () const;
-
-    protected:
-        //--------------------------------------------------------------
-        // Member variables.
-        //--------------------------------------------------------------
-        typedef std::vector<Token> collection; ///< The collection type for a list of Token objects.
-        collection m_tokens; ///< The token list.
-    private:
-        DISALLOW_COPY_AND_ASSIGN (TokenList);
-    };
-
     //----------------------------------------------------------------------
     /// Default constructor.
     ///
@@ -290,14 +54,26 @@
     /// the mangled version.
     ///
     /// @param[in] name
-    ///     The name to copy into this object.
+    ///     The already const name to copy into this object.
     ///
     /// @param[in] is_mangled
     ///     If \b true then \a name is a mangled name, if \b false then
     ///     \a name is demangled.
     //----------------------------------------------------------------------
     explicit
-    Mangled (const char *name, bool is_mangled);
+    Mangled (const ConstString &name, bool is_mangled);
+
+    //----------------------------------------------------------------------
+    /// Construct with name.
+    ///
+    /// Constructor with an optional string and auto-detect if \a name is
+    /// mangled or not.
+    ///
+    /// @param[in] name
+    ///     The already const name to copy into this object.
+    //----------------------------------------------------------------------
+    explicit
+    Mangled (const ConstString &name);
 
     //----------------------------------------------------------------------
     /// Destructor
@@ -401,15 +177,15 @@
     GetDemangledName () const;
 
     void
-    SetDemangledName (const char *name)
+    SetDemangledName (const ConstString &name)
     {
-        m_demangled.SetCString (name);
+        m_demangled = name;
     }
 
     void
-    SetMangledName (const char *name)
+    SetMangledName (const ConstString &name)
     {
-        m_mangled.SetCString (name);
+        m_mangled = name;
     }
 
     //----------------------------------------------------------------------
@@ -471,18 +247,6 @@
     NameMatches (const RegularExpression& regex) const;
 
     //----------------------------------------------------------------------
-    /// Generate the tokens from the demangled name.
-    ///
-    /// @param[out] tokens
-    ///     A token list that will get filled in with the demangled tokens.
-    ///
-    /// @return
-    ///     The number of tokens that were parsed and stored in \a tokens.
-    //----------------------------------------------------------------------
-    size_t
-    GetTokens (Mangled::TokenList &tokens) const;
-
-    //----------------------------------------------------------------------
     /// Get the memory cost of this object.
     ///
     /// Return the size in bytes that this object takes in memory. This
@@ -504,14 +268,26 @@
     /// name, else the demangled name is set to \a name.
     ///
     /// @param[in] name
-    ///     The name to copy into this object.
+    ///     The already const version of the name for this object.
     ///
     /// @param[in] is_mangled
     ///     If \b true then \a name is a mangled name, if \b false then
     ///     \a name is demangled.
     //----------------------------------------------------------------------
     void
-    SetValue (const char *name, bool is_mangled);
+    SetValue (const ConstString &name, bool is_mangled);
+
+    //----------------------------------------------------------------------
+    /// Set the string value in this object.
+    ///
+    /// This version auto detects if the string is mangled by inspecting the
+    /// string value and looking for common mangling prefixes.
+    ///
+    /// @param[in] name
+    ///     The already const version of the name for this object.
+    //----------------------------------------------------------------------
+    void
+    SetValue (const ConstString &name);
 
 private:
     //----------------------------------------------------------------------
@@ -523,8 +299,6 @@
 
 
 Stream& operator << (Stream& s, const Mangled& obj);
-Stream& operator << (Stream& s, const Mangled::TokenList& obj);
-Stream& operator << (Stream& s, const Mangled::Token& obj);
 
 } // namespace lldb_private
 

Modified: lldb/branches/lldb-platform-work/include/lldb/Core/Module.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Core/Module.h?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Core/Module.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Core/Module.h Mon Jul 23 19:12:48 2012
@@ -1030,11 +1030,13 @@
     void
     ReportErrorIfModifyDetected (const char *format, ...) __attribute__ ((format (printf, 2, 3)));
 
+    //------------------------------------------------------------------
+    // Return true if the file backing this module has changed since the
+    // module was originally created  since we saved the intial file
+    // modification time when the module first gets created.
+    //------------------------------------------------------------------
     bool
-    GetModified (bool use_cached_only);
-    
-    bool
-    SetModified (bool b);
+    FileHasChanged () const;
 
     //------------------------------------------------------------------
     // SymbolVendor, SymbolFile and ObjectFile member objects should
@@ -1124,8 +1126,9 @@
                                 m_did_load_symbol_vendor:1,
                                 m_did_parse_uuid:1,
                                 m_did_init_ast:1,
-                                m_is_dynamic_loader_module:1,
-                                m_was_modified:1;   /// See if the module was modified after it was initially opened.
+                                m_is_dynamic_loader_module:1;
+    mutable bool                m_file_has_changed:1,
+                                m_first_file_changed_log:1;   /// See if the module was modified after it was initially opened.
     
     //------------------------------------------------------------------
     /// Resolve a file or load virtual address.

Modified: lldb/branches/lldb-platform-work/include/lldb/Core/ModuleList.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Core/ModuleList.h?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Core/ModuleList.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Core/ModuleList.h Mon Jul 23 19:12:48 2012
@@ -75,6 +75,19 @@
     void
     Append (const lldb::ModuleSP &module_sp);
 
+    //------------------------------------------------------------------
+    /// Append a module to the module list and remove any equivalent
+    /// modules. Equivalent modules are ones whose file, platform file
+    /// and architecture matches.
+    ///
+    /// Replaces the module to the collection.
+    ///
+    /// @param[in] module_sp
+    ///     A shared pointer to a module to replace in this collection.
+    //------------------------------------------------------------------
+    void
+    ReplaceEquivalent (const lldb::ModuleSP &module_sp);
+
     bool
     AppendIfNeeded (const lldb::ModuleSP &module_sp);
 

Modified: lldb/branches/lldb-platform-work/include/lldb/Core/ValueObject.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Core/ValueObject.h?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Core/ValueObject.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Core/ValueObject.h Mon Jul 23 19:12:48 2012
@@ -823,7 +823,7 @@
     virtual lldb::ValueObjectSP
     GetSyntheticChildAtOffset(uint32_t offset, const ClangASTType& type, bool can_create);
     
-    lldb::ValueObjectSP
+    virtual lldb::ValueObjectSP
     GetDynamicValue (lldb::DynamicValueType valueType);
     
     virtual lldb::ValueObjectSP

Modified: lldb/branches/lldb-platform-work/include/lldb/Core/ValueObjectConstResult.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Core/ValueObjectConstResult.h?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Core/ValueObjectConstResult.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Core/ValueObjectConstResult.h Mon Jul 23 19:12:48 2012
@@ -131,6 +131,9 @@
         m_impl.SetLiveAddress(addr,
                               address_type);
     }
+    
+    virtual lldb::ValueObjectSP
+    GetDynamicValue (lldb::DynamicValueType valueType);
 
 protected:
     virtual bool
@@ -142,13 +145,6 @@
     virtual lldb::clang_type_t
     GetClangTypeImpl ();
 
-    // CalculateDynamicValue doesn't change the dynamic value, since this can get
-    // called at any time and you can't reliably fetch the dynamic value at any time.
-    // If we want to have dynamic values for ConstResults, then we'll need to make them
-    // up when we make the const result & stuff them in by hand.
-    virtual void
-    CalculateDynamicValue (lldb::DynamicValueType use_dynamic) {} 
-                                        
     clang::ASTContext *m_clang_ast; // The clang AST that the clang type comes from
     ConstString m_type_name;
     uint32_t m_byte_size;

Modified: lldb/branches/lldb-platform-work/include/lldb/Core/ValueObjectDynamicValue.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Core/ValueObjectDynamicValue.h?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Core/ValueObjectDynamicValue.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Core/ValueObjectDynamicValue.h Mon Jul 23 19:12:48 2012
@@ -180,6 +180,7 @@
 
 private:
     friend class ValueObject;
+    friend class ValueObjectConstResult;
     ValueObjectDynamicValue (ValueObject &parent, lldb::DynamicValueType use_dynamic);
 
     //------------------------------------------------------------------

Modified: lldb/branches/lldb-platform-work/include/lldb/Expression/ClangUserExpression.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Expression/ClangUserExpression.h?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Expression/ClangUserExpression.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Expression/ClangUserExpression.h Mon Jul 23 19:12:48 2012
@@ -132,6 +132,10 @@
     ///     A pointer to direct at the persistent variable in which the
     ///     expression's result is stored.
     ///
+    /// @param[in] single_thread_timeout_usec
+    ///     The amount of time (in usec) that we are willing to wait for this
+    ///     expression to complete, before assuming that we are blocked and giving up
+    ///
     /// @return
     ///     A Process::Execution results value.
     //------------------------------------------------------------------
@@ -140,7 +144,8 @@
              ExecutionContext &exe_ctx,
              bool discard_on_error,
              ClangUserExpressionSP &shared_ptr_to_me,
-             lldb::ClangExpressionVariableSP &result);
+             lldb::ClangExpressionVariableSP &result,
+             uint32_t single_thread_timeout_usec = 500000);
              
     ThreadPlan *
     GetThreadPlanToExecuteJITExpression (Stream &error_stream,
@@ -309,6 +314,10 @@
     /// @param[in/out] result_valobj_sp
     ///      If execution is successful, the result valobj is placed here.
     ///
+    /// @param[in] single_thread_timeout_usec
+    ///     The amount of time (in usec) that we are willing to wait for this
+    ///     expression to complete, before assuming that we are blocked and giving up
+    ///
     /// @result
     ///      A Process::ExecutionResults value.  eExecutionCompleted for success.
     //------------------------------------------------------------------
@@ -320,7 +329,8 @@
               bool discard_on_error,
               const char *expr_cstr,
               const char *expr_prefix,
-              lldb::ValueObjectSP &result_valobj_sp);
+              lldb::ValueObjectSP &result_valobj_sp,
+              uint32_t single_thread_timeout_usec = 500000);
               
     static ExecutionResults
     EvaluateWithError (ExecutionContext &exe_ctx,
@@ -331,7 +341,8 @@
                        const char *expr_cstr,
                        const char *expr_prefix,
                        lldb::ValueObjectSP &result_valobj_sp,
-                       Error &error);
+                       Error &error,
+                       uint32_t single_thread_timeout_usec = 500000);
     
     static const Error::ValueType kNoResult = 0x1001; ///< ValueObject::GetError() returns this if there is no result from the expression.
 private:

Modified: lldb/branches/lldb-platform-work/include/lldb/Expression/IRForTarget.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Expression/IRForTarget.h?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Expression/IRForTarget.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Expression/IRForTarget.h Mon Jul 23 19:12:48 2012
@@ -532,6 +532,20 @@
     ResolveCalls (llvm::BasicBlock &basic_block);
     
     //------------------------------------------------------------------
+    /// Remove calls to __cxa_atexit, which should never be generated by
+    /// expressions.
+    ///
+    /// @param[in] call_inst
+    ///     The call instruction.
+    ///
+    /// @return
+    ///     True if the scan was successful; false if some operation
+    ///     failed
+    //------------------------------------------------------------------
+    bool
+    RemoveCXAAtExit (llvm::BasicBlock &basic_block);
+    
+    //------------------------------------------------------------------
     /// The top-level pass implementation
     ///
     /// @param[in] basic_block

Modified: lldb/branches/lldb-platform-work/include/lldb/Interpreter/CommandInterpreter.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Interpreter/CommandInterpreter.h?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Interpreter/CommandInterpreter.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Interpreter/CommandInterpreter.h Mon Jul 23 19:12:48 2012
@@ -296,10 +296,10 @@
         return m_debugger;
     }
     
-    ExecutionContext &
+    ExecutionContext
     GetExecutionContext()
     {
-        return m_exe_ctx;
+        return m_exe_ctx_ref.Lock();
     }
     
     void
@@ -464,7 +464,7 @@
     PreprocessCommand (std::string &command);
 
     Debugger &m_debugger;                       // The debugger session that this interpreter is associated with
-    ExecutionContext m_exe_ctx;                 // The current execution context to use when handling commands
+    ExecutionContextRef m_exe_ctx_ref;          // The current execution context to use when handling commands
     bool m_synchronous_execution;
     bool m_skip_lldbinit_files;
     bool m_skip_app_init_files;

Modified: lldb/branches/lldb-platform-work/include/lldb/Symbol/Block.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Symbol/Block.h?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Symbol/Block.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Symbol/Block.h Mon Jul 23 19:12:48 2012
@@ -263,6 +263,22 @@
     }
 
     //------------------------------------------------------------------
+    /// Get the variable list for this block only.
+    ///
+    /// @param[in] can_create
+    ///     If \b true, the variables can be parsed if they already
+    ///     haven't been, else the current state of the block will be
+    ///     returned. 
+    ///
+    /// @return
+    ///     A variable list shared pointer that contains all variables
+    ///     for this block.
+    //------------------------------------------------------------------
+    lldb::VariableListSP
+    GetBlockVariableList (bool can_create);
+
+
+    //------------------------------------------------------------------
     /// Get the variable list for this block and optionally all child
     /// blocks if \a get_child_variables is \b true.
     ///
@@ -278,7 +294,7 @@
     ///     point.
     ///
     /// @param[in] add_inline_child_block_variables
-    ///     If this is \b false, no child variables of child blocks 
+    ///     If this is \b false, no child variables of child blocks
     ///     that are inlined functions will be gotten. If \b true then
     ///     all child variables will be added regardless of whether they
     ///     come from inlined functions or not.
@@ -287,10 +303,6 @@
     ///     A variable list shared pointer that contains all variables
     ///     for this block.
     //------------------------------------------------------------------
-    lldb::VariableListSP
-    GetBlockVariableList (bool can_create);
-
-
     uint32_t
     AppendBlockVariables (bool can_create,
                           bool get_child_block_variables,
@@ -345,7 +357,7 @@
     }
     
     clang::DeclContext *
-    GetClangDeclContextForInlinedFunction();
+    GetClangDeclContext();
 
     //------------------------------------------------------------------
     /// Get the memory cost of this object.

Modified: lldb/branches/lldb-platform-work/include/lldb/Symbol/ClangASTContext.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Symbol/ClangASTContext.h?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Symbol/ClangASTContext.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Symbol/ClangASTContext.h Mon Jul 23 19:12:48 2012
@@ -237,6 +237,12 @@
         return GetTranslationUnitDecl (getASTContext());
     }
     
+    static bool
+    GetClassMethodInfoForDeclContext (clang::DeclContext *decl_ctx,
+                                      lldb::LanguageType &language,
+                                      bool &is_instance_method,
+                                      ConstString &language_object_name);
+    
     static lldb::clang_type_t
     CopyType(clang::ASTContext *dest_context, 
              clang::ASTContext *source_context,

Modified: lldb/branches/lldb-platform-work/include/lldb/Symbol/DWARFCallFrameInfo.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Symbol/DWARFCallFrameInfo.h?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Symbol/DWARFCallFrameInfo.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Symbol/DWARFCallFrameInfo.h Mon Jul 23 19:12:48 2012
@@ -18,6 +18,7 @@
 #include "lldb/Core/AddressRange.h"
 #include "lldb/Core/VMRange.h"
 #include "lldb/Core/dwarf.h"
+#include "lldb/Host/Mutex.h"
 #include "lldb/Symbol/UnwindPlan.h"
 #include "lldb/Symbol/ObjectFile.h"
 
@@ -128,6 +129,7 @@
 
     std::vector<FDEEntry>       m_fde_index;
     bool                        m_fde_index_initialized;  // only scan the section for FDEs once
+    Mutex                       m_fde_index_mutex;        // and isolate the thread that does it
 
     bool                        m_is_eh_frame;
 

Modified: lldb/branches/lldb-platform-work/include/lldb/Symbol/SymbolContext.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Symbol/SymbolContext.h?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Symbol/SymbolContext.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Symbol/SymbolContext.h Mon Jul 23 19:12:48 2012
@@ -220,6 +220,56 @@
     uint32_t
     GetResolvedMask () const;
 
+    
+    //------------------------------------------------------------------
+    /// Find a block that defines the function represented by this
+    /// symbol context.
+    ///
+    /// If this symbol context points to a block that is an inlined
+    /// function, or is contained within an inlined function, the block
+    /// that defines the inlined function is returned.
+    ///
+    /// If this symbol context has no block in it, or the block is not
+    /// itself an inlined function block or contained within one, we
+    /// return the top level function block.
+    ///
+    /// This is a handy function to call when you want to get the block
+    /// whose variable list will include the arguments for the function
+    /// that is represented by this symbol context (whether the function
+    /// is an inline function or not).
+    ///
+    /// @return
+    ///     The block object pointer that defines the function that is
+    ///     represented by this symbol context object, NULL otherwise.
+    //------------------------------------------------------------------
+    Block *
+    GetFunctionBlock ();
+
+    
+    //------------------------------------------------------------------
+    /// If this symbol context represents a function that is a method,
+    /// return true and provide information about the method.
+    ///
+    /// @param[out] language
+    ///     If \b true is returned, the language for the method.
+    ///
+    /// @param[out] is_instance_method
+    ///     If \b true is returned, \b true if this is a instance method,
+    ///     \b false if this is a static/class function.
+    ///
+    /// @param[out] language_object_name
+    ///     If \b true is returned, the name of the artificial variable
+    ///     for the language ("this" for C++, "self" for ObjC).
+    ///
+    /// @return
+    ///     \b True if this symbol context represents a function that
+    ///     is a method of a class, \b false otherwise.
+    //------------------------------------------------------------------
+    bool
+    GetFunctionMethodInfo (lldb::LanguageType &language,
+                           bool &is_instance_method,
+                           ConstString &language_object_name);
+
     //------------------------------------------------------------------
     /// Find a name of the innermost function for the symbol context.
     ///

Modified: lldb/branches/lldb-platform-work/include/lldb/Symbol/UnwindPlan.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Symbol/UnwindPlan.h?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Symbol/UnwindPlan.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Symbol/UnwindPlan.h Mon Jul 23 19:12:48 2012
@@ -240,6 +240,17 @@
     public:
         Row ();
     
+        Row (const UnwindPlan::Row& rhs) : 
+            m_offset             (rhs.m_offset),
+            m_cfa_reg_num        (rhs.m_cfa_reg_num),
+            m_cfa_offset         (rhs.m_cfa_offset),
+            m_register_locations (rhs.m_register_locations)
+        {
+        }
+
+        bool
+        operator == (const Row &rhs) const;
+
         bool
         GetRegisterInfo (uint32_t reg_num, RegisterLocation& register_location) const;
     
@@ -314,13 +325,6 @@
         {
             m_cfa_offset = offset;
         }
-    
-        // Return the number of registers we have locations for
-        int
-        GetRegisterCount () const
-        {
-            return m_register_locations.size();
-        }
 
         void
         Clear ();
@@ -328,38 +332,18 @@
         void
         Dump (Stream& s, const UnwindPlan* unwind_plan, Thread* thread, lldb::addr_t base_addr) const;
 
-        bool
-        operator == (const Row &rhs) const
-        {
-            if (m_offset == rhs.m_offset && 
-                m_cfa_reg_num != rhs.m_cfa_reg_num &&
-                m_cfa_offset != rhs.m_cfa_offset)
-                return m_register_locations == rhs.m_register_locations;
-            return false;
-        }
-
-        bool
-        operator != (const Row &rhs) const
-        {
-            if (m_offset != rhs.m_offset ||
-                m_cfa_reg_num != rhs.m_cfa_reg_num ||
-                m_cfa_offset != rhs.m_cfa_offset)
-                return true;
-            
-            return m_register_locations != rhs.m_register_locations;
-        }
-
     protected:
         typedef std::map<uint32_t, RegisterLocation> collection;
         lldb::addr_t m_offset;      // Offset into the function for this row
         uint32_t m_cfa_reg_num;     // The Call Frame Address register number
         int32_t  m_cfa_offset;      // The offset from the CFA for this row
         collection m_register_locations;
-
     }; // class Row
 
 public:
 
+    typedef STD_SHARED_PTR(Row) RowSP;
+
     UnwindPlan (lldb::RegisterKind reg_kind) : 
         m_row_list (), 
         m_plan_valid_address_range (), 
@@ -376,13 +360,13 @@
     Dump (Stream& s, Thread* thread, lldb::addr_t base_addr) const;
 
     void 
-    AppendRow (const Row& row);
+    AppendRow (const RowSP& row_sp);
 
     // Returns a pointer to the best row for the given offset into the function's instructions.
     // If offset is -1 it indicates that the function start is unknown - the final row in the UnwindPlan is returned.
     // In practice, the UnwindPlan for a function with no known start address will be the architectural default
     // UnwindPlan which will only have one row.
-    const Row*
+    UnwindPlan::RowSP
     GetRowForFunctionOffset (int offset) const;
 
     lldb::RegisterKind
@@ -402,7 +386,7 @@
     {
         if (m_row_list.empty())
             return LLDB_INVALID_REGNUM;
-        return m_row_list.front().GetCFARegister();
+        return m_row_list.front()->GetCFARegister();
     }
 
     // This UnwindPlan may not be valid at every address of the function span.  
@@ -423,10 +407,10 @@
     bool
     IsValidRowIndex (uint32_t idx) const;
 
-    const UnwindPlan::Row&
+    const UnwindPlan::RowSP
     GetRowAtIndex (uint32_t idx) const;
 
-    const UnwindPlan::Row&
+    const UnwindPlan::RowSP
     GetLastRow () const;
 
     lldb_private::ConstString
@@ -453,7 +437,7 @@
 private:
 
     
-    typedef std::vector<Row> collection;
+    typedef std::vector<RowSP> collection;
     collection m_row_list;
     AddressRange m_plan_valid_address_range;
     lldb::RegisterKind m_register_kind;   // The RegisterKind these register numbers are in terms of - will need to be

Modified: lldb/branches/lldb-platform-work/include/lldb/Symbol/UnwindTable.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Symbol/UnwindTable.h?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Symbol/UnwindTable.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Symbol/UnwindTable.h Mon Jul 23 19:12:48 2012
@@ -33,6 +33,15 @@
     lldb::FuncUnwindersSP
     GetFuncUnwindersContainingAddress (const Address& addr, SymbolContext &sc);
 
+// Normally when we create a new FuncUnwinders object we track it in this UnwindTable so it can
+// be reused later.  But for the target modules show-unwind we want to create brand new 
+// UnwindPlans for the function of interest - so ignore any existing FuncUnwinders for that
+// function and don't add this new one to our UnwindTable.
+// This FuncUnwinders object does have a reference to the UnwindTable but the lifetime of this
+// uncached FuncUnwinders is expected to be short so in practice this will not be a problem.
+    lldb::FuncUnwindersSP
+    GetUncachedFuncUnwindersContainingAddress (const Address& addr, SymbolContext &sc);
+
 private:
     void
     Dump (Stream &s);

Modified: lldb/branches/lldb-platform-work/include/lldb/Symbol/VariableList.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Symbol/VariableList.h?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Symbol/VariableList.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Symbol/VariableList.h Mon Jul 23 19:12:48 2012
@@ -50,6 +50,11 @@
     lldb::VariableSP
     FindVariable (const ConstString& name);
 
+    // Find the argument variable that represents the language specific
+    // object pointer ("this" in C++, or "self" in Objective C).
+    lldb::VariableSP
+    FindArtificialObjectVariable (lldb::LanguageType language) const;
+
     uint32_t
     FindVariableIndex (const lldb::VariableSP &var_sp);
 

Modified: lldb/branches/lldb-platform-work/include/lldb/Target/Process.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Target/Process.h?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Target/Process.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Target/Process.h Mon Jul 23 19:12:48 2012
@@ -87,10 +87,25 @@
         return m_disable_memory_cache;
     }
     
+    const Args &
+    GetExtraStartupCommands () const
+    {
+        return m_extra_startup_commands;
+    }
+    
+    void
+    SetExtraStartupCommands (const Args &args)
+    {
+        m_extra_startup_commands = args;
+    }
+    
 protected:
     const ConstString &
     GetDisableMemoryCacheVarName () const;
     
+    const ConstString &
+    GetExtraStartupCommandVarName () const;
+
     void
     CopyInstanceSettings (const lldb::InstanceSettingsSP &new_settings,
                           bool pending);
@@ -98,7 +113,8 @@
     const ConstString
     CreateInstanceName ();
     
-    bool    m_disable_memory_cache;
+    bool        m_disable_memory_cache;
+    Args        m_extra_startup_commands;
 };
 
 //----------------------------------------------------------------------
@@ -826,6 +842,7 @@
         m_plugin_name (),
         m_resume_count (0),
         m_wait_for_launch (false),
+        m_ignore_existing (true),
         m_continue_once_attached (false)
     {
     }
@@ -835,6 +852,7 @@
         m_plugin_name (),
         m_resume_count (0),
         m_wait_for_launch (false),
+        m_ignore_existing (true),
         m_continue_once_attached (false)
     {
         ProcessInfo::operator= (launch_info);
@@ -855,6 +873,18 @@
     }
 
     bool
+    GetIgnoreExisting () const
+    {
+        return m_ignore_existing;
+    }
+    
+    void
+    SetIgnoreExisting (bool b)
+    {
+        m_ignore_existing = b;
+    }
+
+    bool
     GetContinueOnceAttached () const
     {
         return m_continue_once_attached;
@@ -902,6 +932,8 @@
         m_plugin_name.clear();
         m_resume_count = 0;
         m_wait_for_launch = false;
+        m_ignore_existing = true;
+        m_continue_once_attached = false;
     }
 
     bool
@@ -919,6 +951,7 @@
     std::string m_plugin_name;
     uint32_t m_resume_count; // How many times do we resume after launching
     bool m_wait_for_launch;
+    bool m_ignore_existing;
     bool m_continue_once_attached; // Supports the use-case scenario of immediately continuing the process once attached.
 };
 
@@ -2776,6 +2809,14 @@
         return error;
     }
 
+    virtual Error
+    GetWatchpointSupportInfo (uint32_t &num, bool& after)
+    {
+        Error error;
+        error.SetErrorString ("Process::GetWatchpointSupportInfo() not supported");
+        return error;
+    }
+    
     lldb::ModuleSP
     ReadModuleFromMemory (const FileSpec& file_spec, 
                           lldb::addr_t header_addr,

Modified: lldb/branches/lldb-platform-work/include/lldb/Target/SectionLoadList.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Target/SectionLoadList.h?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Target/SectionLoadList.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Target/SectionLoadList.h Mon Jul 23 19:12:48 2012
@@ -47,31 +47,31 @@
     Clear ();
 
     lldb::addr_t
-    GetSectionLoadAddress (const Section *section) const;
+    GetSectionLoadAddress (const lldb::SectionSP &section_sp) const;
 
     bool
     ResolveLoadAddress (lldb::addr_t load_addr, Address &so_addr) const;
 
     bool
-    SetSectionLoadAddress (const Section *section, lldb::addr_t load_addr, bool warn_multiple = false);
+    SetSectionLoadAddress (const lldb::SectionSP &section_sp, lldb::addr_t load_addr, bool warn_multiple = false);
 
     // The old load address should be specified when unloading to ensure we get
     // the correct instance of the section as a shared library could be loaded
     // at more than one location.
     bool
-    SetSectionUnloaded (const Section *section, lldb::addr_t load_addr);
+    SetSectionUnloaded (const lldb::SectionSP &section_sp, lldb::addr_t load_addr);
 
     // Unload all instances of a section. This function can be used on systems
     // that don't support multiple copies of the same shared library to be
     // loaded at the same time.
     size_t
-    SetSectionUnloaded (const Section *section);
+    SetSectionUnloaded (const lldb::SectionSP &section_sp);
 
     void
     Dump (Stream &s, Target *target);
 
 protected:
-    typedef std::map<lldb::addr_t, const Section *> addr_to_sect_collection;
+    typedef std::map<lldb::addr_t, lldb::SectionSP> addr_to_sect_collection;
     typedef llvm::DenseMap<const Section *, lldb::addr_t> sect_to_addr_collection;
     addr_to_sect_collection m_addr_to_sect;
     sect_to_addr_collection m_sect_to_addr;

Modified: lldb/branches/lldb-platform-work/include/lldb/Target/StackFrame.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Target/StackFrame.h?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Target/StackFrame.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Target/StackFrame.h Mon Jul 23 19:12:48 2012
@@ -36,7 +36,8 @@
         eExpressionPathOptionCheckPtrVsMember       = (1u << 0),
         eExpressionPathOptionsNoFragileObjcIvar     = (1u << 1),
         eExpressionPathOptionsNoSyntheticChildren   = (1u << 2),
-        eExpressionPathOptionsNoSyntheticArrayRange = (1u << 3)
+        eExpressionPathOptionsNoSyntheticArrayRange = (1u << 3),
+        eExpressionPathOptionsAllowDirectIVarAccess = (1u << 4)
     };
     //------------------------------------------------------------------
     // Constructors and Destructors
@@ -167,9 +168,7 @@
     bool
     GetStatus (Stream &strm,
                bool show_frame_info,
-               bool show_source,
-               uint32_t source_lines_before,
-               uint32_t source_lines_after);
+               bool show_source);
     
 protected:
     friend class StackFrameList;

Modified: lldb/branches/lldb-platform-work/include/lldb/Target/StackFrameList.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Target/StackFrameList.h?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Target/StackFrameList.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Target/StackFrameList.h Mon Jul 23 19:12:48 2012
@@ -76,9 +76,7 @@
                uint32_t first_frame,
                uint32_t num_frames,
                bool show_frame_info,
-               uint32_t num_frames_with_source,
-               uint32_t source_lines_before,
-               uint32_t source_lines_after);
+               uint32_t num_frames_with_source);
     
 protected:
 

Modified: lldb/branches/lldb-platform-work/include/lldb/Target/StopInfo.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Target/StopInfo.h?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Target/StopInfo.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Target/StopInfo.h Mon Jul 23 19:12:48 2012
@@ -161,14 +161,15 @@
     // N.B. running to evaluate a user expression does not count. 
     bool HasTargetRunSinceMe ();
 
-private:
-    friend class Thread;
-    
-    // MakeStopInfoValid is necessary to allow saved stop infos to resurrect themselves as valid.  It should
-    // only need to be called by Thread::RestoreThreadStateFromCheckpoint.
+    // MakeStopInfoValid is necessary to allow saved stop infos to resurrect themselves as valid.
+    // It should only be used by Thread::RestoreThreadStateFromCheckpoint and to make sure the one-step
+    // needed for before-the-fact watchpoints does not prevent us from stopping
     void
     MakeStopInfoValid ();
     
+private:
+    friend class Thread;
+    
     DISALLOW_COPY_AND_ASSIGN (StopInfo);
 };
 

Modified: lldb/branches/lldb-platform-work/include/lldb/Target/Target.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Target/Target.h?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Target/Target.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Target/Target.h Mon Jul 23 19:12:48 2012
@@ -128,8 +128,7 @@
     {
         return m_breakpoints_use_platform_avoid;
     }
-    
-    
+        
     const Args &
     GetRunArguments () const
     {
@@ -899,7 +898,8 @@
                         bool unwind_on_error,
                         bool keep_in_memory,
                         lldb::DynamicValueType use_dynamic,
-                        lldb::ValueObjectSP &result_valobj_sp);
+                        lldb::ValueObjectSP &result_valobj_sp,
+                        uint32_t single_thread_timeout_usec = 500000);
 
     ClangPersistentVariables &
     GetPersistentVariables()

Modified: lldb/branches/lldb-platform-work/include/lldb/Target/Thread.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Target/Thread.h?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Target/Thread.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Target/Thread.h Mon Jul 23 19:12:48 2012
@@ -762,9 +762,7 @@
                          uint32_t first_frame,
                          uint32_t num_frames,
                          bool show_frame_info,
-                         uint32_t num_frames_with_source,
-                         uint32_t source_lines_before,
-                         uint32_t source_lines_after);
+                         uint32_t num_frames_with_source);
 
     // We need a way to verify that even though we have a thread in a shared
     // pointer that the object itself is still valid. Currently this won't be
@@ -775,6 +773,13 @@
     {
         return m_destroy_called;
     }
+
+    // When you implement this method, make sure you don't overwrite the m_actual_stop_info if it claims to be
+    // valid.  The stop info may be a "checkpointed and restored" stop info, so if it is still around it is right
+    // even if you have not calculated this yourself, or if it disagrees with what you might have calculated.
+    virtual lldb::StopInfoSP
+    GetPrivateStopReason () = 0;
+
 protected:
 
     friend class ThreadPlan;
@@ -796,12 +801,6 @@
 
     ThreadPlan *GetPreviousPlan (ThreadPlan *plan);
 
-    // When you implement this method, make sure you don't overwrite the m_actual_stop_info if it claims to be
-    // valid.  The stop info may be a "checkpointed and restored" stop info, so if it is still around it is right
-    // even if you have not calculated this yourself, or if it disagrees with what you might have calculated.
-    virtual lldb::StopInfoSP
-    GetPrivateStopReason () = 0;
-
     typedef std::vector<lldb::ThreadPlanSP> plan_stack;
 
     void

Modified: lldb/branches/lldb-platform-work/include/lldb/Utility/CleanUp.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Utility/CleanUp.h?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Utility/CleanUp.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Utility/CleanUp.h Mon Jul 23 19:12:48 2012
@@ -31,7 +31,7 @@
 // into T.
 //
 // The cleanup function must take one argument that is of type T. 
-// The calback fucntion return type is R. The return value is currently
+// The calback function return type is R. The return value is currently
 // needed for "CallbackType". If there is an easy way to get around the
 // need for the return value we can change this class.
 //

Modified: lldb/branches/lldb-platform-work/include/lldb/lldb-private-enumerations.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/lldb-private-enumerations.h?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/lldb-private-enumerations.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/lldb-private-enumerations.h Mon Jul 23 19:12:48 2012
@@ -1,4 +1,4 @@
-//===-- lldb-enumerations.h -------------------------------------*- C++ -*-===//
+//===-- lldb-private-enumerations.h -----------------------------*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -106,7 +106,7 @@
 
 
 //----------------------------------------------------------------------
-// Used in conjunction with Host::GetLLDBResource () to find files that
+// Used in conjunction with Host::GetLLDBPath () to find files that
 // are related to 
 //----------------------------------------------------------------------
 typedef enum PathType

Modified: lldb/branches/lldb-platform-work/lldb.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/lldb.xcodeproj/project.pbxproj?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/branches/lldb-platform-work/lldb.xcodeproj/project.pbxproj Mon Jul 23 19:12:48 2012
@@ -452,6 +452,7 @@
 		49DA65031485C92A005FF180 /* AppleObjCSymbolVendor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49DA65021485C92A005FF180 /* AppleObjCSymbolVendor.cpp */; };
 		4C6649A014EEE7F100B0316F /* StreamCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C66499F14EEE7F100B0316F /* StreamCallback.h */; };
 		4C6649A314EEE81000B0316F /* StreamCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C6649A214EEE81000B0316F /* StreamCallback.cpp */; };
+		4C701C1E15ABB70C00B50001 /* libxml2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 26D55234159A7DB100708D8D /* libxml2.dylib */; };
 		4CAA56151422D986001FFA01 /* BreakpointResolverFileRegex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CAA56141422D986001FFA01 /* BreakpointResolverFileRegex.cpp */; };
 		4CABA9E0134A8BCD00539BDD /* ValueObjectMemory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CABA9DF134A8BCD00539BDD /* ValueObjectMemory.cpp */; };
 		4CCA644D13B40B82003BDF98 /* ItaniumABILanguageRuntime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CCA643D13B40B82003BDF98 /* ItaniumABILanguageRuntime.cpp */; };
@@ -461,6 +462,7 @@
 		4CCA645613B40B82003BDF98 /* AppleObjCTrampolineHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CCA644813B40B82003BDF98 /* AppleObjCTrampolineHandler.cpp */; };
 		4CCA645813B40B82003BDF98 /* AppleThreadPlanStepThroughObjCTrampoline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CCA644A13B40B82003BDF98 /* AppleThreadPlanStepThroughObjCTrampoline.cpp */; };
 		4CD0BD0F134BFADF00CB44D4 /* ValueObjectDynamicValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CD0BD0E134BFADF00CB44D4 /* ValueObjectDynamicValue.cpp */; };
+		4CF3D80C15AF4DC800845BF3 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EDB919B414F6F10D008FF64B /* Security.framework */; };
 		4CF52AF51428291E0051E832 /* SBFileSpecList.h in Headers */ = {isa = PBXBuildFile; fileRef = 4CF52AF41428291E0051E832 /* SBFileSpecList.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		4CF52AF8142829390051E832 /* SBFileSpecList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CF52AF7142829390051E832 /* SBFileSpecList.cpp */; };
 		94031A9E13CF486700DCFF3C /* InputReaderEZ.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94031A9D13CF486600DCFF3C /* InputReaderEZ.cpp */; };
@@ -509,6 +511,7 @@
 		9AC70390117675270086C050 /* SBInstructionList.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC7038F117675270086C050 /* SBInstructionList.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		9AC703AF117675410086C050 /* SBInstruction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC703AE117675410086C050 /* SBInstruction.cpp */; };
 		9AC703B1117675490086C050 /* SBInstructionList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC703B0117675490086C050 /* SBInstructionList.cpp */; };
+		AF90106515AB7D3600FF120D /* lldb.1 in CopyFiles */ = {isa = PBXBuildFile; fileRef = AF90106315AB7C5700FF120D /* lldb.1 */; };
 		AFF87C87150FF669000E1742 /* com.apple.debugserver.plist in CopyFiles */ = {isa = PBXBuildFile; fileRef = AFF87C86150FF669000E1742 /* com.apple.debugserver.plist */; };
 		AFF87C89150FF672000E1742 /* com.apple.debugserver-secure.plist in CopyFiles */ = {isa = PBXBuildFile; fileRef = AFF87C88150FF672000E1742 /* com.apple.debugserver-secure.plist */; };
 		AFF87C8F150FF688000E1742 /* com.apple.debugserver.applist.plist in CopyFiles */ = {isa = PBXBuildFile; fileRef = AFF87C8E150FF688000E1742 /* com.apple.debugserver.applist.plist */; };
@@ -520,7 +523,6 @@
 		B299580B14F2FA1400050A04 /* DisassemblerLLVMC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B299580A14F2FA1400050A04 /* DisassemblerLLVMC.cpp */; };
 		B2A58722143119810092BFBA /* SBWatchpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = B2A58721143119810092BFBA /* SBWatchpoint.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		B2A58724143119D50092BFBA /* SBWatchpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2A58723143119D50092BFBA /* SBWatchpoint.cpp */; };
-		ED236E0814F84F6800153F6F /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EDB919B414F6F10D008FF64B /* Security.framework */; };
 		ED88244E15114A9200BC98B9 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EDB919B414F6F10D008FF64B /* Security.framework */; };
 		ED88245015114CA200BC98B9 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = ED88244F15114CA200BC98B9 /* main.mm */; };
 		ED88245115114CA200BC98B9 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = ED88244F15114CA200BC98B9 /* main.mm */; };
@@ -638,6 +640,16 @@
 /* End PBXContainerItemProxy section */
 
 /* Begin PBXCopyFilesBuildPhase section */
+		AF90106415AB7D2900FF120D /* CopyFiles */ = {
+			isa = PBXCopyFilesBuildPhase;
+			buildActionMask = 8;
+			dstPath = "$(DEVELOPER_DIR)/usr/share/man/man1/";
+			dstSubfolderSpec = 0;
+			files = (
+				AF90106515AB7D3600FF120D /* lldb.1 in CopyFiles */,
+			);
+			runOnlyForDeploymentPostprocessing = 1;
+		};
 		AFF87C85150FF5CC000E1742 /* CopyFiles */ = {
 			isa = PBXCopyFilesBuildPhase;
 			buildActionMask = 8;
@@ -1532,6 +1544,7 @@
 		AF68D2551255416E002FF25B /* RegisterContextLLDB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextLLDB.h; path = Utility/RegisterContextLLDB.h; sourceTree = "<group>"; };
 		AF68D32F1255A110002FF25B /* UnwindLLDB.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UnwindLLDB.cpp; path = Utility/UnwindLLDB.cpp; sourceTree = "<group>"; };
 		AF68D3301255A110002FF25B /* UnwindLLDB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UnwindLLDB.h; path = Utility/UnwindLLDB.h; sourceTree = "<group>"; };
+		AF90106315AB7C5700FF120D /* lldb.1 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.man; name = lldb.1; path = docs/lldb.1; sourceTree = "<group>"; };
 		AF94005711C03F6500085DB9 /* SymbolVendor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SymbolVendor.cpp; path = source/Symbol/SymbolVendor.cpp; sourceTree = "<group>"; };
 		AFF87C86150FF669000E1742 /* com.apple.debugserver.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = com.apple.debugserver.plist; path = tools/debugserver/source/com.apple.debugserver.plist; sourceTree = "<group>"; };
 		AFF87C88150FF672000E1742 /* com.apple.debugserver-secure.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "com.apple.debugserver-secure.plist"; path = "tools/debugserver/source/com.apple.debugserver-secure.plist"; sourceTree = "<group>"; };
@@ -1585,7 +1598,7 @@
 				268901161335BBC300698AC0 /* liblldb-core.a in Frameworks */,
 				2668022F115FD19D008E1FE4 /* CoreFoundation.framework in Frameworks */,
 				26680233115FD1A7008E1FE4 /* libobjc.dylib in Frameworks */,
-				ED236E0814F84F6800153F6F /* Security.framework in Frameworks */,
+				4CF3D80C15AF4DC800845BF3 /* Security.framework in Frameworks */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -1600,6 +1613,7 @@
 			isa = PBXFrameworksBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
+				4C701C1E15ABB70C00B50001 /* libxml2.dylib in Frameworks */,
 				26DC6A171337FE8000FF7998 /* liblldb-core.a in Frameworks */,
 				26B1FCB813381071002886E2 /* CoreFoundation.framework in Frameworks */,
 				26B1FCBC13381071002886E2 /* libobjc.dylib in Frameworks */,
@@ -2105,6 +2119,7 @@
 		264E8576159BE51A00E9D7A2 /* Resources */ = {
 			isa = PBXGroup;
 			children = (
+				AF90106315AB7C5700FF120D /* lldb.1 */,
 				AFF87C8E150FF688000E1742 /* com.apple.debugserver.applist.plist */,
 				AFF87C8C150FF680000E1742 /* com.apple.debugserver.applist.plist */,
 				AFF87C8A150FF677000E1742 /* com.apple.debugserver.applist.plist */,
@@ -3287,6 +3302,7 @@
 				26680205115FD0ED008E1FE4 /* Frameworks */,
 				261B5A7511C3FA6F00AABD0A /* Fixup Framework Headers */,
 				9A19ACE2116563A700E0D453 /* Finish swig wrapper classes (lldb) */,
+				AF90106415AB7D2900FF120D /* CopyFiles */,
 			);
 			buildRules = (
 			);
@@ -3325,7 +3341,6 @@
 			buildPhases = (
 				26DC6A0D1337FE6900FF7998 /* Sources */,
 				26DC6A0E1337FE6900FF7998 /* Frameworks */,
-				261CE9C014D327DE006D8EFE /* Codesign */,
 			);
 			buildRules = (
 			);
@@ -3394,7 +3409,7 @@
 		08FB7793FE84155DC02AAC07 /* Project object */ = {
 			isa = PBXProject;
 			attributes = {
-				LastUpgradeCheck = 0430;
+				LastUpgradeCheck = 0450;
 			};
 			buildConfigurationList = 1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "lldb" */;
 			compatibilityVersion = "Xcode 3.2";
@@ -3480,20 +3495,6 @@
 			shellPath = /bin/sh;
 			shellScript = "cd \"${TARGET_BUILD_DIR}/${PUBLIC_HEADERS_FOLDER_PATH}\"\nfor file in *.h\ndo\n\t/usr/bin/sed -i '' 's/\\(#include\\)[ ]*\"lldb\\/\\(API\\/\\)\\{0,1\\}\\(.*\\)\"/\\1 <LLDB\\/\\3>/1' \"$file\"\n\t/usr/bin/sed -i '' 's|<LLDB/Utility|<LLDB|' \"$file\"\n\tTRUNCATED_VERSION=`echo ${CURRENT_PROJECT_VERSION} | /usr/bin/sed -E 's/^([0-9]+)(\\.[0-9]+)?$/\\1/g'`\n\t/usr/bin/sed -i '' \"s|//#define LLDB_VERSION|#define LLDB_VERSION $TRUNCATED_VERSION |\" \"$file\"\ndone\n";
 		};
-		261CE9C014D327DE006D8EFE /* Codesign */ = {
-			isa = PBXShellScriptBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			inputPaths = (
-			);
-			name = Codesign;
-			outputPaths = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-			shellPath = "/bin/sh -x";
-			shellScript = "if [ $CONFIGURATION != BuildAndIntegration -a $PLATFORM_NAME = macosx ]; then /usr/bin/codesign -s lldb_codesign -f \"$TARGET_BUILD_DIR/$TARGET_NAME\"; fi";
-		};
 		261EECA21337D399001D193C /* Build llvm and clang */ = {
 			isa = PBXShellScriptBuildPhase;
 			buildActionMask = 2147483647;
@@ -4120,7 +4121,7 @@
 					"-flimit-debug-info",
 					"-Wparentheses",
 				);
-				SDKROOT = macosx;
+				SDKROOT = "";
 				STRIP_INSTALLED_PRODUCT = NO;
 				STRIP_STYLE = debugging;
 				VALID_ARCHS = "armv4t armv5 armv6 armv7 armv7s i386 ppc ppc64 ppc7400 ppc970 x86_64";
@@ -4171,10 +4172,12 @@
 				LLVM_BUILD_DIR_ARCH = "$(CURRENT_ARCH)/";
 				LLVM_CONFIGURATION = Release;
 				LLVM_SOURCE_DIR = "$(SRCROOT)/llvm";
+				ONLY_ACTIVE_ARCH = YES;
 				OTHER_CFLAGS = (
 					"-flimit-debug-info",
 					"-Wparentheses",
 				);
+				SDKROOT = "";
 				STRIP_INSTALLED_PRODUCT = NO;
 				STRIP_STYLE = debugging;
 				VALID_ARCHS = "armv4t armv5 armv6 armv7 armv7s i386 ppc ppc64 ppc7400 ppc970 x86_64";
@@ -4227,9 +4230,10 @@
 				ALWAYS_SEARCH_USER_PATHS = NO;
 				CLANG_LINK_OBJC_RUNTIME = NO;
 				CLANG_OBJC_RUNTIME = NO;
-				CURRENT_PROJECT_VERSION = 160;
+				COMBINE_HIDPI_IMAGES = YES;
+				CURRENT_PROJECT_VERSION = 162;
 				DYLIB_COMPATIBILITY_VERSION = 1;
-				DYLIB_CURRENT_VERSION = 160;
+				DYLIB_CURRENT_VERSION = 162;
 				EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports";
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -4261,8 +4265,6 @@
 					"-lllvmclang",
 					"-framework",
 					Foundation,
-					"-framework",
-					AppKit,
 					"-v",
 					"-t",
 					"-Wl,-v",
@@ -4273,8 +4275,6 @@
 					"-t",
 					"-Wl,-v",
 					"-framework",
-					UIKit,
-					"-framework",
 					Foundation,
 				);
 				PRODUCT_NAME = LLDB;
@@ -4289,10 +4289,11 @@
 				ALWAYS_SEARCH_USER_PATHS = NO;
 				CLANG_LINK_OBJC_RUNTIME = NO;
 				CLANG_OBJC_RUNTIME = NO;
-				CURRENT_PROJECT_VERSION = 160;
+				COMBINE_HIDPI_IMAGES = YES;
+				CURRENT_PROJECT_VERSION = 162;
 				DEAD_CODE_STRIPPING = YES;
 				DYLIB_COMPATIBILITY_VERSION = 1;
-				DYLIB_CURRENT_VERSION = 160;
+				DYLIB_CURRENT_VERSION = 162;
 				EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports";
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -4335,8 +4336,6 @@
 					"-t",
 					"-Wl,-v",
 					"-framework",
-					UIKit,
-					"-framework",
 					Foundation,
 				);
 				PRODUCT_NAME = LLDB;
@@ -4350,7 +4349,8 @@
 			buildSettings = {
 				ARCHS = "$(ARCHS_STANDARD_64_BIT)";
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
-				CURRENT_PROJECT_VERSION = 160;
+				COMBINE_HIDPI_IMAGES = YES;
+				CURRENT_PROJECT_VERSION = 162;
 				DEBUGGING_SYMBOLS = YES;
 				GCC_DYNAMIC_NO_PIC = NO;
 				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
@@ -4375,8 +4375,9 @@
 			buildSettings = {
 				ARCHS = "$(ARCHS_STANDARD_64_BIT)";
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+				COMBINE_HIDPI_IMAGES = YES;
 				COPY_PHASE_STRIP = YES;
-				CURRENT_PROJECT_VERSION = 160;
+				CURRENT_PROJECT_VERSION = 162;
 				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
 				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
 				MACOSX_DEPLOYMENT_TARGET = 10.7;
@@ -4392,8 +4393,9 @@
 			buildSettings = {
 				ARCHS = "$(ARCHS_STANDARD_64_BIT)";
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+				COMBINE_HIDPI_IMAGES = YES;
 				COPY_PHASE_STRIP = YES;
-				CURRENT_PROJECT_VERSION = 160;
+				CURRENT_PROJECT_VERSION = 162;
 				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
 				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
 				MACOSX_DEPLOYMENT_TARGET = 10.7;
@@ -4407,8 +4409,9 @@
 		2689FFD513353D7A00698AC0 /* Debug */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
-				CURRENT_PROJECT_VERSION = 160;
-				DYLIB_CURRENT_VERSION = 160;
+				COMBINE_HIDPI_IMAGES = YES;
+				CURRENT_PROJECT_VERSION = 162;
+				DYLIB_CURRENT_VERSION = 162;
 				EXECUTABLE_EXTENSION = a;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -4437,8 +4440,9 @@
 		2689FFD613353D7A00698AC0 /* Release */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
-				CURRENT_PROJECT_VERSION = 160;
-				DYLIB_CURRENT_VERSION = 160;
+				COMBINE_HIDPI_IMAGES = YES;
+				CURRENT_PROJECT_VERSION = 162;
+				DYLIB_CURRENT_VERSION = 162;
 				EXECUTABLE_EXTENSION = a;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -4467,8 +4471,9 @@
 		2689FFD713353D7A00698AC0 /* BuildAndIntegration */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
-				CURRENT_PROJECT_VERSION = 160;
-				DYLIB_CURRENT_VERSION = 160;
+				COMBINE_HIDPI_IMAGES = YES;
+				CURRENT_PROJECT_VERSION = 162;
+				DYLIB_CURRENT_VERSION = 162;
 				EXECUTABLE_EXTENSION = a;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -4546,6 +4551,7 @@
 					"-flimit-debug-info",
 					"-Wparentheses",
 				);
+				SDKROOT = "";
 				STRIP_INSTALLED_PRODUCT = NO;
 				STRIP_STYLE = debugging;
 				VALID_ARCHS = "armv4t armv5 armv6 armv7 armv7s i386 ppc ppc64 ppc7400 ppc970 x86_64";
@@ -4557,7 +4563,7 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				COPY_PHASE_STRIP = YES;
-				CURRENT_PROJECT_VERSION = 160;
+				CURRENT_PROJECT_VERSION = 162;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
 					"\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
@@ -4596,11 +4602,12 @@
 				ALWAYS_SEARCH_USER_PATHS = NO;
 				CLANG_LINK_OBJC_RUNTIME = NO;
 				CLANG_OBJC_RUNTIME = NO;
+				COMBINE_HIDPI_IMAGES = YES;
 				COPY_PHASE_STRIP = YES;
-				CURRENT_PROJECT_VERSION = 160;
+				CURRENT_PROJECT_VERSION = 162;
 				DEAD_CODE_STRIPPING = YES;
 				DYLIB_COMPATIBILITY_VERSION = 1;
-				DYLIB_CURRENT_VERSION = 160;
+				DYLIB_CURRENT_VERSION = 162;
 				EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports";
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -4643,8 +4650,6 @@
 					"-t",
 					"-Wl,-v",
 					"-framework",
-					UIKit,
-					"-framework",
 					Foundation,
 				);
 				PRODUCT_NAME = LLDB;
@@ -4657,6 +4662,7 @@
 		26CEF3AA14FD58BF007286B2 /* Debug */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
+				COMBINE_HIDPI_IMAGES = YES;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 			};
 			name = Debug;
@@ -4664,6 +4670,7 @@
 		26CEF3AB14FD58BF007286B2 /* Release */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
+				COMBINE_HIDPI_IMAGES = YES;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 			};
 			name = Release;
@@ -4671,6 +4678,7 @@
 		26CEF3AC14FD58BF007286B2 /* BuildAndIntegration */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
+				COMBINE_HIDPI_IMAGES = YES;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 			};
 			name = BuildAndIntegration;
@@ -4678,6 +4686,7 @@
 		26CEF3B314FD592B007286B2 /* Debug */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
+				COMBINE_HIDPI_IMAGES = YES;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 			};
 			name = Debug;
@@ -4685,6 +4694,7 @@
 		26CEF3B414FD592B007286B2 /* Release */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
+				COMBINE_HIDPI_IMAGES = YES;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 			};
 			name = Release;
@@ -4692,6 +4702,7 @@
 		26CEF3B514FD592B007286B2 /* BuildAndIntegration */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
+				COMBINE_HIDPI_IMAGES = YES;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 			};
 			name = BuildAndIntegration;
@@ -4699,6 +4710,7 @@
 		26CEF3BE14FD596A007286B2 /* Debug */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
+				COMBINE_HIDPI_IMAGES = YES;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 			};
 			name = Debug;
@@ -4706,6 +4718,7 @@
 		26CEF3BF14FD596A007286B2 /* Release */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
+				COMBINE_HIDPI_IMAGES = YES;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 			};
 			name = Release;
@@ -4713,6 +4726,7 @@
 		26CEF3C014FD596A007286B2 /* BuildAndIntegration */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
+				COMBINE_HIDPI_IMAGES = YES;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 			};
 			name = BuildAndIntegration;
@@ -4720,6 +4734,8 @@
 		26DC6A121337FE6A00FF7998 /* Debug */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
+				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "-";
+				"CODE_SIGN_IDENTITY[sdk=macosx*]" = lldb_codesign;
 				DEAD_CODE_STRIPPING = YES;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -4774,6 +4790,8 @@
 					UIKit,
 				);
 				PRODUCT_NAME = "lldb-platform";
+				"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
+				"PROVISIONING_PROFILE[sdk=macosx*]" = "";
 				SKIP_INSTALL = YES;
 				USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_SOURCE_DIR)/tools/clang/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include";
 			};
@@ -4782,6 +4800,8 @@
 		26DC6A131337FE6A00FF7998 /* Release */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
+				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "-";
+				"CODE_SIGN_IDENTITY[sdk=macosx*]" = lldb_codesign;
 				DEAD_CODE_STRIPPING = YES;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -4834,6 +4854,8 @@
 					UIKit,
 				);
 				PRODUCT_NAME = "lldb-platform";
+				"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
+				"PROVISIONING_PROFILE[sdk=macosx*]" = "";
 				SKIP_INSTALL = YES;
 				USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_SOURCE_DIR)/tools/clang/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include";
 			};
@@ -4904,7 +4926,7 @@
 		26F5C26C10F3D9A5009D5894 /* Debug */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
-				CURRENT_PROJECT_VERSION = 160;
+				CURRENT_PROJECT_VERSION = 162;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
 					"\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
@@ -4934,7 +4956,7 @@
 		26F5C26D10F3D9A5009D5894 /* Release */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
-				CURRENT_PROJECT_VERSION = 160;
+				CURRENT_PROJECT_VERSION = 162;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
 					"\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
@@ -4964,6 +4986,7 @@
 				CLANG_LINK_OBJC_RUNTIME = NO;
 				CLANG_OBJC_RUNTIME = NO;
 				CODE_SIGN_IDENTITY = "-";
+				COMBINE_HIDPI_IMAGES = YES;
 				DEPLOYMENT_LOCATION = YES;
 				DSTROOT = "$(SYMROOT)";
 				GCC_DYNAMIC_NO_PIC = NO;
@@ -4984,7 +5007,7 @@
 					"RC_BUILDIT=${RC_BUILDIT}0",
 				);
 				INSTALL_PATH = "/$(CONFIGURATION)/LLDB.framework/XPCServices";
-				IS_APPLE_CODE_SIGNED = "(anchor apple or (anchor apple generic and certificate leaf[field.1.2.840.113635.100.6.1.9]))";
+				IS_APPLE_CODE_SIGNED = "(anchor apple or (anchor apple generic and certificate leaf[field.1.2.840.113635.100.6.1.9]) or (anchor apple generic and certificate leaf[field.1.2.840.113635.100.6.1.9.1]))";
 				MACH_O_TYPE = mh_execute;
 				PRODUCT_NAME = "com.apple.lldb.$(TARGET_NAME)";
 				PROVISIONING_PROFILE = "";
@@ -4998,6 +5021,7 @@
 				CLANG_LINK_OBJC_RUNTIME = NO;
 				CLANG_OBJC_RUNTIME = NO;
 				CODE_SIGN_IDENTITY = "-";
+				COMBINE_HIDPI_IMAGES = YES;
 				COPY_PHASE_STRIP = YES;
 				DEPLOYMENT_LOCATION = YES;
 				DSTROOT = "$(SYMROOT)";
@@ -5013,7 +5037,7 @@
 					"RC_BUILDIT=${RC_BUILDIT}0",
 				);
 				INSTALL_PATH = "/$(CONFIGURATION)/LLDB.framework/XPCServices";
-				IS_APPLE_CODE_SIGNED = "(anchor apple or (anchor apple generic and certificate leaf[field.1.2.840.113635.100.6.1.9]))";
+				IS_APPLE_CODE_SIGNED = "(anchor apple or (anchor apple generic and certificate leaf[field.1.2.840.113635.100.6.1.9]) or (anchor apple generic and certificate leaf[field.1.2.840.113635.100.6.1.9.1]))";
 				MACH_O_TYPE = mh_execute;
 				PRODUCT_NAME = "com.apple.lldb.$(TARGET_NAME)";
 				PROVISIONING_PROFILE = "";
@@ -5027,6 +5051,7 @@
 				CLANG_LINK_OBJC_RUNTIME = NO;
 				CLANG_OBJC_RUNTIME = NO;
 				CODE_SIGN_IDENTITY = "-";
+				COMBINE_HIDPI_IMAGES = YES;
 				COPY_PHASE_STRIP = YES;
 				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
@@ -5040,7 +5065,7 @@
 					"RC_BUILDIT=${RC_BUILDIT}0",
 				);
 				INSTALL_PATH = "$(LLDB_FRAMEWORK_INSTALL_DIR)/LLDB.framework/XPCServices";
-				IS_APPLE_CODE_SIGNED = "(anchor apple or (anchor apple generic and certificate leaf[field.1.2.840.113635.100.6.1.9]))";
+				IS_APPLE_CODE_SIGNED = "(anchor apple or (anchor apple generic and certificate leaf[field.1.2.840.113635.100.6.1.9]) or (anchor apple generic and certificate leaf[field.1.2.840.113635.100.6.1.9.1]))";
 				MACH_O_TYPE = mh_execute;
 				PRODUCT_NAME = "com.apple.lldb.$(TARGET_NAME)";
 				PROVISIONING_PROFILE = "";
@@ -5055,6 +5080,7 @@
 				CLANG_OBJC_RUNTIME = NO;
 				CODE_SIGN_ENTITLEMENTS = source/Host/macosx/launcherXPCService/LauncherXPCService.entitlements;
 				CODE_SIGN_IDENTITY = "-";
+				COMBINE_HIDPI_IMAGES = YES;
 				DEPLOYMENT_LOCATION = YES;
 				DSTROOT = "$(SYMROOT)";
 				GCC_DYNAMIC_NO_PIC = NO;
@@ -5075,7 +5101,7 @@
 					"RC_BUILDIT=${RC_BUILDIT}0",
 				);
 				INSTALL_PATH = "/$(CONFIGURATION)/LLDB.framework/XPCServices";
-				IS_APPLE_CODE_SIGNED = "(anchor apple or (anchor apple generic and certificate leaf[field.1.2.840.113635.100.6.1.9]))";
+				IS_APPLE_CODE_SIGNED = "(anchor apple or (anchor apple generic and certificate leaf[field.1.2.840.113635.100.6.1.9]) or (anchor apple generic and certificate leaf[field.1.2.840.113635.100.6.1.9.1]))";
 				MACH_O_TYPE = mh_execute;
 				PRODUCT_NAME = "com.apple.lldb.$(TARGET_NAME)";
 				PROVISIONING_PROFILE = "";
@@ -5090,6 +5116,7 @@
 				CLANG_OBJC_RUNTIME = NO;
 				CODE_SIGN_ENTITLEMENTS = source/Host/macosx/launcherXPCService/LauncherXPCService.entitlements;
 				CODE_SIGN_IDENTITY = "-";
+				COMBINE_HIDPI_IMAGES = YES;
 				COPY_PHASE_STRIP = YES;
 				DEPLOYMENT_LOCATION = YES;
 				DSTROOT = "$(SYMROOT)";
@@ -5105,7 +5132,7 @@
 					"RC_BUILDIT=${RC_BUILDIT}0",
 				);
 				INSTALL_PATH = "/$(CONFIGURATION)/LLDB.framework/XPCServices";
-				IS_APPLE_CODE_SIGNED = "(anchor apple or (anchor apple generic and certificate leaf[field.1.2.840.113635.100.6.1.9]))";
+				IS_APPLE_CODE_SIGNED = "(anchor apple or (anchor apple generic and certificate leaf[field.1.2.840.113635.100.6.1.9]) or (anchor apple generic and certificate leaf[field.1.2.840.113635.100.6.1.9.1]))";
 				MACH_O_TYPE = mh_execute;
 				PRODUCT_NAME = "com.apple.lldb.$(TARGET_NAME)";
 				PROVISIONING_PROFILE = "";
@@ -5120,6 +5147,7 @@
 				CLANG_OBJC_RUNTIME = NO;
 				CODE_SIGN_ENTITLEMENTS = source/Host/macosx/launcherXPCService/LauncherXPCService.entitlements;
 				CODE_SIGN_IDENTITY = "-";
+				COMBINE_HIDPI_IMAGES = YES;
 				COPY_PHASE_STRIP = YES;
 				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
@@ -5133,7 +5161,7 @@
 					"RC_BUILDIT=${RC_BUILDIT}0",
 				);
 				INSTALL_PATH = "$(LLDB_FRAMEWORK_INSTALL_DIR)/LLDB.framework/XPCServices";
-				IS_APPLE_CODE_SIGNED = "(anchor apple or (anchor apple generic and certificate leaf[field.1.2.840.113635.100.6.1.9]))";
+				IS_APPLE_CODE_SIGNED = "(anchor apple or (anchor apple generic and certificate leaf[field.1.2.840.113635.100.6.1.9]) or (anchor apple generic and certificate leaf[field.1.2.840.113635.100.6.1.9.1]))";
 				MACH_O_TYPE = mh_execute;
 				PRODUCT_NAME = "com.apple.lldb.$(TARGET_NAME)";
 				PROVISIONING_PROFILE = "";

Modified: lldb/branches/lldb-platform-work/lldb.xcodeproj/xcshareddata/xcschemes/LLDB.xcscheme
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/lldb.xcodeproj/xcshareddata/xcschemes/LLDB.xcscheme?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/lldb.xcodeproj/xcshareddata/xcschemes/LLDB.xcscheme (original)
+++ lldb/branches/lldb-platform-work/lldb.xcodeproj/xcshareddata/xcschemes/LLDB.xcscheme Mon Jul 23 19:12:48 2012
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Scheme
-   LastUpgradeVersion = "0430"
+   LastUpgradeVersion = "0450"
    version = "1.8">
    <BuildAction
       parallelizeBuildables = "NO"
@@ -23,7 +23,7 @@
       </BuildActionEntries>
    </BuildAction>
    <TestAction
-      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
       selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
       shouldUseLaunchSchemeArgsEnv = "YES"
       buildConfiguration = "Debug">
@@ -56,6 +56,7 @@
       buildConfiguration = "Debug"
       ignoresPersistentStateOnLaunch = "NO"
       debugDocumentVersioning = "YES"
+      enableOpenGLFrameCaptureMode = "0"
       allowLocationSimulation = "YES">
       <BuildableProductRunnable>
          <BuildableReference

Modified: lldb/branches/lldb-platform-work/lldb.xcodeproj/xcshareddata/xcschemes/darwin-debug.xcscheme
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/lldb.xcodeproj/xcshareddata/xcschemes/darwin-debug.xcscheme?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/lldb.xcodeproj/xcshareddata/xcschemes/darwin-debug.xcscheme (original)
+++ lldb/branches/lldb-platform-work/lldb.xcodeproj/xcshareddata/xcschemes/darwin-debug.xcscheme Mon Jul 23 19:12:48 2012
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Scheme
-   LastUpgradeVersion = "0430"
+   LastUpgradeVersion = "0450"
    version = "1.8">
    <BuildAction
       parallelizeBuildables = "NO"
@@ -23,7 +23,7 @@
       </BuildActionEntries>
    </BuildAction>
    <TestAction
-      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
       selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
       shouldUseLaunchSchemeArgsEnv = "YES"
       buildConfiguration = "Debug">
@@ -47,6 +47,7 @@
       buildConfiguration = "Debug"
       ignoresPersistentStateOnLaunch = "NO"
       debugDocumentVersioning = "YES"
+      enableOpenGLFrameCaptureMode = "0"
       allowLocationSimulation = "YES">
       <BuildableProductRunnable>
          <BuildableReference

Modified: lldb/branches/lldb-platform-work/lldb.xcodeproj/xcshareddata/xcschemes/launcherRootXPCService.xcscheme
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/lldb.xcodeproj/xcshareddata/xcschemes/launcherRootXPCService.xcscheme?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/lldb.xcodeproj/xcshareddata/xcschemes/launcherRootXPCService.xcscheme (original)
+++ lldb/branches/lldb-platform-work/lldb.xcodeproj/xcshareddata/xcschemes/launcherRootXPCService.xcscheme Mon Jul 23 19:12:48 2012
@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Scheme
+   LastUpgradeVersion = "0450"
    version = "1.3">
    <BuildAction
       parallelizeBuildables = "YES"
@@ -37,6 +38,7 @@
       buildConfiguration = "Debug"
       ignoresPersistentStateOnLaunch = "NO"
       debugDocumentVersioning = "YES"
+      enableOpenGLFrameCaptureMode = "0"
       allowLocationSimulation = "YES">
       <AdditionalOptions>
       </AdditionalOptions>

Modified: lldb/branches/lldb-platform-work/lldb.xcodeproj/xcshareddata/xcschemes/launcherXPCService.xcscheme
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/lldb.xcodeproj/xcshareddata/xcschemes/launcherXPCService.xcscheme?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/lldb.xcodeproj/xcshareddata/xcschemes/launcherXPCService.xcscheme (original)
+++ lldb/branches/lldb-platform-work/lldb.xcodeproj/xcshareddata/xcschemes/launcherXPCService.xcscheme Mon Jul 23 19:12:48 2012
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Scheme
-   LastUpgradeVersion = "0440"
+   LastUpgradeVersion = "0450"
    version = "1.3">
    <BuildAction
       parallelizeBuildables = "YES"
@@ -38,6 +38,7 @@
       buildConfiguration = "Debug"
       ignoresPersistentStateOnLaunch = "NO"
       debugDocumentVersioning = "YES"
+      enableOpenGLFrameCaptureMode = "0"
       allowLocationSimulation = "YES">
       <PathRunnable
          FilePath = "/Users/moi/Library/Developer/Xcode/DerivedData/Xcode-ezhudafllefyhcfivqaeslnymjsj/Build/Products/Debug/LLDB.framework/XPCServices/com.apple.lldb.launcherXPCService.xpc/Contents/MacOS/com.apple.lldb.launcherXPCService">

Modified: lldb/branches/lldb-platform-work/lldb.xcodeproj/xcshareddata/xcschemes/lldb-tool.xcscheme
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/lldb.xcodeproj/xcshareddata/xcschemes/lldb-tool.xcscheme?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/lldb.xcodeproj/xcshareddata/xcschemes/lldb-tool.xcscheme (original)
+++ lldb/branches/lldb-platform-work/lldb.xcodeproj/xcshareddata/xcschemes/lldb-tool.xcscheme Mon Jul 23 19:12:48 2012
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Scheme
-   LastUpgradeVersion = "0430"
+   LastUpgradeVersion = "0450"
    version = "1.3">
    <BuildAction
       parallelizeBuildables = "NO"
@@ -23,7 +23,7 @@
       </BuildActionEntries>
    </BuildAction>
    <TestAction
-      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
       selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
       shouldUseLaunchSchemeArgsEnv = "YES"
       buildConfiguration = "Debug">
@@ -90,6 +90,7 @@
       buildConfiguration = "Debug"
       ignoresPersistentStateOnLaunch = "YES"
       debugDocumentVersioning = "YES"
+      enableOpenGLFrameCaptureMode = "0"
       allowLocationSimulation = "YES">
       <BuildableProductRunnable>
          <BuildableReference

Modified: lldb/branches/lldb-platform-work/llvm.zip
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/llvm.zip?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
Binary files - no diff available.

Modified: lldb/branches/lldb-platform-work/resources/LLDB-Info.plist
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/resources/LLDB-Info.plist?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/resources/LLDB-Info.plist (original)
+++ lldb/branches/lldb-platform-work/resources/LLDB-Info.plist Mon Jul 23 19:12:48 2012
@@ -17,7 +17,7 @@
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleVersion</key>
-	<string>160</string>
+	<string>162</string>
 	<key>CFBundleName</key>
 	<string>${EXECUTABLE_NAME}</string>
 </dict>

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBAddress.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBAddress.i?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBAddress.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBAddress.i Mon Jul 23 19:12:48 2012
@@ -149,49 +149,50 @@
             return self.SetLoadAddress (load_addr, target)
 
         def __int__(self):
-            '''Convert an address to a load address if there is a process and that
-            process is alive, or to a file address otherwise.'''
+            '''Convert an address to a load address if there is a process and that process is alive, or to a file address otherwise.'''
             if process.is_alive:
                 return self.GetLoadAddress (target)
             else:
                 return self.GetFileAddress ()
 
         def __oct__(self):
+            '''Convert the address to an octal string'''
             return '%o' % int(self)
 
         def __hex__(self):
+            '''Convert the address to an hex string'''
             return '0x%x' % int(self)
 
         __swig_getmethods__["module"] = GetModule
-        if _newclass: module = property(GetModule, None, doc='Returns the same result as GetModule()')
+        if _newclass: module = property(GetModule, None, doc='''A read only property that returns an lldb object that represents the module (lldb.SBModule) that this address resides within.''')
 
         __swig_getmethods__["compile_unit"] = GetCompileUnit
-        if _newclass: compile_unit = property(GetCompileUnit, None, doc='Returns the same result as GetCompileUnit()')
+        if _newclass: compile_unit = property(GetCompileUnit, None, doc='''A read only property that returns an lldb object that represents the compile unit (lldb.SBCompileUnit) that this address resides within.''')
 
         __swig_getmethods__["line_entry"] = GetLineEntry
-        if _newclass: line_entry = property(GetLineEntry, None, doc='Returns the same result as GetLineEntry()')
+        if _newclass: line_entry = property(GetLineEntry, None, doc='''A read only property that returns an lldb object that represents the line entry (lldb.SBLineEntry) that this address resides within.''')
 
         __swig_getmethods__["function"] = GetFunction
-        if _newclass: function = property(GetFunction, None, doc='Returns the same result as GetFunction()')
+        if _newclass: function = property(GetFunction, None, doc='''A read only property that returns an lldb object that represents the function (lldb.SBFunction) that this address resides within.''')
 
         __swig_getmethods__["block"] = GetBlock
-        if _newclass: block = property(GetBlock, None, doc='Returns the same result as GetBlock()')
+        if _newclass: block = property(GetBlock, None, doc='''A read only property that returns an lldb object that represents the block (lldb.SBBlock) that this address resides within.''')
 
         __swig_getmethods__["symbol"] = GetSymbol
-        if _newclass: symbol = property(GetSymbol, None, doc='Returns the same result as GetSymbol()')
+        if _newclass: symbol = property(GetSymbol, None, doc='''A read only property that returns an lldb object that represents the symbol (lldb.SBSymbol) that this address resides within.''')
 
         __swig_getmethods__["offset"] = GetOffset
-        if _newclass: offset = property(GetOffset, None, doc='Returns the same result as GetOffset()')
+        if _newclass: offset = property(GetOffset, None, doc='''A read only property that returns the section offset in bytes as an integer.''')
 
         __swig_getmethods__["section"] = GetSection
-        if _newclass: section = property(GetSection, None, doc='Returns the same result as GetSection()')
+        if _newclass: section = property(GetSection, None, doc='''A read only property that returns an lldb object that represents the section (lldb.SBSection) that this address resides within.''')
 
         __swig_getmethods__["file_addr"] = GetFileAddress
-        if _newclass: file_addr = property(GetFileAddress, None, doc='Returns the same result as GetFileAddress()')
+        if _newclass: file_addr = property(GetFileAddress, None, doc='''A read only property that returns file address for the section as an integer. This is the address that represents the address as it is found in the object file that defines it.''')
 
         __swig_getmethods__["load_addr"] = __get_load_addr_property__
         __swig_setmethods__["load_addr"] = __set_load_addr_property__
-        if _newclass: load_addr = property(__get_load_addr_property__, __set_load_addr_property__, doc='Returns a corresponding load address, resolving this SBAddress via lldb.target')
+        if _newclass: load_addr = property(__get_load_addr_property__, __set_load_addr_property__, doc='''A read/write property that gets/sets the SBAddress using load address. The setter resolves SBAddress using the SBTarget from lldb.target.''')
 
     %}
 

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBBlock.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBBlock.i?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBBlock.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBBlock.i Mon Jul 23 19:12:48 2012
@@ -147,31 +147,31 @@
             return declaration(self.GetInlinedCallSiteFile(), self.GetInlinedCallSiteLine(), self.GetInlinedCallSiteColumn())
 
         __swig_getmethods__["parent"] = GetParent
-        if _newclass: x = property(GetParent, None)
+        if _newclass: parent = property(GetParent, None, doc='''A read only property that returns the same result as GetParent().''')
 
         __swig_getmethods__["first_child"] = GetFirstChild
-        if _newclass: x = property(GetFirstChild, None)
+        if _newclass: first_child = property(GetFirstChild, None, doc='''A read only property that returns the same result as GetFirstChild().''')
         
         __swig_getmethods__["call_site"] = get_call_site
-        if _newclass: x = property(get_call_site, None)
+        if _newclass: call_site = property(get_call_site, None, doc='''A read only property that returns a lldb.declaration object that contains the inlined call site file, line and column.''')
         
         __swig_getmethods__["sibling"] = GetSibling
-        if _newclass: x = property(GetSibling, None)
+        if _newclass: sibling = property(GetSibling, None, doc='''A read only property that returns the same result as GetSibling().''')
 
         __swig_getmethods__["name"] = GetInlinedName
-        if _newclass: x = property(GetInlinedName, None)
+        if _newclass: name = property(GetInlinedName, None, doc='''A read only property that returns the same result as GetInlinedName().''')
 
         __swig_getmethods__["inlined_block"] = GetContainingInlinedBlock
-        if _newclass: x = property(GetContainingInlinedBlock, None)
+        if _newclass: inlined_block = property(GetContainingInlinedBlock, None, doc='''A read only property that returns the same result as GetContainingInlinedBlock().''')
 
         __swig_getmethods__["range"] = get_ranges_access_object
-        if _newclass: x = property(get_ranges_access_object, None)
+        if _newclass: range = property(get_ranges_access_object, None, doc='''A read only property that allows item access to the address ranges for a block by integer (range = block.range[0]) and by lldb.SBAdddress (find the range that contains the specified lldb.SBAddress like "pc_range = lldb.frame.block.range[frame.addr]").''')
 
         __swig_getmethods__["ranges"] = get_ranges_array
-        if _newclass: x = property(get_ranges_array, None)
+        if _newclass: ranges = property(get_ranges_array, None, doc='''A read only property that returns a list() object that contains all of the address ranges for the block.''')
 
         __swig_getmethods__["num_ranges"] = GetNumRanges
-        if _newclass: x = property(GetNumRanges, None)
+        if _newclass: num_ranges = property(GetNumRanges, None, doc='''A read only property that returns the same result as GetNumRanges().''')
     %}
 
 };

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBCompileUnit.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBCompileUnit.i?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBCompileUnit.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBCompileUnit.i Mon Jul 23 19:12:48 2012
@@ -91,10 +91,10 @@
     
     %pythoncode %{
         __swig_getmethods__["file"] = GetFileSpec
-        if _newclass: x = property(GetFileSpec, None)
+        if _newclass: file = property(GetFileSpec, None, doc='''A read only property that returns the same result an lldb object that represents the source file (lldb.SBFileSpec) for the compile unit.''')
         
         __swig_getmethods__["num_line_entries"] = GetNumLineEntries
-        if _newclass: x = property(GetNumLineEntries, None)
+        if _newclass: num_line_entries = property(GetNumLineEntries, None, doc='''A read only property that returns the number of line entries in a compile unit as an integer.''')
     %}
 };
 

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBData.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBData.i?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBData.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBData.i Mon Jul 23 19:12:48 2012
@@ -224,74 +224,74 @@
             return self._make_helper_double().all()
 
         __swig_getmethods__["uint8"] = _make_helper_uint8
-        if _newclass: uint8 = property(_make_helper_uint8, None, doc='Returns an array-like object out of which you can read uint8 values')
+        if _newclass: uint8 = property(_make_helper_uint8, None, doc='''A read only property that returns an array-like object out of which you can read uint8 values.''')
         
         __swig_getmethods__["uint16"] = _make_helper_uint16
-        if _newclass: uint16 = property(_make_helper_uint16, None, doc='Returns an array-like object out of which you can read uint16 values')
+        if _newclass: uint16 = property(_make_helper_uint16, None, doc='''A read only property that returns an array-like object out of which you can read uint16 values.''')
         
         __swig_getmethods__["uint32"] = _make_helper_uint32
-        if _newclass: uint32 = property(_make_helper_uint32, None, doc='Returns an array-like object out of which you can read uint32 values')
+        if _newclass: uint32 = property(_make_helper_uint32, None, doc='''A read only property that returns an array-like object out of which you can read uint32 values.''')
         
         __swig_getmethods__["uint64"] = _make_helper_uint64
-        if _newclass: uint64 = property(_make_helper_uint64, None, doc='Returns an array-like object out of which you can read uint64 values')
+        if _newclass: uint64 = property(_make_helper_uint64, None, doc='''A read only property that returns an array-like object out of which you can read uint64 values.''')
 
         __swig_getmethods__["sint8"] = _make_helper_sint8
-        if _newclass: sint8 = property(_make_helper_sint8, None, doc='Returns an array-like object out of which you can read sint8 values')
+        if _newclass: sint8 = property(_make_helper_sint8, None, doc='''A read only property that returns an array-like object out of which you can read sint8 values.''')
         
         __swig_getmethods__["sint16"] = _make_helper_sint16
-        if _newclass: sint16 = property(_make_helper_sint16, None, doc='Returns an array-like object out of which you can read sint16 values')
+        if _newclass: sint16 = property(_make_helper_sint16, None, doc='''A read only property that returns an array-like object out of which you can read sint16 values.''')
         
         __swig_getmethods__["sint32"] = _make_helper_sint32
-        if _newclass: sint32 = property(_make_helper_sint32, None, doc='Returns an array-like object out of which you can read sint32 values')
+        if _newclass: sint32 = property(_make_helper_sint32, None, doc='''A read only property that returns an array-like object out of which you can read sint32 values.''')
         
         __swig_getmethods__["sint64"] = _make_helper_sint64
-        if _newclass: sint64 = property(_make_helper_sint64, None, doc='Returns an array-like object out of which you can read sint64 values')
+        if _newclass: sint64 = property(_make_helper_sint64, None, doc='''A read only property that returns an array-like object out of which you can read sint64 values.''')
         
         __swig_getmethods__["float"] = _make_helper_float
-        if _newclass: float = property(_make_helper_float, None, doc='Returns an array-like object out of which you can read float values')
+        if _newclass: float = property(_make_helper_float, None, doc='''A read only property that returns an array-like object out of which you can read float values.''')
 
         __swig_getmethods__["double"] = _make_helper_double
-        if _newclass: double = property(_make_helper_double, None, doc='Returns an array-like object out of which you can read double values')
+        if _newclass: double = property(_make_helper_double, None, doc='''A read only property that returns an array-like object out of which you can read double values.''')
                   
         __swig_getmethods__["uint8s"] = _read_all_uint8
-        if _newclass: uint8s = property(_read_all_uint8, None, doc='Returns an array with all the contents of this SBData represented as uint8 values')
+        if _newclass: uint8s = property(_read_all_uint8, None, doc='''A read only property that returns an array with all the contents of this SBData represented as uint8 values.''')
         
         __swig_getmethods__["uint16s"] = _read_all_uint16
-        if _newclass: uint16s = property(_read_all_uint16, None, doc='Returns an array with all the contents of this SBData represented as uint16 values')
+        if _newclass: uint16s = property(_read_all_uint16, None, doc='''A read only property that returns an array with all the contents of this SBData represented as uint16 values.''')
         
         __swig_getmethods__["uint32s"] = _read_all_uint32
-        if _newclass: uint32s = property(_read_all_uint32, None, doc='Returns an array with all the contents of this SBData represented as uint32 values')
+        if _newclass: uint32s = property(_read_all_uint32, None, doc='''A read only property that returns an array with all the contents of this SBData represented as uint32 values.''')
         
         __swig_getmethods__["uint64s"] = _read_all_uint64
-        if _newclass: uint64s = property(_read_all_uint64, None, doc='Returns an array with all the contents of this SBData represented as uint64 values')
+        if _newclass: uint64s = property(_read_all_uint64, None, doc='''A read only property that returns an array with all the contents of this SBData represented as uint64 values.''')
 
         __swig_getmethods__["sint8s"] = _read_all_sint8
-        if _newclass: sint8s = property(_read_all_sint8, None, doc='Returns an array with all the contents of this SBData represented as sint8 values')
+        if _newclass: sint8s = property(_read_all_sint8, None, doc='''A read only property that returns an array with all the contents of this SBData represented as sint8 values.''')
         
         __swig_getmethods__["sint16s"] = _read_all_sint16
-        if _newclass: sint16s = property(_read_all_sint16, None, doc='Returns an array with all the contents of this SBData represented as sint16 values')
+        if _newclass: sint16s = property(_read_all_sint16, None, doc='''A read only property that returns an array with all the contents of this SBData represented as sint16 values.''')
         
         __swig_getmethods__["sint32s"] = _read_all_sint32
-        if _newclass: sint32s = property(_read_all_sint32, None, doc='Returns an array with all the contents of this SBData represented as sint32 values')
+        if _newclass: sint32s = property(_read_all_sint32, None, doc='''A read only property that returns an array with all the contents of this SBData represented as sint32 values.''')
         
         __swig_getmethods__["sint64s"] = _read_all_sint64
-        if _newclass: sint64s = property(_read_all_sint64, None, doc='Returns an array with all the contents of this SBData represented as sint64 values')
+        if _newclass: sint64s = property(_read_all_sint64, None, doc='''A read only property that returns an array with all the contents of this SBData represented as sint64 values.''')
         
         __swig_getmethods__["floats"] = _read_all_float
-        if _newclass: floats = property(_read_all_float, None, doc='Returns an array with all the contents of this SBData represented as float values')
+        if _newclass: floats = property(_read_all_float, None, doc='''A read only property that returns an array with all the contents of this SBData represented as float values.''')
 
         __swig_getmethods__["doubles"] = _read_all_double
-        if _newclass: doubles = property(_read_all_double, None, doc='Returns an array with all the contents of this SBData represented as double values')
+        if _newclass: doubles = property(_read_all_double, None, doc='''A read only property that returns an array with all the contents of this SBData represented as double values.''')
                   
     %}
     
     %pythoncode %{
         __swig_getmethods__["byte_order"] = GetByteOrder
         __swig_setmethods__["byte_order"] = SetByteOrder
-        if _newclass: byte_order = property(GetByteOrder, SetByteOrder, doc='Allows getting and setting the endianness of this SBData object')
+        if _newclass: byte_order = property(GetByteOrder, SetByteOrder, doc='''A read/write property getting and setting the endianness of this SBData (data.byte_order = lldb.eByteOrderLittle).''')
         
         __swig_getmethods__["size"] = GetByteSize
-        if _newclass: size = property(GetByteSize, None, doc='Returns the size (in bytes) of the contents of this SBData object')
+        if _newclass: size = property(GetByteSize, None, doc='''A read only property that returns the size the same result as GetByteSize().''')
         
     %}
 

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBError.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBError.i?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBError.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBError.i Mon Jul 23 19:12:48 2012
@@ -105,19 +105,19 @@
     
     %pythoncode %{
         __swig_getmethods__["value"] = GetError
-        if _newclass: x = property(GetError, None)
+        if _newclass: value = property(GetError, None, doc='''A read only property that returns the same result as GetError().''')
         
         __swig_getmethods__["fail"] = Fail
-        if _newclass: x = property(Fail, None)
+        if _newclass: fail = property(Fail, None, doc='''A read only property that returns the same result as Fail().''')
         
         __swig_getmethods__["success"] = Success
-        if _newclass: x = property(Success, None)
+        if _newclass: success = property(Success, None, doc='''A read only property that returns the same result as Success().''')
         
         __swig_getmethods__["description"] = GetCString
-        if _newclass: x = property(GetCString, None)
+        if _newclass: description = property(GetCString, None, doc='''A read only property that returns the same result as GetCString().''')
         
         __swig_getmethods__["type"] = GetType
-        if _newclass: x = property(GetType, None)
+        if _newclass: type = property(GetType, None, doc='''A read only property that returns the same result as GetType().''')
         
     %}
 

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBFileSpec.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBFileSpec.i?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBFileSpec.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBFileSpec.i Mon Jul 23 19:12:48 2012
@@ -80,16 +80,16 @@
             return None
 
         __swig_getmethods__["fullpath"] = __get_fullpath__
-        if _newclass: x = property(__get_fullpath__, None)
+        if _newclass: fullpath = property(__get_fullpath__, None, doc='''A read only property that returns the fullpath as a python string.''')
 
         __swig_getmethods__["basename"] = GetFilename
-        if _newclass: x = property(GetFilename, None)
+        if _newclass: basename = property(GetFilename, None, doc='''A read only property that returns the path basename as a python string.''')
         
         __swig_getmethods__["dirname"] = GetDirectory
-        if _newclass: x = property(GetDirectory, None)
+        if _newclass: dirname = property(GetDirectory, None, doc='''A read only property that returns the path directory name as a python string.''')
         
         __swig_getmethods__["exists"] = Exists
-        if _newclass: x = property(Exists, None)
+        if _newclass: exists = property(Exists, None, doc='''A read only property that returns a boolean value that indicates if the file exists.''')
     %}
 
 };

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBFrame.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBFrame.i?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBFrame.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBFrame.i Mon Jul 23 19:12:48 2012
@@ -272,73 +272,73 @@
 
         __swig_getmethods__["pc"] = GetPC
         __swig_setmethods__["pc"] = SetPC
-        if _newclass: x = property(GetPC, SetPC)
+        if _newclass: pc = property(GetPC, SetPC)
 
         __swig_getmethods__["addr"] = GetPCAddress
-        if _newclass: x = property(GetPCAddress, None)
+        if _newclass: addr = property(GetPCAddress, None, doc='''A read only property that returns the program counter (PC) as a section offset address (lldb.SBAddress).''')
 
         __swig_getmethods__["fp"] = GetFP
-        if _newclass: x = property(GetFP, None)
+        if _newclass: fp = property(GetFP, None, doc='''A read only property that returns the frame pointer (FP) as an unsigned integer.''')
 
         __swig_getmethods__["sp"] = GetSP
-        if _newclass: x = property(GetSP, None)
+        if _newclass: sp = property(GetSP, None, doc='''A read only property that returns the stack pointer (SP) as an unsigned integer.''')
 
         __swig_getmethods__["module"] = GetModule
-        if _newclass: x = property(GetModule, None)
+        if _newclass: module = property(GetModule, None, doc='''A read only property that returns an lldb object that represents the module (lldb.SBModule) for this stack frame.''')
 
         __swig_getmethods__["compile_unit"] = GetCompileUnit
-        if _newclass: x = property(GetCompileUnit, None)
+        if _newclass: compile_unit = property(GetCompileUnit, None, doc='''A read only property that returns an lldb object that represents the compile unit (lldb.SBCompileUnit) for this stack frame.''')
 
         __swig_getmethods__["function"] = GetFunction
-        if _newclass: x = property(GetFunction, None)
+        if _newclass: function = property(GetFunction, None, doc='''A read only property that returns an lldb object that represents the function (lldb.SBFunction) for this stack frame.''')
 
         __swig_getmethods__["symbol"] = GetSymbol
-        if _newclass: x = property(GetSymbol, None)
+        if _newclass: symbol = property(GetSymbol, None, doc='''A read only property that returns an lldb object that represents the symbol (lldb.SBSymbol) for this stack frame.''')
 
         __swig_getmethods__["block"] = GetBlock
-        if _newclass: x = property(GetBlock, None)
+        if _newclass: block = property(GetBlock, None, doc='''A read only property that returns an lldb object that represents the block (lldb.SBBlock) for this stack frame.''')
 
         __swig_getmethods__["is_inlined"] = IsInlined
-        if _newclass: x = property(IsInlined, None)
+        if _newclass: is_inlined = property(IsInlined, None, doc='''A read only property that returns an boolean that indicates if the block frame is an inlined function.''')
 
         __swig_getmethods__["name"] = GetFunctionName
-        if _newclass: x = property(GetFunctionName, None)
+        if _newclass: name = property(GetFunctionName, None, doc='''A read only property that retuns the name for the function that this frame represents. Inlined stack frame might have a concrete function that differs from the name of the inlined function (a named lldb.SBBlock).''')
 
         __swig_getmethods__["line_entry"] = GetLineEntry
-        if _newclass: x = property(GetLineEntry, None)
+        if _newclass: line_entry = property(GetLineEntry, None, doc='''A read only property that returns an lldb object that represents the line table entry (lldb.SBLineEntry) for this stack frame.''')
 
         __swig_getmethods__["thread"] = GetThread
-        if _newclass: x = property(GetThread, None)
+        if _newclass: thread = property(GetThread, None, doc='''A read only property that returns an lldb object that represents the thread (lldb.SBThread) for this stack frame.''')
 
         __swig_getmethods__["disassembly"] = Disassemble
-        if _newclass: x = property(Disassemble, None)
+        if _newclass: disassembly = property(Disassemble, None, doc='''A read only property that returns the disassembly for this stack frame as a python string.''')
 
         __swig_getmethods__["idx"] = GetFrameID
-        if _newclass: x = property(GetFrameID, None)
+        if _newclass: idx = property(GetFrameID, None, doc='''A read only property that returns the zero based stack frame index.''')
 
         __swig_getmethods__["variables"] = get_all_variables
-        if _newclass: x = property(get_all_variables, None)
+        if _newclass: variables = property(get_all_variables, None, doc='''A read only property that returns a list() that contains a collection of lldb.SBValue objects that represent the variables in this stack frame.''')
 
         __swig_getmethods__["vars"] = get_all_variables
-        if _newclass: x = property(get_all_variables, None)
+        if _newclass: vars = property(get_all_variables, None, doc='''A read only property that returns a list() that contains a collection of lldb.SBValue objects that represent the variables in this stack frame.''')
 
         __swig_getmethods__["locals"] = get_locals
-        if _newclass: x = property(get_locals, None)
+        if _newclass: locals = property(get_locals, None, doc='''A read only property that returns a list() that contains a collection of lldb.SBValue objects that represent the local variables in this stack frame.''')
 
         __swig_getmethods__["args"] = get_arguments
-        if _newclass: x = property(get_arguments, None)
+        if _newclass: args = property(get_arguments, None, doc='''A read only property that returns a list() that contains a collection of lldb.SBValue objects that represent the argument variables in this stack frame.''')
 
         __swig_getmethods__["arguments"] = get_arguments
-        if _newclass: x = property(get_arguments, None)
+        if _newclass: arguments = property(get_arguments, None, doc='''A read only property that returns a list() that contains a collection of lldb.SBValue objects that represent the argument variables in this stack frame.''')
 
         __swig_getmethods__["statics"] = get_statics
-        if _newclass: x = property(get_statics, None)
+        if _newclass: statics = property(get_statics, None, doc='''A read only property that returns a list() that contains a collection of lldb.SBValue objects that represent the static variables in this stack frame.''')
 
         __swig_getmethods__["registers"] = GetRegisters
-        if _newclass: x = property(GetRegisters, None)
+        if _newclass: registers = property(GetRegisters, None, doc='''A read only property that returns a list() that contains a collection of lldb.SBValue objects that represent the CPU registers for this stack frame.''')
 
         __swig_getmethods__["regs"] = GetRegisters
-        if _newclass: x = property(GetRegisters, None)
+        if _newclass: regs = property(GetRegisters, None, doc='''A read only property that returns a list() that contains a collection of lldb.SBValue objects that represent the CPU registers for this stack frame.''')
 
     %}
 };

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBFunction.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBFunction.i?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBFunction.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBFunction.i Mon Jul 23 19:12:48 2012
@@ -88,28 +88,28 @@
             return self.GetInstructions (target)
 
         __swig_getmethods__["addr"] = GetStartAddress
-        if _newclass: x = property(GetStartAddress, None)
+        if _newclass: addr = property(GetStartAddress, None, doc='''A read only property that returns an lldb object that represents the start address (lldb.SBAddress) for this function.''')
 
+        __swig_getmethods__["end_addr"] = GetEndAddress
+        if _newclass: end_addr = property(GetEndAddress, None, doc='''A read only property that returns an lldb object that represents the end address (lldb.SBAddress) for this function.''')
+                
         __swig_getmethods__["block"] = GetBlock
-        if _newclass: x = property(GetBlock, None)
+        if _newclass: block = property(GetBlock, None, doc='''A read only property that returns an lldb object that represents the top level lexical block (lldb.SBBlock) for this function.''')
 
-        __swig_getmethods__["end_addr"] = GetEndAddress
-        if _newclass: x = property(GetEndAddress, None)
-        
         __swig_getmethods__["instructions"] = get_instructions_from_current_target
-        if _newclass: x = property(get_instructions_from_current_target, None)
+        if _newclass: instructions = property(get_instructions_from_current_target, None, doc='''A read only property that returns an lldb object that represents the instructions (lldb.SBInstructionList) for this function.''')
 
         __swig_getmethods__["mangled"] = GetMangledName
-        if _newclass: x = property(GetMangledName, None)
+        if _newclass: mangled = property(GetMangledName, None, doc='''A read only property that returns the mangled (linkage) name for this function as a string.''')
 
         __swig_getmethods__["name"] = GetName
-        if _newclass: x = property(GetName, None)
+        if _newclass: name = property(GetName, None, doc='''A read only property that returns the name for this function as a string.''')
 
         __swig_getmethods__["prologue_size"] = GetPrologueByteSize
-        if _newclass: x = property(GetPrologueByteSize, None)
+        if _newclass: prologue_size = property(GetPrologueByteSize, None, doc='''A read only property that returns the size in bytes of the prologue instructions as an unsigned integer.''')
 
         __swig_getmethods__["type"] = GetType
-        if _newclass: x = property(GetType, None)
+        if _newclass: type = property(GetType, None, doc='''A read only property that returns an lldb object that represents the return type (lldb.SBType) for this function.''')
     %}
 
 };

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBInstruction.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBInstruction.i?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBInstruction.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBInstruction.i Mon Jul 23 19:12:48 2012
@@ -79,22 +79,22 @@
             return self.GetComment (target)
 
         __swig_getmethods__["mnemonic"] = __mnemonic_property__
-        if _newclass: x = property(__mnemonic_property__, None)
+        if _newclass: mnemonic = property(__mnemonic_property__, None, doc='''A read only property that returns the mnemonic for this instruction as a string.''')
 
         __swig_getmethods__["operands"] = __operands_property__
-        if _newclass: x = property(__operands_property__, None)
+        if _newclass: operands = property(__operands_property__, None, doc='''A read only property that returns the operands for this instruction as a string.''')
 
         __swig_getmethods__["comment"] = __comment_property__
-        if _newclass: x = property(__comment_property__, None)
+        if _newclass: comment = property(__comment_property__, None, doc='''A read only property that returns the comment for this instruction as a string.''')
 
         __swig_getmethods__["addr"] = GetAddress
-        if _newclass: x = property(GetAddress, None)
+        if _newclass: addr = property(GetAddress, None, doc='''A read only property that returns an lldb object that represents the address (lldb.SBAddress) for this instruction.''')
         
         __swig_getmethods__["size"] = GetByteSize
-        if _newclass: x = property(GetByteSize, None)
+        if _newclass: size = property(GetByteSize, None, doc='''A read only property that returns the size in bytes for this instruction as an integer.''')
 
         __swig_getmethods__["is_branch"] = DoesBranch
-        if _newclass: x = property(DoesBranch, None)
+        if _newclass: is_branch = property(DoesBranch, None, doc='''A read only property that returns a boolean value that indicates if this instruction is a branch instruction.''')
     %}
     
 

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBInstructionList.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBInstructionList.i?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBInstructionList.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBInstructionList.i Mon Jul 23 19:12:48 2012
@@ -65,7 +65,7 @@
             return int(self.GetSize())
 
         def __getitem__(self, key):
-            '''Access instructions by integer index.'''
+            '''Access instructions by integer index for array access or by lldb.SBAddress to find an instruction that matches a section offset address object.'''
             if type(key) is int:
                 # Find an instruction by index
                 if key < len(self):

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBLineEntry.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBLineEntry.i?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBLineEntry.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBLineEntry.i Mon Jul 23 19:12:48 2012
@@ -79,19 +79,19 @@
 
     %pythoncode %{
         __swig_getmethods__["file"] = GetFileSpec
-        if _newclass: x = property(GetFileSpec, None)
+        if _newclass: file = property(GetFileSpec, None, doc='''A read only property that returns an lldb object that represents the file (lldb.SBFileSpec) for this line entry.''')
         
         __swig_getmethods__["line"] = GetLine
-        if _newclass: x = property(GetLine, None)
+        if _newclass: ling = property(GetLine, None, doc='''A read only property that returns the 1 based line number for this line entry, a return value of zero indicates that no line information is available.''')
         
         __swig_getmethods__["column"] = GetColumn
-        if _newclass: x = property(GetColumn, None)
+        if _newclass: column = property(GetColumn, None, doc='''A read only property that returns the 1 based column number for this line entry, a return value of zero indicates that no column information is available.''')
         
         __swig_getmethods__["addr"] = GetStartAddress
-        if _newclass: x = property(GetStartAddress, None)
+        if _newclass: addr = property(GetStartAddress, None, doc='''A read only property that returns an lldb object that represents the start address (lldb.SBAddress) for this line entry.''')
         
         __swig_getmethods__["end_addr"] = GetEndAddress
-        if _newclass: x = property(GetEndAddress, None)
+        if _newclass: end_addr = property(GetEndAddress, None, doc='''A read only property that returns an lldb object that represents the end address (lldb.SBAddress) for this line entry.''')
         
     %}
 

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBModule.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBModule.i?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBModule.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBModule.i Mon Jul 23 19:12:48 2012
@@ -355,43 +355,43 @@
             return self.sections
 
         __swig_getmethods__["symbols"] = get_symbols_array
-        if _newclass: x = property(get_symbols_array, None)
+        if _newclass: symbols = property(get_symbols_array, None, doc='''A read only property that returns a list() of lldb.SBSymbol objects contained in this module.''')
 
         __swig_getmethods__["symbol"] = get_symbols_access_object
-        if _newclass: x = property(get_symbols_access_object, None)
+        if _newclass: symbol = property(get_symbols_access_object, None, doc='''A read only property that can be used to access symbols by index ("symbol = module.symbol[0]"), name ("symbols = module.symbol['main']"), or using a regular expression ("symbols = module.symbol[re.compile(...)]"). The return value is a single lldb.SBSymbol object for array access, and a list() of lldb.SBSymbol objects for name and regular expression access''')
 
         __swig_getmethods__["sections"] = get_sections_array
-        if _newclass: x = property(get_sections_array, None)
+        if _newclass: sections = property(get_sections_array, None, doc='''A read only property that returns a list() of lldb.SBSection objects contained in this module.''')
         
         __swig_getmethods__["section"] = get_sections_access_object
-        if _newclass: x = property(get_sections_access_object, None)
+        if _newclass: section = property(get_sections_access_object, None, doc='''A read only property that can be used to access symbols by index ("section = module.section[0]"), name ("sections = module.section[\'main\']"), or using a regular expression ("sections = module.section[re.compile(...)]"). The return value is a single lldb.SBSection object for array access, and a list() of lldb.SBSection objects for name and regular expression access''')
 
         def get_uuid(self):
             return uuid.UUID (self.GetUUIDString())
         
         __swig_getmethods__["uuid"] = get_uuid
-        if _newclass: x = property(get_uuid, None)
+        if _newclass: uuid = property(get_uuid, None, doc='''A read only property that returns a standard python uuid.UUID object that represents the UUID of this module.''')
         
         __swig_getmethods__["file"] = GetFileSpec
-        if _newclass: x = property(GetFileSpec, None)
+        if _newclass: file = property(GetFileSpec, None, doc='''A read only property that returns an lldb object that represents the file (lldb.SBFileSpec) for this object file for this module as it is represented where it is being debugged.''')
         
         __swig_getmethods__["platform_file"] = GetPlatformFileSpec
-        if _newclass: x = property(GetPlatformFileSpec, None)
+        if _newclass: platform_file = property(GetPlatformFileSpec, None, doc='''A read only property that returns an lldb object that represents the file (lldb.SBFileSpec) for this object file for this module as it is represented on the current host system.''')
         
         __swig_getmethods__["byte_order"] = GetByteOrder
-        if _newclass: x = property(GetByteOrder, None)
+        if _newclass: byte_order = property(GetByteOrder, None, doc='''A read only property that returns an lldb enumeration value (lldb.eByteOrderLittle, lldb.eByteOrderBig, lldb.eByteOrderInvalid) that represents the byte order for this module.''')
         
         __swig_getmethods__["addr_size"] = GetAddressByteSize
-        if _newclass: x = property(GetAddressByteSize, None)
+        if _newclass: addr_size = property(GetAddressByteSize, None, doc='''A read only property that returns the size in bytes of an address for this module.''')
         
         __swig_getmethods__["triple"] = GetTriple
-        if _newclass: x = property(GetTriple, None)
+        if _newclass: triple = property(GetTriple, None, doc='''A read only property that returns the target triple (arch-vendor-os) for this module.''')
 
         __swig_getmethods__["num_symbols"] = GetNumSymbols
-        if _newclass: x = property(GetNumSymbols, None)
+        if _newclass: num_symbols = property(GetNumSymbols, None, doc='''A read only property that returns number of symbols in the module symbol table as an integer.''')
         
         __swig_getmethods__["num_sections"] = GetNumSections
-        if _newclass: x = property(GetNumSections, None)
+        if _newclass: num_sections = property(GetNumSections, None, doc='''A read only property that returns number of sections in the module as an integer.''')
         
     %}
 

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBProcess.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBProcess.i?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBProcess.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBProcess.i Mon Jul 23 19:12:48 2012
@@ -127,12 +127,30 @@
     uint32_t
     GetNumThreads ();
 
+    %feature("autodoc", "
+    Returns the INDEX'th thread from the list of current threads.  The index
+    of a thread is only valid for the current stop.  For a persistent thread
+    identifier use either the thread ID or the IndexID.  See help on SBThread
+    for more details.
+    ") GetThreadAtIndex;
     lldb::SBThread
     GetThreadAtIndex (size_t index);
 
+    %feature("autodoc", "
+    Returns the thread with the given thread ID.
+    ") GetThreadByID;
     lldb::SBThread
     GetThreadByID (lldb::tid_t sb_thread_id);
+    
+    %feature("autodoc", "
+    Returns the thread with the given thread IndexID.
+    ") GetThreadByIndexID;
+    lldb::SBThread
+    GetThreadByIndexID (uint32_t index_id);
 
+    %feature("autodoc", "
+    Returns the currently selected thread.
+    ") GetSelectedThread;
     lldb::SBThread
     GetSelectedThread () const;
 
@@ -142,6 +160,9 @@
     bool
     SetSelectedThreadByID (uint32_t tid);
 
+    bool
+    SetSelectedThreadByIndexID (uint32_t index_id);
+    
     //------------------------------------------------------------------
     // Stepping related functions
     //------------------------------------------------------------------
@@ -345,44 +366,44 @@
             return threads
         
         __swig_getmethods__["threads"] = get_process_thread_list
-        if _newclass: x = property(get_process_thread_list, None)
+        if _newclass: threads = property(get_process_thread_list, None, doc='''A read only property that returns a list() of lldb.SBThread objects for this process.''')
         
         __swig_getmethods__["thread"] = get_threads_access_object
-        if _newclass: x = property(get_threads_access_object, None)
+        if _newclass: thread = property(get_threads_access_object, None, doc='''A read only property that returns an object that can access threads by thread index (thread = lldb.process.thread[12]).''')
 
         __swig_getmethods__["is_alive"] = __get_is_alive__
-        if _newclass: x = property(__get_is_alive__, None)
+        if _newclass: is_alive = property(__get_is_alive__, None, doc='''A read only property that returns a boolean value that indicates if this process is currently alive.''')
 
         __swig_getmethods__["is_running"] = __get_is_running__
-        if _newclass: x = property(__get_is_running__, None)
+        if _newclass: is_running = property(__get_is_running__, None, doc='''A read only property that returns a boolean value that indicates if this process is currently running.''')
 
         __swig_getmethods__["is_stopped"] = __get_is_running__
-        if _newclass: x = property(__get_is_running__, None)
+        if _newclass: is_stopped = property(__get_is_running__, None, doc='''A read only property that returns a boolean value that indicates if this process is currently stopped.''')
 
         __swig_getmethods__["id"] = GetProcessID
-        if _newclass: x = property(GetProcessID, None)
+        if _newclass: id = property(GetProcessID, None, doc='''A read only property that returns the process ID as an integer.''')
         
         __swig_getmethods__["target"] = GetTarget
-        if _newclass: x = property(GetTarget, None)
+        if _newclass: target = property(GetTarget, None, doc='''A read only property that an lldb object that represents the target (lldb.SBTarget) that owns this process.''')
         
         __swig_getmethods__["num_threads"] = GetNumThreads
-        if _newclass: x = property(GetNumThreads, None)
+        if _newclass: num_threads = property(GetNumThreads, None, doc='''A read only property that returns the number of threads in this process as an integer.''')
         
         __swig_getmethods__["selected_thread"] = GetSelectedThread
         __swig_setmethods__["selected_thread"] = SetSelectedThread
-        if _newclass: x = property(GetSelectedThread, SetSelectedThread)
+        if _newclass: selected_thread = property(GetSelectedThread, SetSelectedThread, doc='''A read/write property that gets/sets the currently selected thread in this process. The getter returns a lldb.SBThread object and the setter takes an lldb.SBThread object.''')
         
         __swig_getmethods__["state"] = GetState
-        if _newclass: x = property(GetState, None)
+        if _newclass: state = property(GetState, None, doc='''A read only property that returns an lldb enumeration value (see enumerations that start with "lldb.eState") that represents the current state of this process (running, stopped, exited, etc.).''')
         
         __swig_getmethods__["exit_state"] = GetExitStatus
-        if _newclass: x = property(GetExitStatus, None)
+        if _newclass: exit_state = property(GetExitStatus, None, doc='''A read only property that returns an exit status as an integer of this process when the process state is lldb.eStateExited.''')
         
         __swig_getmethods__["exit_description"] = GetExitDescription
-        if _newclass: x = property(GetExitDescription, None)
+        if _newclass: exit_description = property(GetExitDescription, None, doc='''A read only property that returns an exit description as a string of this process when the process state is lldb.eStateExited.''')
         
         __swig_getmethods__["broadcaster"] = GetBroadcaster
-        if _newclass: x = property(GetBroadcaster, None)
+        if _newclass: broadcaster = property(GetBroadcaster, None, doc='''A read only property that an lldb object that represents the broadcaster (lldb.SBBroadcaster) for this process.''')
     %}
 
 };

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBSection.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBSection.i?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBSection.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBSection.i Mon Jul 23 19:12:48 2012
@@ -95,28 +95,28 @@
             return SBAddress(self, 0)
 
         __swig_getmethods__["name"] = GetName
-        if _newclass: x = property(GetName, None)
+        if _newclass: name = property(GetName, None, doc='''A read only property that returns the name of this section as a string.''')
 
         __swig_getmethods__["addr"] = get_addr
-        if _newclass: x = property(get_addr, None)
+        if _newclass: addr = property(get_addr, None, doc='''A read only property that returns an lldb object that represents the start address (lldb.SBAddress) for this section.''')
 
         __swig_getmethods__["file_addr"] = GetFileAddress
-        if _newclass: x = property(GetFileAddress, None)
+        if _newclass: file_addr = property(GetFileAddress, None, doc='''A read only property that returns an integer that represents the starting "file" address for this section, or the address of the section in the object file in which it is defined.''')
 
         __swig_getmethods__["size"] = GetByteSize
-        if _newclass: x = property(GetByteSize, None)
+        if _newclass: size = property(GetByteSize, None, doc='''A read only property that returns the size in bytes of this section as an integer.''')
 
         __swig_getmethods__["file_offset"] = GetFileOffset
-        if _newclass: x = property(GetFileOffset, None)
+        if _newclass: file_offset = property(GetFileOffset, None, doc='''A read only property that returns the file offset in bytes of this section as an integer.''')
 
         __swig_getmethods__["file_size"] = GetFileByteSize
-        if _newclass: x = property(GetFileByteSize, None)
+        if _newclass: file_size = property(GetFileByteSize, None, doc='''A read only property that returns the file size in bytes of this section as an integer.''')
 
         __swig_getmethods__["data"] = GetSectionData
-        if _newclass: x = property(GetSectionData, None)
+        if _newclass: data = property(GetSectionData, None, doc='''A read only property that returns an lldb object that represents the bytes for this section (lldb.SBData) for this section.''')
 
         __swig_getmethods__["type"] = GetSectionType
-        if _newclass: x = property(GetSectionType, None)
+        if _newclass: type = property(GetSectionType, None, doc='''A read only property that returns an lldb enumeration value (see enumerations that start with "lldb.eSectionType") that represents the type of this section (code, data, etc.).''')
 
     %}
 

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBSymbol.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBSymbol.i?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBSymbol.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBSymbol.i Mon Jul 23 19:12:48 2012
@@ -64,31 +64,31 @@
             return self.GetInstructions (target)
         
         __swig_getmethods__["name"] = GetName
-        if _newclass: x = property(GetName, None)
+        if _newclass: name = property(GetName, None, doc='''A read only property that returns the name for this symbol as a string.''')
         
         __swig_getmethods__["mangled"] = GetMangledName
-        if _newclass: x = property(GetMangledName, None)
+        if _newclass: mangled = property(GetMangledName, None, doc='''A read only property that returns the mangled (linkage) name for this symbol as a string.''')
         
         __swig_getmethods__["type"] = GetType
-        if _newclass: x = property(GetType, None)
+        if _newclass: type = property(GetType, None, doc='''A read only property that returns an lldb enumeration value (see enumerations that start with "lldb.eSymbolType") that represents the type of this symbol.''')
         
         __swig_getmethods__["addr"] = GetStartAddress
-        if _newclass: x = property(GetStartAddress, None)
+        if _newclass: addr = property(GetStartAddress, None, doc='''A read only property that returns an lldb object that represents the start address (lldb.SBAddress) for this symbol.''')
         
         __swig_getmethods__["end_addr"] = GetEndAddress
-        if _newclass: x = property(GetEndAddress, None)
+        if _newclass: end_addr = property(GetEndAddress, None, doc='''A read only property that returns an lldb object that represents the end address (lldb.SBAddress) for this symbol.''')
         
         __swig_getmethods__["prologue_size"] = GetPrologueByteSize
-        if _newclass: x = property(GetPrologueByteSize, None)
+        if _newclass: prologue_size = property(GetPrologueByteSize, None, doc='''A read only property that returns the size in bytes of the prologue instructions as an unsigned integer.''')
         
         __swig_getmethods__["instructions"] = get_instructions_from_current_target
-        if _newclass: x = property(get_instructions_from_current_target, None)
+        if _newclass: instructions = property(get_instructions_from_current_target, None, doc='''A read only property that returns an lldb object that represents the instructions (lldb.SBInstructionList) for this symbol.''')
 
         __swig_getmethods__["external"] = IsExternal
-        if _newclass: x = property(IsExternal, None)
+        if _newclass: external = property(IsExternal, None, doc='''A read only property that returns a boolean value that indicates if this symbol is externally visiable (exported) from the module that contains it.''')
 
         __swig_getmethods__["synthetic"] = IsSynthetic
-        if _newclass: x = property(IsSynthetic, None)
+        if _newclass: synthetic = property(IsSynthetic, None, doc='''A read only property that returns a boolean value that indicates if this symbol was synthetically created from information in module that contains it.''')
 
         
     %}

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBSymbolContext.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBSymbolContext.i?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBSymbolContext.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBSymbolContext.i Mon Jul 23 19:12:48 2012
@@ -84,27 +84,27 @@
     %pythoncode %{
         __swig_getmethods__["module"] = GetModule
         __swig_setmethods__["module"] = SetModule
-        if _newclass: x = property(GetModule, SetModule)
+        if _newclass: module = property(GetModule, SetModule, doc='''A read/write property that allows the getting/setting of the module (lldb.SBModule) in this symbol context.''')
 
         __swig_getmethods__["compile_unit"] = GetCompileUnit
         __swig_setmethods__["compile_unit"] = SetCompileUnit
-        if _newclass: x = property(GetCompileUnit, SetCompileUnit)
+        if _newclass: compile_unit = property(GetCompileUnit, SetCompileUnit, doc='''A read/write property that allows the getting/setting of the compile unit (lldb.SBCompileUnit) in this symbol context.''')
 
         __swig_getmethods__["function"] = GetFunction
         __swig_setmethods__["function"] = SetFunction
-        if _newclass: x = property(GetFunction, SetFunction)
+        if _newclass: function = property(GetFunction, SetFunction, doc='''A read/write property that allows the getting/setting of the function (lldb.SBFunction) in this symbol context.''')
 
         __swig_getmethods__["block"] = GetBlock
         __swig_setmethods__["block"] = SetBlock
-        if _newclass: x = property(GetBlock, SetBlock)
+        if _newclass: block = property(GetBlock, SetBlock, doc='''A read/write property that allows the getting/setting of the block (lldb.SBBlock) in this symbol context.''')
             
         __swig_getmethods__["symbol"] = GetSymbol
         __swig_setmethods__["symbol"] = SetSymbol
-        if _newclass: x = property(GetSymbol, SetSymbol)
+        if _newclass: symbol = property(GetSymbol, SetSymbol, doc='''A read/write property that allows the getting/setting of the symbol (lldb.SBSymbol) in this symbol context.''')
 
         __swig_getmethods__["line_entry"] = GetLineEntry
         __swig_setmethods__["line_entry"] = SetLineEntry
-        if _newclass: x = property(GetLineEntry, SetLineEntry)
+        if _newclass: line_entry = property(GetLineEntry, SetLineEntry, doc='''A read/write property that allows the getting/setting of the line entry (lldb.SBLineEntry) in this symbol context.''')
     %}
 
 };

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBSymbolContextList.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBSymbolContextList.i?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBSymbolContextList.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBSymbolContextList.i Mon Jul 23 19:12:48 2012
@@ -117,22 +117,22 @@
                     a.append(obj)
             return a
         __swig_getmethods__["modules"] = get_module_array
-        if _newclass: x = property(get_module_array, None)
+        if _newclass: modules = property(get_module_array, None, doc='''Returns a list() of lldb.SBModule objects, one for each module in each SBSymbolContext object in this list.''')
         
         __swig_getmethods__["compile_units"] = get_compile_unit_array
-        if _newclass: x = property(get_compile_unit_array, None)
+        if _newclass: compile_units = property(get_compile_unit_array, None, doc='''Returns a list() of lldb.SBCompileUnit objects, one for each compile unit in each SBSymbolContext object in this list.''')
         
         __swig_getmethods__["functions"] = get_function_array
-        if _newclass: x = property(get_function_array, None)
+        if _newclass: functions = property(get_function_array, None, doc='''Returns a list() of lldb.SBFunction objects, one for each function in each SBSymbolContext object in this list.''')
         
         __swig_getmethods__["blocks"] = get_block_array
-        if _newclass: x = property(get_block_array, None)
+        if _newclass: blocks = property(get_block_array, None, doc='''Returns a list() of lldb.SBBlock objects, one for each block in each SBSymbolContext object in this list.''')
         
         __swig_getmethods__["line_entries"] = get_line_entry_array
-        if _newclass: x = property(get_line_entry_array, None)
+        if _newclass: line_entries = property(get_line_entry_array, None, doc='''Returns a list() of lldb.SBLineEntry objects, one for each line entry in each SBSymbolContext object in this list.''')
         
         __swig_getmethods__["symbols"] = get_symbol_array
-        if _newclass: x = property(get_symbol_array, None)
+        if _newclass: symbols = property(get_symbol_array, None, doc='''Returns a list() of lldb.SBSymbol objects, one for each symbol in each SBSymbolContext object in this list.''')
     %}
 
 };

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBTarget.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBTarget.i?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBTarget.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBTarget.i Mon Jul 23 19:12:48 2012
@@ -125,6 +125,12 @@
     void
     SetWaitForLaunch (bool b);
     
+    bool
+    GetIgnoreExisting ();
+    
+    void
+    SetIgnoreExisting (bool b);
+    
     uint32_t
     GetResumeCount ();
     
@@ -747,37 +753,37 @@
             return modules
 
         __swig_getmethods__["modules"] = get_modules_array
-        if _newclass: x = property(get_modules_array, None)
+        if _newclass: modules = property(get_modules_array, None, doc='''A read only property that returns a list() of lldb.SBModule objects contained in this target. This list is a list all modules that the target currently is tracking (the main executable and all dependent shared libraries).''')
 
         __swig_getmethods__["module"] = get_modules_access_object
-        if _newclass: x = property(get_modules_access_object, None)
+        if _newclass: module = property(get_modules_access_object, None, doc=r'''A read only property that returns an object that implements python operator overloading with the square brackets().\n    target.module[<int>] allows array access to any modules.\n    target.module[<str>] allows access to modules by basename, full path, or uuid string value.\n    target.module[uuid.UUID()] allows module access by UUID.\n    target.module[re] allows module access using a regular expression that matches the module full path.''')
 
         __swig_getmethods__["process"] = GetProcess
-        if _newclass: x = property(GetProcess, None)
+        if _newclass: process = property(GetProcess, None, doc='''A read only property that returns an lldb object that represents the process (lldb.SBProcess) that this target owns.''')
 
         __swig_getmethods__["executable"] = GetExecutable
-        if _newclass: x = property(GetExecutable, None)
+        if _newclass: executable = property(GetExecutable, None, doc='''A read only property that returns an lldb object that represents the main executable module (lldb.SBModule) for this target.''')
 
         __swig_getmethods__["debugger"] = GetDebugger
-        if _newclass: x = property(GetDebugger, None)
+        if _newclass: debugger = property(GetDebugger, None, doc='''A read only property that returns an lldb object that represents the debugger (lldb.SBDebugger) that owns this target.''')
 
         __swig_getmethods__["num_breakpoints"] = GetNumBreakpoints
-        if _newclass: x = property(GetNumBreakpoints, None)
+        if _newclass: num_breakpoints = property(GetNumBreakpoints, None, doc='''A read only property that returns the number of breakpoints that this target has as an integer.''')
 
         __swig_getmethods__["num_watchpoints"] = GetNumWatchpoints
-        if _newclass: x = property(GetNumWatchpoints, None)
+        if _newclass: num_watchpoints = property(GetNumWatchpoints, None, doc='''A read only property that returns the number of watchpoints that this target has as an integer.''')
 
         __swig_getmethods__["broadcaster"] = GetBroadcaster
-        if _newclass: x = property(GetBroadcaster, None)
+        if _newclass: broadcaster = property(GetBroadcaster, None, doc='''A read only property that an lldb object that represents the broadcaster (lldb.SBBroadcaster) for this target.''')
         
         __swig_getmethods__["byte_order"] = GetByteOrder
-        if _newclass: x = property(GetByteOrder, None)
+        if _newclass: byte_order = property(GetByteOrder, None, doc='''A read only property that returns an lldb enumeration value (lldb.eByteOrderLittle, lldb.eByteOrderBig, lldb.eByteOrderInvalid) that represents the byte order for this target.''')
         
         __swig_getmethods__["addr_size"] = GetAddressByteSize
-        if _newclass: x = property(GetAddressByteSize, None)
+        if _newclass: addr_size = property(GetAddressByteSize, None, doc='''A read only property that returns the size in bytes of an address for this target.''')
         
         __swig_getmethods__["triple"] = GetTriple
-        if _newclass: x = property(GetTriple, None)
+        if _newclass: triple = property(GetTriple, None, doc='''A read only property that returns the target triple (arch-vendor-os) for this target as a string.''')
     %}
 
 };

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBThread.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBThread.i?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBThread.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBThread.i Mon Jul 23 19:12:48 2012
@@ -12,6 +12,12 @@
 %feature("docstring",
 "Represents a thread of execution. SBProcess contains SBThread(s).
 
+SBThreads can be referred to by their ID, which maps to the system specific thread
+identifier, or by IndexID.  The ID may or may not be unique depending on whether the
+system reuses its thread identifiers.  The IndexID is a monotonically increasing identifier
+that will always uniquely reference a particular thread, and when that thread goes
+away it will not be reused.
+
 SBThread supports frame iteration. For example (from test/python_api/
 lldbutil/iter/TestLLDBIterator.py),
 
@@ -202,37 +208,37 @@
             return frames
         
         __swig_getmethods__["id"] = GetThreadID
-        if _newclass: x = property(GetThreadID, None)
+        if _newclass: id = property(GetThreadID, None, doc='''A read only property that returns the thread ID as an integer.''')
 
         __swig_getmethods__["idx"] = GetIndexID
-        if _newclass: x = property(GetIndexID, None)
+        if _newclass: idx = property(GetIndexID, None, doc='''A read only property that returns the thread index ID as an integer. Thread index ID values start at 1 and increment as threads come and go and can be used to uniquely identify threads.''')
 
         __swig_getmethods__["return_value"] = GetStopReturnValue
-        if _newclass: x = property(GetStopReturnValue, None)
+        if _newclass: return_value = property(GetStopReturnValue, None, doc='''A read only property that returns an lldb object that represents the return value from the last stop (lldb.SBValue) if we just stopped due to stepping out of a function.''')
 
         __swig_getmethods__["process"] = GetProcess
-        if _newclass: x = property(GetProcess, None)
+        if _newclass: process = property(GetProcess, None, doc='''A read only property that returns an lldb object that represents the process (lldb.SBProcess) that owns this thread.''')
 
         __swig_getmethods__["num_frames"] = GetNumFrames
-        if _newclass: x = property(GetNumFrames, None)
+        if _newclass: num_frames = property(GetNumFrames, None, doc='''A read only property that returns the number of stack frames in this thread as an integer.''')
 
         __swig_getmethods__["frames"] = get_thread_frames
-        if _newclass: x = property(get_thread_frames, None)
+        if _newclass: frames = property(get_thread_frames, None, doc='''A read only property that returns a list() of lldb.SBFrame objects for all frames in this thread.''')
 
         __swig_getmethods__["frame"] = get_frames_access_object
-        if _newclass: x = property(get_frames_access_object, None)
+        if _newclass: frame = property(get_frames_access_object, None, doc='''A read only property that returns an object that can be used to access frames as an array ("frame_12 = lldb.thread.frame[12]").''')
 
         __swig_getmethods__["name"] = GetName
-        if _newclass: x = property(GetName, None)
+        if _newclass: name = property(GetName, None, doc='''A read only property that returns the name of this thread as a string.''')
 
         __swig_getmethods__["queue"] = GetQueueName
-        if _newclass: x = property(GetQueueName, None)
+        if _newclass: queue = property(GetQueueName, None, doc='''A read only property that returns the dispatch queue name of this thread as a string.''')
 
         __swig_getmethods__["stop_reason"] = GetStopReason
-        if _newclass: x = property(GetStopReason, None)
+        if _newclass: stop_reason = property(GetStopReason, None, doc='''A read only property that returns an lldb enumeration value (see enumerations that start with "lldb.eStopReason") that represents the reason this thread stopped.''')
 
         __swig_getmethods__["is_suspended"] = IsSuspended
-        if _newclass: x = property(IsSuspended, None)
+        if _newclass: is_suspended = property(IsSuspended, None, doc='''A read only property that returns a boolean value that indicates if this thread is suspended.''')
     %}
 
 };

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBType.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBType.i?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBType.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBType.i Mon Jul 23 19:12:48 2012
@@ -39,16 +39,16 @@
     
     %pythoncode %{
         __swig_getmethods__["name"] = GetName
-        if _newclass: x = property(GetName, None)
+        if _newclass: name = property(GetName, None, doc='''A read only property that returns the name for this member as a string.''')
         
         __swig_getmethods__["type"] = GetType
-        if _newclass: x = property(GetType, None)
+        if _newclass: type = property(GetType, None, doc='''A read only property that returns an lldb object that represents the type (lldb.SBType) for this member.''')
         
         __swig_getmethods__["byte_offset"] = GetOffsetInBytes
-        if _newclass: x = property(GetOffsetInBytes, None)
+        if _newclass: byte_offset = property(GetOffsetInBytes, None, doc='''A read only property that returns offset in bytes for this member as an integer.''')
         
         __swig_getmethods__["bit_offset"] = GetOffsetInBits
-        if _newclass: x = property(GetOffsetInBits, None)
+        if _newclass: bit_offset = property(GetOffsetInBits, None, doc='''A read only property that returns offset in bits for this member as an integer.''')
     %}    
 
 protected:
@@ -214,37 +214,37 @@
             return None
             
         __swig_getmethods__["name"] = GetName
-        if _newclass: x = property(GetName, None)
+        if _newclass: name = property(GetName, None, doc='''A read only property that returns the name for this type as a string.''')
         
         __swig_getmethods__["size"] = GetByteSize
-        if _newclass: x = property(GetByteSize, None)
+        if _newclass: size = property(GetByteSize, None, doc='''A read only property that returns size in bytes for this type as an integer.''')
         
         __swig_getmethods__["is_pointer"] = IsPointerType
-        if _newclass: x = property(IsPointerType, None)
+        if _newclass: is_pointer = property(IsPointerType, None, doc='''A read only property that returns a boolean value that indicates if this type is a pointer type.''')
         
         __swig_getmethods__["is_reference"] = IsReferenceType
-        if _newclass: x = property(IsReferenceType, None)
+        if _newclass: is_reference = property(IsReferenceType, None, doc='''A read only property that returns a boolean value that indicates if this type is a reference type.''')
 
         __swig_getmethods__["num_fields"] = GetNumberOfFields
-        if _newclass: x = property(GetNumberOfFields, None)
+        if _newclass: num_fields = property(GetNumberOfFields, None, doc='''A read only property that returns number of fields in this type as an integer.''')
         
         __swig_getmethods__["num_bases"] = GetNumberOfDirectBaseClasses
-        if _newclass: x = property(GetNumberOfDirectBaseClasses, None)
+        if _newclass: num_bases = property(GetNumberOfDirectBaseClasses, None, doc='''A read only property that returns number of direct base classes in this type as an integer.''')
         
         __swig_getmethods__["num_vbases"] = GetNumberOfVirtualBaseClasses
-        if _newclass: x = property(GetNumberOfVirtualBaseClasses, None)
+        if _newclass: num_vbases = property(GetNumberOfVirtualBaseClasses, None, doc='''A read only property that returns number of virtual base classes in this type as an integer.''')
         
         __swig_getmethods__["num_template_args"] = GetNumberOfTemplateArguments
-        if _newclass: x = property(GetNumberOfTemplateArguments, None)
+        if _newclass: num_template_args = property(GetNumberOfTemplateArguments, None, doc='''A read only property that returns number of template arguments in this type as an integer.''')
 
         __swig_getmethods__["template_args"] = template_arg_array
-        if _newclass: x = property(template_arg_array, None)
+        if _newclass: template_args = property(template_arg_array, None, doc='''A read only property that returns a list() of lldb.SBType objects that represent all template arguments in this type.''')
 
-        __swig_getmethods__["class"] = GetTypeClass
-        if _newclass: x = property(GetTypeClass, None)
+        __swig_getmethods__["type"] = GetTypeClass
+        if _newclass: type = property(GetTypeClass, None, doc='''A read only property that returns an lldb enumeration value (see enumerations that start with "lldb.eTypeClass") that represents a classification for this type.''')
         
         __swig_getmethods__["is_complete"] = IsTypeComplete
-        if _newclass: is_complete = property(IsTypeComplete, None)
+        if _newclass: is_complete = property(IsTypeComplete, None, doc='''A read only property that returns a boolean value that indicates if this type is a complete type (True) or a forward declaration (False).''')
         %}
 
 };

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeCategory.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeCategory.i?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeCategory.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeCategory.i Mon Jul 23 19:12:48 2012
@@ -117,20 +117,20 @@
         
         %pythoncode %{
             __swig_getmethods__["num_formats"] = GetNumFormats
-            if _newclass: x = property(GetNumFormats, None)
+            if _newclass: num_formats = property(GetNumFormats, None)
             __swig_getmethods__["num_summaries"] = GetNumSummaries
-            if _newclass: x = property(GetNumSummaries, None)
+            if _newclass: num_summaries = property(GetNumSummaries, None)
             __swig_getmethods__["num_filters"] = GetNumFilters
-            if _newclass: x = property(GetNumFilters, None)
+            if _newclass: num_filters = property(GetNumFilters, None)
             __swig_getmethods__["num_synthetics"] = GetNumSynthetics
-            if _newclass: x = property(GetNumSynthetics, None)
+            if _newclass: num_synthetics = property(GetNumSynthetics, None)
             
             __swig_getmethods__["name"] = GetName
-            if _newclass: x = property(GetName, None)
+            if _newclass: name = property(GetName, None)
             
             __swig_getmethods__["enabled"] = GetEnabled
             __swig_setmethods__["enabled"] = SetEnabled
-            if _newclass: x = property(GetEnabled, SetEnabled)
+            if _newclass: enabled = property(GetEnabled, SetEnabled)
         %}
 
     };

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeFilter.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeFilter.i?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeFilter.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeFilter.i Mon Jul 23 19:12:48 2012
@@ -58,10 +58,10 @@
         %pythoncode %{
             __swig_getmethods__["options"] = GetOptions
             __swig_setmethods__["options"] = SetOptions
-            if _newclass: x = property(GetOptions, SetOptions)        
+            if _newclass: options = property(GetOptions, SetOptions)
             
             __swig_getmethods__["count"] = GetNumberOfExpressionPaths
-            if _newclass: x = property(GetNumberOfExpressionPaths, None)
+            if _newclass: count = property(GetNumberOfExpressionPaths, None)
         %}
                 
     };

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeFormat.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeFormat.i?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeFormat.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeFormat.i Mon Jul 23 19:12:48 2012
@@ -50,11 +50,11 @@
         %pythoncode %{
             __swig_getmethods__["format"] = GetFormat
             __swig_setmethods__["format"] = SetFormat
-            if _newclass: x = property(GetFormat, SetFormat)
+            if _newclass: format = property(GetFormat, SetFormat)
             
             __swig_getmethods__["options"] = GetOptions
             __swig_setmethods__["options"] = SetOptions
-            if _newclass: x = property(GetOptions, SetOptions)            
+            if _newclass: options = property(GetOptions, SetOptions)            
         %}
 
     };

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeNameSpecifier.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeNameSpecifier.i?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeNameSpecifier.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeNameSpecifier.i Mon Jul 23 19:12:48 2012
@@ -49,10 +49,10 @@
                         
         %pythoncode %{
             __swig_getmethods__["name"] = GetName
-            if _newclass: x = property(GetName, None)
+            if _newclass: name = property(GetName, None)
             
             __swig_getmethods__["is_regex"] = IsRegex
-            if _newclass: x = property(IsRegex, None)
+            if _newclass: is_regex = property(IsRegex, None)
         %}
 
         

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeSummary.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeSummary.i?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeSummary.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeSummary.i Mon Jul 23 19:12:48 2012
@@ -72,19 +72,19 @@
         %pythoncode %{
             __swig_getmethods__["options"] = GetOptions
             __swig_setmethods__["options"] = SetOptions
-            if _newclass: x = property(GetOptions, SetOptions)        
+            if _newclass: options = property(GetOptions, SetOptions)
             
             __swig_getmethods__["is_summary_string"] = IsSummaryString
-            if _newclass: x = property(IsSummaryString, None)        
+            if _newclass: is_summary_string = property(IsSummaryString, None)
 
             __swig_getmethods__["is_function_name"] = IsFunctionName
-            if _newclass: x = property(IsFunctionName, None)        
+            if _newclass: is_function_name = property(IsFunctionName, None)
 
-            __swig_getmethods__["is_function_code"] = IsFunctionCode
-            if _newclass: x = property(IsFunctionCode, None)        
+            __swig_getmethods__["is_function_name"] = IsFunctionCode
+            if _newclass: is_function_name = property(IsFunctionCode, None)
 
             __swig_getmethods__["summary_data"] = GetData
-            if _newclass: x = property(GetData, None)
+            if _newclass: summary_data = property(GetData, None)
         %}
         
     };

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeSynthetic.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeSynthetic.i?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeSynthetic.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBTypeSynthetic.i Mon Jul 23 19:12:48 2012
@@ -60,13 +60,13 @@
         %pythoncode %{
             __swig_getmethods__["options"] = GetOptions
             __swig_setmethods__["options"] = SetOptions
-            if _newclass: x = property(GetOptions, SetOptions)        
+            if _newclass: options = property(GetOptions, SetOptions)
             
             __swig_getmethods__["contains_code"] = IsClassCode
-            if _newclass: x = property(IsClassCode, None)        
+            if _newclass: contains_code = property(IsClassCode, None)
             
             __swig_getmethods__["synthetic_data"] = GetData
-            if _newclass: x = property(GetData, None)
+            if _newclass: synthetic_data = property(GetData, None)
         %}
         
     };

Modified: lldb/branches/lldb-platform-work/scripts/Python/interface/SBValue.i
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/interface/SBValue.i?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/interface/SBValue.i (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/interface/SBValue.i Mon Jul 23 19:12:48 2012
@@ -387,81 +387,81 @@
             return self.GetDynamicValue (eDynamicCanRunTarget)
         
         __swig_getmethods__["name"] = GetName
-        if _newclass: name = property(GetName, None, doc='Returns the name of this SBValue as a string')
+        if _newclass: name = property(GetName, None, doc='''A read only property that returns the name of this value as a string.''')
 
         __swig_getmethods__["type"] = GetType
-        if _newclass: type = property(GetType, None, doc='Returns an SBType that represents the type of this SBValue')
+        if _newclass: type = property(GetType, None, doc='''A read only property that returns a lldb.SBType object that represents the type for this value.''')
 
         __swig_getmethods__["size"] = GetByteSize
-        if _newclass: size = property(GetByteSize, None, doc='Returns the size (in bytes) of the data contained in this SBValue')
+        if _newclass: size = property(GetByteSize, None, doc='''A read only property that returns the size in bytes of this value.''')
 
         __swig_getmethods__["is_in_scope"] = IsInScope
-        if _newclass: is_in_scope = property(IsInScope, None, doc='Returns True if this SBValue represents an item that is currently in lexical scope')
+        if _newclass: is_in_scope = property(IsInScope, None, doc='''A read only property that returns a boolean value that indicates whether this value is currently lexically in scope.''')
 
         __swig_getmethods__["format"] = GetFormat
         __swig_setmethods__["format"] = SetFormat
-        if _newclass: format = property(GetName, SetFormat, doc='Returns the format for this SBValue')
+        if _newclass: format = property(GetName, SetFormat, doc='''A read/write property that gets/sets the format used for lldb.SBValue().GetValue() for this value. See enumerations that start with "lldb.eFormat".''')
 
         __swig_getmethods__["value"] = GetValue
         __swig_setmethods__["value"] = SetValueFromCString
-        if _newclass: value = property(GetValue, SetValueFromCString, doc='Returns the value of this SBValue as a string')
+        if _newclass: value = property(GetValue, SetValueFromCString, doc='''A read/write property that gets/sets value from a string.''')
 
         __swig_getmethods__["value_type"] = GetValueType
-        if _newclass: value_type = property(GetValueType, None, doc='Returns the type of entry stored in this SBValue')
+        if _newclass: value_type = property(GetValueType, None, doc='''A read only property that returns an lldb enumeration value (see enumerations that start with "lldb.eValueType") that represents the type of this value (local, argument, global, register, etc.).''')
 
         __swig_getmethods__["changed"] = GetValueDidChange
-        if _newclass: changed = property(GetValueDidChange, None, doc='Returns True if this SBValue represents an item that has changed')
+        if _newclass: changed = property(GetValueDidChange, None, doc='''A read only property that returns a boolean value that indicates if this value has changed since it was last updated.''')
 
         __swig_getmethods__["data"] = GetData
-        if _newclass: data = property(GetData, None, doc='Returns an SBData wrapping the contents of this SBValue')
+        if _newclass: data = property(GetData, None, doc='''A read only property that returns an lldb object (lldb.SBData) that represents the bytes that make up the value for this object.''')
 
         __swig_getmethods__["load_addr"] = GetLoadAddress
-        if _newclass: load_addr = property(GetLoadAddress, None, doc='Returns the load address (target address) of this SBValue as a number')
+        if _newclass: load_addr = property(GetLoadAddress, None, doc='''A read only property that returns the load address of this value as an integer.''')
 
         __swig_getmethods__["addr"] = GetAddress
-        if _newclass: addr = property(GetAddress, None, doc='Returns the address of this SBValue as an SBAddress')
+        if _newclass: addr = property(GetAddress, None, doc='''A read only property that returns an lldb.SBAddress that represents the address of this value if it is in memory.''')
 
         __swig_getmethods__["deref"] = Dereference
-        if _newclass: deref = property(Dereference, None, doc='Returns an SBValue that is created by dereferencing this SBValue')
+        if _newclass: deref = property(Dereference, None, doc='''A read only property that returns an lldb.SBValue that is created by dereferencing this value.''')
 
         __swig_getmethods__["address_of"] = AddressOf
-        if _newclass: address_of = property(AddressOf, None, doc='Returns an SBValue that wraps the address-of this SBValue')
+        if _newclass: address_of = property(AddressOf, None, doc='''A read only property that returns an lldb.SBValue that represents the address-of this value.''')
 
         __swig_getmethods__["error"] = GetError
-        if _newclass: error = property(GetError, None, doc='Returns the SBError currently associated to this SBValue')
+        if _newclass: error = property(GetError, None, doc='''A read only property that returns the lldb.SBError that represents the error from the last time the variable value was calculated.''')
     
         __swig_getmethods__["summary"] = GetSummary
-        if _newclass: summary = property(GetSummary, None, doc='Returns the summary for this SBValue as a string')
+        if _newclass: summary = property(GetSummary, None, doc='''A read only property that returns the summary for this value as a string''')
 
         __swig_getmethods__["description"] = GetObjectDescription
-        if _newclass: description = property(GetObjectDescription, None, doc='Returns the language-specific description of this SBValue as a string')
+        if _newclass: description = property(GetObjectDescription, None, doc='''A read only property that returns the language-specific description of this value as a string''')
         
         __swig_getmethods__["dynamic"] = __get_dynamic__
-        if _newclass: description = property(__get_dynamic__, None, doc='Gets the dynamic type for a value')
+        if _newclass: dynamic = property(__get_dynamic__, None, doc='''A read only property that returns an lldb.SBValue that is created by finding the dynamic type of this value.''')
         
         __swig_getmethods__["location"] = GetLocation
-        if _newclass: location = property(GetLocation, None, doc='Returns the location of this SBValue as a string')
+        if _newclass: location = property(GetLocation, None, doc='''A read only property that returns the location of this value as a string.''')
 
         __swig_getmethods__["target"] = GetTarget
-        if _newclass: target = property(GetTarget, None, doc='Returns an SBTarget for the target from which this SBValue comes')
+        if _newclass: target = property(GetTarget, None, doc='''A read only property that returns the lldb.SBTarget that this value is associated with.''')
 
         __swig_getmethods__["process"] = GetProcess
-        if _newclass: process = property(GetProcess, None, doc='Returns an SBProcess for the process from which this SBValue comes')
+        if _newclass: process = property(GetProcess, None, doc='''A read only property that returns the lldb.SBProcess that this value is associated with, the returned value might be invalid and should be tested.''')
 
         __swig_getmethods__["thread"] = GetThread
-        if _newclass: thread = property(GetThread, None, doc='Returns an SBThread for the thread from which this SBValue comes')
+        if _newclass: thread = property(GetThread, None, doc='''A read only property that returns the lldb.SBThread that this value is associated with, the returned value might be invalid and should be tested.''')
 
         __swig_getmethods__["frame"] = GetFrame
-        if _newclass: frame = property(GetFrame, None, doc='Returns an SBFrame for the stack frame from which this SBValue comes')
+        if _newclass: frame = property(GetFrame, None, doc='''A read only property that returns the lldb.SBFrame that this value is associated with, the returned value might be invalid and should be tested.''')
 
         __swig_getmethods__["num_children"] = GetNumChildren
-        if _newclass: num_children = property(GetNumChildren, None, doc='Returns the number of child SBValues that this SBValue has')
+        if _newclass: num_children = property(GetNumChildren, None, doc='''A read only property that returns the number of child lldb.SBValues that this value has.''')
 
         __swig_getmethods__["unsigned"] = GetValueAsUnsigned
-        if _newclass: unsigned = property(GetValueAsUnsigned, None, doc='Returns the value of this SBValue as an unsigned number')
+        if _newclass: unsigned = property(GetValueAsUnsigned, None, doc='''A read only property that returns the value of this SBValue as an usigned integer.''')
 
         __swig_getmethods__["signed"] = GetValueAsSigned
-        if _newclass: signed = property(GetValueAsSigned, None, doc='Returns the value of this SBValue as a signed number')
+        if _newclass: signed = property(GetValueAsSigned, None, doc='''A read only property that returns the value of this SBValue as a signed integer.''')
 
         def get_expr_path(self):
             s = SBStream()
@@ -469,7 +469,7 @@
             return s.GetData()
         
         __swig_getmethods__["path"] = get_expr_path
-        if _newclass: path = property(get_expr_path, None, doc='Returns the expression path that one can use to reach this SBValue')
+        if _newclass: path = property(get_expr_path, None, doc='''A read only property that returns the expression path that one can use to reach this value in an expression.''')
     %}
 
 };

Modified: lldb/branches/lldb-platform-work/scripts/clang.amalgamated.diff
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/clang.amalgamated.diff?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/clang.amalgamated.diff (original)
+++ lldb/branches/lldb-platform-work/scripts/clang.amalgamated.diff Mon Jul 23 19:12:48 2012
@@ -77,6 +77,20 @@
    ExprResult BuildObjCSubscriptExpression(SourceLocation RB, Expr *BaseExpr,
                                            Expr *IndexExpr,
                                            ObjCMethodDecl *getterMethod,
+Index: include/clang/AST/ASTImporter.h
+===================================================================
+--- include/clang/AST/ASTImporter.h	(revision 152265)
++++ include/clang/AST/ASTImporter.h	(working copy)
+@@ -271,7 +271,8 @@
+     
+     /// \brief Determine whether the given types are structurally
+     /// equivalent.
+-    bool IsStructurallyEquivalent(QualType From, QualType To);    
++    bool IsStructurallyEquivalent(QualType From, QualType To,
++                                  bool Complain = true);
+   };
+ }
+ 
 Index: include/clang/AST/Type.h
 ===================================================================
 --- include/clang/AST/Type.h	(revision 152265)
@@ -1261,6 +1275,166 @@
      if ((MethodDecl = ClassDecl->getMethod(Sel, isInstance)))
        return MethodDecl;
  
+Index: lib/AST/ASTImporter.cpp
+===================================================================
+--- lib/AST/ASTImporter.cpp	(revision 152265)
++++ lib/AST/ASTImporter.cpp	(working copy)
+@@ -119,7 +119,8 @@
+     bool ImportTemplateArguments(const TemplateArgument *FromArgs,
+                                  unsigned NumFromArgs,
+                                SmallVectorImpl<TemplateArgument> &ToArgs);
+-    bool IsStructuralMatch(RecordDecl *FromRecord, RecordDecl *ToRecord);
++    bool IsStructuralMatch(RecordDecl *FromRecord, RecordDecl *ToRecord,
++                           bool Complain = true);
+     bool IsStructuralMatch(EnumDecl *FromEnum, EnumDecl *ToRecord);
+     bool IsStructuralMatch(ClassTemplateDecl *From, ClassTemplateDecl *To);
+     Decl *VisitDecl(Decl *D);
+@@ -201,12 +202,16 @@
+     /// \brief Whether we're being strict about the spelling of types when 
+     /// unifying two types.
+     bool StrictTypeSpelling;
+-    
++
++    /// \brief Whether to complain about failures.
++    bool Complain;
++
+     StructuralEquivalenceContext(ASTContext &C1, ASTContext &C2,
+                llvm::DenseSet<std::pair<Decl *, Decl *> > &NonEquivalentDecls,
+-                                 bool StrictTypeSpelling = false)
++                                 bool StrictTypeSpelling = false,
++                                 bool Complain = true)
+       : C1(C1), C2(C2), NonEquivalentDecls(NonEquivalentDecls),
+-        StrictTypeSpelling(StrictTypeSpelling) { }
++        StrictTypeSpelling(StrictTypeSpelling), Complain(Complain) { }
+ 
+     /// \brief Determine whether the two declarations are structurally
+     /// equivalent.
+@@ -223,10 +228,16 @@
+     
+   public:
+     DiagnosticBuilder Diag1(SourceLocation Loc, unsigned DiagID) {
++      if (!Complain)
++        return DiagnosticBuilder(DiagnosticBuilder::Suppress);
++
+       return C1.getDiagnostics().Report(Loc, DiagID);
+     }
+ 
+     DiagnosticBuilder Diag2(SourceLocation Loc, unsigned DiagID) {
++      if (!Complain)
++        return DiagnosticBuilder(DiagnosticBuilder::Suppress);
++      
+       return C2.getDiagnostics().Report(Loc, DiagID);
+     }
+   };
+@@ -2050,10 +2061,12 @@
+ }
+ 
+ bool ASTNodeImporter::IsStructuralMatch(RecordDecl *FromRecord, 
+-                                        RecordDecl *ToRecord) {
++                                        RecordDecl *ToRecord,
++                                        bool Complain) {
+   StructuralEquivalenceContext Ctx(Importer.getFromContext(),
+                                    Importer.getToContext(),
+-                                   Importer.getNonEquivalentDecls());
++                                   Importer.getNonEquivalentDecls(),
++                                   false, Complain);
+   return Ctx.IsStructurallyEquivalent(FromRecord, ToRecord);
+ }
+ 
+@@ -2333,7 +2346,7 @@
+ 
+   // We may already have a record of the same name; try to find and match it.
+   RecordDecl *AdoptDecl = 0;
+-  if (!DC->isFunctionOrMethod() && SearchName) {
++  if (!DC->isFunctionOrMethod()) {
+     SmallVector<NamedDecl *, 4> ConflictingDecls;
+     llvm::SmallVector<NamedDecl *, 2> FoundDecls;
+     DC->localUncachedLookup(SearchName, FoundDecls);
+@@ -2349,26 +2362,32 @@
+       
+       if (RecordDecl *FoundRecord = dyn_cast<RecordDecl>(Found)) {
+         if (RecordDecl *FoundDef = FoundRecord->getDefinition()) {
+-          if (!D->isCompleteDefinition() || IsStructuralMatch(D, FoundDef)) {
++          if ((SearchName && !D->isCompleteDefinition()) ||
++              (D->isCompleteDefinition() &&
++               D->isAnonymousStructOrUnion()
++                 == FoundDef->isAnonymousStructOrUnion() &&
++               IsStructuralMatch(D, FoundDef, SearchName))) {
+             // The record types structurally match, or the "from" translation
+             // unit only had a forward declaration anyway; call it the same
+             // function.
+             // FIXME: For C++, we should also merge methods here.
+             return Importer.Imported(D, FoundDef);
+           }
+-        } else {
++        } else if (!D->isCompleteDefinition()) {
+           // We have a forward declaration of this type, so adopt that forward
+           // declaration rather than building a new one.
+           AdoptDecl = FoundRecord;
+           continue;
+-        }          
++        } else if (!SearchName) {
++          continue;
++        }
+       }
+       
+       ConflictingDecls.push_back(FoundDecls[I]);
+     }
+     
+-    if (!ConflictingDecls.empty()) {
+-      Name = Importer.HandleNameConflict(Name, DC, IDNS,
++    if (!ConflictingDecls.empty() && SearchName) {
++      Name = Importer.HandleNameConflict(SearchName, DC, IDNS,
+                                          ConflictingDecls.data(), 
+                                          ConflictingDecls.size());
+     }
+@@ -2393,6 +2412,8 @@
+     D2->setQualifierInfo(Importer.Import(D->getQualifierLoc()));
+     D2->setLexicalDeclContext(LexicalDC);
+     LexicalDC->addDeclInternal(D2);
++    if (D->isAnonymousStructOrUnion())
++      D2->setAnonymousStructOrUnion(true);
+   }
+   
+   Importer.Imported(D, D2);
+@@ -2631,12 +2652,17 @@
+   DC->localUncachedLookup(Name, FoundDecls);
+   for (unsigned I = 0, N = FoundDecls.size(); I != N; ++I) {
+     if (FieldDecl *FoundField = dyn_cast<FieldDecl>(FoundDecls[I])) {
+-      if (Importer.IsStructurallyEquivalent(D->getType(), 
+-                                            FoundField->getType())) {
++      if (Importer.IsStructurallyEquivalent(D->getType(),
++                                            FoundField->getType(),
++                                            Name)) {
+         Importer.Imported(D, FoundField);
+         return FoundField;
+       }
+-      
++
++      // If there are more anonymous fields to check, continue.
++      if (!Name && I < N-1)
++        continue;
++
+       Importer.ToDiag(Loc, diag::err_odr_field_type_inconsistent)
+         << Name << D->getType() << FoundField->getType();
+       Importer.ToDiag(FoundField->getLocation(), diag::note_odr_value_here)
+@@ -4662,12 +4688,14 @@
+   return To;
+ }
+ 
+-bool ASTImporter::IsStructurallyEquivalent(QualType From, QualType To) {
++bool ASTImporter::IsStructurallyEquivalent(QualType From, QualType To,
++                                           bool Complain) {
+   llvm::DenseMap<const Type *, const Type *>::iterator Pos
+    = ImportedTypes.find(From.getTypePtr());
+   if (Pos != ImportedTypes.end() && ToContext.hasSameType(Import(From), To))
+     return true;
+       
+-  StructuralEquivalenceContext Ctx(FromContext, ToContext, NonEquivalentDecls);
++  StructuralEquivalenceContext Ctx(FromContext, ToContext, NonEquivalentDecls,
++                                   false, Complain);
+   return Ctx.IsStructurallyEquivalent(From, To);
+ }
 Index: lib/AST/NSAPI.cpp
 ===================================================================
 --- lib/AST/NSAPI.cpp	(revision 152265)
@@ -1454,6 +1628,27 @@
  }
  
  void StmtPrinter::VisitObjCArrayLiteral(ObjCArrayLiteral *E) {
+Index: lib/AST/DeclBase.cpp
+===================================================================
+--- lib/AST/DeclBase.cpp	(revision 152265)
++++ lib/AST/DeclBase.cpp	(working copy)
+@@ -1153,14 +1153,14 @@
+   
+   // If there's no external storage, just perform a normal lookup and copy
+   // the results.
+-  if (!hasExternalVisibleStorage() && !hasExternalLexicalStorage()) {
++  if (!hasExternalVisibleStorage() && !hasExternalLexicalStorage() && Name) {
+     lookup_result LookupResults = lookup(Name);
+     Results.insert(Results.end(), LookupResults.first, LookupResults.second);
+     return;
+   }
+ 
+   // If we have a lookup table, check there first. Maybe we'll get lucky.
+-  if (LookupPtr) {
++  if (LookupPtr && Name) {
+     StoredDeclsMap::iterator Pos = LookupPtr->find(Name);
+     if (Pos != LookupPtr->end()) {
+       Results.insert(Results.end(), 
 Index: lib/AST/StmtProfile.cpp
 ===================================================================
 --- lib/AST/StmtProfile.cpp	(revision 152265)

Modified: lldb/branches/lldb-platform-work/scripts/llvm.amalgamated.diff
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/llvm.amalgamated.diff?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/llvm.amalgamated.diff (original)
+++ lldb/branches/lldb-platform-work/scripts/llvm.amalgamated.diff Mon Jul 23 19:12:48 2012
@@ -479,6 +479,32 @@
    return MCDisassembler::Success;
  }
  
+Index: lib/Target/X86/Disassembler/X86Disassembler.cpp
+===================================================================
+--- lib/Target/X86/Disassembler/X86Disassembler.cpp	(revision 152265)
++++ lib/Target/X86/Disassembler/X86Disassembler.cpp	(working copy)
+@@ -322,7 +322,12 @@
+ 
+   OperandType type = (OperandType)operand.type;
+ 
++  bool isBranch = false;
++  uint64_t pcrel = 0;
+   if (type == TYPE_RELv) {
++    isBranch = true;
++    pcrel = insn.startLocation +
++            insn.displacementOffset + insn.displacementSize;
+     switch (insn.displacementSize) {
+     default:
+       break;
+@@ -373,8 +378,6 @@
+     }
+   }
+ 
+-  bool isBranch = false;
+-  uint64_t pcrel = 0;
+   switch (type) {
+   case TYPE_XMM128:
+     mcInst.addOperand(MCOperand::CreateReg(X86::XMM0 + (immediate >> 4)));
 Index: lib/Target/X86/Disassembler/X86DisassemblerDecoder.c
 ===================================================================
 --- lib/Target/X86/Disassembler/X86DisassemblerDecoder.c	(revision 152265)

Modified: lldb/branches/lldb-platform-work/source/API/SBCommandInterpreter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/API/SBCommandInterpreter.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/API/SBCommandInterpreter.cpp (original)
+++ lldb/branches/lldb-platform-work/source/API/SBCommandInterpreter.cpp Mon Jul 23 19:12:48 2012
@@ -139,8 +139,8 @@
         return 0;
         
     if (log)
-        log->Printf ("SBCommandInterpreter(%p)::HandleCompletion (current_line=\"%s\", cursor at: %ld, last char at: %ld, match_start_point: %d, max_return_elements: %d)",
-                     m_opaque_ptr, current_line, cursor - current_line, last_char - current_line, match_start_point, max_return_elements);
+        log->Printf ("SBCommandInterpreter(%p)::HandleCompletion (current_line=\"%s\", cursor at: %lld, last char at: %lld, 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/lldb-platform-work/source/API/SBFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/API/SBFrame.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/API/SBFrame.cpp (original)
+++ lldb/branches/lldb-platform-work/source/API/SBFrame.cpp Mon Jul 23 19:12:48 2012
@@ -534,7 +534,7 @@
             Error error;
             ValueObjectSP value_sp (frame->GetValueForVariableExpressionPath (var_path, 
                                                                               use_dynamic,
-                                                                              StackFrame::eExpressionPathOptionCheckPtrVsMember,
+                                                                              StackFrame::eExpressionPathOptionCheckPtrVsMember | StackFrame::eExpressionPathOptionsAllowDirectIVarAccess,
                                                                               var_sp,
                                                                               error));
             sb_value.SetSP(value_sp);
@@ -1038,7 +1038,7 @@
     
     LogSP expr_log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS));
 
-    ExecutionResults exe_results;
+    ExecutionResults exe_results = eExecutionSetupError;
     SBValue expr_result;
     ValueObjectSP expr_value_sp;
 

Modified: lldb/branches/lldb-platform-work/source/API/SBProcess.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/API/SBProcess.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/API/SBProcess.cpp (original)
+++ lldb/branches/lldb-platform-work/source/API/SBProcess.cpp Mon Jul 23 19:12:48 2012
@@ -39,7 +39,7 @@
 
 
 SBProcess::SBProcess () :
-    m_opaque_sp()
+    m_opaque_wp()
 {
 }
 
@@ -49,13 +49,13 @@
 //----------------------------------------------------------------------
 
 SBProcess::SBProcess (const SBProcess& rhs) :
-    m_opaque_sp (rhs.m_opaque_sp)
+    m_opaque_wp (rhs.m_opaque_wp)
 {
 }
 
 
 SBProcess::SBProcess (const lldb::ProcessSP &process_sp) :
-    m_opaque_sp (process_sp)
+    m_opaque_wp (process_sp)
 {
 }
 
@@ -63,7 +63,7 @@
 SBProcess::operator = (const SBProcess& rhs)
 {
     if (this != &rhs)
-        m_opaque_sp = rhs.m_opaque_sp;
+        m_opaque_wp = rhs.m_opaque_wp;
     return *this;
 }
 
@@ -83,26 +83,26 @@
 lldb::ProcessSP
 SBProcess::GetSP() const
 {
-    return m_opaque_sp;
+    return m_opaque_wp.lock();
 }
 
 void
 SBProcess::SetSP (const ProcessSP &process_sp)
 {
-    m_opaque_sp = process_sp;
+    m_opaque_wp = process_sp;
 }
 
 void
 SBProcess::Clear ()
 {
-    m_opaque_sp.reset();
+    m_opaque_wp.reset();
 }
 
 
 bool
 SBProcess::IsValid() const
 {
-    return m_opaque_sp.get() != NULL;
+    return m_opaque_wp.lock().get() != NULL;
 }
 
 bool
@@ -119,7 +119,7 @@
     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
     if (log) {
         log->Printf ("SBProcess(%p)::RemoteLaunch (argv=%p, envp=%p, stdin=%s, stdout=%s, stderr=%s, working-dir=%s, launch_flags=0x%x, stop_at_entry=%i, &error (%p))...",
-                     m_opaque_sp.get(), 
+                     m_opaque_wp.lock().get(),
                      argv, 
                      envp, 
                      stdin_path ? stdin_path : "NULL", 
@@ -405,6 +405,26 @@
     return ret_val;
 }
 
+bool
+SBProcess::SetSelectedThreadByIndexID (uint32_t index_id)
+{
+    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+
+    bool ret_val = false;
+    ProcessSP process_sp(GetSP());
+    if (process_sp)
+    {
+        Mutex::Locker api_locker (process_sp->GetTarget().GetAPIMutex());
+        ret_val = process_sp->GetThreadList().SetSelectedThreadByIndexID (index_id);
+    }
+
+    if (log)
+        log->Printf ("SBProcess(%p)::SetSelectedThreadByID (tid=0x%x) => %s", 
+                     process_sp.get(), index_id, (ret_val ? "true" : "false"));
+
+    return ret_val;
+}
+
 SBThread
 SBProcess::GetThreadAtIndex (size_t index)
 {
@@ -725,6 +745,33 @@
     return sb_thread;
 }
 
+SBThread
+SBProcess::GetThreadByIndexID (uint32_t index_id)
+{
+    SBThread sb_thread;
+    ThreadSP thread_sp;
+    ProcessSP process_sp(GetSP());
+    if (process_sp)
+    {
+        Mutex::Locker api_locker (process_sp->GetTarget().GetAPIMutex());
+        Process::StopLocker stop_locker;
+        const bool can_update = stop_locker.TryLock(&process_sp->GetRunLock());
+        thread_sp = process_sp->GetThreadList().FindThreadByIndexID (index_id, can_update);
+        sb_thread.SetThread (thread_sp);
+    }
+
+    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+    if (log)
+    {
+        log->Printf ("SBProcess(%p)::GetThreadByID (tid=0x%x) => SBThread (%p)", 
+                     process_sp.get(), 
+                     index_id,
+                     thread_sp.get());
+    }
+
+    return sb_thread;
+}
+
 StateType
 SBProcess::GetStateFromEvent (const SBEvent &event)
 {

Modified: lldb/branches/lldb-platform-work/source/API/SBTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/API/SBTarget.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/API/SBTarget.cpp (original)
+++ lldb/branches/lldb-platform-work/source/API/SBTarget.cpp Mon Jul 23 19:12:48 2012
@@ -369,6 +369,18 @@
     m_opaque_sp->SetWaitForLaunch (b);
 }
 
+bool
+SBAttachInfo::GetIgnoreExisting ()
+{
+    return m_opaque_sp->GetIgnoreExisting();
+}
+
+void
+SBAttachInfo::SetIgnoreExisting (bool b)
+{
+    m_opaque_sp->SetIgnoreExisting (b);
+}
+
 uint32_t
 SBAttachInfo::GetUserID()
 {
@@ -754,20 +766,19 @@
             const bool synchronous_execution = target_sp->GetDebugger().GetAsyncExecution () == false;
             if (error.Success())
             {
-                StateType state = eStateInvalid;
                 if (launch_info.GetFlags().Test(eLaunchFlagStopAtEntry))
                 {
                     // If we are doing synchronous mode, then wait for the initial
                     // stop to happen, else, return and let the caller watch for
                     // the stop
                     if (synchronous_execution)
-                         state = process_sp->WaitForProcessToStop (NULL);
+                         process_sp->WaitForProcessToStop (NULL);
                     // We we are stopping at the entry point, we can return now!
                     return sb_process;
                 }
                 
                 // Make sure we are stopped at the entry
-                state = process_sp->WaitForProcessToStop (NULL);
+                StateType state = process_sp->WaitForProcessToStop (NULL);
                 if (state == eStateStopped)
                 {
                     // resume the process to skip the entry point
@@ -2137,7 +2148,7 @@
                 }
                 else
                 {
-                    target_sp->GetSectionLoadList().SetSectionLoadAddress (section_sp.get(), section_base_addr);
+                    target_sp->GetSectionLoadList().SetSectionLoadAddress (section_sp, section_base_addr);
                 }
             }
         }
@@ -2163,7 +2174,7 @@
         }
         else
         {
-            target_sp->GetSectionLoadList().SetSectionUnloaded (section.GetSP().get());
+            target_sp->GetSectionLoadList().SetSectionUnloaded (section.GetSP());
         }
     }
     else
@@ -2233,7 +2244,7 @@
                     {
                         SectionSP section_sp (section_list->GetSectionAtIndex(sect_idx));
                         if (section_sp)
-                            target_sp->GetSectionLoadList().SetSectionUnloaded (section_sp.get());
+                            target_sp->GetSectionLoadList().SetSectionUnloaded (section_sp);
                     }
                 }
                 else

Modified: lldb/branches/lldb-platform-work/source/Commands/CommandObjectBreakpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Commands/CommandObjectBreakpoint.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Commands/CommandObjectBreakpoint.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Commands/CommandObjectBreakpoint.cpp Mon Jul 23 19:12:48 2012
@@ -373,14 +373,8 @@
 
         Breakpoint *bp = NULL;
         FileSpec module_spec;
-        bool use_module = false;
-        int num_modules = m_options.m_modules.GetSize();
-        
         const bool internal = false;
 
-        if ((num_modules > 0) && (break_type != eSetTypeAddress))
-            use_module = true;
-
         switch (break_type)
         {
             case eSetTypeFileAndLine: // Breakpoint by source position
@@ -1673,8 +1667,6 @@
                             "A set of commands for operating on breakpoints. Also see _regexp-break.",
                             "breakpoint <command> [<command-options>]")
 {
-    bool status;
-
     CommandObjectSP list_command_object (new CommandObjectBreakpointList (interpreter));
     CommandObjectSP enable_command_object (new CommandObjectBreakpointEnable (interpreter));
     CommandObjectSP disable_command_object (new CommandObjectBreakpointDisable (interpreter));
@@ -1693,14 +1685,14 @@
     command_command_object->SetCommandName ("breakpoint command");
     modify_command_object->SetCommandName ("breakpoint modify");
 
-    status = LoadSubCommand ("list",       list_command_object);
-    status = LoadSubCommand ("enable",     enable_command_object);
-    status = LoadSubCommand ("disable",    disable_command_object);
-    status = LoadSubCommand ("clear",      clear_command_object);
-    status = LoadSubCommand ("delete",     delete_command_object);
-    status = LoadSubCommand ("set",        set_command_object);
-    status = LoadSubCommand ("command",    command_command_object);
-    status = LoadSubCommand ("modify",     modify_command_object);
+    LoadSubCommand ("list",       list_command_object);
+    LoadSubCommand ("enable",     enable_command_object);
+    LoadSubCommand ("disable",    disable_command_object);
+    LoadSubCommand ("clear",      clear_command_object);
+    LoadSubCommand ("delete",     delete_command_object);
+    LoadSubCommand ("set",        set_command_object);
+    LoadSubCommand ("command",    command_command_object);
+    LoadSubCommand ("modify",     modify_command_object);
 }
 
 CommandObjectMultiwordBreakpoint::~CommandObjectMultiwordBreakpoint ()

Modified: lldb/branches/lldb-platform-work/source/Commands/CommandObjectBreakpointCommand.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Commands/CommandObjectBreakpointCommand.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Commands/CommandObjectBreakpointCommand.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Commands/CommandObjectBreakpointCommand.cpp Mon Jul 23 19:12:48 2012
@@ -864,7 +864,6 @@
                             "A set of commands for adding, removing and examining bits of code to be executed when the breakpoint is hit (breakpoint 'commmands').",
                             "command <sub-command> [<sub-command-options>] <breakpoint-id>")
 {
-    bool status;
     CommandObjectSP add_command_object (new CommandObjectBreakpointCommandAdd (interpreter));
     CommandObjectSP delete_command_object (new CommandObjectBreakpointCommandDelete (interpreter));
     CommandObjectSP list_command_object (new CommandObjectBreakpointCommandList (interpreter));
@@ -873,9 +872,9 @@
     delete_command_object->SetCommandName ("breakpoint command delete");
     list_command_object->SetCommandName ("breakpoint command list");
 
-    status = LoadSubCommand ("add",    add_command_object);
-    status = LoadSubCommand ("delete", delete_command_object);
-    status = LoadSubCommand ("list",   list_command_object);
+    LoadSubCommand ("add",    add_command_object);
+    LoadSubCommand ("delete", delete_command_object);
+    LoadSubCommand ("list",   list_command_object);
 }
 
 CommandObjectBreakpointCommand::~CommandObjectBreakpointCommand ()

Modified: lldb/branches/lldb-platform-work/source/Commands/CommandObjectExpression.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Commands/CommandObjectExpression.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Commands/CommandObjectExpression.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Commands/CommandObjectExpression.cpp Mon Jul 23 19:12:48 2012
@@ -305,7 +305,8 @@
                                                   m_command_options.unwind_on_error,
                                                   keep_in_memory, 
                                                   use_dynamic, 
-                                                  result_valobj_sp);
+                                                  result_valobj_sp,
+                                                  0 /* no timeout */);
         
         if (exe_results == eExecutionInterrupted && !m_command_options.unwind_on_error)
         {

Modified: lldb/branches/lldb-platform-work/source/Commands/CommandObjectFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Commands/CommandObjectFrame.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Commands/CommandObjectFrame.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Commands/CommandObjectFrame.cpp Mon Jul 23 19:12:48 2012
@@ -282,14 +282,7 @@
 
                     bool show_frame_info = true;
                     bool show_source = !already_shown;
-                    Debugger &debugger = m_interpreter.GetDebugger();
-                    const uint32_t source_lines_before = debugger.GetStopSourceLineCount(true);
-                    const uint32_t source_lines_after = debugger.GetStopSourceLineCount(false);
-                    if (frame->GetStatus (result.GetOutputStream(),
-                                          show_frame_info,
-                                          show_source,
-                                          source_lines_before,
-                                          source_lines_after))
+                    if (frame->GetStatus (result.GetOutputStream(), show_frame_info, show_source))
                     {
                         result.SetStatus (eReturnStatusSuccessFinishResult);
                         return result.Succeeded();
@@ -490,7 +483,8 @@
                     else // No regex, either exact variable names or variable expressions.
                     {
                         Error error;
-                        uint32_t expr_path_options = StackFrame::eExpressionPathOptionCheckPtrVsMember;
+                        uint32_t expr_path_options = StackFrame::eExpressionPathOptionCheckPtrVsMember |
+                                                     StackFrame::eExpressionPathOptionsAllowDirectIVarAccess;
                         lldb::VariableSP var_sp;
                         valobj_sp = frame->GetValueForVariableExpressionPath (name_cstr, 
                                                                               m_varobj_options.use_dynamic, 

Modified: lldb/branches/lldb-platform-work/source/Commands/CommandObjectMemory.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Commands/CommandObjectMemory.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Commands/CommandObjectMemory.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Commands/CommandObjectMemory.cpp Mon Jul 23 19:12:48 2012
@@ -398,19 +398,52 @@
             uint32_t reference_count = 0;
             uint32_t pointer_count = 0;
             size_t idx;
-            static const char *g_keywords[] = { "const", "volatile", "restrict", "struct", "class", "union"};
-            static size_t g_num_keywords = sizeof(g_keywords)/sizeof(const char *);
+            
+#define ALL_KEYWORDS        \
+    KEYWORD("const")        \
+    KEYWORD("volatile")     \
+    KEYWORD("restrict")     \
+    KEYWORD("struct")       \
+    KEYWORD("class")        \
+    KEYWORD("union")
+            
+#define KEYWORD(s) s,
+            static const char *g_keywords[] =
+            {
+                ALL_KEYWORDS
+            };
+#undef KEYWORD
+
+#define KEYWORD(s) (sizeof(s) - 1),
+            static const int g_keyword_lengths[] =
+            {
+                ALL_KEYWORDS
+            };
+#undef KEYWORD
+            
+#undef ALL_KEYWORDS
+            
+            static size_t g_num_keywords = sizeof(g_keywords) / sizeof(const char *);
             std::string type_str(view_as_type_cstr);
             
             // Remove all instances of g_keywords that are followed by spaces
             for (size_t i = 0; i < g_num_keywords; ++i)
             {
                 const char *keyword = g_keywords[i];
-                int keyword_len = ::strlen (keyword);
-                while ((idx = type_str.find (keyword)) != std::string::npos)
+                int keyword_len = g_keyword_lengths[i];
+                
+                idx = 0;
+                while ((idx = type_str.find (keyword, idx)) != std::string::npos)
                 {
                     if (type_str[idx + keyword_len] == ' ' || type_str[idx + keyword_len] == '\t')
+                    {
                         type_str.erase(idx, keyword_len+1);
+                        idx = 0;
+                    }
+                    else
+                    {
+                        idx += keyword_len;
+                    }
                 }
             }
             bool done = type_str.empty();

Modified: lldb/branches/lldb-platform-work/source/Commands/CommandObjectProcess.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Commands/CommandObjectProcess.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Commands/CommandObjectProcess.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Commands/CommandObjectProcess.cpp Mon Jul 23 19:12:48 2012
@@ -350,6 +350,10 @@
                 case 'w':   
                     attach_info.SetWaitForLaunch(true);
                     break;
+                    
+                case 'i':
+                    attach_info.SetIgnoreExisting(false);
+                    break;
 
                 default:
                     error.SetErrorStringWithFormat("invalid short option character '%c'", short_option);
@@ -618,11 +622,12 @@
 OptionDefinition
 CommandObjectProcessAttach::CommandOptions::g_option_table[] =
 {
-{ LLDB_OPT_SET_ALL, false, "continue",'c', no_argument,       NULL, 0, eArgTypeNone,         "Immediately continue the process once attached."},
-{ LLDB_OPT_SET_ALL, false, "plugin",  'P', required_argument, NULL, 0, eArgTypePlugin,       "Name of the process plugin you want to use."},
-{ LLDB_OPT_SET_1,   false, "pid",     'p', required_argument, NULL, 0, eArgTypePid,          "The process ID of an existing process to attach to."},
-{ LLDB_OPT_SET_2,   false, "name",    'n', required_argument, NULL, 0, eArgTypeProcessName,  "The name of the process to attach to."},
-{ LLDB_OPT_SET_2,   false, "waitfor", 'w', no_argument,       NULL, 0, eArgTypeNone,         "Wait for the process with <process-name> to launch."},
+{ LLDB_OPT_SET_ALL, false, "continue",'c', no_argument,         NULL, 0, eArgTypeNone,         "Immediately continue the process once attached."},
+{ LLDB_OPT_SET_ALL, false, "plugin",  'P', required_argument,   NULL, 0, eArgTypePlugin,       "Name of the process plugin you want to use."},
+{ LLDB_OPT_SET_1,   false, "pid",     'p', required_argument,   NULL, 0, eArgTypePid,          "The process ID of an existing process to attach to."},
+{ LLDB_OPT_SET_2,   false, "name",    'n', required_argument,   NULL, 0, eArgTypeProcessName,  "The name of the process to attach to."},
+{ LLDB_OPT_SET_2,   false, "include-existing", 'i', no_argument, NULL, 0, eArgTypeNone,         "Include existing processes when doing attach -w."},
+{ LLDB_OPT_SET_2,   false, "waitfor", 'w', no_argument,         NULL, 0, eArgTypeNone,         "Wait for the process with <process-name> to launch."},
 { 0, false, NULL, 0, 0, NULL, 0, eArgTypeNone, NULL }
 };
 

Modified: lldb/branches/lldb-platform-work/source/Commands/CommandObjectTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Commands/CommandObjectTarget.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Commands/CommandObjectTarget.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Commands/CommandObjectTarget.cpp Mon Jul 23 19:12:48 2012
@@ -34,10 +34,12 @@
 #include "lldb/Interpreter/OptionGroupUInt64.h"
 #include "lldb/Interpreter/OptionGroupUUID.h"
 #include "lldb/Interpreter/OptionGroupValueObjectDisplay.h"
+#include "lldb/Symbol/FuncUnwinders.h"
 #include "lldb/Symbol/LineTable.h"
 #include "lldb/Symbol/ObjectFile.h"
 #include "lldb/Symbol/SymbolFile.h"
 #include "lldb/Symbol/SymbolVendor.h"
+#include "lldb/Symbol/UnwindPlan.h"
 #include "lldb/Symbol/VariableList.h"
 #include "lldb/Target/Process.h"
 #include "lldb/Target/StackFrame.h"
@@ -538,6 +540,13 @@
         if (argc > 0)
         {
             const uint32_t num_targets = target_list.GetNumTargets();
+            // Bail out if don't have any targets.
+            if (num_targets == 0) {
+                result.AppendError("no targets to delete");
+                result.SetStatus(eReturnStatusFailed);
+                success = false;
+            }
+
             for (uint32_t arg_idx = 0; success && arg_idx < argc; ++arg_idx)
             {
                 const char *target_idx_arg = args.GetArgumentAtIndex(arg_idx);
@@ -553,9 +562,14 @@
                             continue;
                         }
                     }
-                    result.AppendErrorWithFormat ("target index %u is out of range, valid target indexes are 0 - %u\n", 
-                                                  target_idx,
-                                                  num_targets - 1);
+                    if (num_targets > 1)
+                        result.AppendErrorWithFormat ("target index %u is out of range, valid target indexes are 0 - %u\n",
+                                                      target_idx,
+                                                      num_targets - 1);
+                    else
+                        result.AppendErrorWithFormat("target index %u is out of range, the only valid index is 0\n",
+                                                    target_idx);
+
                     result.SetStatus (eReturnStatusFailed);
                     success = false;
                 }
@@ -1795,27 +1809,7 @@
     
     const size_t initial_size = module_list.GetSize ();
 
-    size_t num_matches = 0;
-    
-    if (target)
-    {
-        num_matches = target->GetImages().FindModules (module_spec, module_list);
-    
-        // Not found in our module list for our target, check the main
-        // shared module list in case it is a extra file used somewhere
-        // else
-        if (num_matches == 0)
-        {
-            module_spec.GetArchitecture() = target->GetArchitecture();
-            num_matches = ModuleList::FindSharedModules (module_spec, module_list);
-        }
-    }
-    else
-    {
-        num_matches = ModuleList::FindSharedModules (module_spec,module_list);
-    }
-    
-    if (check_global_list && num_matches == 0)
+    if (check_global_list)
     {
         // Check the global list
         Mutex::Locker locker(Module::GetAllocationModuleCollectionMutex());
@@ -1835,6 +1829,27 @@
             }
         }
     }
+    else
+    {
+        if (target)
+        {
+            const size_t num_matches = target->GetImages().FindModules (module_spec, module_list);
+        
+            // Not found in our module list for our target, check the main
+            // shared module list in case it is a extra file used somewhere
+            // else
+            if (num_matches == 0)
+            {
+                module_spec.GetArchitecture() = target->GetArchitecture();
+                ModuleList::FindSharedModules (module_spec, module_list);
+            }
+        }
+        else
+        {
+            ModuleList::FindSharedModules (module_spec,module_list);
+        }
+    }
+    
     return module_list.GetSize () - initial_size;
 }
 
@@ -2715,7 +2730,7 @@
                                                     }
                                                     else
                                                     {
-                                                        if (target->GetSectionLoadList().SetSectionLoadAddress (section_sp.get(), load_addr))
+                                                        if (target->GetSectionLoadList().SetSectionLoadAddress (section_sp, load_addr))
                                                             changed = true;
                                                         result.AppendMessageWithFormat("section '%s' loaded at 0x%llx\n", sect_name, load_addr);
                                                     }
@@ -3257,7 +3272,241 @@
     { 0, false, NULL, 0, 0, NULL, 0, eArgTypeNone, NULL }
 };
 
+#pragma mark CommandObjectTargetModulesShowUnwind
+
+//----------------------------------------------------------------------
+// Lookup unwind information in images
+//----------------------------------------------------------------------
+
+class CommandObjectTargetModulesShowUnwind : public CommandObjectParsed
+{
+public:
+
+    enum
+    {
+        eLookupTypeInvalid = -1,
+        eLookupTypeAddress = 0,
+        eLookupTypeSymbol,
+        eLookupTypeFunction,
+        eLookupTypeFunctionOrSymbol,
+        kNumLookupTypes
+    };
+
+    class CommandOptions : public Options
+    {
+    public:
+
+        CommandOptions (CommandInterpreter &interpreter) :
+        Options(interpreter),
+        m_type(eLookupTypeInvalid),
+        m_str(),
+        m_addr(LLDB_INVALID_ADDRESS)
+        {
+        }
+
+        virtual
+        ~CommandOptions ()
+        {
+        }
+
+        virtual Error
+        SetOptionValue (uint32_t option_idx, const char *option_arg)
+        {
+            Error error;
+
+            char short_option = (char) m_getopt_table[option_idx].val;
+
+            switch (short_option)
+            {
+                case 'a':
+                    m_type = eLookupTypeAddress;
+                    m_addr = Args::StringToUInt64(option_arg, LLDB_INVALID_ADDRESS);
+                    if (m_addr == LLDB_INVALID_ADDRESS)
+                        error.SetErrorStringWithFormat ("invalid address string '%s'", option_arg);
+                    break;
+
+                case 'n':
+                    m_str = option_arg;
+                    m_type = eLookupTypeFunctionOrSymbol;
+                    break;
+            }
+
+            return error;
+        }
+
+        void
+        OptionParsingStarting ()
+        {
+            m_type = eLookupTypeInvalid;
+            m_str.clear();
+            m_addr = LLDB_INVALID_ADDRESS;
+        }
+
+        const OptionDefinition*
+        GetDefinitions ()
+        {
+            return g_option_table;
+        }
+
+        // Options table: Required for subclasses of Options.
+
+        static OptionDefinition g_option_table[];
+
+        // Instance variables to hold the values for command options.
+
+        int             m_type;         // Should be a eLookupTypeXXX enum after parsing options
+        std::string     m_str;          // Holds name lookup
+        lldb::addr_t    m_addr;         // Holds the address to lookup
+    };
+    
+    CommandObjectTargetModulesShowUnwind (CommandInterpreter &interpreter) :
+        CommandObjectParsed (interpreter,
+                             "target modules show-unwind",
+                             "Show synthesized unwind instructions for a function.",
+                             NULL),
+        m_options (interpreter)
+    {
+    }
+    
+    virtual
+    ~CommandObjectTargetModulesShowUnwind ()
+    {
+    }
+    
+    virtual
+    Options *
+    GetOptions ()
+    {
+        return &m_options;
+    }
+
+protected:
+    bool
+    DoExecute (Args& command,
+             CommandReturnObject &result)
+    {
+        Target *target = m_interpreter.GetDebugger().GetSelectedTarget().get();
+        if (!target)
+        {
+            result.AppendError ("invalid target, create a debug target using the 'target create' command");
+            result.SetStatus (eReturnStatusFailed);
+            return false;
+        }
+
+        ExecutionContext exe_ctx = m_interpreter.GetDebugger().GetSelectedExecutionContext();
+        Process *process = exe_ctx.GetProcessPtr();
+        ABI *abi = NULL;
+        if (process)
+          abi = process->GetABI().get();
 
+        if (process == NULL)
+        {
+            result.AppendError ("You must have a process running to use this command.");
+            result.SetStatus (eReturnStatusFailed);
+            return false;
+        }
+
+        ThreadList threads(process->GetThreadList());
+        if (threads.GetSize() == 0)
+        {
+            result.AppendError ("The process must be paused to use this command.");
+            result.SetStatus (eReturnStatusFailed);
+            return false;
+        }
+
+        ThreadSP thread(threads.GetThreadAtIndex(0));
+        if (thread.get() == NULL)
+        {
+            result.AppendError ("The process must be paused to use this command.");
+            result.SetStatus (eReturnStatusFailed);
+            return false;
+        }
+
+        if (m_options.m_type == eLookupTypeFunctionOrSymbol)
+        {
+            SymbolContextList sc_list;
+            uint32_t num_matches;
+            ConstString function_name (m_options.m_str.c_str());
+            num_matches = target->GetImages().FindFunctions (function_name, eFunctionNameTypeAuto, true, false, true, sc_list);
+            for (uint32_t idx = 0; idx < num_matches; idx++)
+            {
+                SymbolContext sc;
+                sc_list.GetContextAtIndex(idx, sc);
+                if (sc.symbol == NULL && sc.function == NULL)
+                    continue;
+                if (sc.module_sp.get() == NULL || sc.module_sp->GetObjectFile() == NULL)
+                    continue;
+                AddressRange range;
+                if (!sc.GetAddressRange (eSymbolContextFunction | eSymbolContextSymbol, 0, false, range))
+                    continue;
+                if (!range.GetBaseAddress().IsValid())
+                    continue;
+                ConstString funcname(sc.GetFunctionName());
+                if (funcname.IsEmpty())
+                    continue;
+                addr_t start_addr = range.GetBaseAddress().GetLoadAddress(target);
+                if (abi)
+                    start_addr = abi->FixCodeAddress(start_addr);
+
+                FuncUnwindersSP func_unwinders_sp (sc.module_sp->GetObjectFile()->GetUnwindTable().GetUncachedFuncUnwindersContainingAddress(start_addr, sc));
+                if (func_unwinders_sp.get() == NULL)
+                    continue;
+
+                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 ("\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);
+                    non_callsite_unwind_plan->Dump(result.GetOutputStream(), thread.get(), LLDB_INVALID_ADDRESS);
+                    result.GetOutputStream().Printf ("\n");
+                }
+
+                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);
+                    callsite_unwind_plan->Dump(result.GetOutputStream(), thread.get(), LLDB_INVALID_ADDRESS);
+                    result.GetOutputStream().Printf ("\n");
+                }
+
+                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);
+                    arch_default_unwind_plan->Dump(result.GetOutputStream(), thread.get(), LLDB_INVALID_ADDRESS);
+                    result.GetOutputStream().Printf ("\n");
+                }
+
+                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);
+                    fast_unwind_plan->Dump(result.GetOutputStream(), thread.get(), LLDB_INVALID_ADDRESS);
+                    result.GetOutputStream().Printf ("\n");
+                }
+
+
+                result.GetOutputStream().Printf ("\n");
+            }
+        }
+        return result.Succeeded();
+    }
+
+    CommandOptions m_options;
+};
+
+OptionDefinition
+CommandObjectTargetModulesShowUnwind::CommandOptions::g_option_table[] =
+{
+    { LLDB_OPT_SET_1,   true,  "name",       'n', required_argument, NULL, 0, eArgTypeFunctionName, "Lookup a function or symbol by name in one or more target modules."},
+    { 0,                false, NULL,           0, 0,                 NULL, 0, eArgTypeNone, NULL }
+};
 
 //----------------------------------------------------------------------
 // Lookup information in images
@@ -3772,6 +4021,7 @@
         LoadSubCommand ("list",         CommandObjectSP (new CommandObjectTargetModulesList (interpreter)));
         LoadSubCommand ("lookup",       CommandObjectSP (new CommandObjectTargetModulesLookup (interpreter)));
         LoadSubCommand ("search-paths", CommandObjectSP (new CommandObjectTargetModulesImageSearchPaths (interpreter)));
+        LoadSubCommand ("show-unwind",  CommandObjectSP (new CommandObjectTargetModulesShowUnwind (interpreter)));
 
     }
     virtual

Modified: lldb/branches/lldb-platform-work/source/Commands/CommandObjectThread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Commands/CommandObjectThread.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Commands/CommandObjectThread.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Commands/CommandObjectThread.cpp Mon Jul 23 19:12:48 2012
@@ -646,37 +646,41 @@
         StateType state = process->GetState();
         if ((state == eStateCrashed) || (state == eStateStopped) || (state == eStateSuspended))
         {
+            Mutex::Locker locker (process->GetThreadList().GetMutex());
             const uint32_t num_threads = process->GetThreadList().GetSize();
-            uint32_t idx;
             const size_t argc = command.GetArgumentCount();
             if (argc > 0)
             {
-                std::vector<uint32_t> resume_thread_indexes;
+                std::vector<Thread *> resume_threads;
                 for (uint32_t i=0; i<argc; ++i)
                 {
                     bool success;
                     const int base = 0;
-                    idx = Args::StringToUInt32 (command.GetArgumentAtIndex(i), LLDB_INVALID_INDEX32, base, &success);
-                    if (!success)
+                    uint32_t thread_idx = Args::StringToUInt32 (command.GetArgumentAtIndex(i), LLDB_INVALID_INDEX32, base, &success);
+                    if (success)
                     {
-                        result.AppendErrorWithFormat ("invalid value for thread index: %s.", command.GetArgumentAtIndex(i));
-                        result.SetStatus (eReturnStatusFailed);
-                        return false;
-                    }
-                    else if (process->GetThreadList().FindThreadByIndexID(idx))
-                    {
-                        if (find(resume_thread_indexes.begin(), resume_thread_indexes.end(), idx) == resume_thread_indexes.end())
-                            resume_thread_indexes.push_back(idx);
+                        Thread *thread = process->GetThreadList().FindThreadByIndexID(thread_idx).get();
+                        
+                        if (thread)
+                        {
+                            resume_threads.push_back(thread);
+                        }
+                        else
+                        {
+                            result.AppendErrorWithFormat("invalid thread index %u.\n", thread_idx);
+                            result.SetStatus (eReturnStatusFailed);
+                            return false;
+                        }
                     }
                     else
                     {
-                        result.AppendErrorWithFormat("thread index %u out of range.\n", idx);
+                        result.AppendErrorWithFormat ("invalid thread index argument: \"%s\".\n", command.GetArgumentAtIndex(i));
                         result.SetStatus (eReturnStatusFailed);
                         return false;
                     }
                 }
-
-                if (resume_thread_indexes.empty())
+                
+                if (resume_threads.empty())
                 {
                     result.AppendError ("no valid thread indexes were specified");
                     result.SetStatus (eReturnStatusFailed);
@@ -684,20 +688,20 @@
                 }
                 else
                 {
-                    if (resume_thread_indexes.size() == 1)
+                    if (resume_threads.size() == 1)
                         result.AppendMessageWithFormat ("Resuming thread: ");
                     else
                         result.AppendMessageWithFormat ("Resuming threads: ");
-
-                    for (idx=0; idx<num_threads; ++idx)
+                    
+                    for (uint32_t idx=0; idx<num_threads; ++idx)
                     {
-                        Thread *thread = process->GetThreadList().FindThreadByIndexID(idx).get();
-                        std::vector<uint32_t>::iterator this_thread_pos = find(resume_thread_indexes.begin(), resume_thread_indexes.end(), thread->GetIndexID());
+                        Thread *thread = process->GetThreadList().GetThreadAtIndex(idx).get();
+                        std::vector<Thread *>::iterator this_thread_pos = find(resume_threads.begin(), resume_threads.end(), thread);
                         
-                        if (this_thread_pos != resume_thread_indexes.end())
+                        if (this_thread_pos != resume_threads.end())
                         {
-                            resume_thread_indexes.erase(this_thread_pos);
-                            if (resume_thread_indexes.size() > 0)
+                            resume_threads.erase(this_thread_pos);
+                            if (resume_threads.size() > 0)
                                 result.AppendMessageWithFormat ("%u, ", thread->GetIndexID());
                             else
                                 result.AppendMessageWithFormat ("%u ", thread->GetIndexID());
@@ -722,9 +726,9 @@
                     return false;
                 }
                 // Set the actions that the threads should each take when resuming
-                for (idx=0; idx<num_threads; ++idx)
+                for (uint32_t idx=0; idx<num_threads; ++idx)
                 {
-                    Thread *thread = process->GetThreadList().FindThreadByIndexID(idx).get();
+                    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());
@@ -736,7 +740,7 @@
                     }
                 }
             }
-
+            
             Error error (process->Resume());
             if (error.Success())
             {
@@ -744,7 +748,7 @@
                 if (synchronous_execution)
                 {
                     state = process->WaitForProcessToStop (NULL);
-
+                    
                     result.SetDidChangeProcessState (true);
                     result.AppendMessageWithFormat ("Process %llu %s\n", process->GetID(), StateAsCString (state));
                     result.SetStatus (eReturnStatusSuccessFinishNoResult);

Modified: lldb/branches/lldb-platform-work/source/Commands/CommandObjectWatchpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Commands/CommandObjectWatchpoint.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Commands/CommandObjectWatchpoint.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Commands/CommandObjectWatchpoint.cpp Mon Jul 23 19:12:48 2012
@@ -924,7 +924,7 @@
                              "Set a watchpoint on a variable. "
                              "Use the '-w' option to specify the type of watchpoint and "
                              "the '-x' option to specify the byte size to watch for. "
-                             "If no '-w' option is specified, it defaults to read_write. "
+                             "If no '-w' option is specified, it defaults to write. "
                              "If no '-x' option is specified, it defaults to the variable's "
                              "byte size. "
                              "Note that there are limited hardware resources for watchpoints. "
@@ -991,10 +991,10 @@
             return false;
         }
 
-        // If no '-w' is specified, default to '-w read_write'.
+        // If no '-w' is specified, default to '-w write'.
         if (!m_option_watchpoint.watch_type_specified)
         {
-            m_option_watchpoint.watch_type = OptionGroupWatchpoint::eWatchReadWrite;
+            m_option_watchpoint.watch_type = OptionGroupWatchpoint::eWatchWrite;
         }
 
         // We passed the sanity check for the command.
@@ -1015,7 +1015,8 @@
 
         // Things have checked out ok...
         Error error;
-        uint32_t expr_path_options = StackFrame::eExpressionPathOptionCheckPtrVsMember;
+        uint32_t expr_path_options = StackFrame::eExpressionPathOptionCheckPtrVsMember |
+                                     StackFrame::eExpressionPathOptionsAllowDirectIVarAccess;
         valobj_sp = frame->GetValueForVariableExpressionPath (command.GetArgumentAtIndex(0), 
                                                               eNoDynamicValues, 
                                                               expr_path_options,
@@ -1087,7 +1088,7 @@
                           "Set a watchpoint on an address by supplying an expression. "
                           "Use the '-w' option to specify the type of watchpoint and "
                           "the '-x' option to specify the byte size to watch for. "
-                          "If no '-w' option is specified, it defaults to read_write. "
+                          "If no '-w' option is specified, it defaults to write. "
                           "If no '-x' option is specified, it defaults to the target's "
                           "pointer byte size. "
                           "Note that there are limited hardware resources for watchpoints. "
@@ -1167,10 +1168,10 @@
         bool with_dash_w = m_option_watchpoint.watch_type_specified;
         bool with_dash_x = (m_option_watchpoint.watch_size != 0);
 
-        // If no '-w' is specified, default to '-w read_write'.
+        // If no '-w' is specified, default to '-w write'.
         if (!with_dash_w)
         {
-            m_option_watchpoint.watch_type = OptionGroupWatchpoint::eWatchReadWrite;
+            m_option_watchpoint.watch_type = OptionGroupWatchpoint::eWatchWrite;
         }
 
         // We passed the sanity check for the command.
@@ -1205,7 +1206,8 @@
                                                                    unwind_on_error, 
                                                                    keep_in_memory, 
                                                                    eNoDynamicValues, 
-                                                                   valobj_sp);
+                                                                   valobj_sp,
+                                                                   0 /* no timeout */);
         if (expr_result != eExecutionCompleted) {
             result.GetErrorStream().Printf("error: expression evaluation of address to watch failed\n");
             result.GetErrorStream().Printf("expression evaluated: %s\n", expr_str.c_str());
@@ -1293,8 +1295,6 @@
                             "A set of commands for operating on watchpoints.",
                             "watchpoint <command> [<command-options>]")
 {
-    bool status;
-
     CommandObjectSP list_command_object (new CommandObjectWatchpointList (interpreter));
     CommandObjectSP enable_command_object (new CommandObjectWatchpointEnable (interpreter));
     CommandObjectSP disable_command_object (new CommandObjectWatchpointDisable (interpreter));
@@ -1311,13 +1311,13 @@
     modify_command_object->SetCommandName("watchpoint modify");
     set_command_object->SetCommandName("watchpoint set");
 
-    status = LoadSubCommand ("list",       list_command_object);
-    status = LoadSubCommand ("enable",     enable_command_object);
-    status = LoadSubCommand ("disable",    disable_command_object);
-    status = LoadSubCommand ("delete",     delete_command_object);
-    status = LoadSubCommand ("ignore",     ignore_command_object);
-    status = LoadSubCommand ("modify",     modify_command_object);
-    status = LoadSubCommand ("set",        set_command_object);
+    LoadSubCommand ("list",       list_command_object);
+    LoadSubCommand ("enable",     enable_command_object);
+    LoadSubCommand ("disable",    disable_command_object);
+    LoadSubCommand ("delete",     delete_command_object);
+    LoadSubCommand ("ignore",     ignore_command_object);
+    LoadSubCommand ("modify",     modify_command_object);
+    LoadSubCommand ("set",        set_command_object);
 }
 
 CommandObjectMultiwordWatchpoint::~CommandObjectMultiwordWatchpoint()

Modified: lldb/branches/lldb-platform-work/source/Core/Address.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Core/Address.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Core/Address.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Core/Address.cpp Mon Jul 23 19:12:48 2012
@@ -354,9 +354,10 @@
 bool
 Address::Dump (Stream *s, ExecutionContextScope *exe_scope, DumpStyle style, DumpStyle fallback_style, uint32_t addr_size) const
 {
-    // If the section was NULL, only load address is going to work.
+    // If the section was NULL, only load address is going to work unless we are
+    // trying to deref a pointer
     SectionSP section_sp (GetSection());
-    if (!section_sp)
+    if (!section_sp && style != DumpStyleResolvedPointerDescription)
         style = DumpStyleLoadAddress;
 
     ExecutionContext exe_ctx (exe_scope);
@@ -430,14 +431,6 @@
     case DumpStyleResolvedDescriptionNoModule:
         if (IsSectionOffset())
         {
-            AddressType addr_type = eAddressTypeLoad;
-            addr_t addr = GetLoadAddress (target);
-            if (addr == LLDB_INVALID_ADDRESS)
-            {
-                addr = GetFileAddress();
-                addr_type = eAddressTypeFile;
-            }
-
             uint32_t pointer_size = 4;
             ModuleSP module_sp (GetModule());
             if (target)
@@ -728,6 +721,37 @@
             return false;
         }
         break;
+    case DumpStyleResolvedPointerDescription:
+        {
+            Process *process = exe_ctx.GetProcessPtr();
+            if (process)
+            {
+                addr_t load_addr = GetLoadAddress (target);
+                if (load_addr != LLDB_INVALID_ADDRESS)
+                {
+                    Error memory_error;
+                    addr_t dereferenced_load_addr = process->ReadPointerFromMemory(load_addr, memory_error);
+                    if (dereferenced_load_addr != LLDB_INVALID_ADDRESS)
+                    {
+                        Address dereferenced_addr;
+                        if (dereferenced_addr.SetLoadAddress(dereferenced_load_addr, target))
+                        {
+                            StreamString strm;
+                            if (dereferenced_addr.Dump (&strm, exe_scope, DumpStyleResolvedDescription, DumpStyleInvalid, addr_size))
+                            {
+                                s->Address (dereferenced_load_addr, addr_size, " -> ", " ");
+                                s->Write(strm.GetData(), strm.GetSize());
+                                return true;
+                            }
+                        }
+                    }
+                }
+            }
+            if (fallback_style != DumpStyleInvalid)
+                return Dump (s, exe_scope, fallback_style, DumpStyleInvalid, addr_size);
+            return false;
+        }
+        break;
     }
 
     return true;

Modified: lldb/branches/lldb-platform-work/source/Core/ConnectionFileDescriptor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Core/ConnectionFileDescriptor.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Core/ConnectionFileDescriptor.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Core/ConnectionFileDescriptor.cpp Mon Jul 23 19:12:48 2012
@@ -21,6 +21,7 @@
 #include <sys/types.h>
 #include <string.h>
 #include <stdlib.h>
+#include <unistd.h>
 
 // C++ Includes
 // Other libraries and framework includes
@@ -74,7 +75,10 @@
     m_udp_send_sockaddr (),
     m_should_close_fd (false), 
     m_socket_timeout_usec(0),
-    m_mutex (Mutex::eMutexTypeRecursive)
+    m_command_fd_send(-1),
+    m_command_fd_receive(-1),
+    m_mutex (Mutex::eMutexTypeRecursive),
+    m_shutting_down (false)
 {
     LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_CONNECTION |  LIBLLDB_LOG_OBJECT));
     if (log)
@@ -90,7 +94,10 @@
     m_udp_send_sockaddr (),
     m_should_close_fd (owns_fd),
     m_socket_timeout_usec(0),
-    m_mutex (Mutex::eMutexTypeRecursive)
+    m_command_fd_send(-1),
+    m_command_fd_receive(-1),
+    m_mutex (Mutex::eMutexTypeRecursive),
+    m_shutting_down (false)
 {
     LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_CONNECTION |  LIBLLDB_LOG_OBJECT));
     if (log)
@@ -104,6 +111,46 @@
     if (log)
         log->Printf ("%p ConnectionFileDescriptor::~ConnectionFileDescriptor ()", this);
     Disconnect (NULL);
+    CloseCommandFileDescriptor ();
+}
+
+void
+ConnectionFileDescriptor::InitializeCommandFileDescriptor ()
+{
+    CloseCommandFileDescriptor();
+    
+    LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_CONNECTION |  LIBLLDB_LOG_OBJECT));
+    // Make the command file descriptor here:
+    int filedes[2];
+    int result = pipe (filedes);
+    if (result != 0)
+    {
+        if (log)
+            log->Printf ("%p ConnectionFileDescriptor::ConnectionFileDescriptor () - could not make pipe: %s",
+                         this,
+                         strerror(errno));
+    }
+    else
+    {
+        m_command_fd_receive = filedes[0];
+        m_command_fd_send    = filedes[1];
+    }
+}
+
+void
+ConnectionFileDescriptor::CloseCommandFileDescriptor ()
+{
+    if (m_command_fd_receive != -1)
+    {
+        close (m_command_fd_receive);
+        m_command_fd_receive = -1;
+    }
+    
+    if (m_command_fd_send != -1)
+    {
+        close (m_command_fd_send);
+        m_command_fd_send = -1;
+    }
 }
 
 bool
@@ -120,6 +167,8 @@
     if (log)
         log->Printf ("%p ConnectionFileDescriptor::Connect (url = '%s')", this, s);
 
+    InitializeCommandFileDescriptor();
+    
     if (s && s[0])
     {
         char *end = NULL;
@@ -157,7 +206,7 @@
             if (success)
             {
                 // We have what looks to be a valid file descriptor, but we 
-                // should make it is. We currently are doing this by trying to
+                // should make sure it is. We currently are doing this by trying to
                 // get the flags from the file descriptor and making sure it 
                 // isn't a bad fd.
                 errno = 0;
@@ -235,22 +284,44 @@
 ConnectionStatus
 ConnectionFileDescriptor::Disconnect (Error *error_ptr)
 {
-    Mutex::Locker locker (m_mutex);
     LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_CONNECTION));
     if (log)
         log->Printf ("%p ConnectionFileDescriptor::Disconnect ()", this);
-    if (m_should_close_fd == false)
+
+    ConnectionStatus status = eConnectionStatusSuccess;
+
+    if (m_fd_send < 0 && m_fd_recv < 0)
     {
-        m_fd_send = m_fd_recv = -1;
+        if (log)
+            log->Printf ("%p ConnectionFileDescriptor::Disconnect(): Nothing to disconnect", this);
         return eConnectionStatusSuccess;
     }
-    ConnectionStatus status = eConnectionStatusSuccess;
-    if (m_fd_send >= 0 || m_fd_recv >= 0)
+    
+    // Try to get the ConnectionFileDescriptor's mutex.  If we fail, that is quite likely
+    // because somebody is doing a blocking read on our file descriptor.  If that's the case,
+    // then send the "q" char to the command file channel so the read will wake up and the connection
+    // will then know to shut down.
+    
+    m_shutting_down = true;
+    
+    Mutex::Locker locker;
+    bool got_lock= locker.TryLock (m_mutex);
+    
+    if (!got_lock)
+    {
+        if (m_command_fd_send != -1 )
+        {
+            write (m_command_fd_send, "q", 1);
+            close (m_command_fd_send);
+            m_command_fd_send = -1;
+        }
+        locker.Lock (m_mutex);
+    }
+    
+    if (m_should_close_fd == true)
     {
         if (m_fd_send == m_fd_recv)
         {
-            // Both file descriptors are the same, only close one
-            m_fd_recv = -1;
             status = Close (m_fd_send, error_ptr);
         }
         else
@@ -266,7 +337,19 @@
             }
         }
     }
-    return status;
+
+    // Now set all our descriptors to invalid values.
+    
+    m_fd_send = m_fd_recv = -1;
+
+    if (status != eConnectionStatusSuccess)
+    {
+        
+        return status;
+    }
+        
+    m_shutting_down = false;
+    return eConnectionStatusSuccess;
 }
 
 size_t
@@ -281,44 +364,31 @@
         log->Printf ("%p ConnectionFileDescriptor::Read () ::read (fd = %i, dst = %p, dst_len = %zu)...",
                      this, m_fd_recv, dst, dst_len);
 
+    Mutex::Locker locker;
+    bool got_lock = locker.TryLock (m_mutex);
+    if (!got_lock)
+    {
+        if (log)
+            log->Printf ("%p ConnectionFileDescriptor::Read () failed to get the connection lock.",
+                     this);
+        if (error_ptr)
+            error_ptr->SetErrorString ("failed to get the connection lock for read.");
+            
+        status = eConnectionStatusTimedOut;
+        return 0;
+    }
+    else if (m_shutting_down)
+        return eConnectionStatusError;
+    
     ssize_t bytes_read = 0;
 
-    switch (m_fd_recv_type)
+    status = BytesAvailable (timeout_usec, error_ptr);
+    if (status == eConnectionStatusSuccess)
     {
-    case eFDTypeFile:       // Other FD requireing read/write
-        status = BytesAvailable (timeout_usec, error_ptr);
-        if (status == eConnectionStatusSuccess)
-        {
-            do
-            {
-                bytes_read = ::read (m_fd_recv, dst, dst_len);
-            } while (bytes_read < 0 && errno == EINTR);
-        }
-        break;
-
-    case eFDTypeSocket:     // Socket requiring send/recv
-        if (SetSocketReceiveTimeout (timeout_usec))
+        do
         {
-            status = eConnectionStatusSuccess;
-            do
-            {
-                bytes_read = ::recv (m_fd_recv, dst, dst_len, 0);
-            } while (bytes_read < 0 && errno == EINTR);
-        }
-        break;
-
-    case eFDTypeSocketUDP:  // Unconnected UDP socket requiring sendto/recvfrom
-        if (SetSocketReceiveTimeout (timeout_usec))
-        {
-            status = eConnectionStatusSuccess;
-            SocketAddress from (m_udp_send_sockaddr);
-            socklen_t from_len = m_udp_send_sockaddr.GetLength();
-            do
-            {
-                bytes_read = ::recvfrom (m_fd_recv, dst, dst_len, 0, (struct sockaddr *)&from, &from_len);
-            } while (bytes_read < 0 && errno == EINTR);
-        }
-        break;
+            bytes_read = ::read (m_fd_recv, dst, dst_len);
+        } while (bytes_read < 0 && errno == EINTR);
     }
 
     if (status != eConnectionStatusSuccess)
@@ -512,7 +582,6 @@
             break;  // Break to close....
         }
 
-        //Disconnect (NULL);
         return 0;
     }
 
@@ -523,6 +592,9 @@
 ConnectionStatus
 ConnectionFileDescriptor::BytesAvailable (uint32_t timeout_usec, Error *error_ptr)
 {
+    // Don't need to take the mutex here separately since we are only called from Read.  If we
+    // ever get used more generally we will need to lock here as well.
+    
     LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_CONNECTION));
     if (log)
         log->Printf("%p ConnectionFileDescriptor::BytesAvailable (timeout_usec = %u)", this, timeout_usec);
@@ -546,7 +618,9 @@
         fd_set read_fds;
         FD_ZERO (&read_fds);
         FD_SET (m_fd_recv, &read_fds);
-        int nfds = m_fd_recv + 1;
+        if (m_command_fd_receive != -1)
+            FD_SET (m_command_fd_receive, &read_fds);
+        int nfds = (m_fd_recv > m_command_fd_receive ? m_fd_recv : m_command_fd_receive) + 1;
         
         Error error;
 
@@ -594,7 +668,26 @@
         }
         else if (num_set_fds > 0)
         {
-            return eConnectionStatusSuccess;
+            if (m_command_fd_receive != -1 && FD_ISSET(m_command_fd_receive, &read_fds))
+            {
+                // We got a command to exit.  Read the data from that pipe:
+                char buffer[16];
+                ssize_t bytes_read;
+                
+                do
+                {
+                    bytes_read = ::read (m_command_fd_receive, buffer, sizeof(buffer));
+                } while (bytes_read < 0 && errno == EINTR);
+                assert (bytes_read == 1 && buffer[0] == 'q');
+                
+                if (log)
+                    log->Printf("%p ConnectionFileDescriptor::BytesAvailable() got data: %*s from the command channel.",
+                                this, (int) bytes_read, buffer);
+
+                return eConnectionStatusEndOfFile;
+            }
+            else
+                return eConnectionStatusSuccess;
         }
     }
 

Modified: lldb/branches/lldb-platform-work/source/Core/DataExtractor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Core/DataExtractor.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Core/DataExtractor.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Core/DataExtractor.cpp Mon Jul 23 19:12:48 2012
@@ -1737,14 +1737,21 @@
                 {
                     TargetSP target_sp (exe_scope->CalculateTarget());
                     lldb_private::Address so_addr;
-                    if (target_sp && target_sp->GetSectionLoadList().ResolveLoadAddress(addr, so_addr))
+                    if (target_sp)
                     {
-                        s->PutChar(' ');
-                        so_addr.Dump (s, 
-                                      exe_scope, 
-                                      Address::DumpStyleResolvedDescription, 
-                                      Address::DumpStyleModuleWithFileAddress);
-                        break;
+                        if (target_sp->GetSectionLoadList().ResolveLoadAddress(addr, so_addr))
+                        {
+                            s->PutChar(' ');
+                            so_addr.Dump (s,
+                                          exe_scope,
+                                          Address::DumpStyleResolvedDescription,
+                                          Address::DumpStyleModuleWithFileAddress);
+                        }
+                        else
+                        {
+                            so_addr.SetOffset(addr);
+                            so_addr.Dump (s, exe_scope, Address::DumpStyleResolvedPointerDescription);
+                        }
                     }
                 }
             }

Modified: lldb/branches/lldb-platform-work/source/Core/Debugger.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Core/Debugger.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Core/Debugger.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Core/Debugger.cpp Mon Jul 23 19:12:48 2012
@@ -987,48 +987,6 @@
     return true;
 }
 
-
-static ValueObjectSP
-ExpandExpressionPath (ValueObject* valobj,
-                      StackFrame* frame,
-                      bool* do_deref_pointer,
-                      const char* var_name_begin,
-                      const char* var_name_final,
-                      Error& error)
-{
-    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES));
-    StreamString sstring;
-    VariableSP var_sp;
-    
-    if (*do_deref_pointer)
-    {
-        if (log)
-            log->Printf("been told to deref_pointer by caller");
-        sstring.PutChar('*');
-    }
-    else if (valobj->IsDereferenceOfParent() && ClangASTContext::IsPointerType(valobj->GetParent()->GetClangType()) && !valobj->IsArrayItemForPointer())
-    {
-        if (log)
-            log->Printf("decided to deref_pointer myself");
-        sstring.PutChar('*');
-        *do_deref_pointer = true;
-    }
-
-    valobj->GetExpressionPath(sstring, true, ValueObject::eGetExpressionPathFormatHonorPointers);
-    if (log)
-        log->Printf("expression path to expand in phase 0: %s",sstring.GetData());
-    sstring.PutRawBytes(var_name_begin+3, var_name_final-var_name_begin-3);
-    if (log)
-        log->Printf("expression path to expand in phase 1: %s",sstring.GetData());
-    std::string name = std::string(sstring.GetData());
-    ValueObjectSP target = frame->GetValueForVariableExpressionPath (name.c_str(),
-                                                                     eNoDynamicValues, 
-                                                                     0,
-                                                                     var_sp,
-                                                                     error);
-    return target;
-}
-
 static ValueObjectSP
 ExpandIndexedExpression (ValueObject* valobj,
                          uint32_t index,
@@ -1378,10 +1336,10 @@
                                         }
                                         else if (is_pointer) // if pointer, value is the address stored
                                         {
-                                            var_success = target->DumpPrintableRepresentation(s,
-                                                                                             val_obj_display,
-                                                                                             custom_format,
-                                                                                             ValueObject::ePrintableRepresentationSpecialCasesDisable);
+                                            target->DumpPrintableRepresentation (s,
+                                                                                 val_obj_display,
+                                                                                 custom_format,
+                                                                                 ValueObject::ePrintableRepresentationSpecialCasesDisable);
                                         }
                                         else
                                         {
@@ -2630,7 +2588,7 @@
         if (new_value != UINT32_MAX)
             m_stop_source_before_count = new_value;
         else
-            err.SetErrorStringWithFormat("invalid unsigned string value '%s' for the '%s' setting", value, StopSourceContextAfterName ().GetCString());
+            err.SetErrorStringWithFormat("invalid unsigned string value '%s' for the '%s' setting", value, StopSourceContextBeforeName ().GetCString());
     }
     else if (var_name == StopSourceContextAfterName ())
     {
@@ -2638,7 +2596,7 @@
         if (new_value != UINT32_MAX)
             m_stop_source_after_count = new_value;
         else
-            err.SetErrorStringWithFormat("invalid unsigned string value '%s' for the '%s' setting", value, StopSourceContextBeforeName ().GetCString());
+            err.SetErrorStringWithFormat("invalid unsigned string value '%s' for the '%s' setting", value, StopSourceContextAfterName ().GetCString());
     }
     else if (var_name == StopDisassemblyCountName ())
     {
@@ -2703,13 +2661,13 @@
     else if (var_name == StopSourceContextAfterName ())
     {
         StreamString strm;
-        strm.Printf ("%u", m_stop_source_before_count);
+        strm.Printf ("%u", m_stop_source_after_count);
         value.AppendString (strm.GetData());
     }
     else if (var_name == StopSourceContextBeforeName ())
     {
         StreamString strm;
-        strm.Printf ("%u", m_stop_source_after_count);
+        strm.Printf ("%u", m_stop_source_before_count);
         value.AppendString (strm.GetData());
     }
     else if (var_name == StopDisassemblyCountName ())

Modified: lldb/branches/lldb-platform-work/source/Core/FormatManager.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Core/FormatManager.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Core/FormatManager.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Core/FormatManager.cpp Mon Jul 23 19:12:48 2012
@@ -834,6 +834,17 @@
     sys_category_sp->GetSummaryNavigator()->Add(ConstString("char *"), string_format);
     sys_category_sp->GetSummaryNavigator()->Add(ConstString("const char *"), string_format);
     sys_category_sp->GetRegexSummaryNavigator()->Add(any_size_char_arr, string_array_format);
+    
+    lldb::TypeSummaryImplSP ostype_summary(new StringSummaryFormat(TypeSummaryImpl::Flags().SetCascades(false)
+                                                                   .SetSkipPointers(true)
+                                                                   .SetSkipReferences(true)
+                                                                   .SetDontShowChildren(true)
+                                                                   .SetDontShowValue(false)
+                                                                   .SetShowMembersOneLiner(false)
+                                                                   .SetHideItemNames(false),
+                                                                   "${var%O}"));
+    
+    sys_category_sp->GetSummaryNavigator()->Add(ConstString("OSType"), ostype_summary);
 }
 
 static void
@@ -873,8 +884,8 @@
 {
     TypeSummaryImpl::Flags objc_flags;
     objc_flags.SetCascades(false)
-    .SetSkipPointers(false)
-    .SetSkipReferences(false)
+    .SetSkipPointers(true)
+    .SetSkipReferences(true)
     .SetDontShowChildren(true)
     .SetDontShowValue(true)
     .SetShowMembersOneLiner(false)
@@ -886,6 +897,18 @@
     TypeCategoryImpl::SharedPointer objc_category_sp = GetCategory(m_objc_category_name);
     objc_category_sp->GetSummaryNavigator()->Add(ConstString("BOOL"),
                                                  ObjC_BOOL_summary);
+
+    lldb::TypeSummaryImplSP ObjC_BOOLRef_summary(new ScriptSummaryFormat(objc_flags,
+                                                                      "lldb.formatters.objc.objc.BOOLRef_SummaryProvider",
+                                                                      ""));
+    objc_category_sp->GetSummaryNavigator()->Add(ConstString("BOOL &"),
+                                                 ObjC_BOOLRef_summary);
+    lldb::TypeSummaryImplSP ObjC_BOOLPtr_summary(new ScriptSummaryFormat(objc_flags,
+                                                                      "lldb.formatters.objc.objc.BOOLPtr_SummaryProvider",
+                                                                      ""));
+    objc_category_sp->GetSummaryNavigator()->Add(ConstString("BOOL *"),
+                                                 ObjC_BOOLPtr_summary);
+
     
     // we need to skip pointers here since we are special casing a SEL* when retrieving its value
     objc_flags.SetSkipPointers(true);

Modified: lldb/branches/lldb-platform-work/source/Core/InputReader.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Core/InputReader.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Core/InputReader.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Core/InputReader.cpp Mon Jul 23 19:12:48 2012
@@ -151,7 +151,7 @@
             {
                 if (end_token && end_token == p)
                 {
-                    p += m_end_token.size();
+                    m_end_token.size();
                     SetIsDone(true);
                     break;
                 }

Modified: lldb/branches/lldb-platform-work/source/Core/Listener.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Core/Listener.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Core/Listener.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Core/Listener.cpp Mon Jul 23 19:12:48 2012
@@ -304,7 +304,11 @@
         // it so it should be okay to get the next event off the queue here - and it might
         // be useful to do that in the "DoOnRemoval".
         lock.Unlock();
-        event_sp->DoOnRemoval();
+        
+        // Don't call DoOnRemoval if you aren't removing the event...
+        if (remove)
+            event_sp->DoOnRemoval();
+            
         return true;
     }
 

Modified: lldb/branches/lldb-platform-work/source/Core/Mangled.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Core/Mangled.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Core/Mangled.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Core/Mangled.cpp Mon Jul 23 19:12:48 2012
@@ -21,6 +21,14 @@
 
 using namespace lldb_private;
 
+static inline bool
+cstring_is_mangled (const char *s)
+{
+    if (s)
+        return s[0] == '_' && s[1] == 'Z';
+    return false;
+}
+
 #pragma mark Mangled
 //----------------------------------------------------------------------
 // Default constructor
@@ -35,14 +43,20 @@
 // Constructor with an optional string and a boolean indicating if it is
 // the mangled version.
 //----------------------------------------------------------------------
-Mangled::Mangled (const char *s, bool mangled) :
+Mangled::Mangled (const ConstString &s, bool mangled) :
     m_mangled(),
     m_demangled()
 {
-    if (s && s[0])
-    {
+    if (s)
         SetValue(s, mangled);
-    }
+}
+
+Mangled::Mangled (const ConstString &s) :
+    m_mangled(),
+    m_demangled()
+{
+    if (s)
+        SetValue(s);
 }
 
 //----------------------------------------------------------------------
@@ -107,28 +121,52 @@
 // demangled name is set.
 //----------------------------------------------------------------------
 void
-Mangled::SetValue (const char *s, bool mangled)
+Mangled::SetValue (const ConstString &s, bool mangled)
 {
     if (s)
     {
         if (mangled)
         {
-            m_demangled.Clear();        
-            m_mangled.SetCString (s);
+            m_demangled.Clear();
+            m_mangled = s;
+        }
+        else
+        {
+            m_demangled = s;
+            m_mangled.Clear();
+        }
+    }
+    else
+    {
+        m_demangled.Clear();
+        m_mangled.Clear();
+    }
+}
+
+void
+Mangled::SetValue (const ConstString &name)
+{
+    if (name)
+    {
+        if (cstring_is_mangled(name.GetCString()))
+        {
+            m_demangled.Clear();
+            m_mangled = name;
         }
         else
         {
-            m_demangled.SetCString(s);
+            m_demangled = name;
             m_mangled.Clear();
         }
     }
     else
     {
-        m_demangled.Clear();        
+        m_demangled.Clear();
         m_mangled.Clear();
     }
 }
 
+
 //----------------------------------------------------------------------
 // Generate the demangled name on demand using this accessor. Code in
 // this class will need to use this accessor if it wishes to decode
@@ -148,17 +186,15 @@
                             "Mangled::GetDemangledName (m_mangled = %s)",
                             m_mangled.GetCString());
 
-        // We already know mangled is valid from the above check,
-        // lets just make sure it isn't empty...
-        const char * mangled = m_mangled.AsCString();
-        // Don't bother running anything that doesn't start with _Z through the demangler
-        if (mangled[0] == '_' && mangled[1] == 'Z')
+        // Don't bother running anything that isn't mangled
+        const char *mangled_cstr = m_mangled.GetCString();
+        if (cstring_is_mangled(mangled_cstr))
         {
             if (!m_mangled.GetMangledCounterpart(m_demangled))
             {
                 // We didn't already mangle this name, demangle it and if all goes well
                 // add it to our map.
-                char *demangled_name = abi::__cxa_demangle (mangled, NULL, NULL, NULL);
+                char *demangled_name = abi::__cxa_demangle (mangled_cstr, NULL, NULL, NULL);
 
                 if (demangled_name)
                 {
@@ -213,22 +249,6 @@
 }
 
 //----------------------------------------------------------------------
-// Generate the tokens from the demangled name.
-//
-// Returns the number of tokens that were parsed.
-//----------------------------------------------------------------------
-size_t
-Mangled::GetTokens (Mangled::TokenList &tokens) const
-{
-    tokens.Clear();
-    const ConstString& demangled = GetDemangledName();
-    if (demangled && !demangled.IsEmpty())
-        tokens.Parse(demangled.AsCString());
-
-    return tokens.Size();
-}
-
-//----------------------------------------------------------------------
 // Dump a Mangled object to stream "s". We don't force our
 // demangled name to be computed currently (we don't use the accessor).
 //----------------------------------------------------------------------
@@ -286,459 +306,3 @@
         s << ", demangled = <error>";
     return s;
 }
-
-
-
-
-#pragma mark Mangled::Token
-
-//--------------------------------------------------------------
-// Default constructor
-//--------------------------------------------------------------
-Mangled::Token::Token () :
-    type(eInvalid),
-    value()
-{
-}
-
-//--------------------------------------------------------------
-// Equal to operator
-//--------------------------------------------------------------
-bool
-Mangled::Token::operator== (const Token& rhs) const
-{
-    return type == rhs.type && value == rhs.value;
-}
-
-//--------------------------------------------------------------
-// Dump the token to a stream "s"
-//--------------------------------------------------------------
-void
-Mangled::Token::Dump (Stream *s) const
-{
-    switch (type)
-    {
-    case eInvalid:      s->PutCString("invalid    "); break;
-    case eNameSpace:    s->PutCString("namespace  "); break;
-    case eMethodName:   s->PutCString("method     "); break;
-    case eType:         s->PutCString("type       "); break;
-    case eTemplate:     s->PutCString("template   "); break;
-    case eTemplateBeg:  s->PutCString("template < "); break;
-    case eTemplateEnd:  s->PutCString("template > "); break;
-    case eParamsBeg:    s->PutCString("params   ( "); break;
-    case eParamsEnd:    s->PutCString("params   ) "); break;
-    case eQualifier:    s->PutCString("qualifier  "); break;
-    case eError:        s->PutCString("ERROR      "); break;
-    default:
-        s->Printf("type = %i", type);
-        break;
-    }
-    value.DumpDebug(s);
-}
-
-//--------------------------------------------------------------
-// Returns true if this token is a wildcard
-//--------------------------------------------------------------
-bool
-Mangled::Token::IsWildcard () const
-{
-    static ConstString g_wildcard_str("*");
-    return value == g_wildcard_str;
-}
-
-
-//----------------------------------------------------------------------
-// Dump "obj" to the supplied stream "s"
-//----------------------------------------------------------------------
-Stream&
-lldb_private::operator << (Stream& s, const Mangled::Token& obj)
-{
-    obj.Dump(&s);
-    return s;
-}
-
-
-#pragma mark Mangled::TokenList
-//----------------------------------------------------------------------
-// Mangled::TokenList
-//----------------------------------------------------------------------
-
-//--------------------------------------------------------------
-// Default constructor. If demangled is non-NULL and not-empty
-// the token list will parse up the demangled string it is
-// given, else the object will initialize an empty token list.
-//--------------------------------------------------------------
-Mangled::TokenList::TokenList (const char *demangled) :
-    m_tokens()
-{
-    if (demangled && demangled[0])
-    {
-        Parse(demangled);
-    }
-}
-
-//----------------------------------------------------------------------
-// Destructor
-//----------------------------------------------------------------------
-Mangled::TokenList::~TokenList ()
-{
-}
-
-//----------------------------------------------------------------------
-// Parses "demangled" into tokens. This allows complex
-// comparisons to be done. Comparisons can include wildcards at
-// the namespace, method name, template, and template and
-// parameter type levels.
-//
-// Example queries include:
-// "std::basic_string<*>"   // Find all std::basic_string variants
-// "std::basic_string<*>::erase(*)" // Find all std::basic_string::erase variants with any number of parameters
-// "*::clear()"             // Find all functions with a method name of
-//                          // "clear" that are in any namespace that
-//                          // have no parameters
-// "::printf"               // Find the printf function in the global namespace
-// "printf"                 // Ditto
-// "foo::*(int)"            // Find all functions in the class or namespace "foo" that take a single integer argument
-//
-// Returns the number of tokens that were decoded, or zero when
-// we fail.
-//----------------------------------------------------------------------
-size_t
-Mangled::TokenList::Parse (const char *s)
-{
-    m_tokens.clear();
-
-    Token token;
-    token.type = eNameSpace;
-
-    TokenType max_type = eInvalid;
-    const char *p = s;
-    size_t span = 0;
-    size_t sep_size = 0;
-
-    while (*p != '\0')
-    {
-        p = p + span + sep_size;
-        while (isspace(*p))
-            ++p;
-
-        if (*p == '\0')
-            break;
-
-        span = strcspn(p, ":<>(),");
-        sep_size = 1;
-        token.type = eInvalid;
-        switch (p[span])
-        {
-        case '\0':
-            break;
-
-        case ':':
-            if (p[span+1] == ':')
-            {
-                sep_size = 2;
-                if (span > 0)
-                {
-                    token.type = eNameSpace;
-                    token.value.SetCStringWithLength (p, span);
-                    m_tokens.push_back(token);
-                }
-                else
-                    continue;
-            }
-            break;
-
-        case '(':
-            if (span > 0)
-            {
-                token.type = eMethodName;
-                token.value.SetCStringWithLength (p, span);
-                m_tokens.push_back(token);
-            }
-
-            token.type = eParamsBeg;
-            token.value.Clear();
-            m_tokens.push_back(token);
-            break;
-
-        case ',':
-            if (span > 0)
-            {
-                token.type = eType;
-                token.value.SetCStringWithLength (p, span);
-                m_tokens.push_back(token);
-            }
-            else
-            {
-                continue;
-            }
-            break;
-
-        case ')':
-            if (span > 0)
-            {
-                token.type = eType;
-                token.value.SetCStringWithLength (p, span);
-                m_tokens.push_back(token);
-            }
-
-            token.type = eParamsEnd;
-            token.value.Clear();
-            m_tokens.push_back(token);
-            break;
-
-        case '<':
-            if (span > 0)
-            {
-                token.type = eTemplate;
-                token.value.SetCStringWithLength (p, span);
-                m_tokens.push_back(token);
-            }
-
-            token.type = eTemplateBeg;
-            token.value.Clear();
-            m_tokens.push_back(token);
-            break;
-
-        case '>':
-            if (span > 0)
-            {
-                token.type = eType;
-                token.value.SetCStringWithLength (p, span);
-                m_tokens.push_back(token);
-            }
-
-            token.type = eTemplateEnd;
-            token.value.Clear();
-            m_tokens.push_back(token);
-            break;
-        }
-
-        if (max_type < token.type)
-            max_type = token.type;
-
-        if (token.type == eInvalid)
-        {
-            if (max_type >= eParamsEnd)
-            {
-                token.type = eQualifier;
-                token.value.SetCString(p);
-                m_tokens.push_back(token);
-            }
-            else if (max_type >= eParamsBeg)
-            {
-                token.type = eType;
-                token.value.SetCString(p);
-                m_tokens.push_back(token);
-            }
-            else
-            {
-                token.type = eMethodName;
-                token.value.SetCString(p);
-                m_tokens.push_back(token);
-            }
-            break;
-        }
-    }
-    return m_tokens.size();
-}
-
-
-//----------------------------------------------------------------------
-// Clear the token list.
-//----------------------------------------------------------------------
-void
-Mangled::TokenList::Clear ()
-{
-    m_tokens.clear();
-}
-
-//----------------------------------------------------------------------
-// Dump the token list to the stream "s"
-//----------------------------------------------------------------------
-void
-Mangled::TokenList::Dump (Stream *s) const
-{
-    collection::const_iterator pos;
-    collection::const_iterator beg = m_tokens.begin();
-    collection::const_iterator end = m_tokens.end();
-    for (pos = beg; pos != end; ++pos)
-    {
-        s->Indent("token[");
-        *s << (uint32_t)std::distance(beg, pos) << "] = " << *pos << "\n";
-    }
-}
-
-//----------------------------------------------------------------------
-// Find the first token in the list that has "token_type" as its
-// type
-//----------------------------------------------------------------------
-const Mangled::Token *
-Mangled::TokenList::Find (TokenType token_type) const
-{
-    collection::const_iterator pos;
-    collection::const_iterator beg = m_tokens.begin();
-    collection::const_iterator end = m_tokens.end();
-    for (pos = beg; pos != end; ++pos)
-    {
-        if (pos->type == token_type)
-            return &(*pos);
-    }
-    return NULL;
-}
-
-//----------------------------------------------------------------------
-// Return the token at index "idx", or NULL if the index is
-// out of range.
-//----------------------------------------------------------------------
-const Mangled::Token *
-Mangled::TokenList::GetTokenAtIndex (uint32_t idx) const
-{
-    if (idx < m_tokens.size())
-        return &m_tokens[idx];
-    return NULL;
-}
-
-
-//----------------------------------------------------------------------
-// Given a token list, see if it matches this object's tokens.
-// "token_list" can contain wild card values to enable powerful
-// matching. Matching the std::string::erase(*) example that was
-// tokenized above we could use a token list such as:
-//
-//      token           name
-//      -----------     ----------------------------------------
-//      eNameSpace      "std"
-//      eTemplate       "basic_string"
-//      eTemplateBeg
-//      eInvalid        "*"
-//      eTemplateEnd
-//      eMethodName     "erase"
-//      eParamsBeg
-//      eInvalid        "*"
-//      eParamsEnd
-//
-// Returns true if it "token_list" matches this object's tokens,
-// false otherwise.
-//----------------------------------------------------------------------
-bool
-Mangled::TokenList::MatchesQuery (const Mangled::TokenList &match) const
-{
-    size_t match_count = 0;
-    collection::const_iterator pos;
-    collection::const_iterator pos_end = m_tokens.end();
-
-    collection::const_iterator match_pos;
-    collection::const_iterator match_pos_end = match.m_tokens.end();
-    collection::const_iterator match_wildcard_pos = match_pos_end;
-    collection::const_iterator match_next_pos = match_pos_end;
-
-    size_t template_scope_depth = 0;
-
-    for (pos = m_tokens.begin(), match_pos = match.m_tokens.begin();
-         pos != pos_end && match_pos != match_pos_end;
-         ++match_pos)
-    {
-        match_next_pos = match_pos + 1;
-        // Is this a wildcard?
-        if (match_pos->IsWildcard())
-        {
-            if (match_wildcard_pos != match_pos_end)
-                return false;   // Can't have two wildcards in effect at once.
-
-            match_wildcard_pos = match_pos;
-            // Are we at the end of the MATCH token list?
-            if (match_next_pos == match_pos_end)
-            {
-                // There is nothing more to match, return if we have any matches so far...
-                return match_count > 0;
-            }
-        }
-
-        if (match_pos->type == eInvalid || match_pos->type == eError)
-        {
-            return false;
-        }
-        else
-        {
-            if (match_pos->type == eTemplateBeg)
-            {
-                ++template_scope_depth;
-            }
-            else if (match_pos->type == eTemplateEnd)
-            {
-                assert(template_scope_depth > 0);
-                --template_scope_depth;
-            }
-
-            // Do we have a wildcard going right now?
-            if (match_wildcard_pos == match_pos_end)
-            {
-                // No wildcard matching right now, just check and see if things match
-                if (*pos == *match_pos)
-                    ++match_count;
-                else
-                    return false;
-            }
-            else
-            {
-                // We have a wildcard match going
-
-                // For template types we need to make sure to match the template depths...
-                const size_t start_wildcard_template_scope_depth = template_scope_depth;
-                size_t curr_wildcard_template_scope_depth = template_scope_depth;
-                while (pos != pos_end)
-                {
-                    if (match_wildcard_pos->type == eNameSpace && pos->type == eParamsBeg)
-                        return false;
-
-                    if (start_wildcard_template_scope_depth == curr_wildcard_template_scope_depth)
-                    {
-                        if (*pos == *match_next_pos)
-                        {
-                            ++match_count;
-                            match_pos = match_next_pos;
-                            match_wildcard_pos = match_pos_end;
-                            break;
-                        }
-                    }
-                    if (pos->type == eTemplateBeg)
-                        ++curr_wildcard_template_scope_depth;
-                    else if (pos->type == eTemplateEnd)
-                        --curr_wildcard_template_scope_depth;
-
-
-                    ++pos;
-                }
-            }
-        }
-
-        if (pos != pos_end)
-            ++pos;
-    }
-    if (match_pos != match_pos_end)
-        return false;
-
-    return match_count > 0;
-}
-
-
-//----------------------------------------------------------------------
-// Return the number of tokens in the token collection
-//----------------------------------------------------------------------
-size_t
-Mangled::TokenList::Size () const
-{
-    return m_tokens.size();
-}
-
-
-//----------------------------------------------------------------------
-// Stream out the tokens
-//----------------------------------------------------------------------
-Stream&
-lldb_private::operator << (Stream& s, const Mangled::TokenList& obj)
-{
-    obj.Dump(&s);
-    return s;
-}

Modified: lldb/branches/lldb-platform-work/source/Core/Module.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Core/Module.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Core/Module.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Core/Module.cpp Mon Jul 23 19:12:48 2012
@@ -134,7 +134,8 @@
     m_did_parse_uuid (false),
     m_did_init_ast (false),
     m_is_dynamic_loader_module (false),
-    m_was_modified (false)
+    m_file_has_changed (false),
+    m_first_file_changed_log (false)
 {
     // Scope for locker below...
     {
@@ -176,7 +177,8 @@
     m_did_parse_uuid (false),
     m_did_init_ast (false),
     m_is_dynamic_loader_module (false),
-    m_was_modified (false)
+    m_file_has_changed (false),
+    m_first_file_changed_log (false)
 {
     // Scope for locker below...
     {
@@ -693,10 +695,6 @@
             types.RemoveMismatchedTypes (type_scope, type_basename, exact_match);
             num_matches = types.GetSize();
         }
-        else
-        {
-            types.Clear();
-        }
     }
     else
     {
@@ -807,32 +805,44 @@
     }
 }
 
+bool
+Module::FileHasChanged () const
+{
+    if (m_file_has_changed == false)
+        m_file_has_changed = (m_file.GetModificationTime() != m_mod_time);
+    return m_file_has_changed;
+}
+
 void
 Module::ReportErrorIfModifyDetected (const char *format, ...)
 {
-    if (!GetModified(true) && GetModified(false))
+    if (m_first_file_changed_log == false)
     {
-        if (format)
+        if (FileHasChanged ())
         {
-            StreamString strm;
-            strm.PutCString("error: the object file ");
-            GetDescription(&strm, lldb::eDescriptionLevelFull);
-            strm.PutCString (" has been modified\n");
-            
-            va_list args;
-            va_start (args, format);
-            strm.PrintfVarArg(format, args);
-            va_end (args);
-            
-            const int format_len = strlen(format);
-            if (format_len > 0)
+            m_first_file_changed_log = true;
+            if (format)
             {
-                const char last_char = format[format_len-1];
-                if (last_char != '\n' || last_char != '\r')
-                    strm.EOL();
+                StreamString strm;
+                strm.PutCString("error: the object file ");
+                GetDescription(&strm, lldb::eDescriptionLevelFull);
+                strm.PutCString (" has been modified\n");
+                
+                va_list args;
+                va_start (args, format);
+                strm.PrintfVarArg(format, args);
+                va_end (args);
+                
+                const int format_len = strlen(format);
+                if (format_len > 0)
+                {
+                    const char last_char = format[format_len-1];
+                    if (last_char != '\n' || last_char != '\r')
+                        strm.EOL();
+                }
+                strm.PutCString("The debug session should be aborted as the original debug information has been overwritten.\n");
+                Host::SystemLog (Host::eSystemLogError, "%s", strm.GetString().c_str());
             }
-            strm.PutCString("The debug session should be aborted as the original debug information has been overwritten.\n");
-            Host::SystemLog (Host::eSystemLogError, "%s", strm.GetString().c_str());
         }
     }
 }
@@ -897,26 +907,6 @@
     }
 }
 
-bool
-Module::GetModified (bool use_cached_only)
-{
-    if (m_was_modified == false && use_cached_only == false)
-    {
-        TimeValue curr_mod_time (m_file.GetModificationTime());
-        m_was_modified = curr_mod_time != m_mod_time;
-    }
-    return m_was_modified;
-}
-
-bool
-Module::SetModified (bool b)
-{
-    const bool prev_value = m_was_modified;
-    m_was_modified = b;
-    return prev_value;
-}
-
-
 void
 Module::Dump(Stream *s)
 {
@@ -1139,11 +1129,11 @@
                 // Iterate through the object file sections to find the
                 // first section that starts of file offset zero and that
                 // has bytes in the file...
-                Section *section = section_list->GetSectionAtIndex (sect_idx).get();
+                SectionSP section_sp (section_list->GetSectionAtIndex (sect_idx));
                 // Only load non-thread specific sections when given a slide
-                if (section && !section->IsThreadSpecific())
+                if (section_sp && !section_sp->IsThreadSpecific())
                 {
-                    if (target.GetSectionLoadList().SetSectionLoadAddress (section, section->GetFileAddress() + offset))
+                    if (target.GetSectionLoadList().SetSectionLoadAddress (section_sp, section_sp->GetFileAddress() + offset))
                         ++num_loaded_sections;
                 }
             }

Modified: lldb/branches/lldb-platform-work/source/Core/ModuleList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Core/ModuleList.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Core/ModuleList.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Core/ModuleList.cpp Mon Jul 23 19:12:48 2012
@@ -77,6 +77,32 @@
     }
 }
 
+void
+ModuleList::ReplaceEquivalent (const ModuleSP &module_sp)
+{
+    if (module_sp)
+    {
+        Mutex::Locker locker(m_modules_mutex);
+
+        // First remove any equivalent modules. Equivalent modules are modules
+        // whose path, platform path and architecture match.
+        ModuleSpec equivalent_module_spec (module_sp->GetFileSpec(), module_sp->GetArchitecture());
+        equivalent_module_spec.GetPlatformFileSpec() = module_sp->GetPlatformFileSpec();
+
+        size_t idx = 0;
+        while (idx < m_modules.size())
+        {
+            ModuleSP module_sp (m_modules[idx]);
+            if (module_sp->MatchesModuleSpec (equivalent_module_spec))
+                m_modules.erase(m_modules.begin() + idx);
+            else
+                ++idx;
+        }
+        // Now add the new module to the list
+        m_modules.push_back(module_sp);
+    }
+}
+
 bool
 ModuleList::AppendIfNeeded (const ModuleSP &module_sp)
 {
@@ -323,7 +349,7 @@
     return sc_list.GetSize() - initial_size;
 }
 
-    size_t
+size_t
 ModuleList::FindSymbolsMatchingRegExAndType (const RegularExpression &regex, 
                                              lldb::SymbolType symbol_type, 
                                              SymbolContextList &sc_list,
@@ -684,24 +710,21 @@
             for (uint32_t module_idx = 0; module_idx < num_matching_modules; ++module_idx)
             {
                 module_sp = matching_module_list.GetModuleAtIndex(module_idx);
-                // If we had a UUID and we found a match, then that is good enough for a match
-                if (uuid_ptr)
-                    break;
-                if (module_file_spec)
+                
+                // Make sure the file for the module hasn't been modified
+                if (module_sp->FileHasChanged())
                 {
-                    // If we didn't have a UUID in mind when looking for the object file,
-                    // then we should make sure the modification time hasn't changed!
-                    TimeValue file_spec_mod_time(module_file_spec.GetModificationTime());
-                    if (file_spec_mod_time.IsValid())
-                    {
-                        if (file_spec_mod_time == module_sp->GetModificationTime())
-                            return error;
-                    }
+                    if (old_module_sp_ptr && !old_module_sp_ptr->get())
+                        *old_module_sp_ptr = module_sp;
+                    shared_module_list.Remove (module_sp);
+                    module_sp.reset();
+                }
+                else
+                {
+                    // The module matches and the module was not modified from
+                    // when it was last loaded.
+                    return error;
                 }
-                if (old_module_sp_ptr && !old_module_sp_ptr->get())
-                    *old_module_sp_ptr = module_sp;
-                shared_module_list.Remove (module_sp);
-                module_sp.reset();
             }
         }
     }
@@ -727,7 +750,7 @@
                     if (did_create_ptr)
                         *did_create_ptr = true;
                     
-                    shared_module_list.Append(module_sp);
+                    shared_module_list.ReplaceEquivalent(module_sp);
                     return error;
                 }
             }
@@ -819,7 +842,7 @@
                 if (did_create_ptr)
                     *did_create_ptr = true;
 
-                shared_module_list.Append(module_sp);
+                shared_module_list.ReplaceEquivalent(module_sp);
             }
             else
             {

Modified: lldb/branches/lldb-platform-work/source/Core/SearchFilter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Core/SearchFilter.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Core/SearchFilter.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Core/SearchFilter.cpp Mon Jul 23 19:12:48 2012
@@ -186,11 +186,21 @@
 Searcher::CallbackReturn
 SearchFilter::DoModuleIteration (const SymbolContext &context, Searcher &searcher)
 {
-    Searcher::CallbackReturn shouldContinue;
-
     if (searcher.GetDepth () >= Searcher::eDepthModule)
     {
-        if (!context.module_sp)
+        if (context.module_sp)
+        {
+            if (searcher.GetDepth () == Searcher::eDepthModule)
+            {
+                SymbolContext matchingContext(context.module_sp.get());
+                searcher.SearchCallback (*this, matchingContext, NULL, false);
+            }
+            else
+            {
+                return DoCUIteration(context.module_sp, context, searcher);
+            }
+        }
+        else
         {
             ModuleList &target_images = m_target_sp->GetImages();
             Mutex::Locker modules_locker(target_images.GetMutex());
@@ -208,14 +218,14 @@
                 {
                     SymbolContext matchingContext(m_target_sp, module_sp);
 
-                    shouldContinue = searcher.SearchCallback (*this, matchingContext, NULL, false);
+                    Searcher::CallbackReturn shouldContinue = searcher.SearchCallback (*this, matchingContext, NULL, false);
                     if (shouldContinue == Searcher::eCallbackReturnStop
                         || shouldContinue == Searcher::eCallbackReturnPop)
                         return shouldContinue;
                 }
                 else
                 {
-                    shouldContinue = DoCUIteration(module_sp, context, searcher);
+                    Searcher::CallbackReturn shouldContinue = DoCUIteration(module_sp, context, searcher);
                     if (shouldContinue == Searcher::eCallbackReturnStop)
                         return shouldContinue;
                     else if (shouldContinue == Searcher::eCallbackReturnPop)
@@ -223,20 +233,6 @@
                 }
             }
         }
-        else
-        {
-            if (searcher.GetDepth () == Searcher::eDepthModule)
-            {
-                SymbolContext matchingContext(context.module_sp.get());
-
-                shouldContinue = searcher.SearchCallback (*this, matchingContext, NULL, false);
-            }
-            else
-            {
-                return DoCUIteration(context.module_sp, context, searcher);
-            }
-        }
-
     }
     return Searcher::eCallbackReturnContinue;
 }

Modified: lldb/branches/lldb-platform-work/source/Core/Section.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Core/Section.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Core/Section.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Core/Section.cpp Mon Jul 23 19:12:48 2012
@@ -152,7 +152,7 @@
         }
         else
         {
-            load_base_addr = target->GetSectionLoadList().GetSectionLoadAddress (this);
+            load_base_addr = target->GetSectionLoadList().GetSectionLoadAddress (const_cast<Section *>(this)->shared_from_this());
         }
     }
 
@@ -184,6 +184,11 @@
     {
         so_addr.SetOffset(offset);
         so_addr.SetSection(const_cast<Section *>(this)->shared_from_this());
+        
+#ifdef LLDB_CONFIGURATION_DEBUG
+        // For debug builds, ensure that there are no orphaned (i.e., moduleless) sections.
+        assert(GetModule().get());
+#endif
     }
     return true;
 }

Modified: lldb/branches/lldb-platform-work/source/Core/UserSettingsController.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Core/UserSettingsController.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Core/UserSettingsController.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Core/UserSettingsController.cpp Mon Jul 23 19:12:48 2012
@@ -173,16 +173,13 @@
 
     // Verify child is not already in m_children.
     size_t num_children = m_children.size();
-    bool found = false;
     for (size_t i = 0; i < num_children; ++i)
-      {
-	if (m_children[i].get() == child.get())
-    	    found = true;
-      }
-
+    {
+        if (m_children[i].get() == child.get())
+            return;
+    }
     // Add child to m_children.
-    if (! found)
-        m_children.push_back (child);
+    m_children.push_back (child);
 }
 
 const ConstString &
@@ -494,14 +491,12 @@
                 UserSettingsControllerSP child;
                 ConstString child_prefix (names.GetArgumentAtIndex (0));
                 int num_children = GetNumChildren();
-                bool found = false;
-                for (int i = 0; i < num_children && !found; ++i)
+                for (int i = 0; i < num_children; ++i)
                 {
                     child = GetChildAtIndex (i);
                     ConstString current_prefix = child->GetLevelName();
                     if (current_prefix == child_prefix)
                     {
-                        found = true;
                         std::string new_name;
                         for (int j = 0; j < names.GetArgumentCount(); ++j)
                         {
@@ -513,12 +508,9 @@
                                                    index_value);
                     }
                 }
-                if (!found)
-                {
-                    err.SetErrorStringWithFormat ("unable to find variable '%s', cannot assign value", 
-                                                  full_dot_name);
-                    return err;
-                }
+                err.SetErrorStringWithFormat ("unable to find variable '%s', cannot assign value",
+                                              full_dot_name);
+                return err;
             }
         }
     }
@@ -576,12 +568,10 @@
     if (names.GetArgumentCount() > 1)
     {
         ConstString child_prefix (names.GetArgumentAtIndex (0));
-        bool found = false;
-        for (int i = 0; i < m_children.size() && !found; ++i)
+        for (int i = 0; i < m_children.size(); ++i)
         {
             if (child_prefix == m_children[i]->GetLevelName())
             {
-                found = true;
                 child = m_children[i];
                 std::string new_name;
                 for (int j = 0; j < names.GetArgumentCount(); ++j)
@@ -594,60 +584,57 @@
             }
         }
 
-        if (!found)
+        // Cannot be handled by a child, because name did not match any child prefixes.
+        // Cannot be a class-wide variable because there are too many name pieces.
+
+        if (instance_entry != NULL)
         {
-            // Cannot be handled by a child, because name did not match any child prefixes.
-            // Cannot be a class-wide variable because there are too many name pieces.
+            var_type = instance_entry->var_type;
+            ConstString instance_name (names.GetArgumentAtIndex (0));
+            InstanceSettings *current_settings = FindSettingsForInstance (instance_name);
 
-            if (instance_entry != NULL)
+            if (current_settings != NULL)
             {
-                var_type = instance_entry->var_type;
-                ConstString instance_name (names.GetArgumentAtIndex (0));
-                InstanceSettings *current_settings = FindSettingsForInstance (instance_name);
+                current_settings->GetInstanceSettingsValue (*instance_entry, const_var_name, value, &err);
+            }
+            else
+            {
+                // Look for instance name setting in pending settings.
 
-                if (current_settings != NULL)
+                std::string inst_name_str = instance_name.GetCString();
+                std::map<std::string, InstanceSettingsSP>::iterator pos;
+
+                pos = m_pending_settings.find (inst_name_str);
+                if (pos != m_pending_settings.end())
                 {
-                    current_settings->GetInstanceSettingsValue (*instance_entry, const_var_name, value, &err);
+                    InstanceSettingsSP settings_sp = pos->second;
+                    settings_sp->GetInstanceSettingsValue (*instance_entry, const_var_name,  value, &err);
                 }
-                else
+                else 
                 {
-                    // Look for instance name setting in pending settings.
-
-                    std::string inst_name_str = instance_name.GetCString();
-                    std::map<std::string, InstanceSettingsSP>::iterator pos;
-
-                    pos = m_pending_settings.find (inst_name_str);
-                    if (pos != m_pending_settings.end())
+                    if (m_settings.level_name.GetLength() > 0)
                     {
-                        InstanceSettingsSP settings_sp = pos->second;
-                        settings_sp->GetInstanceSettingsValue (*instance_entry, const_var_name,  value, &err);
+                        // No valid instance name; assume they want the default settings.
+                        m_default_settings->GetInstanceSettingsValue (*instance_entry, const_var_name, value, &err);
                     }
-                    else 
+                    else
                     {
-                        if (m_settings.level_name.GetLength() > 0)
-                        {
-                            // No valid instance name; assume they want the default settings.
-                            m_default_settings->GetInstanceSettingsValue (*instance_entry, const_var_name, value, &err);
-                        }
+                        // We're at the Debugger level;  use the debugger's instance settings.
+                        StreamString tmp_name;
+                        if (debugger_instance_name[0] != '[')
+                            tmp_name.Printf ("[%s]", debugger_instance_name);
                         else
-                        {
-                            // We're at the Debugger level;  use the debugger's instance settings.
-                            StreamString tmp_name;
-                            if (debugger_instance_name[0] != '[')
-                                tmp_name.Printf ("[%s]", debugger_instance_name);
-                            else
-                                tmp_name.Printf ("%s", debugger_instance_name);
-                            ConstString dbg_name (debugger_instance_name);
-                            InstanceSettings *dbg_settings = FindSettingsForInstance (dbg_name);
-                            if (dbg_settings)
-                                dbg_settings->GetInstanceSettingsValue (*instance_entry, const_var_name, value, &err);
-                        }
+                            tmp_name.Printf ("%s", debugger_instance_name);
+                        ConstString dbg_name (debugger_instance_name);
+                        InstanceSettings *dbg_settings = FindSettingsForInstance (dbg_name);
+                        if (dbg_settings)
+                            dbg_settings->GetInstanceSettingsValue (*instance_entry, const_var_name, value, &err);
                     }
                 }
             }
-            else
-                err.SetErrorString ("invalid variable name");
         }
+        else
+            err.SetErrorString ("invalid variable name");
     }
     else
     {
@@ -1194,14 +1181,11 @@
     else if (num_pieces == 1)
     {
         ConstString var_name (names.GetArgumentAtIndex (0));
-        bool is_global = false;
 
         const SettingEntry *setting_entry = usc_sp->GetGlobalEntry (var_name);
 
         if (setting_entry == NULL)
             setting_entry = usc_sp->GetInstanceEntry (var_name);
-        else
-            is_global = true;
 
         // Check to see if it is a global or instance variable name.
         if (setting_entry != NULL)
@@ -1773,21 +1757,18 @@
         else
         {
             // 'next_name' must be a child name.  Find the correct child and pass the remaining piece to be resolved.
-            bool found = false;
             int num_children = my_usc_sp->GetNumChildren();
             ConstString child_level (next_name.c_str());
             for (int i = 0; i < num_children; ++i)
             {
                 if (my_usc_sp->GetChildAtIndex (i)->GetLevelName() == child_level)
                 {
-                    found = true;
                     return UserSettingsController::CompleteSettingsNames (my_usc_sp->GetChildAtIndex (i),
                                                                           partial_setting_name_pieces,
                                                                           word_complete, matches);
                 }
             }
-            if (!found)
-                return 0;
+            return 0;
         }
     }
     else if (num_name_pieces == 1)

Modified: lldb/branches/lldb-platform-work/source/Core/ValueObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Core/ValueObject.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Core/ValueObject.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Core/ValueObject.cpp Mon Jul 23 19:12:48 2012
@@ -2344,8 +2344,10 @@
                 ValueObjectSP final_value = ret_val->Dereference(error);
                 if (error.Fail() || !final_value.get())
                 {
-                    *reason_to_stop = ValueObject::eExpressionPathScanEndReasonDereferencingFailed;
-                    *final_value_type = ValueObject::eExpressionPathEndResultTypeInvalid;
+                    if (reason_to_stop)
+                        *reason_to_stop = ValueObject::eExpressionPathScanEndReasonDereferencingFailed;
+                    if (final_value_type)
+                        *final_value_type = ValueObject::eExpressionPathEndResultTypeInvalid;
                     return 0;
                 }
                 else
@@ -2361,8 +2363,10 @@
                 ValueObjectSP final_value = ret_val->AddressOf(error);
                 if (error.Fail() || !final_value.get())
                 {
-                    *reason_to_stop = ValueObject::eExpressionPathScanEndReasonTakingAddressFailed;
-                    *final_value_type = ValueObject::eExpressionPathEndResultTypeInvalid;
+                    if (reason_to_stop)
+                        *reason_to_stop = ValueObject::eExpressionPathScanEndReasonTakingAddressFailed;
+                    if (final_value_type)
+                        *final_value_type = ValueObject::eExpressionPathEndResultTypeInvalid;
                     return 0;
                 }
                 else
@@ -3770,9 +3774,9 @@
     if (current_mod_id.GetStopID() == 0)
         return false;
     
-    bool changed;
-    
-    if (m_mod_id.IsValid())
+    bool changed = false;
+    const bool was_valid = m_mod_id.IsValid();
+    if (was_valid)
     {
         if (m_mod_id == current_mod_id)
         {
@@ -3804,6 +3808,7 @@
                 {
                     // We used to have a frame, but now it is gone
                     SetInvalid();
+                    changed = was_valid;
                 }
             }
         }
@@ -3811,6 +3816,7 @@
         {
             // We used to have a thread, but now it is gone
             SetInvalid();
+            changed = was_valid;
         }
 
     }

Modified: lldb/branches/lldb-platform-work/source/Core/ValueObjectConstResult.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Core/ValueObjectConstResult.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Core/ValueObjectConstResult.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Core/ValueObjectConstResult.cpp Mon Jul 23 19:12:48 2012
@@ -13,6 +13,7 @@
 #include "lldb/Core/ValueObjectConstResultChild.h"
 #include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Module.h"
+#include "lldb/Core/ValueObjectDynamicValue.h"
 #include "lldb/Core/ValueObjectList.h"
 
 #include "lldb/Symbol/ClangASTType.h"
@@ -375,3 +376,24 @@
 {
     return m_impl.GetPointeeData(data, item_idx, item_count);
 }
+
+lldb::ValueObjectSP
+ValueObjectConstResult::GetDynamicValue (lldb::DynamicValueType use_dynamic)
+{
+    // Always recalculate dynamic values for const results as the memory that
+    // they might point to might have changed at any time.
+    if (use_dynamic != eNoDynamicValues)
+    {
+        if (!IsDynamic())
+        {
+            ExecutionContext exe_ctx (GetExecutionContextRef());
+            Process *process = exe_ctx.GetProcessPtr();
+            if (process && process->IsPossibleDynamicValue(*this))
+                m_dynamic_value = new ValueObjectDynamicValue (*this, use_dynamic);
+        }
+        if (m_dynamic_value)
+            return m_dynamic_value->GetSP();
+    }
+    return ValueObjectSP();
+}
+

Modified: lldb/branches/lldb-platform-work/source/Expression/ClangExpressionDeclMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Expression/ClangExpressionDeclMap.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Expression/ClangExpressionDeclMap.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Expression/ClangExpressionDeclMap.cpp Mon Jul 23 19:12:48 2012
@@ -2443,12 +2443,13 @@
             if (!sym_ctx.function)
                 return;
             
-            clang::DeclContext *decl_context;
-            
-            if (sym_ctx.block && sym_ctx.block->GetInlinedFunctionInfo())
-                decl_context = sym_ctx.block->GetClangDeclContextForInlinedFunction();
-            else
-                decl_context = sym_ctx.function->GetClangDeclContext();
+            // Get the block that defines the function
+            Block *function_block = sym_ctx.GetFunctionBlock();
+
+            if (!function_block)
+                return;
+
+            clang::DeclContext *decl_context = function_block->GetClangDeclContext();
             
             if (!decl_context)
                 return;
@@ -2501,12 +2502,13 @@
             if (!sym_ctx.function)
                 return;
             
-            clang::DeclContext *decl_context;
+            // Get the block that defines the function
+            Block *function_block = sym_ctx.GetFunctionBlock();
             
-            if (sym_ctx.block && sym_ctx.block->GetInlinedFunctionInfo())
-                decl_context = sym_ctx.block->GetClangDeclContextForInlinedFunction();
-            else
-                decl_context = sym_ctx.function->GetClangDeclContext();
+            if (!function_block)
+                return;
+            
+            clang::DeclContext *decl_context = function_block->GetClangDeclContext();
             
             if (!decl_context)
                 return;

Modified: lldb/branches/lldb-platform-work/source/Expression/ClangUserExpression.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Expression/ClangUserExpression.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Expression/ClangUserExpression.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Expression/ClangUserExpression.cpp Mon Jul 23 19:12:48 2012
@@ -110,18 +110,19 @@
     if (frame == NULL)
         return;
     
-    SymbolContext sym_ctx = frame->GetSymbolContext(lldb::eSymbolContextFunction);
+    SymbolContext sym_ctx = frame->GetSymbolContext(lldb::eSymbolContextFunction | lldb::eSymbolContextBlock);
     
     if (!sym_ctx.function)
         return;
     
-    clang::DeclContext *decl_context;
+    // Find the block that defines the function represented by "sym_ctx"
+    Block *function_block = sym_ctx.GetFunctionBlock();
     
-    if (sym_ctx.block && sym_ctx.block->GetInlinedFunctionInfo())
-        decl_context = sym_ctx.block->GetClangDeclContextForInlinedFunction();
-    else
-        decl_context = sym_ctx.function->GetClangDeclContext();
-        
+    if (!function_block)
+        return;
+
+    clang::DeclContext *decl_context = function_block->GetClangDeclContext();
+
     if (!decl_context)
         return;
             
@@ -131,24 +132,22 @@
         {
             if (m_enforce_valid_object)
             {
-                VariableList *vars = frame->GetVariableList(false);
+                lldb::VariableListSP variable_list_sp (function_block->GetBlockVariableList (true));
                 
                 const char *thisErrorString = "Stopped in a C++ method, but 'this' isn't available; pretending we are in a generic context";
                 
-                if (!vars)
+                if (!variable_list_sp)
                 {
-                    err.SetErrorToGenericError();
                     err.SetErrorString(thisErrorString);
                     return;
                 }
                 
-                lldb::VariableSP this_var = vars->FindVariable(ConstString("this"));
+                lldb::VariableSP this_var_sp (variable_list_sp->FindVariable(ConstString("this")));
                 
-                if (!this_var ||
-                    !this_var->IsInScope(frame) || 
-                    !this_var->LocationIsValidForFrame (frame))
+                if (!this_var_sp ||
+                    !this_var_sp->IsInScope(frame) || 
+                    !this_var_sp->LocationIsValidForFrame (frame))
                 {
-                    err.SetErrorToGenericError();
                     err.SetErrorString(thisErrorString);
                     return;
                 }
@@ -164,24 +163,22 @@
         {
             if (m_enforce_valid_object)
             {
-                VariableList *vars = frame->GetVariableList(false);
+                lldb::VariableListSP variable_list_sp (function_block->GetBlockVariableList (true));
                 
                 const char *selfErrorString = "Stopped in an Objective-C method, but 'self' isn't available; pretending we are in a generic context";
                 
-                if (!vars)
+                if (!variable_list_sp)
                 {
-                    err.SetErrorToGenericError();
                     err.SetErrorString(selfErrorString);
                     return;
                 }
                 
-                lldb::VariableSP self_var = vars->FindVariable(ConstString("self"));
+                lldb::VariableSP self_variable_sp = variable_list_sp->FindVariable(ConstString("self"));
                 
-                if (!self_var || 
-                    !self_var->IsInScope(frame) || 
-                    !self_var->LocationIsValidForFrame (frame))
+                if (!self_variable_sp || 
+                    !self_variable_sp->IsInScope(frame) || 
+                    !self_variable_sp->LocationIsValidForFrame (frame))
                 {
-                    err.SetErrorToGenericError();
                     err.SetErrorString(selfErrorString);
                     return;
                 }
@@ -545,7 +542,8 @@
                               ExecutionContext &exe_ctx,
                               bool discard_on_error,
                               ClangUserExpression::ClangUserExpressionSP &shared_ptr_to_me,
-                              lldb::ClangExpressionVariableSP &result)
+                              lldb::ClangExpressionVariableSP &result,
+                              uint32_t single_thread_timeout_usec)
 {
     // The expression log is quite verbose, and if you're just tracking the execution of the
     // expression, it's quite convenient to have these logs come out with the STEP log as well.
@@ -581,8 +579,6 @@
     
         call_plan_sp->SetPrivate(true);
     
-        uint32_t single_thread_timeout_usec = 500000;
-        
         if (log)
             log->Printf("-- [ClangUserExpression::Execute] Execution of expression begins --");
         
@@ -651,10 +647,11 @@
                                bool discard_on_error,
                                const char *expr_cstr,
                                const char *expr_prefix,
-                               lldb::ValueObjectSP &result_valobj_sp)
+                               lldb::ValueObjectSP &result_valobj_sp,
+                               uint32_t single_thread_timeout_usec)
 {
     Error error;
-    return EvaluateWithError (exe_ctx, execution_policy, language, desired_type, discard_on_error, expr_cstr, expr_prefix, result_valobj_sp, error);
+    return EvaluateWithError (exe_ctx, execution_policy, language, desired_type, discard_on_error, expr_cstr, expr_prefix, result_valobj_sp, error, single_thread_timeout_usec);
 }
 
 ExecutionResults
@@ -666,7 +663,8 @@
                                         const char *expr_cstr,
                                         const char *expr_prefix,
                                         lldb::ValueObjectSP &result_valobj_sp,
-                                        Error &error)
+                                        Error &error,
+                                        uint32_t single_thread_timeout_usec)
 {
     lldb::LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_EXPRESSIONS | LIBLLDB_LOG_STEP));
 
@@ -741,7 +739,8 @@
                                                              exe_ctx, 
                                                              discard_on_error,
                                                              user_expression_sp, 
-                                                             expr_result);
+                                                             expr_result,
+                                                             single_thread_timeout_usec);
             
             if (execution_results != eExecutionCompleted)
             {

Modified: lldb/branches/lldb-platform-work/source/Expression/IRDynamicChecks.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Expression/IRDynamicChecks.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Expression/IRDynamicChecks.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Expression/IRDynamicChecks.cpp Mon Jul 23 19:12:48 2012
@@ -461,11 +461,16 @@
         case eMsgSend_stret:
             target_object = call_inst->getArgOperand(1);
             selector = call_inst->getArgOperand(2);
+            break;
         case eMsgSendSuper:
         case eMsgSendSuper_stret:
             return true;
         }
-                
+            
+        // These objects should always be valid according to Sean Calannan
+        assert (target_object);
+        assert (selector);
+
         // Insert an instruction to cast the receiver id to int8_t*
         
         BitCastInst *bit_cast = new BitCastInst(target_object,

Modified: lldb/branches/lldb-platform-work/source/Expression/IRForTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Expression/IRForTarget.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Expression/IRForTarget.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Expression/IRForTarget.cpp Mon Jul 23 19:12:48 2012
@@ -229,7 +229,7 @@
     {
         if (!m_decl_map->GetFunctionInfo (fun_decl, fun_addr)) 
         {
-            lldb_private::ConstString alternate_mangling_const_str;
+            lldb_private::ConstString altnernate_name;
             bool found_it = m_decl_map->GetFunctionAddress (name, fun_addr);
             if (!found_it)
             {
@@ -240,27 +240,35 @@
                 {
                     std::string alternate_mangling("_ZNKSs");
                     alternate_mangling.append (name_cstr + strlen("_ZNKSbIcE"));
-                    alternate_mangling_const_str.SetCString(alternate_mangling.c_str());
-                    found_it = m_decl_map->GetFunctionAddress (alternate_mangling_const_str, fun_addr);
+                    altnernate_name.SetCString(alternate_mangling.c_str());
+                    found_it = m_decl_map->GetFunctionAddress (altnernate_name, fun_addr);
                 }
             }
             
             if (!found_it)
             {
+                lldb_private::Mangled mangled_name(name);
+                lldb_private::Mangled alt_mangled_name(altnernate_name);
                 if (log)
                 {
-                    if (alternate_mangling_const_str)
-                        log->Printf("Function \"%s\" (alternate name \"%s\") has no address", name.GetCString(), alternate_mangling_const_str.GetCString());
+                    if (alt_mangled_name)
+                        log->Printf("Function \"%s\" (alternate name \"%s\") has no address",
+                                    mangled_name.GetName().GetCString(),
+                                    alt_mangled_name.GetName().GetCString());
                     else
-                        log->Printf("Function \"%s\" had no address", name.GetCString());
+                        log->Printf("Function \"%s\" had no address",
+                                    mangled_name.GetName().GetCString());
                 }
                 
                 if (m_error_stream)
                 {
-                    if (alternate_mangling_const_str)
-                        m_error_stream->Printf("error: call to a function '%s' (alternate name '%s') that is not present in the target\n", name.GetCString(), alternate_mangling_const_str.GetCString());
+                    if (alt_mangled_name)
+                        m_error_stream->Printf("error: call to a function '%s' (alternate name '%s') that is not present in the target\n",
+                                               mangled_name.GetName().GetCString(),
+                                               alt_mangled_name.GetName().GetCString());
                     else
-                        m_error_stream->Printf("error: call to a function '%s' that is not present in the target\n", name.GetCString());
+                        m_error_stream->Printf("error: call to a function '%s' that is not present in the target\n",
+                                               mangled_name.GetName().GetCString());
                 }
                 return false;
             }
@@ -1378,7 +1386,7 @@
     // What we're going to do here is make believe this was a regular old external
     // variable.  That means we need to make the metadata valid.
     
-    NamedMDNode *named_metadata = m_module->getNamedMetadata("clang.global.decl.ptrs");
+    NamedMDNode *named_metadata = m_module->getOrInsertNamedMetadata("clang.global.decl.ptrs");
     
     llvm::Value* values[2];
     values[0] = persistent_global;
@@ -1810,6 +1818,51 @@
 }
 
 bool
+IRForTarget::RemoveCXAAtExit (BasicBlock &basic_block)
+{
+    BasicBlock::iterator ii;
+    
+    std::vector<CallInst *> calls_to_remove;
+    
+    for (ii = basic_block.begin();
+         ii != basic_block.end();
+         ++ii)
+    {
+        Instruction &inst = *ii;
+        
+        CallInst *call = dyn_cast<CallInst>(&inst);
+        
+        // MaybeHandleCallArguments handles error reporting; we are silent here
+        if (!call)
+            continue;
+        
+        bool remove = false;
+    
+        llvm::Function *func = call->getCalledFunction();
+        
+        if (func && func->getName() == "__cxa_atexit")
+            remove = true;
+        
+        llvm::Value *val = call->getCalledValue();
+        
+        if (val && val->getName() == "__cxa_atexit")
+            remove = true;
+        
+        if (remove)
+            calls_to_remove.push_back(call);
+    }
+    
+    for (std::vector<CallInst *>::iterator ci = calls_to_remove.begin(), ce = calls_to_remove.end();
+         ci != ce;
+         ++ci)
+    {
+        (*ci)->eraseFromParent();
+    }
+    
+    return true;
+}
+
+bool
 IRForTarget::ResolveCalls(BasicBlock &basic_block)
 {        
     /////////////////////////////////////////////////////////////////////////
@@ -2676,6 +2729,16 @@
             
             return false;
         }
+        
+        if (!RemoveCXAAtExit(*bbi))
+        {
+            if (log)
+                log->Printf("RemoveCXAAtExit() failed");
+            
+            // RemoveCXAAtExit() reports its own errors, so we don't do so here
+
+            return false;
+        }
     }
     
     if (m_decl_map && m_execution_policy != lldb_private::eExecutionPolicyAlways)

Modified: lldb/branches/lldb-platform-work/source/Expression/IRInterpreter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Expression/IRInterpreter.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Expression/IRInterpreter.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Expression/IRInterpreter.cpp Mon Jul 23 19:12:48 2012
@@ -634,7 +634,7 @@
             lldb::LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS));
 
             lldb_private::Value resolved_value;
-            lldb_private::ClangExpressionVariable::FlagType flags;
+            lldb_private::ClangExpressionVariable::FlagType flags = 0;
             
             if (global_value)
             {            

Modified: lldb/branches/lldb-platform-work/source/Host/common/Mutex.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Host/common/Mutex.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Host/common/Mutex.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Host/common/Mutex.cpp Mon Jul 23 19:12:48 2012
@@ -275,7 +275,7 @@
 int
 Mutex::Lock()
 {
-    DEBUG_LOG ("[%4.4x/%4.4x] pthread_mutex_lock (%p)...\n", Host::GetCurrentProcessID(), Host::GetCurrentThreadID(), mutex_ptr);
+    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);
@@ -291,7 +291,7 @@
         assert(err == 0);
     }
 #endif
-    DEBUG_LOG ("[%4.4x/%4.4x] pthread_mutex_lock (%p) => %i\n", Host::GetCurrentProcessID(), Host::GetCurrentThreadID(), &m_mutex, err);
+    DEBUG_LOG ("[%4.4llx/%4.4llx] pthread_mutex_lock (%p) => %i\n", Host::GetCurrentProcessID(), Host::GetCurrentThreadID(), &m_mutex, err);
     return err;
 }
 
@@ -311,7 +311,7 @@
 #endif
 
     int err = ::pthread_mutex_trylock (&m_mutex);
-    DEBUG_LOG ("[%4.4x/%4.4x] pthread_mutex_trylock (%p) => %i\n", Host::GetCurrentProcessID(), Host::GetCurrentThreadID(), &m_mutex, err);
+    DEBUG_LOG ("[%4.4llx/%4.4llx] pthread_mutex_trylock (%p) => %i\n", Host::GetCurrentProcessID(), Host::GetCurrentThreadID(), &m_mutex, err);
     return err;
 }
 
@@ -340,7 +340,7 @@
         assert(err == 0);
     }
 #endif
-    DEBUG_LOG ("[%4.4x/%4.4x] pthread_mutex_unlock (%p) => %i\n", Host::GetCurrentProcessID(), Host::GetCurrentThreadID(), &m_mutex, err);
+    DEBUG_LOG ("[%4.4llx/%4.4llx] pthread_mutex_unlock (%p) => %i\n", Host::GetCurrentProcessID(), Host::GetCurrentThreadID(), &m_mutex, err);
     return err;
 }
 

Modified: lldb/branches/lldb-platform-work/source/Host/common/Terminal.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Host/common/Terminal.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Host/common/Terminal.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Host/common/Terminal.cpp Mon Jul 23 19:12:48 2012
@@ -161,16 +161,15 @@
 bool
 TerminalState::Restore () const
 {
-    int result = 0;
     if (IsValid())
     {
         const int fd = m_tty.GetFileDescriptor();
         if (TFlagsIsValid())
-            result = fcntl (fd, F_SETFL, m_tflags);
+            fcntl (fd, F_SETFL, m_tflags);
 
 #ifdef LLDB_CONFIG_TERMIOS_SUPPORTED
         if (TTYStateIsValid())
-            result = tcsetattr (fd, TCSANOW, m_termios_ap.get());
+            tcsetattr (fd, TCSANOW, m_termios_ap.get());
 #endif // #ifdef LLDB_CONFIG_TERMIOS_SUPPORTED
 
         if (ProcessGroupIsValid())
@@ -179,7 +178,7 @@
             void (*saved_sigttou_callback) (int) = NULL;
             saved_sigttou_callback = (void (*)(int)) signal (SIGTTOU, SIG_IGN);
             // Set the process group
-            result = tcsetpgrp (fd, m_process_group);
+            tcsetpgrp (fd, m_process_group);
             // Restore the original signal handler.
             signal (SIGTTOU, saved_sigttou_callback);
         }

Modified: lldb/branches/lldb-platform-work/source/Host/macosx/Host.mm
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Host/macosx/Host.mm?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Host/macosx/Host.mm (original)
+++ lldb/branches/lldb-platform-work/source/Host/macosx/Host.mm Mon Jul 23 19:12:48 2012
@@ -60,12 +60,11 @@
 
 #include <objc/objc-auto.h>
 
-#if defined(__arm__)
-#include <UIKit/UIKit.h>
-#else
-#include <ApplicationServices/ApplicationServices.h>
+#include <CoreFoundation/CoreFoundation.h>
+#include <Foundation/Foundation.h>
+
+#if !defined(__arm__)
 #include <Carbon/Carbon.h>
-#include <Security/Security.h>
 #endif
 
 #ifndef _POSIX_SPAWN_DISABLE_ASLR
@@ -115,7 +114,7 @@
     {
         if (m_pool)
         {
-            [m_pool release];
+            [m_pool drain];
             m_pool = nil;
         }
     }
@@ -233,6 +232,8 @@
 
     ::pid_t pid = LLDB_INVALID_PROCESS_ID;
     error = ::GetProcessPID(&psn, &pid);
+    if (error != noErr)
+        return LLDB_INVALID_PROCESS_ID;
     return pid;
 #endif
 }
@@ -293,164 +294,164 @@
 }
 #if !defined(__arm__)
 
-static lldb::pid_t
-LaunchInNewTerminalWithCommandFile 
-(
-    const char **argv, 
-    const char **envp,
-    const char *working_dir,
-    const ArchSpec *arch_spec,
-    bool stop_at_entry,
-    bool disable_aslr
-)
-{
-    if (!argv || !argv[0])
-        return LLDB_INVALID_PROCESS_ID;
-
-    OSStatus error = 0;
-    
-    FileSpec program (argv[0], false);
-    
-    
-    std::string unix_socket_name;
-
-    char temp_file_path[PATH_MAX];
-    const char *tmpdir = ::getenv ("TMPDIR");
-    if (tmpdir == NULL)
-        tmpdir = "/tmp/";
-    ::snprintf (temp_file_path, sizeof(temp_file_path), "%s%s-XXXXXX", tmpdir, program.GetFilename().AsCString());
-    
-    if (::mktemp (temp_file_path) == NULL)
-        return LLDB_INVALID_PROCESS_ID;
-
-    unix_socket_name.assign (temp_file_path);
-
-    ::strlcat (temp_file_path, ".command", sizeof (temp_file_path));
-
-    StreamFile command_file;
-    command_file.GetFile().Open (temp_file_path, 
-                                 File::eOpenOptionWrite | File::eOpenOptionCanCreate,
-                                 File::ePermissionsDefault);
-    
-    if (!command_file.GetFile().IsValid())
-        return LLDB_INVALID_PROCESS_ID;
-    
-    FileSpec darwin_debug_file_spec;
-    if (!Host::GetLLDBPath (ePathTypeSupportExecutableDir, darwin_debug_file_spec))
-        return LLDB_INVALID_PROCESS_ID;
-    darwin_debug_file_spec.GetFilename().SetCString("darwin-debug");
-        
-    if (!darwin_debug_file_spec.Exists())
-        return LLDB_INVALID_PROCESS_ID;
-    
-    char launcher_path[PATH_MAX];
-    darwin_debug_file_spec.GetPath(launcher_path, sizeof(launcher_path));
-    command_file.Printf("\"%s\" ", launcher_path);
-    
-    command_file.Printf("--unix-socket=%s ", unix_socket_name.c_str());
-    
-    if (arch_spec && arch_spec->IsValid())
-    {
-        command_file.Printf("--arch=%s ", arch_spec->GetArchitectureName());
-    }
-
-    if (disable_aslr)
-    {
-        command_file.PutCString("--disable-aslr ");
-    }
-        
-    command_file.PutCString("-- ");
-
-    if (argv)
-    {
-        for (size_t i=0; argv[i] != NULL; ++i)
-        {
-            command_file.Printf("\"%s\" ", argv[i]);
-        }
-    }
-    command_file.PutCString("\necho Process exited with status $?\n");
-    command_file.GetFile().Close();
-    if (::chmod (temp_file_path, S_IRWXU | S_IRWXG) != 0)
-        return LLDB_INVALID_PROCESS_ID;
-            
-    CFCMutableDictionary cf_env_dict;
-    
-    const bool can_create = true;
-    if (envp)
-    {
-        for (size_t i=0; envp[i] != NULL; ++i)
-        {
-            const char *env_entry = envp[i];            
-            const char *equal_pos = strchr(env_entry, '=');
-            if (equal_pos)
-            {
-                std::string env_key (env_entry, equal_pos);
-                std::string env_val (equal_pos + 1);
-                CFCString cf_env_key (env_key.c_str(), kCFStringEncodingUTF8);
-                CFCString cf_env_val (env_val.c_str(), kCFStringEncodingUTF8);
-                cf_env_dict.AddValue (cf_env_key.get(), cf_env_val.get(), can_create);
-            }
-        }
-    }
-    
-    LSApplicationParameters app_params;
-    ::memset (&app_params, 0, sizeof (app_params));
-    app_params.flags = kLSLaunchDontAddToRecents | kLSLaunchAsync;
-    app_params.argv = NULL;
-    app_params.environment = (CFDictionaryRef)cf_env_dict.get();
-
-    CFCReleaser<CFURLRef> command_file_url (::CFURLCreateFromFileSystemRepresentation (NULL, 
-                                                                                       (const UInt8 *)temp_file_path, 
-                                                                                       strlen(temp_file_path),
-                                                                                       false));
-    
-    CFCMutableArray urls;
-    
-    // Terminal.app will open the ".command" file we have created
-    // and run our process inside it which will wait at the entry point
-    // for us to attach.
-    urls.AppendValue(command_file_url.get());
-
-
-    lldb::pid_t pid = LLDB_INVALID_PROCESS_ID;
-
-    Error lldb_error;
-    // Sleep and wait a bit for debugserver to start to listen...
-    char connect_url[128];
-    ::snprintf (connect_url, sizeof(connect_url), "unix-accept://%s", unix_socket_name.c_str());
-
-    // Spawn a new thread to accept incoming connection on the connect_url
-    // so we can grab the pid from the inferior
-    lldb::thread_t accept_thread = Host::ThreadCreate (unix_socket_name.c_str(),
-                                                       AcceptPIDFromInferior,
-                                                       connect_url,
-                                                       &lldb_error);
-    
-    ProcessSerialNumber psn;
-    error = LSOpenURLsWithRole(urls.get(), kLSRolesShell, NULL, &app_params, &psn, 1);
-    if (error == noErr)
-    {
-        thread_result_t accept_thread_result = NULL;
-        if (Host::ThreadJoin (accept_thread, &accept_thread_result, &lldb_error))
-        {
-            if (accept_thread_result)
-            {
-                pid = (intptr_t)accept_thread_result;
-            
-                // Wait for process to be stopped the the entry point by watching
-                // for the process status to be set to SSTOP which indicates it it
-                // SIGSTOP'ed at the entry point
-                WaitForProcessToSIGSTOP (pid, 5);
-            }
-        }
-    }
-    else
-    {
-        Host::ThreadCancel (accept_thread, &lldb_error);
-    }
-
-    return pid;
-}
+//static lldb::pid_t
+//LaunchInNewTerminalWithCommandFile 
+//(
+//    const char **argv, 
+//    const char **envp,
+//    const char *working_dir,
+//    const ArchSpec *arch_spec,
+//    bool stop_at_entry,
+//    bool disable_aslr
+//)
+//{
+//    if (!argv || !argv[0])
+//        return LLDB_INVALID_PROCESS_ID;
+//
+//    OSStatus error = 0;
+//    
+//    FileSpec program (argv[0], false);
+//    
+//    
+//    std::string unix_socket_name;
+//
+//    char temp_file_path[PATH_MAX];
+//    const char *tmpdir = ::getenv ("TMPDIR");
+//    if (tmpdir == NULL)
+//        tmpdir = "/tmp/";
+//    ::snprintf (temp_file_path, sizeof(temp_file_path), "%s%s-XXXXXX", tmpdir, program.GetFilename().AsCString());
+//    
+//    if (::mktemp (temp_file_path) == NULL)
+//        return LLDB_INVALID_PROCESS_ID;
+//
+//    unix_socket_name.assign (temp_file_path);
+//
+//    ::strlcat (temp_file_path, ".command", sizeof (temp_file_path));
+//
+//    StreamFile command_file;
+//    command_file.GetFile().Open (temp_file_path, 
+//                                 File::eOpenOptionWrite | File::eOpenOptionCanCreate,
+//                                 File::ePermissionsDefault);
+//    
+//    if (!command_file.GetFile().IsValid())
+//        return LLDB_INVALID_PROCESS_ID;
+//    
+//    FileSpec darwin_debug_file_spec;
+//    if (!Host::GetLLDBPath (ePathTypeSupportExecutableDir, darwin_debug_file_spec))
+//        return LLDB_INVALID_PROCESS_ID;
+//    darwin_debug_file_spec.GetFilename().SetCString("darwin-debug");
+//        
+//    if (!darwin_debug_file_spec.Exists())
+//        return LLDB_INVALID_PROCESS_ID;
+//    
+//    char launcher_path[PATH_MAX];
+//    darwin_debug_file_spec.GetPath(launcher_path, sizeof(launcher_path));
+//    command_file.Printf("\"%s\" ", launcher_path);
+//    
+//    command_file.Printf("--unix-socket=%s ", unix_socket_name.c_str());
+//    
+//    if (arch_spec && arch_spec->IsValid())
+//    {
+//        command_file.Printf("--arch=%s ", arch_spec->GetArchitectureName());
+//    }
+//
+//    if (disable_aslr)
+//    {
+//        command_file.PutCString("--disable-aslr ");
+//    }
+//        
+//    command_file.PutCString("-- ");
+//
+//    if (argv)
+//    {
+//        for (size_t i=0; argv[i] != NULL; ++i)
+//        {
+//            command_file.Printf("\"%s\" ", argv[i]);
+//        }
+//    }
+//    command_file.PutCString("\necho Process exited with status $?\n");
+//    command_file.GetFile().Close();
+//    if (::chmod (temp_file_path, S_IRWXU | S_IRWXG) != 0)
+//        return LLDB_INVALID_PROCESS_ID;
+//            
+//    CFCMutableDictionary cf_env_dict;
+//    
+//    const bool can_create = true;
+//    if (envp)
+//    {
+//        for (size_t i=0; envp[i] != NULL; ++i)
+//        {
+//            const char *env_entry = envp[i];            
+//            const char *equal_pos = strchr(env_entry, '=');
+//            if (equal_pos)
+//            {
+//                std::string env_key (env_entry, equal_pos);
+//                std::string env_val (equal_pos + 1);
+//                CFCString cf_env_key (env_key.c_str(), kCFStringEncodingUTF8);
+//                CFCString cf_env_val (env_val.c_str(), kCFStringEncodingUTF8);
+//                cf_env_dict.AddValue (cf_env_key.get(), cf_env_val.get(), can_create);
+//            }
+//        }
+//    }
+//    
+//    LSApplicationParameters app_params;
+//    ::memset (&app_params, 0, sizeof (app_params));
+//    app_params.flags = kLSLaunchDontAddToRecents | kLSLaunchAsync;
+//    app_params.argv = NULL;
+//    app_params.environment = (CFDictionaryRef)cf_env_dict.get();
+//
+//    CFCReleaser<CFURLRef> command_file_url (::CFURLCreateFromFileSystemRepresentation (NULL, 
+//                                                                                       (const UInt8 *)temp_file_path, 
+//                                                                                       strlen(temp_file_path),
+//                                                                                       false));
+//    
+//    CFCMutableArray urls;
+//    
+//    // Terminal.app will open the ".command" file we have created
+//    // and run our process inside it which will wait at the entry point
+//    // for us to attach.
+//    urls.AppendValue(command_file_url.get());
+//
+//
+//    lldb::pid_t pid = LLDB_INVALID_PROCESS_ID;
+//
+//    Error lldb_error;
+//    // Sleep and wait a bit for debugserver to start to listen...
+//    char connect_url[128];
+//    ::snprintf (connect_url, sizeof(connect_url), "unix-accept://%s", unix_socket_name.c_str());
+//
+//    // Spawn a new thread to accept incoming connection on the connect_url
+//    // so we can grab the pid from the inferior
+//    lldb::thread_t accept_thread = Host::ThreadCreate (unix_socket_name.c_str(),
+//                                                       AcceptPIDFromInferior,
+//                                                       connect_url,
+//                                                       &lldb_error);
+//    
+//    ProcessSerialNumber psn;
+//    error = LSOpenURLsWithRole(urls.get(), kLSRolesShell, NULL, &app_params, &psn, 1);
+//    if (error == noErr)
+//    {
+//        thread_result_t accept_thread_result = NULL;
+//        if (Host::ThreadJoin (accept_thread, &accept_thread_result, &lldb_error))
+//        {
+//            if (accept_thread_result)
+//            {
+//                pid = (intptr_t)accept_thread_result;
+//            
+//                // Wait for process to be stopped the the entry point by watching
+//                // for the process status to be set to SSTOP which indicates it it
+//                // SIGSTOP'ed at the entry point
+//                WaitForProcessToSIGSTOP (pid, 5);
+//            }
+//        }
+//    }
+//    else
+//    {
+//        Host::ThreadCancel (accept_thread, &lldb_error);
+//    }
+//
+//    return pid;
+//}
 
 const char *applscript_in_new_tty = 
 "tell application \"Terminal\"\n"
@@ -931,6 +932,9 @@
     return false;
 }
     
+#include <libxml/parser.h>
+#include <libxml/tree.h>
+
 bool
 Host::GetOSVersion 
 (
@@ -939,51 +943,61 @@
     uint32_t &update
 )
 {
-    
-#if defined (__arm__)
-    major = UINT32_MAX;
-    minor = UINT32_MAX;
-    update = UINT32_MAX;
-
-    NSString *system_version_nstr = [[UIDevice currentDevice] systemVersion];
-    if (system_version_nstr)
-    {
-        const char *system_version_cstr = system_version_nstr.UTF8String;
-        Args::StringToVersion(system_version_cstr, major, minor, update);
+    static const char *version_plist_file = "/System/Library/CoreServices/SystemVersion.plist";
+    char buffer[256];
+    const char *product_version_str = NULL;
+    
+    CFCReleaser<CFURLRef> plist_url(CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault,
+                                                                            (UInt8 *) version_plist_file,
+                                                                            strlen (version_plist_file), NO));
+    if (plist_url.get())
+    {
+        CFCReleaser<CFPropertyListRef> property_list;
+        CFCReleaser<CFStringRef>       error_string;
+        CFCReleaser<CFDataRef>         resource_data;
+        SInt32                         error_code;
+ 
+        // Read the XML file.
+        if (CFURLCreateDataAndPropertiesFromResource (kCFAllocatorDefault,
+                                                      plist_url.get(),
+                                                      resource_data.ptr_address(),
+                                                      NULL,
+                                                      NULL,
+                                                      &error_code))
+        {
+               // Reconstitute the dictionary using the XML data.
+            property_list = CFPropertyListCreateFromXMLData (kCFAllocatorDefault,
+                                                              resource_data.get(),
+                                                              kCFPropertyListImmutable,
+                                                              error_string.ptr_address());
+            if (CFGetTypeID(property_list.get()) == CFDictionaryGetTypeID())
+            {
+                CFDictionaryRef property_dict = (CFDictionaryRef) property_list.get();
+                CFStringRef product_version_key = CFSTR("ProductVersion");
+                CFPropertyListRef product_version_value;
+                product_version_value = CFDictionaryGetValue(property_dict, product_version_key);
+                if (product_version_value && CFGetTypeID(product_version_value) == CFStringGetTypeID())
+                {
+                    CFStringRef product_version_cfstr = (CFStringRef) product_version_value;
+                    product_version_str = CFStringGetCStringPtr(product_version_cfstr, kCFStringEncodingUTF8);
+                    if (product_version_str == NULL) {
+                        if (CFStringGetCString(product_version_cfstr, buffer, 256, kCFStringEncodingUTF8))
+                            product_version_str = buffer;
+                    }
+                }
+            }
+        }
     }
-    return major != UINT32_MAX;    
-#else
-    SInt32 version;
     
-    OSErr err = ::Gestalt (gestaltSystemVersion, &version);
-    if (err != noErr) 
-        return false;
 
-    if (version < 0x1040)
+    if (product_version_str)
     {
-        major = ((version & 0xF000) >> 12) * 10 + ((version & 0x0F00) >> 8);
-        minor = (version & 0x00F0) >> 4;
-        update = (version & 0x000F);
+        Args::StringToVersion(product_version_str, major, minor, update);
+        return true;
     }
     else
-    {
-        if (::Gestalt (gestaltSystemVersionMajor, &version) != noErr)
-            return false;
-        major = version;
-
-        if (::Gestalt (gestaltSystemVersionMinor, &version) == noErr)
-            minor = version;
-        else
-            minor = 0;
+        return false;
 
-        if (::Gestalt (gestaltSystemVersionBugFix, &version) == noErr)
-            update = version;
-        else
-            update = 0;
-    }
-    
-    return true;
-#endif
 }
 
 static bool
@@ -1056,7 +1070,6 @@
         {
             DataExtractor data (arg_data, arg_data_size, lldb::endian::InlHostByteOrder(), sizeof(void *));
             uint32_t offset = 0;
-            uint32_t start_offset;
             uint32_t argc = data.GetU32 (&offset);
             const char *cstr;
             
@@ -1082,7 +1095,6 @@
                     Args &proc_args = process_info.GetArguments();
                     for (int i=0; i<argc; ++i)
                     {
-                        start_offset = offset;
                         cstr = data.GetCStr(&offset);
                         if (cstr)
                             proc_args.AppendArgument(cstr);
@@ -1457,6 +1469,9 @@
     }
     
     return error;
+#else
+    Error error;
+    return error;
 #endif
 }
 
@@ -1532,7 +1547,16 @@
     if (working_dir)
     {
         // No more thread specific current working directory
-        __pthread_chdir (working_dir);
+        if (__pthread_chdir (working_dir) < 0) {
+            if (errno == ENOENT) {
+                error.SetErrorStringWithFormat("No such file or directory: %s", working_dir);
+            } else if (errno == ENOTDIR) {
+                error.SetErrorStringWithFormat("Path doesn't name a directory: %s", working_dir);
+            } else {
+                error.SetErrorStringWithFormat("An unknown error occurred when changing directory for process execution.");
+            }
+            return error;
+        }
     }
     
     const size_t num_file_actions = launch_info.GetNumFileActions ();
@@ -1802,7 +1826,7 @@
                 if (callback)
                     cancel = callback (callback_baton, pid, exited, signal, exit_status);
                 
-                if (exited)
+                if (exited || cancel)
                 {
                     ::dispatch_source_cancel(source);
                 }

Modified: lldb/branches/lldb-platform-work/source/Host/macosx/Symbols.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Host/macosx/Symbols.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Host/macosx/Symbols.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Host/macosx/Symbols.cpp Mon Jul 23 19:12:48 2012
@@ -388,6 +388,11 @@
                                     char build_src_path[PATH_MAX];
                                     ::CFStringGetFileSystemRepresentation (actual_src_cfpath, actual_src_path, sizeof(actual_src_path));
                                     ::CFStringGetFileSystemRepresentation (build_src_cfpath, build_src_path, sizeof(build_src_path));
+                                    if (actual_src_path[0] == '~')
+                                    {
+                                        FileSpec resolved_source_path(actual_src_path, true);
+                                        resolved_source_path.GetPath(actual_src_path, sizeof(actual_src_path));
+                                    }
                                     module_spec.GetSourceMappingList().Append (ConstString(build_src_path), ConstString(actual_src_path), true);
                                 }
                             }

Modified: lldb/branches/lldb-platform-work/source/Host/macosx/launcherXPCService/LauncherRootXPCService-Info.plist
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Host/macosx/launcherXPCService/LauncherRootXPCService-Info.plist?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Host/macosx/launcherXPCService/LauncherRootXPCService-Info.plist (original)
+++ lldb/branches/lldb-platform-work/source/Host/macosx/launcherXPCService/LauncherRootXPCService-Info.plist Mon Jul 23 19:12:48 2012
@@ -25,7 +25,7 @@
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleVersion</key>
-	<string>160</string>
+	<string>162</string>
 	<key>NSHumanReadableCopyright</key>
 	<string>Copyright © 2012 Apple Inc. All rights reserved.</string>
 	<key>XPCService</key>

Modified: lldb/branches/lldb-platform-work/source/Host/macosx/launcherXPCService/LauncherXPCService-Info.plist
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Host/macosx/launcherXPCService/LauncherXPCService-Info.plist?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Host/macosx/launcherXPCService/LauncherXPCService-Info.plist (original)
+++ lldb/branches/lldb-platform-work/source/Host/macosx/launcherXPCService/LauncherXPCService-Info.plist Mon Jul 23 19:12:48 2012
@@ -25,7 +25,7 @@
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleVersion</key>
-	<string>160</string>
+	<string>162</string>
 	<key>NSHumanReadableCopyright</key>
 	<string>Copyright © 2012 Apple Inc. All rights reserved.</string>
 	<key>XPCService</key>

Modified: lldb/branches/lldb-platform-work/source/Interpreter/Args.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Interpreter/Args.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Interpreter/Args.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Interpreter/Args.cpp Mon Jul 23 19:12:48 2012
@@ -230,7 +230,18 @@
                             break;
 
                         default:
-                            arg_pos = arg_end + 2;
+                            if (quote_char == '\0')
+                            {
+                                arg.append (arg_piece_start, arg_end - arg_piece_start);
+                                if (arg_end + 1 != '\0')
+                                {
+                                    arg.append (arg_end + 1, 1);
+                                    arg_pos = arg_end + 2;
+                                    arg_piece_start = arg_pos;
+                                }
+                            }
+                            else
+                                arg_pos = arg_end + 2;
                             break;
                     }
                     break;

Modified: lldb/branches/lldb-platform-work/source/Interpreter/CommandInterpreter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Interpreter/CommandInterpreter.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Interpreter/CommandInterpreter.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Interpreter/CommandInterpreter.cpp Mon Jul 23 19:12:48 2012
@@ -248,7 +248,11 @@
     if (cmd_obj_sp)
     {
         alias_arguments_vector_sp.reset (new OptionArgVector);
+#if defined (__arm__)
+        ProcessAliasOptionsArgs (cmd_obj_sp, "--", alias_arguments_vector_sp);
+#else
         ProcessAliasOptionsArgs (cmd_obj_sp, "--shell=/bin/bash --", alias_arguments_vector_sp);
+#endif
         AddAlias ("r", cmd_obj_sp);
         AddAlias ("run", cmd_obj_sp);
         AddOrReplaceAliasOptions ("r", alias_arguments_vector_sp);
@@ -1139,7 +1143,8 @@
             {
                 std::string expr_str (command, expr_content_start, end_backtick - expr_content_start);
                 
-                Target *target = m_exe_ctx.GetTargetPtr();
+                ExecutionContext exe_ctx(GetExecutionContext());
+                Target *target = exe_ctx.GetTargetPtr();
                 // Get a dummy target to allow for calculator mode while processing backticks.
                 // This also helps break the infinite loop caused when target is null.
                 if (!target)
@@ -1151,13 +1156,14 @@
                     const bool keep_in_memory = false;
                     ValueObjectSP expr_result_valobj_sp;
                     ExecutionResults expr_result = target->EvaluateExpression (expr_str.c_str(), 
-                                                                               m_exe_ctx.GetFramePtr(), 
+                                                                               exe_ctx.GetFramePtr(), 
                                                                                eExecutionPolicyOnlyWhenNeeded,
                                                                                coerce_to_id,
                                                                                unwind_on_error, 
                                                                                keep_in_memory, 
                                                                                eNoDynamicValues, 
-                                                                               expr_result_valobj_sp);
+                                                                               expr_result_valobj_sp,
+                                                                               0 /* no timeout */);
                     if (expr_result == eExecutionCompleted)
                     {
                         Scalar scalar;
@@ -2224,7 +2230,8 @@
     PlatformSP platform_sp;
     if (prefer_target_platform)
     {
-        Target *target = m_exe_ctx.GetTargetPtr();
+        ExecutionContext exe_ctx(GetExecutionContext());
+        Target *target = exe_ctx.GetTargetPtr();
         if (target)
             platform_sp = target->GetPlatform();
     }
@@ -2386,6 +2393,16 @@
 ScriptInterpreter *
 CommandInterpreter::GetScriptInterpreter ()
 {
+    // <rdar://problem/11751427>
+    // we need to protect the initialization of the script interpreter
+    // otherwise we could end up with two threads both trying to create
+    // their instance of it, and for some languages (e.g. Python)
+    // this is a bulletproof recipe for disaster!
+    // this needs to be a function-level static because multiple Debugger instances living in the same process
+    // still need to be isolated and not try to initialize Python concurrently
+    static Mutex g_interpreter_mutex(Mutex::eMutexTypeRecursive);
+    Mutex::Locker interpreter_lock(g_interpreter_mutex);
+    
     if (m_script_interpreter_ap.get() != NULL)
         return m_script_interpreter_ap.get();
     
@@ -2520,7 +2537,6 @@
     text_strm.Printf ("%-*s %s %s",  max_word_len, word_text, separator, help_text);
     
     const uint32_t max_columns = m_debugger.GetTerminalWidth();
-    bool first_line = true;
     
     size_t len = text_strm.GetSize();
     const char *text = text_strm.GetData();
@@ -2531,7 +2547,6 @@
     {
         if ((text[i] == ' ' && ::strchr((text+i+1), ' ') && chars_left < ::strchr((text+i+1), ' ')-(text+i)) || text[i] == '\n')
         {
-            first_line = false;
             chars_left = max_columns - indent_size;
             strm.EOL();
             strm.Indent();
@@ -2604,39 +2619,14 @@
 void
 CommandInterpreter::UpdateExecutionContext (ExecutionContext *override_context)
 {
-    m_exe_ctx.Clear();
-    
     if (override_context != NULL)
     {
-        m_exe_ctx = *override_context;
+        m_exe_ctx_ref = *override_context;
     }
     else
     {
-        TargetSP target_sp (m_debugger.GetSelectedTarget());
-        if (target_sp)
-        {
-            m_exe_ctx.SetTargetSP (target_sp);
-            ProcessSP process_sp (target_sp->GetProcessSP());
-            m_exe_ctx.SetProcessSP (process_sp);
-            if (process_sp && process_sp->IsAlive() && !process_sp->IsRunning())
-            {
-                ThreadSP thread_sp (process_sp->GetThreadList().GetSelectedThread());
-                if (thread_sp)
-                {
-                    m_exe_ctx.SetThreadSP (thread_sp);
-                    StackFrameSP frame_sp (thread_sp->GetSelectedFrame());
-                    if (!frame_sp)
-                    {
-                        frame_sp = thread_sp->GetStackFrameAtIndex (0);
-                        // If we didn't have a selected frame select one here.
-                        if (frame_sp)
-                            thread_sp->SetSelectedFrame(frame_sp.get());
-                    }
-                    if (frame_sp)
-                        m_exe_ctx.SetFrameSP (frame_sp);
-                }
-            }
-        }
+        const bool adopt_selected = true;
+        m_exe_ctx_ref.SetTargetPtr (m_debugger.GetSelectedTarget().get(), adopt_selected);
     }
 }
 

Modified: lldb/branches/lldb-platform-work/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp Mon Jul 23 19:12:48 2012
@@ -536,13 +536,13 @@
         pc_reg_num == LLDB_INVALID_REGNUM)
         return false;
 
-    UnwindPlan::Row row;
+    UnwindPlan::RowSP row(new UnwindPlan::Row);
     
-    // Our previous Call Frame Address is the stack pointer
-    row.SetCFARegister (sp_reg_num);
+    // Our Call Frame Address is the stack pointer value
+    row->SetCFARegister (sp_reg_num);
     
-    // Our previous PC is in the LR
-    row.SetRegisterLocationToRegister(pc_reg_num, lr_reg_num, true);
+    // The previous PC is in the LR
+    row->SetRegisterLocationToRegister(pc_reg_num, lr_reg_num, true);
     unwind_plan.AppendRow (row);
     
     // All other registers are the same.
@@ -554,42 +554,20 @@
 bool
 ABIMacOSX_arm::CreateDefaultUnwindPlan (UnwindPlan &unwind_plan)
 {
-    uint32_t reg_kind = unwind_plan.GetRegisterKind();
-    uint32_t fp_reg_num = LLDB_INVALID_REGNUM;
-    uint32_t sp_reg_num = LLDB_INVALID_REGNUM;
-    uint32_t pc_reg_num = LLDB_INVALID_REGNUM;
+    uint32_t fp_reg_num = dwarf_r7; // apple uses r7 for all frames. Normal arm uses r11;
+    uint32_t pc_reg_num = dwarf_pc;
     
-    switch (reg_kind)
-    {
-        case eRegisterKindDWARF:
-        case eRegisterKindGCC:
-            fp_reg_num = dwarf_r7; // apple uses r7 for all frames. Normal arm uses r11
-            sp_reg_num = dwarf_sp;
-            pc_reg_num = dwarf_pc;
-            break;
-            
-        case eRegisterKindGeneric:
-            fp_reg_num = LLDB_REGNUM_GENERIC_FP;
-            sp_reg_num = LLDB_REGNUM_GENERIC_SP;
-            pc_reg_num = LLDB_REGNUM_GENERIC_PC;
-            break;
-    }
-    
-    if (fp_reg_num == LLDB_INVALID_REGNUM ||
-        sp_reg_num == LLDB_INVALID_REGNUM ||
-        pc_reg_num == LLDB_INVALID_REGNUM)
-        return false;
-    
-    UnwindPlan::Row row;    
+    UnwindPlan::RowSP row(new UnwindPlan::Row);
     const int32_t ptr_size = 4;
     
-    unwind_plan.SetRegisterKind (eRegisterKindGeneric);
-    row.SetCFARegister (fp_reg_num);
-    row.SetCFAOffset (2 * ptr_size);
-    row.SetOffset (0);
+    unwind_plan.Clear ();
+    unwind_plan.SetRegisterKind (eRegisterKindDWARF);
+    row->SetCFARegister (fp_reg_num);
+    row->SetCFAOffset (2 * ptr_size);
+    row->SetOffset (0);
     
-    row.SetRegisterLocationToAtCFAPlusOffset(fp_reg_num, ptr_size * -2, true);
-    row.SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, ptr_size * -1, true);
+    row->SetRegisterLocationToAtCFAPlusOffset(fp_reg_num, ptr_size * -2, true);
+    row->SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, ptr_size * -1, true);
     
     unwind_plan.AppendRow (row);
     unwind_plan.SetSourceName ("arm-apple-ios default unwind plan");
@@ -601,7 +579,7 @@
 {
     if (reg_info)
     {
-        // Volatile registers include: ebx, ebp, esi, edi, esp, eip
+        // Volatile registers include: r0, r1, r2, r3, r9, r12, r13
         const char *name = reg_info->name;
         if (name[0] == 'r')
         {

Modified: lldb/branches/lldb-platform-work/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp Mon Jul 23 19:12:48 2012
@@ -272,6 +272,8 @@
     // the actual register it pertains to is not important, just the size needs 
     // to be correct. Here we use "eax"...
     const RegisterInfo *reg_info_32 = reg_ctx->GetRegisterInfoByName("eax");
+    if (!reg_info_32)
+        return false; // TODO this should actually never happen
 
     // Make room for the argument(s) on the stack
 
@@ -806,10 +808,10 @@
         pc_reg_num == LLDB_INVALID_REGNUM)
         return false;
 
-    UnwindPlan::Row row;
-    row.SetCFARegister (sp_reg_num);
-    row.SetCFAOffset (4);
-    row.SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, -4, false);    
+    UnwindPlan::RowSP row(new UnwindPlan::Row);
+    row->SetCFARegister (sp_reg_num);
+    row->SetCFAOffset (4);
+    row->SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, -4, false);
     unwind_plan.AppendRow (row);
     unwind_plan.SetSourceName ("i386 at-func-entry default");
     return true;
@@ -818,54 +820,22 @@
 bool
 ABIMacOSX_i386::CreateDefaultUnwindPlan (UnwindPlan &unwind_plan)
 {
-    uint32_t reg_kind = unwind_plan.GetRegisterKind();
-    uint32_t fp_reg_num = LLDB_INVALID_REGNUM;
-    uint32_t sp_reg_num = LLDB_INVALID_REGNUM;
-    uint32_t pc_reg_num = LLDB_INVALID_REGNUM;
+    uint32_t fp_reg_num = dwarf_ebp;
+    uint32_t sp_reg_num = dwarf_esp;
+    uint32_t pc_reg_num = dwarf_eip;
     
-    switch (reg_kind)
-    {
-        case eRegisterKindDWARF:
-            fp_reg_num = dwarf_ebp;
-            sp_reg_num = dwarf_esp;
-            pc_reg_num = dwarf_eip;
-            break;
-            
-        case eRegisterKindGCC:
-            fp_reg_num = gcc_ebp;
-            sp_reg_num = gcc_esp;
-            pc_reg_num = gcc_eip;
-            break;
-            
-        case eRegisterKindGDB:
-            fp_reg_num = gdb_ebp;
-            sp_reg_num = gdb_esp;
-            pc_reg_num = gdb_eip;
-            break;
-            
-        case eRegisterKindGeneric:
-            fp_reg_num = LLDB_REGNUM_GENERIC_FP;
-            sp_reg_num = LLDB_REGNUM_GENERIC_SP;
-            pc_reg_num = LLDB_REGNUM_GENERIC_PC;
-            break;
-    }
-    
-    if (fp_reg_num == LLDB_INVALID_REGNUM ||
-        sp_reg_num == LLDB_INVALID_REGNUM ||
-        pc_reg_num == LLDB_INVALID_REGNUM)
-        return false;
-
-    UnwindPlan::Row row;    
+    UnwindPlan::RowSP row(new UnwindPlan::Row);
     const int32_t ptr_size = 4;
 
-    unwind_plan.SetRegisterKind (eRegisterKindGeneric);
-    row.SetCFARegister (fp_reg_num);
-    row.SetCFAOffset (2 * ptr_size);
-    row.SetOffset (0);
-    
-    row.SetRegisterLocationToAtCFAPlusOffset(fp_reg_num, ptr_size * -2, true);
-    row.SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, ptr_size * -1, true);
-    row.SetRegisterLocationToAtCFAPlusOffset(sp_reg_num, ptr_size *  0, true);
+    unwind_plan.Clear ();
+    unwind_plan.SetRegisterKind (eRegisterKindDWARF);
+    row->SetCFARegister (fp_reg_num);
+    row->SetCFAOffset (2 * ptr_size);
+    row->SetOffset (0);
+    
+    row->SetRegisterLocationToAtCFAPlusOffset(fp_reg_num, ptr_size * -2, true);
+    row->SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, ptr_size * -1, true);
+    row->SetRegisterLocationToAtCFAPlusOffset(sp_reg_num, ptr_size *  0, true);
 
     unwind_plan.AppendRow (row);
     unwind_plan.SetSourceName ("i386 default unwind plan");

Modified: lldb/branches/lldb-platform-work/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp Mon Jul 23 19:12:48 2012
@@ -985,10 +985,10 @@
         pc_reg_num == LLDB_INVALID_REGNUM)
         return false;
 
-    UnwindPlan::Row row;
-    row.SetCFARegister (sp_reg_num);
-    row.SetCFAOffset (8);
-    row.SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, -8, false);    
+    UnwindPlan::RowSP row(new UnwindPlan::Row);
+    row->SetCFARegister (sp_reg_num);
+    row->SetCFAOffset (8);
+    row->SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, -8, false);
     unwind_plan.AppendRow (row);
     unwind_plan.SetSourceName ("x86_64 at-func-entry default");
     return true;
@@ -1029,16 +1029,16 @@
         pc_reg_num == LLDB_INVALID_REGNUM)
         return false;
 
-    UnwindPlan::Row row;
+    UnwindPlan::RowSP row(new UnwindPlan::Row);
 
     const int32_t ptr_size = 8;
-    row.SetCFARegister (LLDB_REGNUM_GENERIC_FP);
-    row.SetCFAOffset (2 * ptr_size);
-    row.SetOffset (0);
+    row->SetCFARegister (LLDB_REGNUM_GENERIC_FP);
+    row->SetCFAOffset (2 * ptr_size);
+    row->SetOffset (0);
     
-    row.SetRegisterLocationToAtCFAPlusOffset(fp_reg_num, ptr_size * -2, true);
-    row.SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, ptr_size * -1, true);
-    row.SetRegisterLocationToAtCFAPlusOffset(sp_reg_num, ptr_size *  0, true);
+    row->SetRegisterLocationToAtCFAPlusOffset(fp_reg_num, ptr_size * -2, true);
+    row->SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, ptr_size * -1, true);
+    row->SetRegisterLocationToAtCFAPlusOffset(sp_reg_num, ptr_size *  0, true);
 
     unwind_plan.AppendRow (row);
     unwind_plan.SetSourceName ("x86_64 default unwind plan");

Modified: lldb/branches/lldb-platform-work/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp Mon Jul 23 19:12:48 2012
@@ -208,7 +208,6 @@
 
     if (!module_sp)
     {
-        bool uuid_is_valid = uuid.IsValid();
         if (uuid_is_valid)
         {
             ModuleList &target_images = target.GetImages();
@@ -252,13 +251,13 @@
                         uint32_t num_sections_loaded = 0;
                         for (sect_idx=0; sect_idx<num_ondisk_sections; ++sect_idx)
                         {
-                            const Section *ondisk_section = ondisk_section_list->GetSectionAtIndex(sect_idx).get();
-                            if (ondisk_section)
+                            SectionSP ondisk_section_sp(ondisk_section_list->GetSectionAtIndex(sect_idx));
+                            if (ondisk_section_sp)
                             {
-                                const Section *memory_section = memory_section_list->FindSectionByName(ondisk_section->GetName()).get();
+                                const Section *memory_section = memory_section_list->FindSectionByName(ondisk_section_sp->GetName()).get();
                                 if (memory_section)
                                 {
-                                    target.GetSectionLoadList().SetSectionLoadAddress (ondisk_section, memory_section->GetFileAddress());
+                                    target.GetSectionLoadList().SetSectionLoadAddress (ondisk_section_sp, memory_section->GetFileAddress());
                                     ++num_sections_loaded;
                                 }
                             }

Modified: lldb/branches/lldb-platform-work/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp Mon Jul 23 19:12:48 2012
@@ -390,15 +390,15 @@
                 uint32_t num_sections = section_list->GetSize();
                 for (uint32_t i=0; i<num_sections; ++i)
                 {
-                    Section* section = section_list->GetSectionAtIndex (i).get();
-                    if (section)
+                    SectionSP section_sp (section_list->GetSectionAtIndex (i));
+                    if (section_sp)
                     {
-                        const addr_t new_section_load_addr = section->GetFileAddress ();
-                        const addr_t old_section_load_addr = m_process->GetTarget().GetSectionLoadList().GetSectionLoadAddress (section);
+                        const addr_t new_section_load_addr = section_sp->GetFileAddress ();
+                        const addr_t old_section_load_addr = m_process->GetTarget().GetSectionLoadList().GetSectionLoadAddress (section_sp);
                         if (old_section_load_addr == LLDB_INVALID_ADDRESS ||
                             old_section_load_addr != new_section_load_addr)
                         {
-                            if (m_process->GetTarget().GetSectionLoadList().SetSectionLoadAddress (section, section->GetFileAddress ()))
+                            if (m_process->GetTarget().GetSectionLoadList().SetSectionLoadAddress (section_sp, section_sp->GetFileAddress ()))
                                 changed = true;
                         }
                     }
@@ -453,11 +453,11 @@
                             // "Section" objects, and "true" for all other sections.
                             const bool warn_multiple = section_sp->GetName() != g_section_name_LINKEDIT;
 
-                            const addr_t old_section_load_addr = m_process->GetTarget().GetSectionLoadList().GetSectionLoadAddress (section_sp.get());
+                            const addr_t old_section_load_addr = m_process->GetTarget().GetSectionLoadList().GetSectionLoadAddress (section_sp);
                             if (old_section_load_addr == LLDB_INVALID_ADDRESS ||
                                 old_section_load_addr != new_section_load_addr)
                             {
-                                if (m_process->GetTarget().GetSectionLoadList().SetSectionLoadAddress (section_sp.get(), new_section_load_addr, warn_multiple))
+                                if (m_process->GetTarget().GetSectionLoadList().SetSectionLoadAddress (section_sp, new_section_load_addr, warn_multiple))
                                     changed = true;
                             }
                         }
@@ -530,7 +530,7 @@
                     if (section_sp)
                     {
                         const addr_t old_section_load_addr = info.segments[i].vmaddr + info.slide;
-                        if (m_process->GetTarget().GetSectionLoadList().SetSectionUnloaded (section_sp.get(), old_section_load_addr))
+                        if (m_process->GetTarget().GetSectionLoadList().SetSectionUnloaded (section_sp, old_section_load_addr))
                             changed = true;
                     }
                     else

Modified: lldb/branches/lldb-platform-work/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp Mon Jul 23 19:12:48 2012
@@ -172,9 +172,9 @@
 
     for (unsigned i = 0; i < num_sections; ++i)
     {
-        Section *section = sections->GetSectionAtIndex(i).get();
-        lldb::addr_t new_load_addr = section->GetFileAddress() + base_addr;
-        lldb::addr_t old_load_addr = load_list.GetSectionLoadAddress(section);
+        SectionSP section_sp (sections->GetSectionAtIndex(i));
+        lldb::addr_t new_load_addr = section_sp->GetFileAddress() + base_addr;
+        lldb::addr_t old_load_addr = load_list.GetSectionLoadAddress(section_sp);
 
         // If the file address of the section is zero then this is not an
         // allocatable/loadable section (property of ELF sh_addr).  Skip it.
@@ -183,7 +183,7 @@
 
         if (old_load_addr == LLDB_INVALID_ADDRESS ||
             old_load_addr != new_load_addr)
-            load_list.SetSectionLoadAddress(section, new_load_addr);
+            load_list.SetSectionLoadAddress(section_sp, new_load_addr);
     }
 }
 

Modified: lldb/branches/lldb-platform-work/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp Mon Jul 23 19:12:48 2012
@@ -126,10 +126,10 @@
                         // Iterate through the object file sections to find the
                         // first section that starts of file offset zero and that
                         // has bytes in the file...
-                        Section *section = section_list->GetSectionAtIndex (sect_idx).get();
-                        if (section)
+                        SectionSP section_sp (section_list->GetSectionAtIndex (sect_idx));
+                        if (section_sp)
                         {
-                            if (m_process->GetTarget().GetSectionLoadList().SetSectionLoadAddress (section, section->GetFileAddress()))
+                            if (m_process->GetTarget().GetSectionLoadList().SetSectionLoadAddress (section_sp, section_sp->GetFileAddress()))
                                 changed = true;
                         }
                     }

Modified: lldb/branches/lldb-platform-work/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp Mon Jul 23 19:12:48 2012
@@ -564,7 +564,7 @@
             // In ARMv5T and above, this is an interworking branch.
             if (!LoadWritePC(context, data))
                 return false;
-            addr += addr_byte_size;
+            //addr += addr_byte_size;
         }
         
         context.type = EmulateInstruction::eContextAdjustStackPointer;
@@ -1295,13 +1295,12 @@
             return false;
         uint32_t imm32; // the immediate operand
         uint32_t d;
-        bool setflags;
+        //bool setflags = false; // Add this back if/when support eEncodingT3 eEncodingA1
         switch (encoding) 
         {
             case eEncodingT1:
                 // d = UInt(Rd); setflags = FALSE; imm32 = ZeroExtend(imm8:'00', 32);
                 d = Bits32 (opcode, 10, 8);
-                setflags = false;
                 imm32 = (Bits32 (opcode, 7, 0) << 2);
                   
                 break;
@@ -1309,7 +1308,6 @@
             case eEncodingT2:
                 // d = 13; setflags = FALSE; imm32 = ZeroExtend(imm7:'00', 32);
                 d = 13;
-                setflags = false;
                 imm32 = ThumbImm7Scaled(opcode); // imm32 = ZeroExtend(imm7:'00', 32)
                   
                 break;
@@ -1335,6 +1333,15 @@
         {
             if (!WriteRegisterUnsigned (context, eRegisterKindDWARF, dwarf_r0 + d, addr))
                 return false;
+            
+            // Add this back if/when support eEncodingT3 eEncodingA1
+            //if (setflags)
+            //{
+            //    APSR.N = result<31>;
+            //    APSR.Z = IsZeroBit(result);
+            //    APSR.C = carry;
+            //    APSR.V = overflow;
+            //}
         }
     }
     return true;
@@ -5395,6 +5402,7 @@
         case eEncodingT1:
             Rd = Bits32(opcode, 10, 8);
             imm32 = ThumbImm8Scaled(opcode); // imm32 = ZeroExtend(imm8:'00', 32)
+            add = true;
             break;
         case eEncodingT2:
         case eEncodingT3:
@@ -11505,6 +11513,10 @@
                     else
                         alignment = 4;
                 }
+                else
+                {
+                    return false;
+                }
                 // d = UInt(D:Vd); n = UInt(Rn); m = UInt(Rm);
                 d = (Bit32 (opcode, 22) << 4) | Bits32 (opcode, 15, 12);
                 n = Bits32 (opcode, 19, 16);
@@ -11841,6 +11853,10 @@
                     else
                         alignment = 4;
                 }
+                else
+                {
+                    return false;
+                }
                 // d = UInt(D:Vd); n = UInt(Rn); m = UInt(Rm);
                 d = (Bit32 (opcode, 22) << 4) | Bits32 (opcode, 15, 12);
                 n = Bits32 (opcode, 19, 16);
@@ -13583,13 +13599,13 @@
     unwind_plan.Clear();
     unwind_plan.SetRegisterKind (eRegisterKindDWARF);
 
-    UnwindPlan::Row row;
+    UnwindPlan::RowSP row(new UnwindPlan::Row);
 
     // Our previous Call Frame Address is the stack pointer
-    row.SetCFARegister (dwarf_sp);
+    row->SetCFARegister (dwarf_sp);
     
     // Our previous PC is in the LR
-    row.SetRegisterLocationToRegister(dwarf_pc, dwarf_lr, true);
+    row->SetRegisterLocationToRegister(dwarf_pc, dwarf_lr, true);
     unwind_plan.AppendRow (row);
 
     // All other registers are the same.

Modified: lldb/branches/lldb-platform-work/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp Mon Jul 23 19:12:48 2012
@@ -119,11 +119,29 @@
                         const bool exact_match = true;
                         TypeList class_types;
                         
-                        uint32_t num_matches = target->GetImages().FindTypes (sc,
-                                                                              ConstString(class_name),
-                                                                              exact_match,
-                                                                              UINT32_MAX,
-                                                                              class_types);
+                        uint32_t num_matches = 0;
+                        // First look in the module that the vtable symbol came from
+                        // and look for a single exact match.
+                        if (sc.module_sp)
+                        {
+                            num_matches = sc.module_sp->FindTypes (sc,
+                                                                   ConstString(class_name),
+                                                                   exact_match,
+                                                                   1,
+                                                                   class_types);
+                        }
+                        
+                        // If we didn't find a symbol, then move on to the entire
+                        // module list in the target and get as many unique matches
+                        // as possible
+                        if (num_matches == 0)
+                        {
+                            num_matches = target->GetImages().FindTypes (sc,
+                                                                         ConstString(class_name),
+                                                                         exact_match,
+                                                                         UINT32_MAX,
+                                                                         class_types);
+                        }
                         
                         lldb::TypeSP type_sp;
                         if (num_matches == 0)

Modified: lldb/branches/lldb-platform-work/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp Mon Jul 23 19:12:48 2012
@@ -142,7 +142,7 @@
                                                      &wrapper_struct_addr, 
                                                      error_stream, 
                                                      stop_others, 
-                                                     100000, 
+                                                     0 /* no timeout */,
                                                      try_all_threads, 
                                                      unwind_on_error, 
                                                      ret);

Modified: lldb/branches/lldb-platform-work/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp Mon Jul 23 19:12:48 2012
@@ -877,14 +877,11 @@
     DataExtractor dynsym_data;
     if (ReadSectionData(dynsym, dynsym_data))
     {
-
         const unsigned section_size = dynsym_data.GetByteSize();
-        unsigned offset = 0;
         unsigned cursor = 0;
 
         while (cursor < section_size)
         {
-            offset = cursor;
             if (!symbol.Parse(dynsym_data, &cursor))
                 break;
 

Modified: lldb/branches/lldb-platform-work/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Mon Jul 23 19:12:48 2012
@@ -1801,7 +1801,7 @@
                                                                 {
                                                                     // We have two consecutive N_SO entries where the first contains a directory
                                                                     // and the second contains a full path.
-                                                                    sym[sym_idx - 1].GetMangled().SetValue(symbol_name, false);
+                                                                    sym[sym_idx - 1].GetMangled().SetValue(ConstString(symbol_name), false);
                                                                     m_nlist_idx_to_sym_idx[nlist_idx] = sym_idx - 1;
                                                                     add_nlist = false;
                                                                 }
@@ -1823,7 +1823,7 @@
                                                                     if (*full_so_path.rbegin() != '/')
                                                                         full_so_path += '/';
                                                                     full_so_path += symbol_name;
-                                                                    sym[sym_idx - 1].GetMangled().SetValue(full_so_path.c_str(), false);
+                                                                    sym[sym_idx - 1].GetMangled().SetValue(ConstString(full_so_path.c_str()), false);
                                                                     add_nlist = false;
                                                                     m_nlist_idx_to_sym_idx[nlist_idx] = sym_idx - 1;
                                                                 }
@@ -2127,8 +2127,8 @@
                                                 
                                                 if (symbol_name_non_abi_mangled)
                                                 {
-                                                    sym[sym_idx].GetMangled().SetMangledName (symbol_name_non_abi_mangled);
-                                                    sym[sym_idx].GetMangled().SetDemangledName (symbol_name);
+                                                    sym[sym_idx].GetMangled().SetMangledName (ConstString(symbol_name_non_abi_mangled));
+                                                    sym[sym_idx].GetMangled().SetDemangledName (ConstString(symbol_name));
                                                 }
                                                 else
                                                 {
@@ -2140,7 +2140,7 @@
                                                     
                                                     if (symbol_name)
                                                     {
-                                                        sym[sym_idx].GetMangled().SetValue(symbol_name, symbol_name_is_mangled);
+                                                        sym[sym_idx].GetMangled().SetValue(ConstString(symbol_name), symbol_name_is_mangled);
                                                     }
                                                 }
                                                 
@@ -2520,7 +2520,7 @@
                             {
                                 // We have two consecutive N_SO entries where the first contains a directory
                                 // and the second contains a full path.
-                                sym[sym_idx - 1].GetMangled().SetValue(symbol_name, false);
+                                sym[sym_idx - 1].GetMangled().SetValue(ConstString(symbol_name), false);
                                 m_nlist_idx_to_sym_idx[nlist_idx] = sym_idx - 1;
                                 add_nlist = false;
                             }
@@ -2542,7 +2542,7 @@
                                 if (*full_so_path.rbegin() != '/')
                                     full_so_path += '/';
                                 full_so_path += symbol_name;
-                                sym[sym_idx - 1].GetMangled().SetValue(full_so_path.c_str(), false);
+                                sym[sym_idx - 1].GetMangled().SetValue(ConstString(full_so_path.c_str()), false);
                                 add_nlist = false;
                                 m_nlist_idx_to_sym_idx[nlist_idx] = sym_idx - 1;
                             }
@@ -2846,8 +2846,8 @@
 
                 if (symbol_name_non_abi_mangled)
                 {
-                    sym[sym_idx].GetMangled().SetMangledName (symbol_name_non_abi_mangled);
-                    sym[sym_idx].GetMangled().SetDemangledName (symbol_name);
+                    sym[sym_idx].GetMangled().SetMangledName (ConstString(symbol_name_non_abi_mangled));
+                    sym[sym_idx].GetMangled().SetDemangledName (ConstString(symbol_name));
                 }
                 else
                 {
@@ -2859,7 +2859,7 @@
 
                     if (symbol_name)
                     {
-                        sym[sym_idx].GetMangled().SetValue(symbol_name, symbol_name_is_mangled);
+                        sym[sym_idx].GetMangled().SetValue(ConstString(symbol_name), symbol_name_is_mangled);
                     }
                 }
 
@@ -2933,13 +2933,8 @@
                             func_start_entry->data = true;
                             
                             addr_t symbol_file_addr = func_start_entry->addr;
-                            uint32_t symbol_flags = 0;
                             if (is_arm)
-                            {
-                                if (symbol_file_addr & 1)
-                                    symbol_flags = MACHO_NLIST_ARM_SYMBOL_IS_THUMB;
                                 symbol_file_addr &= 0xfffffffffffffffeull;
-                            }
 
                             const FunctionStarts::Entry *next_func_start_entry = function_starts.FindNextEntry (func_start_entry);
                             const addr_t section_end_file_addr = section_file_addr + symbol_section->GetByteSize();
@@ -3070,7 +3065,7 @@
                                           ++synthetic_function_symbol_idx,
                                           module_sp->GetFileSpec().GetFilename().GetCString());
                                 sym[sym_idx].SetID (synthetic_sym_id++);
-                                sym[sym_idx].GetMangled().SetDemangledName(synthetic_function_symbol);
+                                sym[sym_idx].GetMangled().SetDemangledName(ConstString(synthetic_function_symbol));
                                 sym[sym_idx].SetType (eSymbolTypeCode);
                                 sym[sym_idx].SetIsSynthetic (true);
                                 sym[sym_idx].GetAddress() = symbol_addr;
@@ -3236,8 +3231,21 @@
             if (load_cmd.cmd == LoadCommandUUID)
             {
                 const uint8_t *uuid_bytes = m_data.PeekData(offset, 16);
+                
                 if (uuid_bytes)
                 {
+                    // OpenCL on Mac OS X uses the same UUID for each of its object files.
+                    // We pretend these object files have no UUID to prevent crashing.
+                    
+                    const uint8_t opencl_uuid[] = { 0x8c, 0x8e, 0xb3, 0x9b,
+                                                    0x3b, 0xa8,
+                                                    0x4b, 0x16,
+                                                    0xb6, 0xa4,
+                                                    0x27, 0x63, 0xbb, 0x14, 0xf0, 0x0d };
+                    
+                    if (!memcmp(uuid_bytes, opencl_uuid, 16))
+                        return false;
+                    
                     uuid->SetBytes (uuid_bytes);
                     return true;
                 }

Modified: lldb/branches/lldb-platform-work/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp Mon Jul 23 19:12:48 2012
@@ -544,7 +544,7 @@
                     symbol.storage  = symtab_data.GetU8  (&offset);
                     symbol.naux     = symtab_data.GetU8  (&offset);		
                     Address symbol_addr(sect_list->GetSectionAtIndex(symbol.sect-1), symbol.value);
-                    symbols[i].GetMangled ().SetValue (symbol_name.c_str(), symbol_name[0]=='_' && symbol_name[1] == 'Z');
+                    symbols[i].GetMangled ().SetValue (ConstString(symbol_name.c_str()));
                     symbols[i].GetAddress() = symbol_addr;
 
                     if (symbol.naux > 0)

Modified: lldb/branches/lldb-platform-work/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp Mon Jul 23 19:12:48 2012
@@ -99,6 +99,7 @@
                 {
                     case llvm::Triple::Apple:
                         create = true;
+                        break;
 
                     case llvm::Triple::UnknownArch:
                         create = !arch->TripleVendorWasSpecified();

Modified: lldb/branches/lldb-platform-work/source/Plugins/Process/Utility/ARMUtils.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/Process/Utility/ARMUtils.h?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/Process/Utility/ARMUtils.h (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/Process/Utility/ARMUtils.h Mon Jul 23 19:12:48 2012
@@ -25,10 +25,10 @@
 
 static inline uint32_t DecodeImmShift(const uint32_t type, const uint32_t imm5, ARM_ShifterType &shift_t)
 {
-    switch (type) {
+    switch (type)
+    {
     default:
         //assert(0 && "Invalid shift type");
-        return UINT32_MAX;
     case 0:
         shift_t = SRType_LSL;
         return imm5;
@@ -50,6 +50,9 @@
             return imm5;
         }
     }
+    shift_t = SRType_Invalid;
+    return UINT32_MAX;
+
 }
 
 // A8.6.35 CMP (register) -- Encoding T3
@@ -322,6 +325,7 @@
     if (bits(imm12, 11, 10) == 0)
     {
         switch (bits(imm12, 9, 8)) {
+        default: // Keep static analyzer happy with a default case
         case 0:
             imm32 = abcdefgh;
             break;

Modified: lldb/branches/lldb-platform-work/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/Process/Utility/RegisterContextLLDB.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/Process/Utility/RegisterContextLLDB.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/Process/Utility/RegisterContextLLDB.cpp Mon Jul 23 19:12:48 2012
@@ -182,14 +182,14 @@
     m_fast_unwind_plan_sp = GetFastUnwindPlanForFrame ();
     m_full_unwind_plan_sp = GetFullUnwindPlanForFrame (); 
     
-    const UnwindPlan::Row *active_row = NULL;
+    UnwindPlan::RowSP active_row;
     int cfa_offset = 0;
-    int row_register_kind;
+    int row_register_kind = -1;
     if (m_full_unwind_plan_sp && m_full_unwind_plan_sp->PlanValidAtAddress (m_current_pc))
     {
         active_row = m_full_unwind_plan_sp->GetRowForFunctionOffset (m_current_offset);
         row_register_kind = m_full_unwind_plan_sp->GetRegisterKind ();
-        if (active_row && log)
+        if (active_row.get() && log)
         {
             StreamString active_row_strm;
             active_row->Dump(active_row_strm, m_full_unwind_plan_sp.get(), &m_thread, m_start_pc.GetLoadAddress(exe_ctx.GetTargetPtr()));
@@ -198,7 +198,7 @@
         }
     }
 
-    if (active_row == NULL)
+    if (!active_row.get())
     {
         m_frame_type = eNotAValidFrame;
         return;
@@ -356,8 +356,8 @@
             m_current_offset_backed_up_one = -1;
             addr_t cfa_regval;
             int row_register_kind = m_full_unwind_plan_sp->GetRegisterKind ();
-            const UnwindPlan::Row *row = m_full_unwind_plan_sp->GetRowForFunctionOffset(0);
-            if (row)
+            UnwindPlan::RowSP row = m_full_unwind_plan_sp->GetRowForFunctionOffset(0);
+            if (row.get())
             {
                 uint32_t cfa_regnum = row->GetCFARegister();
                 int cfa_offset = row->GetCFAOffset();
@@ -505,9 +505,9 @@
     // We've set m_frame_type and m_sym_ctx before this call.
     m_fast_unwind_plan_sp = GetFastUnwindPlanForFrame ();
 
-    const UnwindPlan::Row *active_row = NULL;
+    UnwindPlan::RowSP active_row;
     int cfa_offset = 0;
-    int row_register_kind;
+    int row_register_kind = -1;
 
     // Try to get by with just the fast UnwindPlan if possible - the full UnwindPlan may be expensive to get
     // (e.g. if we have to parse the entire eh_frame section of an ObjectFile for the first time.)
@@ -516,7 +516,7 @@
     {
         active_row = m_fast_unwind_plan_sp->GetRowForFunctionOffset (m_current_offset);
         row_register_kind = m_fast_unwind_plan_sp->GetRegisterKind ();
-        if (active_row && log)
+        if (active_row.get() && log)
         {
             StreamString active_row_strm;
             active_row->Dump(active_row_strm, m_fast_unwind_plan_sp.get(), &m_thread, m_start_pc.GetLoadAddress(exe_ctx.GetTargetPtr()));
@@ -531,7 +531,7 @@
         {
             active_row = m_full_unwind_plan_sp->GetRowForFunctionOffset (m_current_offset);
             row_register_kind = m_full_unwind_plan_sp->GetRegisterKind ();
-            if (active_row && log)
+            if (active_row.get() && log)
             {
                 StreamString active_row_strm;
                 active_row->Dump(active_row_strm, m_full_unwind_plan_sp.get(), &m_thread, m_start_pc.GetLoadAddress(exe_ctx.GetTargetPtr()));
@@ -541,7 +541,7 @@
         }
     }
 
-    if (active_row == NULL)
+    if (!active_row.get())
     {
         m_frame_type = eNotAValidFrame;
         return;
@@ -670,8 +670,8 @@
                 const char *has_fast = "";
                 if (m_fast_unwind_plan_sp)
                     has_fast = ", and has a fast UnwindPlan";
-                log->Printf("%*sFrame %u frame has a fast UnwindPlan",
-                            m_frame_number < 100 ? m_frame_number : 100, "", m_frame_number);
+                log->Printf("%*sFrame %u frame%s",
+                            m_frame_number < 100 ? m_frame_number : 100, "", m_frame_number, has_fast);
             }
             m_frame_type = eNormalFrame;
             return unwind_plan_sp;
@@ -1038,7 +1038,7 @@
 
     if (m_fast_unwind_plan_sp)
     {
-        const UnwindPlan::Row *active_row = m_fast_unwind_plan_sp->GetRowForFunctionOffset (m_current_offset);
+        UnwindPlan::RowSP active_row = m_fast_unwind_plan_sp->GetRowForFunctionOffset (m_current_offset);
         unwindplan_registerkind = m_fast_unwind_plan_sp->GetRegisterKind ();
         uint32_t row_regnum;
         if (!m_thread.GetRegisterContext()->ConvertBetweenRegisterKinds (eRegisterKindLLDB, lldb_regnum, unwindplan_registerkind, row_regnum))
@@ -1071,7 +1071,7 @@
 
         if (m_full_unwind_plan_sp)
         {
-            const UnwindPlan::Row *active_row = m_full_unwind_plan_sp->GetRowForFunctionOffset (m_current_offset);
+            UnwindPlan::RowSP active_row = m_full_unwind_plan_sp->GetRowForFunctionOffset (m_current_offset);
             unwindplan_registerkind = m_full_unwind_plan_sp->GetRegisterKind ();
             uint32_t row_regnum;
             if (!m_thread.GetRegisterContext()->ConvertBetweenRegisterKinds (eRegisterKindLLDB, lldb_regnum, unwindplan_registerkind, row_regnum))

Modified: lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp Mon Jul 23 19:12:48 2012
@@ -50,6 +50,8 @@
     m_supports_alloc_dealloc_memory (eLazyBoolCalculate),
     m_supports_memory_region_info  (eLazyBoolCalculate),
     m_supports_watchpoint_support_info  (eLazyBoolCalculate),
+    m_watchpoints_trigger_after_instruction(eLazyBoolCalculate),
+    m_attach_or_wait_reply(eLazyBoolCalculate),
     m_supports_qProcessInfoPID (true),
     m_supports_qfProcessInfo (true),
     m_supports_qUserName (true),
@@ -133,6 +135,26 @@
     }
 }
 
+bool
+GDBRemoteCommunicationClient::GetVAttachOrWaitSupported ()
+{
+    if (m_attach_or_wait_reply == eLazyBoolCalculate)
+    {
+        m_attach_or_wait_reply = eLazyBoolNo;
+        
+        StringExtractorGDBRemote response;
+        if (SendPacketAndWaitForResponse("qVAttachOrWaitSupported", response, false))
+        {
+            if (response.IsOKResponse())
+                m_attach_or_wait_reply = eLazyBoolYes;
+        }
+    }
+    if (m_attach_or_wait_reply == eLazyBoolYes)
+        return true;
+    else
+        return false;
+}
+
 
 void
 GDBRemoteCommunicationClient::ResetDiscoverableSettings()
@@ -382,6 +404,7 @@
     StringExtractorGDBRemote &response
 )
 {
+    m_curr_tid = LLDB_INVALID_THREAD_ID;
     LogSP log (ProcessGDBRemoteLog::GetLogIfAllCategoriesSet (GDBR_LOG_PROCESS));
     if (log)
         log->Printf ("GDBRemoteCommunicationClient::%s ()", __FUNCTION__);
@@ -1019,6 +1042,17 @@
                         if (m_os_version_major != UINT32_MAX)
                             ++num_keys_decoded;
                     }
+                    else if (name.compare("watchpoint_exceptions_received") == 0)
+                    {
+                        ++num_keys_decoded;
+                        if (strcmp(value.c_str(),"before") == 0)
+                            m_watchpoints_trigger_after_instruction = eLazyBoolNo;
+                        else if (strcmp(value.c_str(),"after") == 0)
+                            m_watchpoints_trigger_after_instruction = eLazyBoolYes;
+                        else
+                            --num_keys_decoded;
+                    }
+
                 }
                 
                 if (num_keys_decoded > 0)
@@ -1352,6 +1386,30 @@
 
 }
 
+lldb_private::Error
+GDBRemoteCommunicationClient::GetWatchpointSupportInfo (uint32_t &num, bool& after)
+{
+    Error error(GetWatchpointSupportInfo(num));
+    if (error.Success())
+        error = GetWatchpointsTriggerAfterInstruction(after);
+    return error;
+}
+
+lldb_private::Error
+GDBRemoteCommunicationClient::GetWatchpointsTriggerAfterInstruction (bool &after)
+{
+    Error error;
+    
+    // we assume watchpoints will happen after running the relevant opcode
+    // and we only want to override this behavior if we have explicitly
+    // received a qHostInfo telling us otherwise
+    if (m_qHostInfo_is_valid != eLazyBoolYes)
+        after = true;
+    else
+        after = (m_watchpoints_trigger_after_instruction != eLazyBoolNo);
+    return error;
+}
+
 int
 GDBRemoteCommunicationClient::SetSTDIN (char const *path)
 {
@@ -1788,13 +1846,13 @@
         std::string name;
         std::string value;
         uint16_t port = 0;
-        lldb::pid_t pid = LLDB_INVALID_PROCESS_ID;
+        //lldb::pid_t pid = LLDB_INVALID_PROCESS_ID;
         while (response.GetNameColonValue(name, value))
         {
             if (name.size() == 4 && name.compare("port") == 0)
                 port = Args::StringToUInt32(value.c_str(), 0, 0);
-            if (name.size() == 3 && name.compare("pid") == 0)
-                pid = Args::StringToUInt32(value.c_str(), LLDB_INVALID_PROCESS_ID, 0);
+//            if (name.size() == 3 && name.compare("pid") == 0)
+//                pid = Args::StringToUInt32(value.c_str(), LLDB_INVALID_PROCESS_ID, 0);
         }
         return port;
     }

Modified: lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h Mon Jul 23 19:12:48 2012
@@ -209,12 +209,21 @@
     lldb_private::Error
     GetWatchpointSupportInfo (uint32_t &num); 
 
+    lldb_private::Error
+    GetWatchpointSupportInfo (uint32_t &num, bool& after);
+    
+    lldb_private::Error
+    GetWatchpointsTriggerAfterInstruction (bool &after);
+
     const lldb_private::ArchSpec &
     GetHostArchitecture ();
     
     bool
     GetVContSupported (char flavor);
 
+    bool
+    GetVAttachOrWaitSupported ();
+    
     void
     ResetDiscoverableSettings();
 
@@ -398,7 +407,9 @@
     lldb_private::LazyBool m_supports_alloc_dealloc_memory;
     lldb_private::LazyBool m_supports_memory_region_info;
     lldb_private::LazyBool m_supports_watchpoint_support_info;
-
+    lldb_private::LazyBool m_watchpoints_trigger_after_instruction;
+    lldb_private::LazyBool m_attach_or_wait_reply;
+    
     bool
         m_supports_qProcessInfoPID:1,
         m_supports_qfProcessInfo:1,

Modified: lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp Mon Jul 23 19:12:48 2012
@@ -276,6 +276,11 @@
     if (sub != LLDB_INVALID_CPUTYPE)
         response.Printf ("cpusubtype:%u;", sub);
     
+    if (cpu == ArchSpec::kCore_arm_any)
+        response.Printf("watchpoint_exceptions_received:before;");   // On armv7 we use "synchronous" watchpoints which means the exception is delivered before the instruction executes.
+    else
+        response.Printf("watchpoint_exceptions_received:after;");
+    
     switch (lldb::endian::InlHostByteOrder())
     {
     case eByteOrderBig:     response.PutCString ("endian:big;"); break;

Modified: lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Mon Jul 23 19:12:48 2012
@@ -11,6 +11,7 @@
 #include <errno.h>
 #include <spawn.h>
 #include <stdlib.h>
+#include <netinet/in.h>
 #include <sys/mman.h>       // for mmap
 #include <sys/stat.h>
 #include <sys/types.h>
@@ -47,6 +48,7 @@
 // Project includes
 #include "lldb/Host/Host.h"
 #include "Plugins/Process/Utility/InferiorCallPOSIX.h"
+#include "Plugins/Platform/MacOSX/PlatformRemoteiOS.h"
 #include "Utility/StringExtractorGDBRemote.h"
 #include "GDBRemoteRegisterContext.h"
 #include "ProcessGDBRemote.h"
@@ -79,6 +81,18 @@
 
 static bool rand_initialized = false;
 
+// TODO Randomly assigning a port is unsafe.  We should get an unused
+// ephemeral port from the kernel and make sure we reserve it before passing
+// it to debugserver.
+
+#if defined (__APPLE__)
+#define LOW_PORT    (IPPORT_RESERVED)
+#define HIGH_PORT   (IPPORT_HIFIRSTAUTO)
+#else
+#define LOW_PORT    (1024u)
+#define HIGH_PORT   (49151u)
+#endif
+
 static inline uint16_t
 get_random_port ()
 {
@@ -89,7 +103,7 @@
         rand_initialized = true;
         srand(seed);
     }
-    return (rand() % (UINT16_MAX - 1000u)) + 1000u;
+    return (rand() % (HIGH_PORT - LOW_PORT)) + LOW_PORT;
 }
 
 
@@ -175,7 +189,8 @@
     m_max_memory_size (512),
     m_addr_to_mmap_size (),
     m_thread_create_bp_sp (),
-    m_waiting_for_attach (false)
+    m_waiting_for_attach (false),
+    m_destroy_tried_resuming (false)
 {
     m_async_broadcaster.SetEventName (eBroadcastBitAsyncThreadShouldExit,   "async thread should exit");
     m_async_broadcaster.SetEventName (eBroadcastBitAsyncContinue,           "async thread continue");
@@ -227,8 +242,7 @@
     m_register_info.Clear();
     uint32_t reg_offset = 0;
     uint32_t reg_num = 0;
-    StringExtractorGDBRemote::ResponseType response_type;
-    for (response_type = StringExtractorGDBRemote::eResponse; 
+    for (StringExtractorGDBRemote::ResponseType response_type = StringExtractorGDBRemote::eResponse;
          response_type == StringExtractorGDBRemote::eResponse; 
          ++reg_num)
     {
@@ -374,7 +388,6 @@
         }
         else
         {
-            response_type = StringExtractorGDBRemote::eError;
             break;
         }
     }
@@ -729,6 +742,15 @@
     m_gdb_comm.GetListThreadsInStopReplySupported ();
     m_gdb_comm.GetHostInfo ();
     m_gdb_comm.GetVContSupported ('c');
+    m_gdb_comm.GetVAttachOrWaitSupported();
+    
+    size_t num_cmds = GetExtraStartupCommands().GetArgumentCount();
+    for (size_t idx = 0; idx < num_cmds; idx++)
+    {
+        StringExtractorGDBRemote response;
+        printf ("Sending command: \%s.\n", GetExtraStartupCommands().GetArgumentAtIndex(idx));
+        m_gdb_comm.SendPacketAndWaitForResponse (GetExtraStartupCommands().GetArgumentAtIndex(idx), response, false);
+    }
     return error;
 }
 
@@ -908,7 +930,19 @@
             StreamString packet;
             
             if (wait_for_launch)
-                packet.PutCString("vAttachWait");
+            {
+                if (!m_gdb_comm.GetVAttachOrWaitSupported())
+                {
+                    packet.PutCString ("vAttachWait");
+                }
+                else
+                {
+                    if (attach_info.GetIgnoreExisting())
+                        packet.PutCString("vAttachWait");
+                    else
+                        packet.PutCString ("vAttachOrWait");
+                }
+            }
             else
                 packet.PutCString("vAttachName");
             packet.PutChar(';');
@@ -1261,7 +1295,6 @@
             uint32_t exc_type = 0;
             std::vector<addr_t> exc_data;
             addr_t thread_dispatch_qaddr = LLDB_INVALID_ADDRESS;
-            uint32_t exc_data_count = 0;
             ThreadSP thread_sp;
 
             while (stop_packet.GetNameColonValue(name, value))
@@ -1271,11 +1304,6 @@
                     // exception type in big endian hex
                     exc_type = Args::StringToUInt32 (value.c_str(), 0, 16);
                 }
-                else if (name.compare("mecount") == 0)
-                {
-                    // exception count in big endian hex
-                    exc_data_count = Args::StringToUInt32 (value.c_str(), 0, 16);
-                }
                 else if (name.compare("medata") == 0)
                 {
                     // exception data in big endian hex
@@ -1413,17 +1441,18 @@
                                 // If the breakpoint is for this thread, then we'll report the hit, but if it is for another thread,
                                 // we can just report no reason.  We don't need to worry about stepping over the breakpoint here, that
                                 // will be taken care of when the thread resumes and notices that there's a breakpoint under the pc.
+                                handled = true;
                                 if (bp_site_sp->ValidForThisThread (gdb_thread))
                                 {
                                     gdb_thread->SetStopInfo (StopInfo::CreateStopReasonWithBreakpointSiteID (*thread_sp, bp_site_sp->GetID()));
-                                    handled = true;
+                                }
+                                else
+                                {
+                                    StopInfoSP invalid_stop_info_sp;
+                                    gdb_thread->SetStopInfo (invalid_stop_info_sp);
                                 }
                             }
                             
-                            if (!handled)
-                            {
-                                gdb_thread->SetStopInfo (StopInfo::CreateStopReasonToTrace (*thread_sp));
-                            }
                         }
                         else if (reason.compare("trap") == 0)
                         {
@@ -1449,8 +1478,10 @@
                         {
                             // Currently we are going to assume SIGTRAP means we are either
                             // hitting a breakpoint or hardware single stepping. 
+                            handled = true;
                             addr_t pc = gdb_thread->GetRegisterContext()->GetPC();
                             lldb::BreakpointSiteSP bp_site_sp = gdb_thread->GetProcess()->GetBreakpointSiteList().FindByAddress(pc);
+                            
                             if (bp_site_sp)
                             {
                                 // If the breakpoint is for this thread, then we'll report the hit, but if it is for another thread,
@@ -1459,15 +1490,18 @@
                                 if (bp_site_sp->ValidForThisThread (gdb_thread))
                                 {
                                     gdb_thread->SetStopInfo (StopInfo::CreateStopReasonWithBreakpointSiteID (*thread_sp, bp_site_sp->GetID()));
-                                    handled = true;
+                                }
+                                else
+                                {
+                                    StopInfoSP invalid_stop_info_sp;
+                                    gdb_thread->SetStopInfo (invalid_stop_info_sp);
                                 }
                             }
-                            if (!handled)
+                            else
                             {
                                 // TODO: check for breakpoint or trap opcode in case there is a hard 
                                 // coded software trap
                                 gdb_thread->SetStopInfo (StopInfo::CreateStopReasonToTrace (*thread_sp));
-                                handled = true;
                             }
                         }
                         if (!handled)
@@ -1681,6 +1715,7 @@
     return error;
 }
 
+
 Error
 ProcessGDBRemote::DoDestroy ()
 {
@@ -1689,6 +1724,110 @@
     if (log)
         log->Printf ("ProcessGDBRemote::DoDestroy()");
 
+    // There is a bug in older iOS debugservers where they don't shut down the process
+    // they are debugging properly.  If the process is sitting at a breakpoint or an exception,
+    // this can cause problems with restarting.  So we check to see if any of our threads are stopped
+    // at a breakpoint, and if so we remove all the breakpoints, resume the process, and THEN
+    // destroy it again.
+    //
+    // Note, we don't have a good way to test the version of debugserver, but I happen to know that
+    // the set of all the iOS debugservers which don't support GetThreadSuffixSupported() and that of
+    // the debugservers with this bug are equal.  There really should be a better way to test this!
+    //
+    // We also use m_destroy_tried_resuming to make sure we only do this once, if we resume and then halt and
+    // get called here to destroy again and we're still at a breakpoint or exception, then we should
+    // just do the straight-forward kill.
+    //
+    // And of course, if we weren't able to stop the process by the time we get here, it isn't
+    // necessary (or helpful) to do any of this.
+
+    if (!m_gdb_comm.GetThreadSuffixSupported() && m_public_state.GetValue() != eStateRunning)
+    {
+        PlatformSP platform_sp = GetTarget().GetPlatform();
+        
+        // FIXME: These should be ConstStrings so we aren't doing strcmp'ing.
+        if (platform_sp
+            && platform_sp->GetName()
+            && strcmp (platform_sp->GetName(), PlatformRemoteiOS::GetShortPluginNameStatic()) == 0)
+        {
+            if (m_destroy_tried_resuming)
+            {
+                if (log)
+                    log->PutCString ("ProcessGDBRemote::DoDestroy()Tried resuming to destroy once already, not doing it again.");
+            }
+            else
+            {            
+                // At present, the plans are discarded and the breakpoints disabled Process::Destroy,
+                // but we really need it to happen here and it doesn't matter if we do it twice.
+                m_thread_list.DiscardThreadPlans();
+                DisableAllBreakpointSites();
+                
+                bool stop_looks_like_crash = false;
+                ThreadList &threads = GetThreadList();
+                
+                {
+                    Mutex::Locker(threads.GetMutex());
+                    
+                    size_t num_threads = threads.GetSize();
+                    for (size_t i = 0; i < num_threads; i++)
+                    {
+                        ThreadSP thread_sp = threads.GetThreadAtIndex(i);
+                        StopInfoSP stop_info_sp = thread_sp->GetPrivateStopReason();
+                        StopReason reason = eStopReasonInvalid;
+                        if (stop_info_sp)
+                            reason = stop_info_sp->GetStopReason();
+                        if (reason == eStopReasonBreakpoint
+                            || reason == eStopReasonException)
+                        {
+                            if (log)
+                                log->Printf ("ProcessGDBRemote::DoDestroy() - thread: %lld stopped with reason: %s.",
+                                             thread_sp->GetID(),
+                                             stop_info_sp->GetDescription());
+                            stop_looks_like_crash = true;
+                            break;
+                        }
+                    }
+                }
+                
+                if (stop_looks_like_crash)
+                {
+                    if (log)
+                        log->PutCString ("ProcessGDBRemote::DoDestroy() - Stopped at a breakpoint, continue and then kill.");
+                    m_destroy_tried_resuming = true;
+                    
+                    // If we are going to run again before killing, it would be good to suspend all the threads 
+                    // before resuming so they won't get into more trouble.  Sadly, for the threads stopped with
+                    // the breakpoint or exception, the exception doesn't get cleared if it is suspended, so we do
+                    // have to run the risk of letting those threads proceed a bit.
+    
+                    {
+                        Mutex::Locker(threads.GetMutex());
+                        
+                        size_t num_threads = threads.GetSize();
+                        for (size_t i = 0; i < num_threads; i++)
+                        {
+                            ThreadSP thread_sp = threads.GetThreadAtIndex(i);
+                            StopInfoSP stop_info_sp = thread_sp->GetPrivateStopReason();
+                            StopReason reason = eStopReasonInvalid;
+                            if (stop_info_sp)
+                                reason = stop_info_sp->GetStopReason();
+                            if (reason != eStopReasonBreakpoint
+                                && reason != eStopReasonException)
+                            {
+                                if (log)
+                                    log->Printf ("ProcessGDBRemote::DoDestroy() - Suspending thread: %lld before running.",
+                                                 thread_sp->GetID());
+                                thread_sp->SetResumeState(eStateSuspended);
+                            }
+                        }
+                    }
+                    Resume ();
+                    return Destroy();
+                }
+            }
+        }
+    }
+    
     // Interrupt if our inferior is running...
     int exit_status = SIGABRT;
     std::string exit_string;
@@ -1894,6 +2033,13 @@
 }
 
 Error
+ProcessGDBRemote::GetWatchpointSupportInfo (uint32_t &num, bool& after)
+{
+    Error error (m_gdb_comm.GetWatchpointSupportInfo (num, after));
+    return error;
+}
+
+Error
 ProcessGDBRemote::DoDeallocateMemory (lldb::addr_t addr)
 {
     Error error; 

Modified: lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h Mon Jul 23 19:12:48 2012
@@ -207,6 +207,9 @@
     virtual lldb_private::Error
     GetWatchpointSupportInfo (uint32_t &num);
     
+    virtual lldb_private::Error
+    GetWatchpointSupportInfo (uint32_t &num, bool& after);
+    
     virtual bool
     StartNoticingNewThreads();    
 
@@ -321,6 +324,7 @@
     MMapMap m_addr_to_mmap_size;
     lldb::BreakpointSP m_thread_create_bp_sp;
     bool m_waiting_for_attach;
+    bool m_destroy_tried_resuming;
     
     bool
     StartAsyncThread ();

Modified: lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp Mon Jul 23 19:12:48 2012
@@ -618,9 +618,8 @@
         DWARFDebugInfoEntry::Attributes attributes;
         const char *name = NULL;
         const char *mangled_cstr = NULL;
-        bool is_variable = false;
         bool is_declaration = false;
-        bool is_artificial = false;
+        //bool is_artificial = false;
         bool has_address = false;
         bool has_location = false;
         bool is_global_or_static_variable = false;
@@ -629,8 +628,6 @@
         const size_t num_attributes = die.GetAttributes(m_dwarf2Data, this, fixed_form_sizes, attributes);
         if (num_attributes > 0)
         {
-            is_variable = tag == DW_TAG_variable;
-
             for (uint32_t i=0; i<num_attributes; ++i)
             {
                 dw_attr_t attr = attributes.AttributeAtIndex(i);
@@ -647,10 +644,10 @@
                         is_declaration = form_value.Unsigned() != 0;
                     break;
 
-                case DW_AT_artificial:
-                    if (attributes.ExtractFormValueAtIndex(m_dwarf2Data, i, form_value))
-                        is_artificial = form_value.Unsigned() != 0;
-                    break;
+//                case DW_AT_artificial:
+//                    if (attributes.ExtractFormValueAtIndex(m_dwarf2Data, i, form_value))
+//                        is_artificial = form_value.Unsigned() != 0;
+//                    break;
 
                 case DW_AT_MIPS_linkage_name:
                     if (attributes.ExtractFormValueAtIndex(m_dwarf2Data, i, form_value))
@@ -798,9 +795,9 @@
                     // as our name. If it starts with '_', then it is ok, else compare
                     // the string to make sure it isn't the same and we don't end up
                     // with duplicate entries
-                    if (name != mangled_cstr && ((mangled_cstr[0] == '_') || (::strcmp(name, mangled_cstr) != 0)))
+                    if (name != mangled_cstr && ((mangled_cstr[0] == '_') || (name && ::strcmp(name, mangled_cstr) != 0)))
                     {
-                        Mangled mangled (mangled_cstr, true);
+                        Mangled mangled (ConstString(mangled_cstr), true);
                         func_fullnames.Insert (mangled.GetMangledName(), die.GetOffset());
                         if (mangled.GetDemangledName())
                             func_fullnames.Insert (mangled.GetDemangledName(), die.GetOffset());
@@ -822,7 +819,7 @@
                     // with duplicate entries
                     if (name != mangled_cstr && ((mangled_cstr[0] == '_') || (::strcmp(name, mangled_cstr) != 0)))
                     {
-                        Mangled mangled (mangled_cstr, true);
+                        Mangled mangled (ConstString(mangled_cstr), true);
                         func_fullnames.Insert (mangled.GetMangledName(), die.GetOffset());
                         if (mangled.GetDemangledName())
                             func_fullnames.Insert (mangled.GetDemangledName(), die.GetOffset());
@@ -867,7 +864,7 @@
                 // with duplicate entries
                 if (mangled_cstr && name != mangled_cstr && ((mangled_cstr[0] == '_') || (::strcmp(name, mangled_cstr) != 0)))
                 {
-                    Mangled mangled (mangled_cstr, true);
+                    Mangled mangled (ConstString(mangled_cstr), true);
                     globals.Insert (mangled.GetMangledName(), die.GetOffset());
                     if (mangled.GetDemangledName())
                         globals.Insert (mangled.GetDemangledName(), die.GetOffset());

Modified: lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp Mon Jul 23 19:12:48 2012
@@ -2127,8 +2127,6 @@
         if (abbrev_decl->Code() == abbrev_code)
             return abbrev_decl;
         
-        // Only log if we are the one to figure out that the module was modified
-        // which is indicated by SetModified() returning false.
         dwarf2Data->GetObjectFile()->GetModule()->ReportErrorIfModifyDetected ("0x%8.8x: the DWARF debug information has been modified (abbrev code was %u, and is now %u)", 
                                                                                GetOffset(),
                                                                                (uint32_t)abbrev_decl->Code(),

Modified: lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp Mon Jul 23 19:12:48 2012
@@ -105,7 +105,6 @@
                 const char *name = NULL;
                 const char *mangled = NULL;
                 bool add_die = false;
-                bool is_variable = false;
                 const size_t num_attributes = die->GetAttributes(dwarf2Data, cu, fixed_form_sizes, attributes);
                 if (num_attributes > 0)
                 {
@@ -113,8 +112,6 @@
 
                     dw_tag_t tag = die->Tag();
                     
-                    is_variable = tag == DW_TAG_variable;
-
                     for (i=0; i<num_attributes; ++i)
                     {
                         dw_attr_t attr = attributes.AttributeAtIndex(i);

Modified: lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h Mon Jul 23 19:12:48 2012
@@ -46,9 +46,11 @@
         bool
         NameMatches (const Entry& rhs) const
         {
-            if (name && rhs.name)
+            if (name == rhs.name)
+                return true;
+            else if (name && rhs.name)
                 return strcmp(name, rhs.name) == 0;
-            return name == NULL && rhs.name == NULL;
+            return false;
         }
 
         // Test operator

Modified: lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp Mon Jul 23 19:12:48 2012
@@ -186,83 +186,83 @@
 bool
 DWARFFormValue::SkipValue(dw_form_t form, const DataExtractor& debug_info_data, uint32_t* offset_ptr, const DWARFCompileUnit* cu)
 {
-    bool indirect = false;
-    do
+    switch (form)
     {
-        indirect = false;
-        switch (form)
-        {
-        // Blocks if inlined data that have a length field and the data bytes
-        // inlined in the .debug_info
-        case DW_FORM_exprloc:
-        case DW_FORM_block:  { dw_uleb128_t size = debug_info_data.GetULEB128(offset_ptr); *offset_ptr += size; } return true;
-        case DW_FORM_block1: { dw_uleb128_t size = debug_info_data.GetU8(offset_ptr);      *offset_ptr += size; } return true;
-        case DW_FORM_block2: { dw_uleb128_t size = debug_info_data.GetU16(offset_ptr);     *offset_ptr += size; } return true;
-        case DW_FORM_block4: { dw_uleb128_t size = debug_info_data.GetU32(offset_ptr);     *offset_ptr += size; } return true;
-
-        // Inlined NULL terminated C-strings
-        case DW_FORM_string:
-            debug_info_data.GetCStr(offset_ptr);
-            return true;
-
-        // Compile unit address sized values
-        case DW_FORM_addr:
-        case DW_FORM_ref_addr:
-            *offset_ptr += DWARFCompileUnit::GetAddressByteSize(cu);
-            return true;
-
-        // 0 bytes values (implied from DW_FORM)
-        case DW_FORM_flag_present:
-            return true;
-
-        // 1 byte values
-        case DW_FORM_data1:
-        case DW_FORM_flag:
-        case DW_FORM_ref1:
-            *offset_ptr += 1;
-            return true;
+    // Blocks if inlined data that have a length field and the data bytes
+    // inlined in the .debug_info
+    case DW_FORM_exprloc:
+    case DW_FORM_block:  { dw_uleb128_t size = debug_info_data.GetULEB128(offset_ptr); *offset_ptr += size; } return true;
+    case DW_FORM_block1: { dw_uleb128_t size = debug_info_data.GetU8(offset_ptr);      *offset_ptr += size; } return true;
+    case DW_FORM_block2: { dw_uleb128_t size = debug_info_data.GetU16(offset_ptr);     *offset_ptr += size; } return true;
+    case DW_FORM_block4: { dw_uleb128_t size = debug_info_data.GetU32(offset_ptr);     *offset_ptr += size; } return true;
 
-        // 2 byte values
-        case DW_FORM_data2:
-        case DW_FORM_ref2:
-            *offset_ptr += 2;
-            return true;
+    // Inlined NULL terminated C-strings
+    case DW_FORM_string:
+        debug_info_data.GetCStr(offset_ptr);
+        return true;
 
-        // 32 bit for DWARF 32, 64 for DWARF 64
-        case DW_FORM_sec_offset:
-            *offset_ptr += 4;
-            return true;
-
-        // 4 byte values
-        case DW_FORM_strp:
-        case DW_FORM_data4:
-        case DW_FORM_ref4:
-            *offset_ptr += 4;
-            return true;
+    // Compile unit address sized values
+    case DW_FORM_addr:
+    case DW_FORM_ref_addr:
+        *offset_ptr += DWARFCompileUnit::GetAddressByteSize(cu);
+        return true;
 
-        // 8 byte values
-        case DW_FORM_data8:
-        case DW_FORM_ref8:
-        case DW_FORM_ref_sig8:
-            *offset_ptr += 8;
-            return true;
-
-        // signed or unsigned LEB 128 values
-        case DW_FORM_sdata:
-        case DW_FORM_udata:
-        case DW_FORM_ref_udata:
-            debug_info_data.Skip_LEB128(offset_ptr);
-            return true;
+    // 0 bytes values (implied from DW_FORM)
+    case DW_FORM_flag_present:
+        return true;
 
-        case DW_FORM_indirect:
-            indirect = true;
-            form = debug_info_data.GetULEB128(offset_ptr);
-            break;
-        default:
-            return false;
+    // 1 byte values
+    case DW_FORM_data1:
+    case DW_FORM_flag:
+    case DW_FORM_ref1:
+        *offset_ptr += 1;
+        return true;
+
+    // 2 byte values
+    case DW_FORM_data2:
+    case DW_FORM_ref2:
+        *offset_ptr += 2;
+        return true;
+
+    // 32 bit for DWARF 32, 64 for DWARF 64
+    case DW_FORM_sec_offset:
+        *offset_ptr += 4;
+        return true;
+
+    // 4 byte values
+    case DW_FORM_strp:
+    case DW_FORM_data4:
+    case DW_FORM_ref4:
+        *offset_ptr += 4;
+        return true;
+
+    // 8 byte values
+    case DW_FORM_data8:
+    case DW_FORM_ref8:
+    case DW_FORM_ref_sig8:
+        *offset_ptr += 8;
+        return true;
+
+    // signed or unsigned LEB 128 values
+    case DW_FORM_sdata:
+    case DW_FORM_udata:
+    case DW_FORM_ref_udata:
+        debug_info_data.Skip_LEB128(offset_ptr);
+        return true;
+
+    case DW_FORM_indirect:
+        {
+            dw_form_t indirect_form = debug_info_data.GetULEB128(offset_ptr);
+            return DWARFFormValue::SkipValue (indirect_form,
+                                              debug_info_data,
+                                              offset_ptr,
+                                              cu);
         }
-    } while (indirect);
-    return true;
+
+    default:
+        break;
+    }
+    return false;
 }
 
 

Modified: lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Mon Jul 23 19:12:48 2012
@@ -421,16 +421,8 @@
             return 0;
 
         uint64_t debug_abbrev_file_size = 0;
-        uint64_t debug_aranges_file_size = 0;
-        uint64_t debug_frame_file_size = 0;
         uint64_t debug_info_file_size = 0;
         uint64_t debug_line_file_size = 0;
-        uint64_t debug_loc_file_size = 0;
-        uint64_t debug_macinfo_file_size = 0;
-        uint64_t debug_pubnames_file_size = 0;
-        uint64_t debug_pubtypes_file_size = 0;
-        uint64_t debug_ranges_file_size = 0;
-        uint64_t debug_str_file_size = 0;
 
         section = section_list->FindSectionByName(GetDWARFMachOSegmentName ()).get();
         
@@ -449,15 +441,11 @@
                 m_flags.Set (flagsGotDebugAbbrevData);
 
             section = section_list->FindSectionByType (eSectionTypeDWARFDebugAranges, true).get();
-            if (section)
-                debug_aranges_file_size = section->GetFileSize();
-            else
+            if (!section)
                 m_flags.Set (flagsGotDebugArangesData);
 
             section = section_list->FindSectionByType (eSectionTypeDWARFDebugFrame, true).get();
-            if (section)
-                debug_frame_file_size = section->GetFileSize();
-            else
+            if (!section)
                 m_flags.Set (flagsGotDebugFrameData);
 
             section = section_list->FindSectionByType (eSectionTypeDWARFDebugLine, true).get();
@@ -467,39 +455,27 @@
                 m_flags.Set (flagsGotDebugLineData);
 
             section = section_list->FindSectionByType (eSectionTypeDWARFDebugLoc, true).get();
-            if (section)
-                debug_loc_file_size = section->GetFileSize();
-            else
+            if (!section)
                 m_flags.Set (flagsGotDebugLocData);
 
             section = section_list->FindSectionByType (eSectionTypeDWARFDebugMacInfo, true).get();
-            if (section)
-                debug_macinfo_file_size = section->GetFileSize();
-            else
+            if (!section)
                 m_flags.Set (flagsGotDebugMacInfoData);
 
             section = section_list->FindSectionByType (eSectionTypeDWARFDebugPubNames, true).get();
-            if (section)
-                debug_pubnames_file_size = section->GetFileSize();
-            else
+            if (!section)
                 m_flags.Set (flagsGotDebugPubNamesData);
 
             section = section_list->FindSectionByType (eSectionTypeDWARFDebugPubTypes, true).get();
-            if (section)
-                debug_pubtypes_file_size = section->GetFileSize();
-            else
+            if (!section)
                 m_flags.Set (flagsGotDebugPubTypesData);
 
             section = section_list->FindSectionByType (eSectionTypeDWARFDebugRanges, true).get();
-            if (section)
-                debug_ranges_file_size = section->GetFileSize();
-            else
+            if (!section)
                 m_flags.Set (flagsGotDebugRangesData);
 
             section = section_list->FindSectionByType (eSectionTypeDWARFDebugStr, true).get();
-            if (section)
-                debug_str_file_size = section->GetFileSize();
-            else
+            if (!section)
                 m_flags.Set (flagsGotDebugStrData);
         }
         else
@@ -883,9 +859,9 @@
         {
             Mangled func_name;
             if (mangled)
-                func_name.SetValue(mangled, true);
+                func_name.SetValue(ConstString(mangled), true);
             else if (name)
-                func_name.SetValue(name, false);
+                func_name.SetValue(ConstString(name), false);
 
             FunctionSP func_sp;
             std::auto_ptr<Declaration> decl_ap;
@@ -1834,7 +1810,7 @@
                     AccessType accessibility = default_accessibility;
                     bool is_virtual = false;
                     bool is_base_of_class = true;
-                    off_t member_offset = 0;
+                    //off_t member_offset = 0;
                     uint32_t i;
                     for (i=0; i<num_attributes; ++i)
                     {
@@ -1848,31 +1824,31 @@
                             case DW_AT_decl_line:   decl.SetLine(form_value.Unsigned()); break;
                             case DW_AT_decl_column: decl.SetColumn(form_value.Unsigned()); break;
                             case DW_AT_type:        encoding_uid = form_value.Reference(dwarf_cu); break;
-                            case DW_AT_data_member_location:
-                                if (form_value.BlockData())
-                                {
-                                    Value initialValue(0);
-                                    Value memberOffset(0);
-                                    const DataExtractor& debug_info_data = get_debug_info_data();
-                                    uint32_t block_length = form_value.Unsigned();
-                                    uint32_t block_offset = form_value.BlockData() - debug_info_data.GetDataStart();
-                                    if (DWARFExpression::Evaluate (NULL, 
-                                                                   NULL, 
-                                                                   NULL, 
-                                                                   NULL, 
-                                                                   NULL,
-                                                                   debug_info_data, 
-                                                                   block_offset, 
-                                                                   block_length, 
-                                                                   eRegisterKindDWARF, 
-                                                                   &initialValue, 
-                                                                   memberOffset, 
-                                                                   NULL))
-                                    {
-                                        member_offset = memberOffset.ResolveValue(NULL, NULL).UInt();
-                                    }
-                                }
-                                break;
+//                            case DW_AT_data_member_location:
+//                                if (form_value.BlockData())
+//                                {
+//                                    Value initialValue(0);
+//                                    Value memberOffset(0);
+//                                    const DataExtractor& debug_info_data = get_debug_info_data();
+//                                    uint32_t block_length = form_value.Unsigned();
+//                                    uint32_t block_offset = form_value.BlockData() - debug_info_data.GetDataStart();
+//                                    if (DWARFExpression::Evaluate (NULL, 
+//                                                                   NULL, 
+//                                                                   NULL, 
+//                                                                   NULL, 
+//                                                                   NULL,
+//                                                                   debug_info_data, 
+//                                                                   block_offset, 
+//                                                                   block_length, 
+//                                                                   eRegisterKindDWARF, 
+//                                                                   &initialValue, 
+//                                                                   memberOffset, 
+//                                                                   NULL))
+//                                    {
+//                                        member_offset = memberOffset.ResolveValue(NULL, NULL).UInt();
+//                                    }
+//                                }
+//                                break;
 
                             case DW_AT_accessibility:
                                 accessibility = DW_ACCESS_to_AccessType(form_value.Unsigned());
@@ -3093,7 +3069,7 @@
             if (attributes.ExtractFormValueAtIndex(this, idx, form_value))
             {
                 const char *name = form_value.AsCString(&get_debug_str_data());
-                best_name.SetValue (name, true);
+                best_name.SetValue (ConstString(name), true);
             } 
         }
         if (best_name)
@@ -4011,58 +3987,12 @@
         const dw_tag_t tag = die->Tag();
         switch (tag)
         {
-        case DW_TAG_enumerator:
-            {
-                DWARFDebugInfoEntry::Attributes attributes;
-                const size_t num_child_attributes = die->GetAttributes(this, dwarf_cu, fixed_form_sizes, attributes);
-                if (num_child_attributes > 0)
-                {
-                    const char *name = NULL;
-                    bool got_value = false;
-                    int64_t enum_value = 0;
-
-                    uint32_t i;
-                    for (i=0; i<num_child_attributes; ++i)
-                    {
-                        const dw_attr_t attr = attributes.AttributeAtIndex(i);
-                        DWARFFormValue form_value;
-                        if (attributes.ExtractFormValueAtIndex(this, i, form_value))
-                        {
-                            switch (attr)
-                            {
-                            case DW_AT_const_value:
-                                got_value = true;
-                                enum_value = form_value.Unsigned();
-                                break;
-
-                            case DW_AT_name:
-                                name = form_value.AsCString(&get_debug_str_data());
-                                break;
-
-                            case DW_AT_description:
-                            default:
-                            case DW_AT_decl_file:
-                            case DW_AT_decl_line:
-                            case DW_AT_decl_column:
-                            case DW_AT_sibling:
-                                break;
-                            }
-                        }
-                    }
-                }
-            }
-            break;
-
         case DW_TAG_subrange_type:
             {
                 DWARFDebugInfoEntry::Attributes attributes;
                 const size_t num_child_attributes = die->GetAttributes(this, dwarf_cu, fixed_form_sizes, attributes);
                 if (num_child_attributes > 0)
                 {
-                    const char *name = NULL;
-                    bool got_value = false;
-                    uint64_t byte_size = 0;
-                    int64_t enum_value = 0;
                     uint64_t num_elements = 0;
                     uint64_t lower_bound = 0;
                     uint64_t upper_bound = 0;
@@ -4075,13 +4005,7 @@
                         {
                             switch (attr)
                             {
-                            case DW_AT_const_value:
-                                got_value = true;
-                                enum_value = form_value.Unsigned();
-                                break;
-
                             case DW_AT_name:
-                                name = form_value.AsCString(&get_debug_str_data());
                                 break;
 
                             case DW_AT_count:
@@ -4096,10 +4020,6 @@
                                 byte_stride = form_value.Unsigned();
                                 break;
 
-                            case DW_AT_byte_size:
-                                byte_size = form_value.Unsigned();
-                                break;
-
                             case DW_AT_lower_bound:
                                 lower_bound = form_value.Unsigned();
                                 break;
@@ -4995,6 +4915,18 @@
     
     if (src_size && dst_size)
     {
+        if (src_size != dst_size)
+        {
+            if (log)
+                log->Printf("warning: tried to unique class DIE 0x%8.8x to 0x%8.8x, but they didn't have the same size (src=%d, dst=%d)",
+                            src_class_die->GetOffset(),
+                            dst_class_die->GetOffset(),
+                            src_size,
+                            dst_size);
+            
+            return false;
+        }
+            
         uint32_t idx;
         for (idx = 0; idx < src_size; ++idx)
         {
@@ -5140,7 +5072,6 @@
             ConstString type_name_const_str;
             Type::ResolveState resolve_state = Type::eResolveStateUnresolved;
             size_t byte_size = 0;
-            bool byte_size_valid = false;
             Declaration decl;
 
             Type::EncodingDataType encoding_data_type = Type::eEncodingIsUID;
@@ -5194,7 +5125,7 @@
                                     if (type_name_cstr)
                                         type_name_const_str.SetCString(type_name_cstr);
                                     break;
-                                case DW_AT_byte_size:   byte_size = form_value.Unsigned();  byte_size_valid = true; break;
+                                case DW_AT_byte_size:   byte_size = form_value.Unsigned(); break;
                                 case DW_AT_encoding:    encoding = form_value.Unsigned(); break;
                                 case DW_AT_type:        encoding_uid = form_value.Reference(dwarf_cu); break;
                                 default:
@@ -5316,6 +5247,7 @@
                 {
                     // Set a bit that lets us know that we are currently parsing this
                     m_die_to_type[die] = DIE_IS_BEING_PARSED;
+                    bool byte_size_valid = false;
 
                     LanguageType class_language = eLanguageTypeUnknown;
                     bool is_complete_objc_class = false;
@@ -5699,9 +5631,9 @@
                                     type_name_const_str.SetCString(type_name_cstr);
                                     break;
                                 case DW_AT_type:            encoding_uid = form_value.Reference(dwarf_cu); break;
-                                case DW_AT_byte_size:       byte_size = form_value.Unsigned(); byte_size_valid = true; break;
-                                case DW_AT_accessibility:   accessibility = DW_ACCESS_to_AccessType(form_value.Unsigned()); break;
-                                case DW_AT_declaration:     is_forward_declaration = form_value.Unsigned() != 0; break;
+                                case DW_AT_byte_size:       byte_size = form_value.Unsigned(); break;
+                                case DW_AT_accessibility:   break; //accessibility = DW_ACCESS_to_AccessType(form_value.Unsigned()); break;
+                                case DW_AT_declaration:     break; //is_forward_declaration = form_value.Unsigned() != 0; break;
                                 case DW_AT_allocated:
                                 case DW_AT_associated:
                                 case DW_AT_bit_stride:
@@ -5769,7 +5701,7 @@
                     // Set a bit that lets us know that we are currently parsing this
                     m_die_to_type[die] = DIE_IS_BEING_PARSED;
 
-                    const char *mangled = NULL;
+                    //const char *mangled = NULL;
                     dw_offset_t type_die_offset = DW_INVALID_OFFSET;
                     bool is_variadic = false;
                     bool is_inline = false;
@@ -5804,10 +5736,10 @@
                                     type_name_const_str.SetCString(type_name_cstr);
                                     break;
 
-                                case DW_AT_MIPS_linkage_name:   mangled = form_value.AsCString(&get_debug_str_data()); break;
+                                case DW_AT_MIPS_linkage_name:   break; // mangled = form_value.AsCString(&get_debug_str_data()); break;
                                 case DW_AT_type:                type_die_offset = form_value.Reference(dwarf_cu); break;
                                 case DW_AT_accessibility:       accessibility = DW_ACCESS_to_AccessType(form_value.Unsigned()); break;
-                                case DW_AT_declaration:         is_forward_declaration = form_value.Unsigned() != 0; break;
+                                case DW_AT_declaration:         break; // is_forward_declaration = form_value.Unsigned() != 0; break;
                                 case DW_AT_inline:              is_inline = form_value.Unsigned() != 0; break;
                                 case DW_AT_virtuality:          is_virtual = form_value.Unsigned() != 0;  break;
                                 case DW_AT_explicit:            is_explicit = form_value.Unsigned() != 0;  break; 
@@ -6202,11 +6134,11 @@
                                     break;
 
                                 case DW_AT_type:            type_die_offset = form_value.Reference(dwarf_cu); break;
-                                case DW_AT_byte_size:       byte_size = form_value.Unsigned(); byte_size_valid = true; break;
+                                case DW_AT_byte_size:       break; // byte_size = form_value.Unsigned(); break;
                                 case DW_AT_byte_stride:     byte_stride = form_value.Unsigned(); break;
                                 case DW_AT_bit_stride:      bit_stride = form_value.Unsigned(); break;
-                                case DW_AT_accessibility:   accessibility = DW_ACCESS_to_AccessType(form_value.Unsigned()); break;
-                                case DW_AT_declaration:     is_forward_declaration = form_value.Unsigned() != 0; break;
+                                case DW_AT_accessibility:   break; // accessibility = DW_ACCESS_to_AccessType(form_value.Unsigned()); break;
+                                case DW_AT_declaration:     break; // is_forward_declaration = form_value.Unsigned() != 0; break;
                                 case DW_AT_allocated:
                                 case DW_AT_associated:
                                 case DW_AT_data_location:
@@ -6230,9 +6162,6 @@
                         {
                             std::vector<uint64_t> element_orders;
                             ParseChildArrayInfo(sc, dwarf_cu, die, first_index, element_orders, byte_stride, bit_stride);
-                            // We have an array that claims to have no members, lets give it at least one member...
-                            if (element_orders.empty())
-                                element_orders.push_back (1);
                             if (byte_stride == 0 && bit_stride == 0)
                                 byte_stride = element_type->GetByteSize();
                             clang_type_t array_element_type = element_type->GetClangForwardType();
@@ -6585,7 +6514,7 @@
             bool is_external = false;
             bool is_artificial = false;
             bool location_is_const_value_data = false;
-            AccessType accessibility = eAccessNone;
+            //AccessType accessibility = eAccessNone;
 
             for (i=0; i<num_attributes; ++i)
             {
@@ -6632,7 +6561,7 @@
                         break;
 
                     case DW_AT_artificial:      is_artificial = form_value.Unsigned() != 0; break;
-                    case DW_AT_accessibility:   accessibility = DW_ACCESS_to_AccessType(form_value.Unsigned()); break;
+                    case DW_AT_accessibility:   break; //accessibility = DW_ACCESS_to_AccessType(form_value.Unsigned()); break;
                     case DW_AT_declaration:
                     case DW_AT_description:
                     case DW_AT_endianity:

Modified: lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp Mon Jul 23 19:12:48 2012
@@ -143,14 +143,20 @@
                     m_compile_unit_infos[i].so_symbol = symtab->SymbolAtIndex(oso_indexes[i] - 2);
                 m_compile_unit_infos[i].oso_symbol = symtab->SymbolAtIndex(oso_indexes[i]);
                 uint32_t sibling_idx = m_compile_unit_infos[i].so_symbol->GetSiblingIndex();
-                assert (sibling_idx != 0);
-                assert (sibling_idx > i + 1);
-                m_compile_unit_infos[i].last_symbol = symtab->SymbolAtIndex (sibling_idx - 1);
-                m_compile_unit_infos[i].first_symbol_index = symtab->GetIndexForSymbol(m_compile_unit_infos[i].so_symbol);
-                m_compile_unit_infos[i].last_symbol_index = symtab->GetIndexForSymbol(m_compile_unit_infos[i].last_symbol);
-                
-                if (log)
-                    log->Printf("Initialized OSO 0x%8.8x: file=%s", i, m_compile_unit_infos[i].oso_symbol->GetName().GetCString());
+                // The sibling index can't be less that or equal to the current index "i"
+                if (sibling_idx <= i)
+                {
+                    m_obj_file->GetModule()->ReportError ("N_SO in symbol with UID %u has invalid sibling in debug map, please file a bug and attach the binary listed in this error", m_compile_unit_infos[i].so_symbol->GetID());
+                }
+                else
+                {
+                    m_compile_unit_infos[i].last_symbol = symtab->SymbolAtIndex (sibling_idx - 1);
+                    m_compile_unit_infos[i].first_symbol_index = symtab->GetIndexForSymbol(m_compile_unit_infos[i].so_symbol);
+                    m_compile_unit_infos[i].last_symbol_index = symtab->GetIndexForSymbol(m_compile_unit_infos[i].last_symbol);
+                    
+                    if (log)
+                        log->Printf("Initialized OSO 0x%8.8x: file=%s", i, m_compile_unit_infos[i].oso_symbol->GetName().GetCString());
+                }
             }
         }
     }
@@ -280,6 +286,9 @@
                 // it will have the remapped sections that we do below.
                 SymbolFileDWARF *oso_symfile = (SymbolFileDWARF *)comp_unit_info->oso_symbol_vendor->GetSymbolFile();
                 
+                if (!oso_symfile)
+                    return NULL;
+                
                 if (oso_symfile->GetNumCompileUnits() != 1)
                 {
                     oso_symfile->GetObjectFile()->GetModule()->ReportError ("DWARF for object file '%s' contains multiple translation units!",

Modified: lldb/branches/lldb-platform-work/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp Mon Jul 23 19:12:48 2012
@@ -225,30 +225,37 @@
                                                                             xmlNode *value_node = key_node->next;
                                                                             while (value_node && value_node->type != XML_ELEMENT_NODE)
                                                                                 value_node = value_node->next;
-                                                                            if (strcmp((const char *)value_node->name, "string") == 0)
+                                                                            if (value_node && value_node->name)
                                                                             {
-                                                                                const char *node_content = (const char *)::xmlNodeGetContent(value_node);
-                                                                                if (node_content)
+                                                                                if (strcmp((const char *)value_node->name, "string") == 0)
                                                                                 {
-                                                                                    strncpy(DBGBuildSourcePath, node_content, sizeof(DBGBuildSourcePath));
+                                                                                    const char *node_content = (const char *)::xmlNodeGetContent(value_node);
+                                                                                    if (node_content)
+                                                                                    {
+                                                                                        strncpy(DBGBuildSourcePath, node_content, sizeof(DBGBuildSourcePath));
+                                                                                    }
                                                                                 }
+                                                                                key_node = value_node;
                                                                             }
-                                                                            key_node = value_node;
                                                                         }
                                                                         else if (strcmp(key_name, "DBGSourcePath") == 0)
                                                                         {
                                                                             xmlNode *value_node = key_node->next;
                                                                             while (value_node && value_node->type != XML_ELEMENT_NODE)
                                                                                 value_node = value_node->next;
-                                                                            if (strcmp((const char *)value_node->name, "string") == 0)
+                                                                            if (value_node && value_node->name)
                                                                             {
-                                                                                const char *node_content = (const char *)::xmlNodeGetContent(value_node);
-                                                                                if (node_content)
+                                                                                if (strcmp((const char *)value_node->name, "string") == 0)
                                                                                 {
-                                                                                    strncpy(DBGSourcePath, node_content, sizeof(DBGSourcePath));
+                                                                                    const char *node_content = (const char *)::xmlNodeGetContent(value_node);
+                                                                                    if (node_content)
+                                                                                    {
+                                                                                        FileSpec resolved_source_path(node_content, true);
+                                                                                        resolved_source_path.GetPath(DBGSourcePath, sizeof(DBGSourcePath));
+                                                                                    }
                                                                                 }
+                                                                                key_node = value_node;
                                                                             }
-                                                                            key_node = value_node;
                                                                         }
                                                                     }
                                                                 }

Modified: lldb/branches/lldb-platform-work/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp Mon Jul 23 19:12:48 2012
@@ -30,7 +30,7 @@
 
 
 //-----------------------------------------------------------------------------------------------
-//  UnwindAssemblyParser_x86 method definitions 
+//  UnwindAssemblyInstEmulation method definitions 
 //-----------------------------------------------------------------------------------------------
 
 bool
@@ -71,9 +71,6 @@
             const uint32_t addr_byte_size = m_arch.GetAddressByteSize();
             const bool show_address = true;
             const bool show_bytes = true;
-            // Initialize the CFA with a known value. In the 32 bit case
-            // it will be 0x80000000, and in the 64 bit case 0x8000000000000000.
-            // We use the address byte size to be safe for any future addresss sizes
             m_inst_emulator_ap->GetRegisterInfo (unwind_plan.GetRegisterKind(), 
                                                  unwind_plan.GetInitialCFARegister(), 
                                                  m_cfa_reg_info);
@@ -82,27 +79,52 @@
             m_register_values.clear();
             m_pushed_regs.clear();
 
+            // Initialize the CFA with a known value. In the 32 bit case
+            // it will be 0x80000000, and in the 64 bit case 0x8000000000000000.
+            // We use the address byte size to be safe for any future addresss sizes
             m_initial_sp = (1ull << ((addr_byte_size * 8) - 1));
             RegisterValue cfa_reg_value;
             cfa_reg_value.SetUInt (m_initial_sp, m_cfa_reg_info.byte_size);
             SetRegisterValue (m_cfa_reg_info, cfa_reg_value);
-                
+
             const InstructionList &inst_list = disasm_sp->GetInstructionList ();
             const size_t num_instructions = inst_list.GetSize();
+
             if (num_instructions > 0)
             {
                 Instruction *inst = inst_list.GetInstructionAtIndex (0).get();
                 const addr_t base_addr = inst->GetAddress().GetFileAddress();
-                // Initialize the current row with the one row that was created
-                // from the CreateFunctionEntryUnwind call above...
-                m_curr_row = unwind_plan.GetLastRow();
+
+                // Make a copy of the current instruction Row and save it in m_curr_row
+                // so we can add updates as we process the instructions.  
+                UnwindPlan::RowSP last_row = unwind_plan.GetLastRow();
+                UnwindPlan::Row *newrow = new UnwindPlan::Row;
+                if (last_row.get())
+                    *newrow = *last_row.get();
+                m_curr_row.reset(newrow);
+
+                // Once we've seen the initial prologue instructions complete, save a
+                // copy of the CFI at that point into prologue_completed_row for possible
+                // use later.
+                int instructions_since_last_prologue_insn = 0;     // # of insns since last CFI was update
+                bool prologue_complete = false;                    // true if we have finished prologue setup
+                bool reinstate_prologue_next_instruction = false;  // Next iteration, re-install the prologue row of CFI
+                UnwindPlan::RowSP prologue_completed_row;          // copy of prologue row of CFI
+
+                // cache the pc register number (in whatever register numbering this UnwindPlan uses) for
+                // quick reference during instruction parsing.
+                uint32_t pc_reg_num = LLDB_INVALID_REGNUM;
+                RegisterInfo pc_reg_info;
+                if (m_inst_emulator_ap->GetRegisterInfo (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_PC, pc_reg_info))
+                    pc_reg_num = pc_reg_info.kinds[unwind_plan.GetRegisterKind()];
+
 
                 for (size_t idx=0; idx<num_instructions; ++idx)
                 {
+                    m_curr_row_modified = false;
                     inst = inst_list.GetInstructionAtIndex (idx).get();
                     if (inst)
                     {
-
                         if (log && log->GetVerbose ())
                         {
                             StreamString strm;
@@ -115,14 +137,70 @@
                                                             exe_ctx.GetTargetPtr());
 
                         m_inst_emulator_ap->EvaluateInstruction (eEmulateInstructionOptionIgnoreConditions);
-                        
-                        if (unwind_plan.GetLastRow() != m_curr_row)
+
+                        // Were there any changes to the CFI while evaluating this instruction?
+                        if (m_curr_row_modified)
                         {
-                            // Be sure to not edit the offset unless our row has changed
-                            // so that the "!=" call above doesn't trigger every time
-                            m_curr_row.SetOffset (inst->GetAddress().GetFileAddress() + inst->GetOpcode().GetByteSize() - base_addr);
+                            reinstate_prologue_next_instruction = false;
+                            m_curr_row->SetOffset (inst->GetAddress().GetFileAddress() + inst->GetOpcode().GetByteSize() - base_addr);
                             // Append the new row
                             unwind_plan.AppendRow (m_curr_row);
+
+                            // Allocate a new Row for m_curr_row, copy the current state into it
+                            UnwindPlan::Row *newrow = new UnwindPlan::Row;
+                            *newrow = *m_curr_row.get();
+                            m_curr_row.reset(newrow);
+
+                            instructions_since_last_prologue_insn = 0;
+
+                            // If the caller's pc is "same", we've just executed an epilogue and we return to the caller
+                            // after this instruction completes executing.
+                            // If there are any instructions past this, there must have been flow control over this
+                            // epilogue so we'll reinstate the original prologue setup instructions.
+                            UnwindPlan::Row::RegisterLocation pc_regloc;
+                            if (prologue_complete
+                                && pc_reg_num != LLDB_INVALID_REGNUM 
+                                && m_curr_row->GetRegisterInfo (pc_reg_num, pc_regloc)
+                                && pc_regloc.IsSame())
+                            {
+                                if (log && log->GetVerbose())
+                                    log->Printf("UnwindAssemblyInstEmulation::GetNonCallSiteUnwindPlanFromAssembly -- pc is <same>, restore prologue instructions.");
+                                reinstate_prologue_next_instruction = true;
+                            }
+                        }
+                        else
+                        {
+                            // If the previous instruction was a return-to-caller (epilogue), and we're still executing
+                            // instructions in this function, there must be a code path that jumps over that epilogue.
+                            // Reinstate the frame setup from the prologue.
+                            if (reinstate_prologue_next_instruction)
+                            {
+                                if (log && log->GetVerbose())
+                                    log->Printf("UnwindAssemblyInstEmulation::GetNonCallSiteUnwindPlanFromAssembly -- Reinstating prologue instruction set");
+                                UnwindPlan::Row *newrow = new UnwindPlan::Row;
+                                *newrow = *prologue_completed_row.get();
+                                m_curr_row.reset(newrow);
+                                m_curr_row->SetOffset (inst->GetAddress().GetFileAddress() + inst->GetOpcode().GetByteSize() - base_addr);
+                                unwind_plan.AppendRow(m_curr_row);
+
+                                newrow = new UnwindPlan::Row;
+                                *newrow = *m_curr_row.get();
+                                m_curr_row.reset(newrow);
+
+                                reinstate_prologue_next_instruction = false;
+                            }
+
+                            // If we haven't seen any prologue instructions for a while (4 instructions in a row),
+                            // the function prologue has probably completed.  Save a copy of that Row.
+                            if (prologue_complete == false && instructions_since_last_prologue_insn++ > 3)
+                            {
+                                prologue_complete = true;
+                                UnwindPlan::Row *newrow = new UnwindPlan::Row;
+                                *newrow = *m_curr_row.get();
+                                prologue_completed_row.reset(newrow);
+                                if (log && log->GetVerbose())
+                                    log->Printf("UnwindAssemblyInstEmulation::GetNonCallSiteUnwindPlanFromAssembly -- prologue has been set up, saving a copy.");
+                            }
                         }
                     }
                 }
@@ -362,7 +440,8 @@
                     {
                         m_pushed_regs[reg_num] = addr;
                         const int32_t offset = addr - m_initial_sp;
-                        m_curr_row.SetRegisterLocationToAtCFAPlusOffset (reg_num, offset, cant_replace);
+                        m_curr_row->SetRegisterLocationToAtCFAPlusOffset (reg_num, offset, cant_replace);
+                        m_curr_row_modified = true;
                         if (is_return_address_reg)
                         {
                             // This push was pushing the return address register,
@@ -372,7 +451,10 @@
                             {
                                 uint32_t pc_reg_num = pc_reg_info.kinds[unwind_reg_kind];
                                 if (pc_reg_num != LLDB_INVALID_REGNUM)
-                                    m_curr_row.SetRegisterLocationToAtCFAPlusOffset (pc_reg_num, offset, can_replace);
+                                {
+                                    m_curr_row->SetRegisterLocationToAtCFAPlusOffset (pc_reg_num, offset, can_replace);
+                                    m_curr_row_modified = true;
+                                }
                             }
                         }
                     }
@@ -479,6 +561,7 @@
 //                    m_curr_row.SetRegisterLocationToUndefined (reg_num, 
 //                                                               can_replace_only_if_unspecified, 
 //                                                               can_replace_only_if_unspecified);
+//                    m_curr_row_modified = true;
 //                }
 //            }
             break;
@@ -488,7 +571,8 @@
                 const uint32_t reg_num = reg_info->kinds[m_unwind_plan_ptr->GetRegisterKind()];
                 if (reg_num != LLDB_INVALID_REGNUM)
                 {
-                    m_curr_row.SetRegisterLocationToSame (reg_num, must_replace);
+                    m_curr_row->SetRegisterLocationToSame (reg_num, must_replace);
+                    m_curr_row_modified = true;
                 }
             }
             break;
@@ -500,8 +584,9 @@
                 m_cfa_reg_info = *reg_info;
                 const uint32_t cfa_reg_num = reg_info->kinds[m_unwind_plan_ptr->GetRegisterKind()];
                 assert (cfa_reg_num != LLDB_INVALID_REGNUM);
-                m_curr_row.SetCFARegister(cfa_reg_num);
-                m_curr_row.SetCFAOffset(m_initial_sp - reg_value.GetAsUInt64());
+                m_curr_row->SetCFARegister(cfa_reg_num);
+                m_curr_row->SetCFAOffset(m_initial_sp - reg_value.GetAsUInt64());
+                m_curr_row_modified = true;
             }
             break;
 
@@ -510,7 +595,8 @@
             // subsequent adjustments to the stack pointer.
             if (!m_fp_is_cfa)
             {
-                m_curr_row.SetCFAOffset (m_initial_sp - reg_value.GetAsUInt64());
+                m_curr_row->SetCFAOffset (m_initial_sp - reg_value.GetAsUInt64());
+                m_curr_row_modified = true;
             }
             break;
     }

Modified: lldb/branches/lldb-platform-work/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h Mon Jul 23 19:12:48 2012
@@ -134,6 +134,7 @@
         m_thread_ptr (NULL),
         m_unwind_plan_ptr (NULL),
         m_curr_row (),
+        m_curr_row_modified (false),
         m_cfa_reg_info (),
         m_fp_is_cfa (false),
         m_register_values (),
@@ -161,7 +162,8 @@
     lldb_private::AddressRange* m_range_ptr; 
     lldb_private::Thread* m_thread_ptr;
     lldb_private::UnwindPlan* m_unwind_plan_ptr;
-    lldb_private::UnwindPlan::Row m_curr_row;
+    lldb_private::UnwindPlan::RowSP m_curr_row;
+    bool m_curr_row_modified;
     typedef std::map<uint64_t, uint64_t> PushedRegisterToAddrMap;
     uint64_t m_initial_sp;
     lldb_private::RegisterInfo m_cfa_reg_info;

Modified: lldb/branches/lldb-platform-work/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp Mon Jul 23 19:12:48 2012
@@ -531,7 +531,7 @@
 bool 
 AssemblyParse_x86::get_non_call_site_unwind_plan (UnwindPlan &unwind_plan)
 {
-    UnwindPlan::Row row;
+    UnwindPlan::RowSP row(new UnwindPlan::Row);
     int non_prologue_insn_count = 0;
     m_cur_insn = m_func_bounds.GetBaseAddress ();
     int current_func_text_offset = 0;
@@ -548,20 +548,26 @@
     unwind_plan.SetRegisterKind (eRegisterKindLLDB);
 
     // At the start of the function, find the CFA by adding wordsize to the SP register
-    row.SetOffset (current_func_text_offset);
-    row.SetCFARegister (m_lldb_sp_regnum);
-    row.SetCFAOffset (m_wordsize);
+    row->SetOffset (current_func_text_offset);
+    row->SetCFARegister (m_lldb_sp_regnum);
+    row->SetCFAOffset (m_wordsize);
 
     // caller's stack pointer value before the call insn is the CFA address
     initial_regloc.SetIsCFAPlusOffset (0);
-    row.SetRegisterInfo (m_lldb_sp_regnum, initial_regloc);
+    row->SetRegisterInfo (m_lldb_sp_regnum, initial_regloc);
 
     // saved instruction pointer can be found at CFA - wordsize.
     current_sp_bytes_offset_from_cfa = m_wordsize;
     initial_regloc.SetAtCFAPlusOffset (-current_sp_bytes_offset_from_cfa);
-    row.SetRegisterInfo (m_lldb_ip_regnum, initial_regloc);
+    row->SetRegisterInfo (m_lldb_ip_regnum, initial_regloc);
 
     unwind_plan.AppendRow (row);
+
+    // Allocate a new Row, populate it with the existing Row contents.
+    UnwindPlan::Row *newrow = new UnwindPlan::Row;
+    *newrow = *row.get();
+    row.reset(newrow);
+
     const bool prefer_file_cache = true;
 
     Target *target = m_exe_ctx.GetTargetPtr();
@@ -584,21 +590,29 @@
 
         if (push_rbp_pattern_p ())
         {
-            row.SetOffset (current_func_text_offset + insn_len);
+            row->SetOffset (current_func_text_offset + insn_len);
             current_sp_bytes_offset_from_cfa += m_wordsize;
-            row.SetCFAOffset (current_sp_bytes_offset_from_cfa);
+            row->SetCFAOffset (current_sp_bytes_offset_from_cfa);
             UnwindPlan::Row::RegisterLocation regloc;
-            regloc.SetAtCFAPlusOffset (-row.GetCFAOffset());
-            row.SetRegisterInfo (m_lldb_fp_regnum, regloc);
+            regloc.SetAtCFAPlusOffset (-row->GetCFAOffset());
+            row->SetRegisterInfo (m_lldb_fp_regnum, regloc);
             unwind_plan.AppendRow (row);
+            // Allocate a new Row, populate it with the existing Row contents.
+            newrow = new UnwindPlan::Row;
+            *newrow = *row.get();
+            row.reset(newrow);
             goto loopnext;
         }
 
         if (mov_rsp_rbp_pattern_p ())
         {
-            row.SetOffset (current_func_text_offset + insn_len);
-            row.SetCFARegister (m_lldb_fp_regnum);
+            row->SetOffset (current_func_text_offset + insn_len);
+            row->SetCFARegister (m_lldb_fp_regnum);
             unwind_plan.AppendRow (row);
+            // Allocate a new Row, populate it with the existing Row contents.
+            newrow = new UnwindPlan::Row;
+            *newrow = *row.get();
+            row.reset(newrow);
             goto loopnext;
         }
 
@@ -615,15 +629,19 @@
             current_sp_bytes_offset_from_cfa += m_wordsize;
             if (nonvolatile_reg_p (machine_regno) && machine_regno_to_lldb_regno (machine_regno, lldb_regno))
             {
-                row.SetOffset (current_func_text_offset + insn_len);
-                if (row.GetCFARegister() == m_lldb_sp_regnum)
+                row->SetOffset (current_func_text_offset + insn_len);
+                if (row->GetCFARegister() == m_lldb_sp_regnum)
                 {
-                    row.SetCFAOffset (current_sp_bytes_offset_from_cfa);
+                    row->SetCFAOffset (current_sp_bytes_offset_from_cfa);
                 }
                 UnwindPlan::Row::RegisterLocation regloc;
                 regloc.SetAtCFAPlusOffset (-current_sp_bytes_offset_from_cfa);
-                row.SetRegisterInfo (lldb_regno, regloc);
+                row->SetRegisterInfo (lldb_regno, regloc);
                 unwind_plan.AppendRow (row);
+                // Allocate a new Row, populate it with the existing Row contents.
+                newrow = new UnwindPlan::Row;
+                *newrow = *row.get();
+                row.reset(newrow);
             }
             goto loopnext;
         }
@@ -632,11 +650,15 @@
         {
             if (machine_regno_to_lldb_regno (machine_regno, lldb_regno))
             {
-                row.SetOffset (current_func_text_offset + insn_len);
+                row->SetOffset (current_func_text_offset + insn_len);
                 UnwindPlan::Row::RegisterLocation regloc;
-                regloc.SetAtCFAPlusOffset (-row.GetCFAOffset());
-                row.SetRegisterInfo (lldb_regno, regloc);
+                regloc.SetAtCFAPlusOffset (-row->GetCFAOffset());
+                row->SetRegisterInfo (lldb_regno, regloc);
                 unwind_plan.AppendRow (row);
+                // Allocate a new Row, populate it with the existing Row contents.
+                newrow = new UnwindPlan::Row;
+                *newrow = *row.get();
+                row.reset(newrow);
                 goto loopnext;
             }
         }
@@ -644,11 +666,15 @@
         if (sub_rsp_pattern_p (stack_offset))
         {
             current_sp_bytes_offset_from_cfa += stack_offset;
-            if (row.GetCFARegister() == m_lldb_sp_regnum)
+            if (row->GetCFARegister() == m_lldb_sp_regnum)
             {
-                row.SetOffset (current_func_text_offset + insn_len);
-                row.SetCFAOffset (current_sp_bytes_offset_from_cfa);
+                row->SetOffset (current_func_text_offset + insn_len);
+                row->SetCFAOffset (current_sp_bytes_offset_from_cfa);
                 unwind_plan.AppendRow (row);
+                // Allocate a new Row, populate it with the existing Row contents.
+                newrow = new UnwindPlan::Row;
+                *newrow = *row.get();
+                row.reset(newrow);
             }
             goto loopnext;
         }
@@ -722,21 +748,21 @@
     if (ret_insn_offset != LLDB_INVALID_ADDRESS)
     {
         // Create a fresh, empty Row and RegisterLocation - don't mention any other registers
-        UnwindPlan::Row epi_row;
+        UnwindPlan::RowSP epi_row(new UnwindPlan::Row);
         UnwindPlan::Row::RegisterLocation epi_regloc;
 
         // When the ret instruction is about to be executed, here's our state
-        epi_row.SetOffset (ret_insn_offset);
-        epi_row.SetCFARegister (m_lldb_sp_regnum);
-        epi_row.SetCFAOffset (m_wordsize);
+        epi_row->SetOffset (ret_insn_offset);
+        epi_row->SetCFARegister (m_lldb_sp_regnum);
+        epi_row->SetCFAOffset (m_wordsize);
        
         // caller's stack pointer value before the call insn is the CFA address
         epi_regloc.SetIsCFAPlusOffset (0);
-        epi_row.SetRegisterInfo (m_lldb_sp_regnum, epi_regloc);
+        epi_row->SetRegisterInfo (m_lldb_sp_regnum, epi_regloc);
 
         // saved instruction pointer can be found at CFA - wordsize
         epi_regloc.SetAtCFAPlusOffset (-m_wordsize);
-        epi_row.SetRegisterInfo (m_lldb_ip_regnum, epi_regloc);
+        epi_row->SetRegisterInfo (m_lldb_ip_regnum, epi_regloc);
 
         unwind_plan.AppendRow (epi_row);
     }
@@ -755,7 +781,7 @@
 bool 
 AssemblyParse_x86::get_fast_unwind_plan (AddressRange& func, UnwindPlan &unwind_plan)
 {
-    UnwindPlan::Row row;
+    UnwindPlan::RowSP row(new UnwindPlan::Row);
     UnwindPlan::Row::RegisterLocation pc_reginfo;
     UnwindPlan::Row::RegisterLocation sp_reginfo;
     UnwindPlan::Row::RegisterLocation fp_reginfo;
@@ -790,30 +816,41 @@
     }
 
     pc_reginfo.SetAtCFAPlusOffset (-m_wordsize);
-    row.SetRegisterInfo (m_lldb_ip_regnum, pc_reginfo);
+    row->SetRegisterInfo (m_lldb_ip_regnum, pc_reginfo);
 
     sp_reginfo.SetIsCFAPlusOffset (0);
-    row.SetRegisterInfo (m_lldb_sp_regnum, sp_reginfo);
+    row->SetRegisterInfo (m_lldb_sp_regnum, sp_reginfo);
 
     // Zero instructions into the function
-    row.SetCFARegister (m_lldb_sp_regnum);
-    row.SetCFAOffset (m_wordsize);
-    row.SetOffset (0);
+    row->SetCFARegister (m_lldb_sp_regnum);
+    row->SetCFAOffset (m_wordsize);
+    row->SetOffset (0);
     unwind_plan.AppendRow (row);
+    UnwindPlan::Row *newrow = new UnwindPlan::Row;
+    *newrow = *row.get();
+    row.reset(newrow);
 
     // push %rbp has executed - stack moved, rbp now saved
-    row.SetCFAOffset (2 * m_wordsize);
+    row->SetCFAOffset (2 * m_wordsize);
     fp_reginfo.SetAtCFAPlusOffset (2 * -m_wordsize);
-    row.SetRegisterInfo (m_lldb_fp_regnum, fp_reginfo);
-    row.SetOffset (1);
+    row->SetRegisterInfo (m_lldb_fp_regnum, fp_reginfo);
+    row->SetOffset (1);
     unwind_plan.AppendRow (row);
 
+    newrow = new UnwindPlan::Row;
+    *newrow = *row.get();
+    row.reset(newrow);
+    
     // mov %rsp, %rbp has executed
-    row.SetCFARegister (m_lldb_fp_regnum);
-    row.SetCFAOffset (2 * m_wordsize);
-    row.SetOffset (prologue_size);     /// 3 or 4 bytes depending on arch
+    row->SetCFARegister (m_lldb_fp_regnum);
+    row->SetCFAOffset (2 * m_wordsize);
+    row->SetOffset (prologue_size);     /// 3 or 4 bytes depending on arch
     unwind_plan.AppendRow (row);
 
+    newrow = new UnwindPlan::Row;
+    *newrow = *row.get();
+    row.reset(newrow);
+
     unwind_plan.SetPlanValidAddressRange (func);
     return true;
 }

Modified: lldb/branches/lldb-platform-work/source/Symbol/Block.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Symbol/Block.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Symbol/Block.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Symbol/Block.cpp Mon Jul 23 19:12:48 2012
@@ -542,7 +542,7 @@
 }
 
 clang::DeclContext *
-Block::GetClangDeclContextForInlinedFunction()
+Block::GetClangDeclContext()
 {
     SymbolContext sc;
     

Modified: lldb/branches/lldb-platform-work/source/Symbol/ClangASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Symbol/ClangASTContext.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Symbol/ClangASTContext.cpp Mon Jul 23 19:12:48 2012
@@ -1156,9 +1156,6 @@
     if (decl)
         SetMetadata(ast, (uintptr_t)decl, metadata);
     
-    if (!name)
-        decl->setAnonymousStructOrUnion(true);
-
     if (decl_ctx)
     {
         if (access_type != eAccessNone)
@@ -1961,8 +1958,18 @@
                                                   false,      // Mutable
                                                   false);     // HasInit
             
-            if (!name)
-                field->setImplicit();
+            if (!name) {
+                // Determine whether this field corresponds to an anonymous
+                // struct or union.
+                if (const TagType *TagT = field->getType()->getAs<TagType>()) {
+                  if (RecordDecl *Rec = dyn_cast<RecordDecl>(TagT->getDecl()))
+                    if (!Rec->getDeclName()) {
+                      Rec->setAnonymousStructOrUnion(true);
+                      field->setImplicit();
+
+                    }
+                }
+            }
 
             field->setAccess (ConvertAccessTypeToAccessSpecifier (access));
 
@@ -2413,7 +2420,7 @@
         {
             ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterface();
             
-            clang_type_t property_opaque_type_to_access;
+            clang_type_t property_opaque_type_to_access = NULL;
             
             if (property_opaque_type)
                 property_opaque_type_to_access = property_opaque_type;
@@ -6323,3 +6330,49 @@
     return llvm::dyn_cast<clang::DeclContext>(objc_method_decl);
 }
 
+
+bool
+ClangASTContext::GetClassMethodInfoForDeclContext (clang::DeclContext *decl_ctx,
+                                                   lldb::LanguageType &language,
+                                                   bool &is_instance_method,
+                                                   ConstString &language_object_name)
+{
+    language_object_name.Clear();
+    language = eLanguageTypeUnknown;
+    is_instance_method = false;
+
+    if (decl_ctx)
+    {
+        if (clang::CXXMethodDecl *method_decl = llvm::dyn_cast<clang::CXXMethodDecl>(decl_ctx))
+        {
+            if (method_decl->isStatic())
+            {
+                is_instance_method = false;
+            }
+            else
+            {
+                language_object_name.SetCString("this");
+                is_instance_method = true;
+            }
+            language = eLanguageTypeC_plus_plus;
+            return true;
+        }
+        else if (clang::ObjCMethodDecl *method_decl = llvm::dyn_cast<clang::ObjCMethodDecl>(decl_ctx))
+        {
+            // Both static and instance methods have a "self" object in objective C
+            language_object_name.SetCString("self");
+            if (method_decl->isInstanceMethod())
+            {
+                is_instance_method = true;
+            }
+            else
+            {
+                is_instance_method = false;
+            }
+            language = eLanguageTypeObjC;
+            return true;
+        }
+    }
+    return false;
+}
+

Modified: lldb/branches/lldb-platform-work/source/Symbol/ClangASTImporter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Symbol/ClangASTImporter.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Symbol/ClangASTImporter.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Symbol/ClangASTImporter.cpp Mon Jul 23 19:12:48 2012
@@ -161,7 +161,7 @@
             CompleteObjCInterfaceDecl(interface_decl);
         }
     }
-    else if (ObjCProtocolDecl *protocol_decl = dyn_cast<ObjCProtocolDecl>(protocol_decl)) 
+    else if (ObjCProtocolDecl *protocol_decl = dyn_cast<ObjCProtocolDecl>(decl)) 
     {
         if (!protocol_decl->getDefinition())
             protocol_decl->startDefinition();

Modified: lldb/branches/lldb-platform-work/source/Symbol/DWARFCallFrameInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Symbol/DWARFCallFrameInfo.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Symbol/DWARFCallFrameInfo.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Symbol/DWARFCallFrameInfo.cpp Mon Jul 23 19:12:48 2012
@@ -293,9 +293,14 @@
 {
     if (m_section_sp.get() == NULL || m_section_sp->IsEncrypted())
         return;
+    
     if (m_fde_index_initialized)
         return;
-
+    
+    Mutex::Locker locker(m_fde_index_mutex);
+    
+    if (m_fde_index_initialized) // if two threads hit the locker
+        return;
 
     dw_offset_t offset = 0;
     if (m_cfi_data_initialized == false)
@@ -393,12 +398,13 @@
 
     uint32_t reg_num = 0;
     int32_t op_offset = 0;
-    uint32_t tmp_uval32;
     uint32_t code_align = cie->code_align;
     int32_t data_align = cie->data_align;
 
     unwind_plan.SetPlanValidAddressRange (range);
-    UnwindPlan::Row row = cie->initial_row;
+    UnwindPlan::Row *cie_initial_row = new UnwindPlan::Row;
+    *cie_initial_row = cie->initial_row;
+    UnwindPlan::RowSP row(cie_initial_row);
 
     unwind_plan.SetRegisterKind (m_reg_kind);
 
@@ -421,7 +427,7 @@
                         // value and adding (delta * code_align). All other
                         // values in the new row are initially identical to the current row.
                         unwind_plan.AppendRow(row);
-                        row.SlideOffset(extended_opcode * code_align);
+                        row->SlideOffset(extended_opcode * code_align);
                     }
                     break;
 
@@ -435,7 +441,7 @@
                         reg_num = extended_opcode;
                         op_offset = (int32_t)m_cfi_data.GetULEB128(&offset) * data_align;
                         reg_location.SetAtCFAPlusOffset(op_offset);
-                        row.SetRegisterInfo (reg_num, reg_location);
+                        row->SetRegisterInfo (reg_num, reg_location);
                     }
                     break;
 
@@ -450,8 +456,8 @@
                         // by the register index in that state, so we need to convert our
                         // GCC register number from the EH frame info, to a register index
 
-                        if (unwind_plan.IsValidRowIndex(0) && unwind_plan.GetRowAtIndex(0).GetRegisterInfo(reg_num, reg_location))
-                            row.SetRegisterInfo (reg_num, reg_location);
+                        if (unwind_plan.IsValidRowIndex(0) && unwind_plan.GetRowAtIndex(0)->GetRegisterInfo(reg_num, reg_location))
+                            row->SetRegisterInfo (reg_num, reg_location);
                     }
                     break;
             }
@@ -471,7 +477,7 @@
                         // are initially identical to the current row. The new location value
                         // should always be greater than the current one.
                         unwind_plan.AppendRow(row);
-                        row.SetOffset(m_cfi_data.GetPointer(&offset) - startaddr.GetFileAddress());
+                        row->SetOffset(m_cfi_data.GetPointer(&offset) - startaddr.GetFileAddress());
                     }
                     break;
 
@@ -481,7 +487,7 @@
                         // This instruction is identical to DW_CFA_advance_loc except for the
                         // encoding and size of the delta argument.
                         unwind_plan.AppendRow(row);
-                        row.SlideOffset (m_cfi_data.GetU8(&offset) * code_align);
+                        row->SlideOffset (m_cfi_data.GetU8(&offset) * code_align);
                     }
                     break;
 
@@ -491,7 +497,7 @@
                         // This instruction is identical to DW_CFA_advance_loc except for the
                         // encoding and size of the delta argument.
                         unwind_plan.AppendRow(row);
-                        row.SlideOffset (m_cfi_data.GetU16(&offset) * code_align);
+                        row->SlideOffset (m_cfi_data.GetU16(&offset) * code_align);
                     }
                     break;
 
@@ -501,7 +507,7 @@
                         // This instruction is identical to DW_CFA_advance_loc except for the
                         // encoding and size of the delta argument.
                         unwind_plan.AppendRow(row);
-                        row.SlideOffset (m_cfi_data.GetU32(&offset) * code_align);
+                        row->SlideOffset (m_cfi_data.GetU32(&offset) * code_align);
                     }
                     break;
 
@@ -513,7 +519,7 @@
                         reg_num = (uint32_t)m_cfi_data.GetULEB128(&offset);
                         op_offset = (int32_t)m_cfi_data.GetULEB128(&offset) * data_align;
                         reg_location.SetAtCFAPlusOffset(op_offset);
-                        row.SetRegisterInfo (reg_num, reg_location);
+                        row->SetRegisterInfo (reg_num, reg_location);
                     }
                     break;
 
@@ -523,8 +529,8 @@
                         // number. This instruction is identical to DW_CFA_restore except for
                         // the encoding and size of the register argument.
                         reg_num = (uint32_t)m_cfi_data.GetULEB128(&offset);
-                        if (unwind_plan.IsValidRowIndex(0) && unwind_plan.GetRowAtIndex(0).GetRegisterInfo(reg_num, reg_location))
-                            row.SetRegisterInfo (reg_num, reg_location);
+                        if (unwind_plan.IsValidRowIndex(0) && unwind_plan.GetRowAtIndex(0)->GetRegisterInfo(reg_num, reg_location))
+                            row->SetRegisterInfo (reg_num, reg_location);
                     }
                     break;
 
@@ -535,7 +541,7 @@
                         // register to undefined.
                         reg_num = (uint32_t)m_cfi_data.GetULEB128(&offset);
                         reg_location.SetUndefined();
-                        row.SetRegisterInfo (reg_num, reg_location);
+                        row->SetRegisterInfo (reg_num, reg_location);
                     }
                     break;
 
@@ -546,7 +552,7 @@
                         // register to same value.
                         reg_num = (uint32_t)m_cfi_data.GetULEB128(&offset);
                         reg_location.SetSame();
-                        row.SetRegisterInfo (reg_num, reg_location);
+                        row->SetRegisterInfo (reg_num, reg_location);
                     }
                     break;
 
@@ -559,7 +565,7 @@
                         reg_num = (uint32_t)m_cfi_data.GetULEB128(&offset);
                         uint32_t other_reg_num = (uint32_t)m_cfi_data.GetULEB128(&offset);
                         reg_location.SetInRegister(other_reg_num);
-                        row.SetRegisterInfo (reg_num, reg_location);
+                        row->SetRegisterInfo (reg_num, reg_location);
                     }
                     break;
 
@@ -595,8 +601,8 @@
                         // register and offset.
                         reg_num = (uint32_t)m_cfi_data.GetULEB128(&offset);
                         op_offset = (int32_t)m_cfi_data.GetULEB128(&offset);
-                        row.SetCFARegister (reg_num);
-                        row.SetCFAOffset (op_offset);
+                        row->SetCFARegister (reg_num);
+                        row->SetCFAOffset (op_offset);
                     }
                     break;
 
@@ -606,7 +612,7 @@
                         // number. The required action is to define the current CFA rule to
                         // use the provided register (but to keep the old offset).
                         reg_num = (uint32_t)m_cfi_data.GetULEB128(&offset);
-                        row.SetCFARegister (reg_num);
+                        row->SetCFARegister (reg_num);
                     }
                     break;
 
@@ -617,7 +623,7 @@
                         // the current CFA rule to use the provided offset (but
                         // to keep the old register).
                         op_offset = (int32_t)m_cfi_data.GetULEB128(&offset);
-                        row.SetCFAOffset (op_offset);
+                        row->SetCFAOffset (op_offset);
                     }
                     break;
 
@@ -643,7 +649,7 @@
                         const uint8_t *block_data = (uint8_t *)m_cfi_data.GetData(&offset, block_len);
 
                         reg_location.SetAtDWARFExpression(block_data, block_len);
-                        row.SetRegisterInfo (reg_num, reg_location);
+                        row->SetRegisterInfo (reg_num, reg_location);
                     }
                     break;
 
@@ -656,7 +662,7 @@
                         reg_num = (uint32_t)m_cfi_data.GetULEB128(&offset);
                         op_offset = (int32_t)m_cfi_data.GetSLEB128(&offset) * data_align;
                         reg_location.SetAtCFAPlusOffset(op_offset);
-                        row.SetRegisterInfo (reg_num, reg_location);
+                        row->SetRegisterInfo (reg_num, reg_location);
                     }
                     break;
 
@@ -668,8 +674,8 @@
                         // that the second operand is signed and factored.
                         reg_num = (uint32_t)m_cfi_data.GetULEB128(&offset);
                         op_offset = (int32_t)m_cfi_data.GetSLEB128(&offset) * data_align;
-                        row.SetCFARegister (reg_num);
-                        row.SetCFAOffset (op_offset);
+                        row->SetCFARegister (reg_num);
+                        row->SetCFAOffset (op_offset);
                     }
                     break;
 
@@ -679,7 +685,7 @@
                         // offset. This instruction is identical to  DW_CFA_def_cfa_offset
                         // except that the operand is signed and factored.
                         op_offset = (int32_t)m_cfi_data.GetSLEB128(&offset) * data_align;
-                        row.SetCFAOffset (op_offset);
+                        row->SetCFAOffset (op_offset);
                     }
                     break;
 
@@ -736,14 +742,13 @@
 //                      }
 //#endif
                         reg_location.SetIsDWARFExpression(block_data, block_len);
-                        row.SetRegisterInfo (reg_num, reg_location);
+                        row->SetRegisterInfo (reg_num, reg_location);
                     }
                     break;
 
                 case DW_CFA_val_offset          :   // 0x14
                 case DW_CFA_val_offset_sf       :   // 0x15
                 default:
-                    tmp_uval32 = extended_opcode;
                     break;
             }
         }

Modified: lldb/branches/lldb-platform-work/source/Symbol/Function.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Symbol/Function.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Symbol/Function.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Symbol/Function.cpp Mon Jul 23 19:12:48 2012
@@ -100,7 +100,7 @@
     const Declaration *call_decl_ptr
 ) :
     FunctionInfo(name, decl_ptr),
-    m_mangled(mangled, true),
+    m_mangled(ConstString(mangled), true),
     m_call_decl (call_decl_ptr)
 {
 }
@@ -233,7 +233,7 @@
     m_comp_unit (comp_unit),
     m_type_uid (type_uid),
     m_type (type),
-    m_mangled (mangled, true),
+    m_mangled (ConstString(mangled), true),
     m_block (func_uid),
     m_range (range),
     m_frame_base (),

Modified: lldb/branches/lldb-platform-work/source/Symbol/Symbol.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Symbol/Symbol.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Symbol/Symbol.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Symbol/Symbol.cpp Mon Jul 23 19:12:48 2012
@@ -54,7 +54,7 @@
 ) :
     SymbolContextScope (),
     m_uid (symID),
-    m_mangled (name, name_is_mangled),
+    m_mangled (ConstString(name), name_is_mangled),
     m_type_data (0),
     m_type_data_resolved (false),
     m_is_synthetic (is_artificial),
@@ -84,7 +84,7 @@
 ) :
     SymbolContextScope (),
     m_uid (symID),
-    m_mangled (name, name_is_mangled),
+    m_mangled (ConstString(name), name_is_mangled),
     m_type_data (0),
     m_type_data_resolved (false),
     m_is_synthetic (is_artificial),

Modified: lldb/branches/lldb-platform-work/source/Symbol/SymbolContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Symbol/SymbolContext.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Symbol/SymbolContext.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Symbol/SymbolContext.cpp Mon Jul 23 19:12:48 2012
@@ -13,6 +13,8 @@
 #include "lldb/Core/Module.h"
 #include "lldb/Host/Host.h"
 #include "lldb/Interpreter/Args.h"
+#include "lldb/Symbol/Block.h"
+#include "lldb/Symbol/ClangASTContext.h"
 #include "lldb/Symbol/CompileUnit.h"
 #include "lldb/Symbol/ObjectFile.h"
 #include "lldb/Symbol/Symbol.h"
@@ -535,7 +537,61 @@
     return false;
 }
 
-ConstString 
+Block *
+SymbolContext::GetFunctionBlock ()
+{
+    if (function)
+    {
+        if (block)
+        {
+            // If this symbol context has a block, check to see if this block
+            // is itself, or is contained within a block with inlined function
+            // information. If so, then the inlined block is the block that
+            // defines the function.
+            Block *inlined_block = block->GetContainingInlinedBlock();
+            if (inlined_block)
+                return inlined_block;
+
+            // The block in this symbol context is not inside an inlined
+            // block, so the block that defines the function is the function's
+            // top level block, which is returned below.
+        }
+
+        // There is no block information in this symbol context, so we must
+        // assume that the block that is desired is the top level block of
+        // the function itself.
+        return &function->GetBlock(true);
+    }
+    return NULL;
+}
+
+bool
+SymbolContext::GetFunctionMethodInfo (lldb::LanguageType &language,
+                                      bool &is_instance_method,
+                                      ConstString &language_object_name)
+
+
+{
+    Block *function_block = GetFunctionBlock ();
+    if (function_block)
+    {
+        clang::DeclContext *decl_context = function_block->GetClangDeclContext();
+        
+        if (decl_context)
+        {
+            return ClangASTContext::GetClassMethodInfoForDeclContext (decl_context,
+                                                                      language,
+                                                                      is_instance_method,
+                                                                      language_object_name);
+        }
+    }
+    language = eLanguageTypeUnknown;
+    is_instance_method = false;
+    language_object_name.Clear();
+    return false;
+}
+
+ConstString
 SymbolContext::GetFunctionName (Mangled::NamePreference preference)
 {
     if (function)

Modified: lldb/branches/lldb-platform-work/source/Symbol/UnwindPlan.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Symbol/UnwindPlan.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Symbol/UnwindPlan.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Symbol/UnwindPlan.cpp Mon Jul 23 19:12:48 2012
@@ -295,36 +295,44 @@
     m_cfa_reg_num = reg_num;
 }
 
+bool
+UnwindPlan::Row::operator == (const UnwindPlan::Row& rhs) const
+{
+    if (m_offset != rhs.m_offset || m_cfa_reg_num != rhs.m_cfa_reg_num || m_cfa_offset != rhs.m_cfa_offset)
+        return false;
+    return m_register_locations == rhs.m_register_locations;
+}
+
 void
-UnwindPlan::AppendRow (const UnwindPlan::Row &row)
+UnwindPlan::AppendRow (const UnwindPlan::RowSP &row_sp)
 {
-    if (m_row_list.empty() || m_row_list.back().GetOffset() != row.GetOffset())
-        m_row_list.push_back(row);
+    if (m_row_list.empty() || m_row_list.back()->GetOffset() != row_sp->GetOffset())
+        m_row_list.push_back(row_sp);
     else
-        m_row_list.back() = row;
+        m_row_list.back() = row_sp;
 }
 
-const UnwindPlan::Row *
+UnwindPlan::RowSP
 UnwindPlan::GetRowForFunctionOffset (int offset) const
 {
-    const UnwindPlan::Row *row_ptr = NULL;
+    RowSP row;
     if (!m_row_list.empty())
     {
         if (offset == -1)
-            row_ptr = &m_row_list.back();
+            row = m_row_list.back();
         else
         {
             collection::const_iterator pos, end = m_row_list.end();
             for (pos = m_row_list.begin(); pos != end; ++pos)
             {
-                if (pos->GetOffset() <= offset)
-                    row_ptr = &*pos;
+                if ((*pos)->GetOffset() <= offset)
+                    row = *pos;
                 else
                     break;
             }
         }
     }
-    return row_ptr;
+    return row;
 }
 
 bool
@@ -333,7 +341,7 @@
     return idx < m_row_list.size();
 }
 
-const UnwindPlan::Row&
+const UnwindPlan::RowSP
 UnwindPlan::GetRowAtIndex (uint32_t idx) const
 {
     // You must call IsValidRowIndex(idx) first before calling this!!!
@@ -341,7 +349,7 @@
     return m_row_list[idx];
 }
 
-const UnwindPlan::Row&
+const UnwindPlan::RowSP
 UnwindPlan::GetLastRow () const
 {
     // You must call GetRowCount() first to make sure there is at least one row
@@ -410,7 +418,7 @@
     for (pos = begin; pos != end; ++pos)
     {
         s.Printf ("row[%u]: ", (uint32_t)std::distance (begin, pos));
-        pos->Dump(s, this, thread, base_addr);
+        (*pos)->Dump(s, this, thread, base_addr);
     }
 }
 

Modified: lldb/branches/lldb-platform-work/source/Symbol/UnwindTable.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Symbol/UnwindTable.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Symbol/UnwindTable.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Symbol/UnwindTable.cpp Mon Jul 23 19:12:48 2012
@@ -107,6 +107,31 @@
     return func_unwinder_sp;
 }
 
+// Ignore any existing FuncUnwinders for this function, create a new one and don't add it to the
+// UnwindTable.  This is intended for use by target modules show-unwind where we want to create 
+// new UnwindPlans, not re-use existing ones.
+
+FuncUnwindersSP
+UnwindTable::GetUncachedFuncUnwindersContainingAddress (const Address& addr, SymbolContext &sc)
+{
+    FuncUnwindersSP no_unwind_found;
+    Initialize();
+
+    AddressRange range;
+    if (!sc.GetAddressRange(eSymbolContextFunction | eSymbolContextSymbol, 0, false, range) || !range.GetBaseAddress().IsValid())
+    {
+        // Does the eh_frame unwind info has a function bounds for this addr?
+        if (m_eh_frame == NULL || !m_eh_frame->GetAddressRange (addr, range))
+        {
+            return no_unwind_found;
+        }
+    }
+
+    FuncUnwindersSP func_unwinder_sp(new FuncUnwinders(*this, m_assembly_profiler, range));
+    return func_unwinder_sp;
+}
+
+
 void
 UnwindTable::Dump (Stream &s)
 {

Modified: lldb/branches/lldb-platform-work/source/Symbol/Variable.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Symbol/Variable.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Symbol/Variable.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Symbol/Variable.cpp Mon Jul 23 19:12:48 2012
@@ -46,7 +46,7 @@
 ) :
     UserID(uid),
     m_name(name),
-    m_mangled (mangled, true),
+    m_mangled (ConstString(mangled), true),
     m_symfile_type_sp(symfile_type_sp),
     m_scope(scope),
     m_owner_scope(context),

Modified: lldb/branches/lldb-platform-work/source/Symbol/VariableList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Symbol/VariableList.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Symbol/VariableList.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Symbol/VariableList.cpp Mon Jul 23 19:12:48 2012
@@ -176,3 +176,40 @@
     }
 }
 
+lldb::VariableSP
+VariableList::FindArtificialObjectVariable (lldb::LanguageType language) const
+{
+    lldb::VariableSP object_variable_sp;
+    ConstString object_variable_name;
+    switch (language)
+    {
+        case eLanguageTypeC_plus_plus:
+            object_variable_name.SetCString("this");
+            break;
+
+        case eLanguageTypeObjC:
+        case eLanguageTypeObjC_plus_plus:
+            object_variable_name.SetCString("self");
+            break;
+
+        default:
+            break;
+    }
+    if (object_variable_name)
+    {
+        const_iterator pos, end = m_variables.end();
+        for (pos = m_variables.begin(); pos != end; ++pos)
+        {
+            Variable *variable = pos->get();
+            if (variable->IsArtificial() &&
+                variable->GetScope() == eValueTypeVariableArgument &&
+                variable->GetName() == object_variable_name)
+            {
+                object_variable_sp = *pos;
+                break;
+            }
+        }
+    }
+    return object_variable_sp;
+}
+

Modified: lldb/branches/lldb-platform-work/source/Target/Process.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Target/Process.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Target/Process.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Target/Process.cpp Mon Jul 23 19:12:48 2012
@@ -1621,6 +1621,11 @@
 Process::DisableAllBreakpointSites ()
 {
     m_breakpoint_site_list.SetEnabledForAll (false);
+    size_t num_sites = m_breakpoint_site_list.GetSize();
+    for (size_t i = 0; i < num_sites; i++)
+    {
+        DisableBreakpoint (m_breakpoint_site_list.GetByIndex(i).get());
+    }
 }
 
 Error
@@ -2704,75 +2709,6 @@
     return error;
 }
 
-//Error
-//Process::Attach (const char *process_name, bool wait_for_launch)
-//{
-//    m_abi_sp.reset();
-//    m_process_input_reader.reset();
-//    
-//    // Find the process and its architecture.  Make sure it matches the architecture
-//    // of the current Target, and if not adjust it.
-//    Error error;
-//    
-//    if (!wait_for_launch)
-//    {
-//        ProcessInstanceInfoList process_infos;
-//        PlatformSP platform_sp (m_target.GetPlatform ());
-//        assert (platform_sp.get());
-//        
-//        if (platform_sp)
-//        {
-//            ProcessInstanceInfoMatch match_info;
-//            match_info.GetProcessInfo().SetName(process_name);
-//            match_info.SetNameMatchType (eNameMatchEquals);
-//            platform_sp->FindProcesses (match_info, process_infos);
-//            if (process_infos.GetSize() > 1)
-//            {
-//                error.SetErrorStringWithFormat ("more than one process named %s", process_name);
-//            }
-//            else if (process_infos.GetSize() == 0)
-//            {
-//                error.SetErrorStringWithFormat ("could not find a process named %s", process_name);
-//            }
-//        }
-//        else
-//        {        
-//            error.SetErrorString ("invalid platform");
-//        }
-//    }
-//
-//    if (error.Success())
-//    {
-//        m_dyld_ap.reset();
-//        m_os_ap.reset();
-//        
-//        error = WillAttachToProcessWithName(process_name, wait_for_launch);
-//        if (error.Success())
-//        {
-//            SetPublicState (eStateAttaching);
-//            error = DoAttachToProcessWithName (process_name, wait_for_launch);
-//            if (error.Fail())
-//            {
-//                if (GetID() != LLDB_INVALID_PROCESS_ID)
-//                {
-//                    SetID (LLDB_INVALID_PROCESS_ID);
-//                    const char *error_string = error.AsCString();
-//                    if (error_string == NULL)
-//                        error_string = "attach failed";
-//
-//                    SetExitStatus(-1, error_string);
-//                }
-//            }
-//            else
-//            {
-//                SetNextEventAction(new Process::AttachCompletionHandler(this, 0));
-//                StartPrivateStateThread();
-//            }
-//        }
-//    }
-//    return error;
-//}
-
 void
 Process::CompleteAttach ()
 {
@@ -3174,11 +3110,11 @@
                     // break at main.cpp:58, run and hit the breakpoints on
                     // multiple threads, then somehow during the stepping over
                     // of all breakpoints no run gets reported.
-                    return_value = true;
 
                     // This is a transition from stop to run.
                     switch (m_thread_list.ShouldReportRun (event_ptr))
                     {
+                        default:
                         case eVoteYes:
                         case eVoteNoOpinion:
                             return_value = true;
@@ -4138,546 +4074,580 @@
     
     Listener listener("lldb.process.listener.run-thread-plan");
     
-    // This process event hijacker Hijacks the Public events and its destructor makes sure that the process events get 
-    // restored on exit to the function.
+    lldb::EventSP event_to_broadcast_sp;
     
-    ProcessEventHijacker run_thread_plan_hijacker (*this, &listener);
-        
-    if (log)
     {
-        StreamString s;
-        thread_plan_sp->GetDescription(&s, lldb::eDescriptionLevelVerbose);
-        log->Printf ("Process::RunThreadPlan(): Resuming thread %u - 0x%4.4llx to run thread plan \"%s\".",  
-                     thread->GetIndexID(), 
-                     thread->GetID(), 
-                     s.GetData());
-    }
-    
-    bool got_event;
-    lldb::EventSP event_sp;
-    lldb::StateType stop_state = lldb::eStateInvalid;
-    
-    TimeValue* timeout_ptr = NULL;
-    TimeValue real_timeout;
-    
-    bool first_timeout = true;
-    bool do_resume = true;
-    
-    while (1)
-    {
-        // We usually want to resume the process if we get to the top of the loop.
-        // The only exception is if we get two running events with no intervening
-        // stop, which can happen, we will just wait for then next stop event.
+        // This process event hijacker Hijacks the Public events and its destructor makes sure that the process events get
+        // restored on exit to the function.
+        //
+        // If the event needs to propagate beyond the hijacker (e.g., the process exits during execution), then the event
+        // is put into event_to_broadcast_sp for rebroadcasting.
         
-        if (do_resume)
+        ProcessEventHijacker run_thread_plan_hijacker (*this, &listener);
+            
+        if (log)
         {
-            // Do the initial resume and wait for the running event before going further.
-    
-            Error resume_error = PrivateResume ();
-            if (!resume_error.Success())
-            {
-                errors.Printf("Error resuming inferior: \"%s\".\n", resume_error.AsCString());
-                return_value = eExecutionSetupError;
-                break;
-            }
-    
-            real_timeout = TimeValue::Now();
-            real_timeout.OffsetWithMicroSeconds(500000);
-            timeout_ptr = &real_timeout;
+            StreamString s;
+            thread_plan_sp->GetDescription(&s, lldb::eDescriptionLevelVerbose);
+            log->Printf ("Process::RunThreadPlan(): Resuming thread %u - 0x%4.4llx to run thread plan \"%s\".",  
+                         thread->GetIndexID(), 
+                         thread->GetID(), 
+                         s.GetData());
+        }
+        
+        bool got_event;
+        lldb::EventSP event_sp;
+        lldb::StateType stop_state = lldb::eStateInvalid;
+        
+        TimeValue* timeout_ptr = NULL;
+        TimeValue real_timeout;
+        
+        bool first_timeout = true;
+        bool do_resume = true;
+        
+        while (1)
+        {
+            // We usually want to resume the process if we get to the top of the loop.
+            // The only exception is if we get two running events with no intervening
+            // stop, which can happen, we will just wait for then next stop event.
             
-            got_event = listener.WaitForEvent(timeout_ptr, event_sp);
-            if (!got_event)
+            if (do_resume)
             {
-                if (log)
-                    log->PutCString("Process::RunThreadPlan(): didn't get any event after initial resume, exiting.");
+                // Do the initial resume and wait for the running event before going further.
+        
+                Error resume_error = PrivateResume ();
+                if (!resume_error.Success())
+                {
+                    errors.Printf("Error resuming inferior: \"%s\".\n", resume_error.AsCString());
+                    return_value = eExecutionSetupError;
+                    break;
+                }
+        
+                real_timeout = TimeValue::Now();
+                real_timeout.OffsetWithMicroSeconds(500000);
+                timeout_ptr = &real_timeout;
+                
+                got_event = listener.WaitForEvent(timeout_ptr, event_sp);
+                if (!got_event)
+                {
+                    if (log)
+                        log->PutCString("Process::RunThreadPlan(): didn't get any event after initial resume, exiting.");
 
-                errors.Printf("Didn't get any event after initial resume, exiting.");
-                return_value = eExecutionSetupError;
-                break;
-            }
+                    errors.Printf("Didn't get any event after initial resume, exiting.");
+                    return_value = eExecutionSetupError;
+                    break;
+                }
+                
+                stop_state = Process::ProcessEventData::GetStateFromEvent(event_sp.get());
+                if (stop_state != eStateRunning)
+                {
+                    if (log)
+                        log->Printf("Process::RunThreadPlan(): didn't get running event after initial resume, got %s instead.", StateAsCString(stop_state));
+
+                    errors.Printf("Didn't get running event after initial resume, got %s instead.", StateAsCString(stop_state));
+                    return_value = eExecutionSetupError;
+                    break;
+                }
             
-            stop_state = Process::ProcessEventData::GetStateFromEvent(event_sp.get());
-            if (stop_state != eStateRunning)
-            {
                 if (log)
-                    log->Printf("Process::RunThreadPlan(): didn't get running event after initial resume, got %s instead.", StateAsCString(stop_state));
-
-                errors.Printf("Didn't get running event after initial resume, got %s instead.", StateAsCString(stop_state));
-                return_value = eExecutionSetupError;
-                break;
+                    log->PutCString ("Process::RunThreadPlan(): resuming succeeded.");
+                // We need to call the function synchronously, so spin waiting for it to return.
+                // If we get interrupted while executing, we're going to lose our context, and
+                // won't be able to gather the result at this point.
+                // We set the timeout AFTER the resume, since the resume takes some time and we
+                // don't want to charge that to the timeout.
+                
+                if (single_thread_timeout_usec != 0)
+                {
+                    // we have a > 0 timeout, let us set it so that we stop after the deadline
+                    real_timeout = TimeValue::Now();
+                    real_timeout.OffsetWithMicroSeconds(single_thread_timeout_usec);
+                        
+                    timeout_ptr = &real_timeout;
+                }
+                else if (first_timeout)
+                {
+                    // if we are willing to wait "forever" we still need to have an initial timeout
+                    // this timeout is going to induce all threads to run when hit. we do this so that
+                    // we can avoid ending locked up because of multithreaded contention issues
+                    real_timeout = TimeValue::Now();
+                    real_timeout.OffsetWithNanoSeconds(500000000UL);
+                    timeout_ptr = &real_timeout;
+                }
+                else
+                {
+                    timeout_ptr = NULL; // if we are in a no-timeout scenario, then we only need a fake timeout the first time through
+                    // at this point in the code, all threads will be running so we are willing to wait forever, and do not
+                    // need a timeout
+                }
             }
-        
-            if (log)
-                log->PutCString ("Process::RunThreadPlan(): resuming succeeded.");
-            // We need to call the function synchronously, so spin waiting for it to return.
-            // If we get interrupted while executing, we're going to lose our context, and
-            // won't be able to gather the result at this point.
-            // We set the timeout AFTER the resume, since the resume takes some time and we
-            // don't want to charge that to the timeout.
-            
-            if (single_thread_timeout_usec != 0)
+            else
             {
-                real_timeout = TimeValue::Now();
-                real_timeout.OffsetWithMicroSeconds(single_thread_timeout_usec);
-                    
-                timeout_ptr = &real_timeout;
+                if (log)
+                    log->PutCString ("Process::RunThreadPlan(): handled an extra running event.");
+                do_resume = true;
             }
-        }
-        else
-        {
-            if (log)
-                log->PutCString ("Process::RunThreadPlan(): handled an extra running event.");
-            do_resume = true;
-        }
-        
-        // Now wait for the process to stop again:
-        stop_state = lldb::eStateInvalid;
-        event_sp.reset();
+            
+            // Now wait for the process to stop again:
+            event_sp.reset();
 
-        if (log)
-        {
-            if (timeout_ptr)
-            {
-                StreamString s;
-                s.Printf ("about to wait - timeout is:\n   ");
-                timeout_ptr->Dump (&s, 120);
-                s.Printf ("\nNow is:\n    ");
-                TimeValue::Now().Dump (&s, 120);
-                log->Printf ("Process::RunThreadPlan(): %s", s.GetData());
-            }
-            else
+            if (log)
             {
-                log->Printf ("Process::RunThreadPlan(): about to wait forever.");
+                if (timeout_ptr)
+                {
+                    StreamString s;
+                    s.Printf ("about to wait - timeout is:\n   ");
+                    timeout_ptr->Dump (&s, 120);
+                    s.Printf ("\nNow is:\n    ");
+                    TimeValue::Now().Dump (&s, 120);
+                    log->Printf ("Process::RunThreadPlan(): %s", s.GetData());
+                }
+                else
+                {
+                    log->Printf ("Process::RunThreadPlan(): about to wait forever.");
+                }
             }
-        }
-        
-        got_event = listener.WaitForEvent (timeout_ptr, event_sp);
-        
-        if (got_event)
-        {
-            if (event_sp.get())
+            
+            got_event = listener.WaitForEvent (timeout_ptr, event_sp);
+            
+            if (got_event)
             {
-                bool keep_going = false;
-                stop_state = Process::ProcessEventData::GetStateFromEvent(event_sp.get());
-                if (log)
-                    log->Printf("Process::RunThreadPlan(): in while loop, got event: %s.", StateAsCString(stop_state));
-                    
-                switch (stop_state)
+                if (event_sp.get())
                 {
-                case lldb::eStateStopped:
+                    bool keep_going = false;
+                    stop_state = Process::ProcessEventData::GetStateFromEvent(event_sp.get());
+                    if (log)
+                        log->Printf("Process::RunThreadPlan(): in while loop, got event: %s.", StateAsCString(stop_state));
+                        
+                    switch (stop_state)
                     {
-                        // Yay, we're done.  Now make sure that our thread plan actually completed.
-                        ThreadSP thread_sp = GetThreadList().FindThreadByIndexID (thread_idx_id);
-                        if (!thread_sp)
-                        {
-                            // Ooh, our thread has vanished.  Unlikely that this was successful execution...
-                            if (log)
-                                log->Printf ("Process::RunThreadPlan(): execution completed but our thread (index-id=%u) has vanished.", thread_idx_id);
-                            return_value = eExecutionInterrupted;
-                        }
-                        else
+                    case lldb::eStateStopped:
                         {
-                            StopInfoSP stop_info_sp (thread_sp->GetStopInfo ());
-                            StopReason stop_reason = eStopReasonInvalid;
-                            if (stop_info_sp)
-                                 stop_reason = stop_info_sp->GetStopReason();
-                            if (stop_reason == eStopReasonPlanComplete)
+                            // Yay, we're done.  Now make sure that our thread plan actually completed.
+                            ThreadSP thread_sp = GetThreadList().FindThreadByIndexID (thread_idx_id);
+                            if (!thread_sp)
                             {
+                                // Ooh, our thread has vanished.  Unlikely that this was successful execution...
                                 if (log)
-                                    log->PutCString ("Process::RunThreadPlan(): execution completed successfully.");
-                                // Now mark this plan as private so it doesn't get reported as the stop reason
-                                // after this point.  
-                                if (thread_plan_sp)
-                                    thread_plan_sp->SetPrivate (orig_plan_private);
-                                return_value = eExecutionCompleted;
+                                    log->Printf ("Process::RunThreadPlan(): execution completed but our thread (index-id=%u) has vanished.", thread_idx_id);
+                                return_value = eExecutionInterrupted;
                             }
                             else
                             {
-                                if (log)
-                                    log->PutCString ("Process::RunThreadPlan(): thread plan didn't successfully complete.");
+                                StopInfoSP stop_info_sp (thread_sp->GetStopInfo ());
+                                StopReason stop_reason = eStopReasonInvalid;
+                                if (stop_info_sp)
+                                     stop_reason = stop_info_sp->GetStopReason();
+                                if (stop_reason == eStopReasonPlanComplete)
+                                {
+                                    if (log)
+                                        log->PutCString ("Process::RunThreadPlan(): execution completed successfully.");
+                                    // Now mark this plan as private so it doesn't get reported as the stop reason
+                                    // after this point.  
+                                    if (thread_plan_sp)
+                                        thread_plan_sp->SetPrivate (orig_plan_private);
+                                    return_value = eExecutionCompleted;
+                                }
+                                else
+                                {
+                                    if (log)
+                                        log->PutCString ("Process::RunThreadPlan(): thread plan didn't successfully complete.");
 
-                                return_value = eExecutionInterrupted;
+                                    return_value = eExecutionInterrupted;
+                                }
                             }
-                        }
-                    }        
-                    break;
+                        }        
+                        break;
 
-                case lldb::eStateCrashed:
-                    if (log)
-                        log->PutCString ("Process::RunThreadPlan(): execution crashed.");
-                    return_value = eExecutionInterrupted;
-                    break;
+                    case lldb::eStateCrashed:
+                        if (log)
+                            log->PutCString ("Process::RunThreadPlan(): execution crashed.");
+                        return_value = eExecutionInterrupted;
+                        break;
 
-                case lldb::eStateRunning:
-                    do_resume = false;
-                    keep_going = true;
-                    break;
+                    case lldb::eStateRunning:
+                        do_resume = false;
+                        keep_going = true;
+                        break;
 
-                default:
+                    default:
+                        if (log)
+                            log->Printf("Process::RunThreadPlan(): execution stopped with unexpected state: %s.", StateAsCString(stop_state));
+                            
+                        if (stop_state == eStateExited)
+                            event_to_broadcast_sp = event_sp;
+                            
+                        errors.Printf ("Execution stopped with unexpected state.");
+                        return_value = eExecutionInterrupted;
+                        break;
+                    }
+                    if (keep_going)
+                        continue;
+                    else
+                        break;
+                } 
+                else
+                {
                     if (log)
-                        log->Printf("Process::RunThreadPlan(): execution stopped with unexpected state: %s.", StateAsCString(stop_state));
-                        
-                    errors.Printf ("Execution stopped with unexpected state.");
+                        log->PutCString ("Process::RunThreadPlan(): got_event was true, but the event pointer was null.  How odd...");
                     return_value = eExecutionInterrupted;
                     break;
                 }
-                if (keep_going)
-                    continue;
-                else
-                    break;
-            } 
+            }
             else
             {
-                if (log)
-                    log->PutCString ("Process::RunThreadPlan(): got_event was true, but the event pointer was null.  How odd...");
-                return_value = eExecutionInterrupted;
-                break;
-            }
-        }
-        else
-        {
-            // If we didn't get an event that means we've timed out...
-            // We will interrupt the process here.  Depending on what we were asked to do we will
-            // either exit, or try with all threads running for the same timeout.
-            // Not really sure what to do if Halt fails here...
-            
-            if (log) {
-                if (try_all_threads)
-                {
-                    if (first_timeout)
-                        log->Printf ("Process::RunThreadPlan(): Running function with timeout: %d timed out, "
-                                     "trying with all threads enabled.",
-                                     single_thread_timeout_usec);
+                // If we didn't get an event that means we've timed out...
+                // We will interrupt the process here.  Depending on what we were asked to do we will
+                // either exit, or try with all threads running for the same timeout.
+                // Not really sure what to do if Halt fails here...
+                
+                if (log) {
+                    if (try_all_threads)
+                    {
+                        if (first_timeout)
+                            log->Printf ("Process::RunThreadPlan(): Running function with timeout: %d timed out, "
+                                         "trying with all threads enabled.",
+                                         single_thread_timeout_usec);
+                        else
+                            log->Printf ("Process::RunThreadPlan(): Restarting function with all threads enabled "
+                                         "and timeout: %d timed out.",
+                                         single_thread_timeout_usec);
+                    }
                     else
-                        log->Printf ("Process::RunThreadPlan(): Restarting function with all threads enabled "
-                                     "and timeout: %d timed out.",
+                        log->Printf ("Process::RunThreadPlan(): Running function with timeout: %d timed out, "
+                                     "halt and abandoning execution.", 
                                      single_thread_timeout_usec);
                 }
-                else
-                    log->Printf ("Process::RunThreadPlan(): Running function with timeout: %d timed out, "
-                                 "halt and abandoning execution.", 
-                                 single_thread_timeout_usec);
-            }
-            
-            Error halt_error = Halt();
-            if (halt_error.Success())
-            {
-                if (log)
-                    log->PutCString ("Process::RunThreadPlan(): Halt succeeded.");
-                    
-                // If halt succeeds, it always produces a stopped event.  Wait for that:
                 
-                real_timeout = TimeValue::Now();
-                real_timeout.OffsetWithMicroSeconds(500000);
-
-                got_event = listener.WaitForEvent(&real_timeout, event_sp);
-                
-                if (got_event)
+                Error halt_error = Halt();
+                if (halt_error.Success())
                 {
-                    stop_state = Process::ProcessEventData::GetStateFromEvent(event_sp.get());
                     if (log)
-                    {
-                        log->Printf ("Process::RunThreadPlan(): Stopped with event: %s", StateAsCString(stop_state));
-                        if (stop_state == lldb::eStateStopped 
-                            && Process::ProcessEventData::GetInterruptedFromEvent(event_sp.get()))
-                            log->PutCString ("    Event was the Halt interruption event.");
-                    }
-                    
-                    if (stop_state == lldb::eStateStopped)
-                    {
-                        // Between the time we initiated the Halt and the time we delivered it, the process could have
-                        // already finished its job.  Check that here:
+                        log->PutCString ("Process::RunThreadPlan(): Halt succeeded.");
                         
-                        if (thread->IsThreadPlanDone (thread_plan_sp.get()))
-                        {
-                            if (log)
-                                log->PutCString ("Process::RunThreadPlan(): Even though we timed out, the call plan was done.  "
-                                             "Exiting wait loop.");
-                            return_value = eExecutionCompleted;
-                            break;
-                        }
+                    // If halt succeeds, it always produces a stopped event.  Wait for that:
+                    
+                    real_timeout = TimeValue::Now();
+                    real_timeout.OffsetWithMicroSeconds(500000);
 
-                        if (!try_all_threads)
+                    got_event = listener.WaitForEvent(&real_timeout, event_sp);
+                    
+                    if (got_event)
+                    {
+                        stop_state = Process::ProcessEventData::GetStateFromEvent(event_sp.get());
+                        if (log)
                         {
-                            if (log)
-                                log->PutCString ("Process::RunThreadPlan(): try_all_threads was false, we stopped so now we're quitting.");
-                            return_value = eExecutionInterrupted;
-                            break;
+                            log->Printf ("Process::RunThreadPlan(): Stopped with event: %s", StateAsCString(stop_state));
+                            if (stop_state == lldb::eStateStopped 
+                                && Process::ProcessEventData::GetInterruptedFromEvent(event_sp.get()))
+                                log->PutCString ("    Event was the Halt interruption event.");
                         }
                         
-                        if (first_timeout)
+                        if (stop_state == lldb::eStateStopped)
                         {
-                            // Set all the other threads to run, and return to the top of the loop, which will continue;
-                            first_timeout = false;
-                            thread_plan_sp->SetStopOthers (false);
-                            if (log)
-                                log->PutCString ("Process::RunThreadPlan(): about to resume.");
+                            // Between the time we initiated the Halt and the time we delivered it, the process could have
+                            // already finished its job.  Check that here:
+                            
+                            if (thread->IsThreadPlanDone (thread_plan_sp.get()))
+                            {
+                                if (log)
+                                    log->PutCString ("Process::RunThreadPlan(): Even though we timed out, the call plan was done.  "
+                                                 "Exiting wait loop.");
+                                return_value = eExecutionCompleted;
+                                break;
+                            }
 
-                            continue;
-                        }
-                        else
-                        {
-                            // Running all threads failed, so return Interrupted.
-                            if (log)
-                                log->PutCString("Process::RunThreadPlan(): running all threads timed out.");
-                            return_value = eExecutionInterrupted;
-                            break;
+                            if (!try_all_threads)
+                            {
+                                if (log)
+                                    log->PutCString ("Process::RunThreadPlan(): try_all_threads was false, we stopped so now we're quitting.");
+                                return_value = eExecutionInterrupted;
+                                break;
+                            }
+                            
+                            if (first_timeout)
+                            {
+                                // Set all the other threads to run, and return to the top of the loop, which will continue;
+                                first_timeout = false;
+                                thread_plan_sp->SetStopOthers (false);
+                                if (log)
+                                    log->PutCString ("Process::RunThreadPlan(): about to resume.");
+
+                                continue;
+                            }
+                            else
+                            {
+                                // Running all threads failed, so return Interrupted.
+                                if (log)
+                                    log->PutCString("Process::RunThreadPlan(): running all threads timed out.");
+                                return_value = eExecutionInterrupted;
+                                break;
+                            }
                         }
                     }
-                }
-                else
-                {   if (log)
-                        log->PutCString("Process::RunThreadPlan(): halt said it succeeded, but I got no event.  "
-                                "I'm getting out of here passing Interrupted.");
-                    return_value = eExecutionInterrupted;
-                    break;
-                }
-            }
-            else
-            {
-                // This branch is to work around some problems with gdb-remote's Halt.  It is a little racy, and can return 
-                // an error from halt, but if you wait a bit you'll get a stopped event anyway.
-                if (log)
-                    log->Printf ("Process::RunThreadPlan(): halt failed: error = \"%s\", I'm just going to wait a little longer and see if I get a stopped event.", 
-                                 halt_error.AsCString());                
-                real_timeout = TimeValue::Now();
-                real_timeout.OffsetWithMicroSeconds(500000);
-                timeout_ptr = &real_timeout;
-                got_event = listener.WaitForEvent(&real_timeout, event_sp);
-                if (!got_event || event_sp.get() == NULL)
-                {
-                    // This is not going anywhere, bag out.
-                    if (log)
-                        log->PutCString ("Process::RunThreadPlan(): halt failed: and waiting for the stopped event failed.");
-                    return_value = eExecutionInterrupted;
-                    break;                
+                    else
+                    {   if (log)
+                            log->PutCString("Process::RunThreadPlan(): halt said it succeeded, but I got no event.  "
+                                    "I'm getting out of here passing Interrupted.");
+                        return_value = eExecutionInterrupted;
+                        break;
+                    }
                 }
                 else
                 {
-                    stop_state = Process::ProcessEventData::GetStateFromEvent(event_sp.get());
+                    // This branch is to work around some problems with gdb-remote's Halt.  It is a little racy, and can return 
+                    // an error from halt, but if you wait a bit you'll get a stopped event anyway.
                     if (log)
-                        log->PutCString ("Process::RunThreadPlan(): halt failed: but then I got a stopped event.  Whatever...");
-                    if (stop_state == lldb::eStateStopped)
+                        log->Printf ("Process::RunThreadPlan(): halt failed: error = \"%s\", I'm just going to wait a little longer and see if I get a stopped event.", 
+                                     halt_error.AsCString());                
+                    real_timeout = TimeValue::Now();
+                    real_timeout.OffsetWithMicroSeconds(500000);
+                    timeout_ptr = &real_timeout;
+                    got_event = listener.WaitForEvent(&real_timeout, event_sp);
+                    if (!got_event || event_sp.get() == NULL)
                     {
-                        // Between the time we initiated the Halt and the time we delivered it, the process could have
-                        // already finished its job.  Check that here:
-                        
-                        if (thread->IsThreadPlanDone (thread_plan_sp.get()))
+                        // This is not going anywhere, bag out.
+                        if (log)
+                            log->PutCString ("Process::RunThreadPlan(): halt failed: and waiting for the stopped event failed.");
+                        return_value = eExecutionInterrupted;
+                        break;                
+                    }
+                    else
+                    {
+                        stop_state = Process::ProcessEventData::GetStateFromEvent(event_sp.get());
+                        if (log)
+                            log->PutCString ("Process::RunThreadPlan(): halt failed: but then I got a stopped event.  Whatever...");
+                        if (stop_state == lldb::eStateStopped)
                         {
-                            if (log)
-                                log->PutCString ("Process::RunThreadPlan(): Even though we timed out, the call plan was done.  "
-                                             "Exiting wait loop.");
-                            return_value = eExecutionCompleted;
-                            break;
-                        }
+                            // Between the time we initiated the Halt and the time we delivered it, the process could have
+                            // already finished its job.  Check that here:
+                            
+                            if (thread->IsThreadPlanDone (thread_plan_sp.get()))
+                            {
+                                if (log)
+                                    log->PutCString ("Process::RunThreadPlan(): Even though we timed out, the call plan was done.  "
+                                                 "Exiting wait loop.");
+                                return_value = eExecutionCompleted;
+                                break;
+                            }
 
-                        if (first_timeout)
-                        {
-                            // Set all the other threads to run, and return to the top of the loop, which will continue;
-                            first_timeout = false;
-                            thread_plan_sp->SetStopOthers (false);
-                            if (log)
-                                log->PutCString ("Process::RunThreadPlan(): About to resume.");
+                            if (first_timeout)
+                            {
+                                // Set all the other threads to run, and return to the top of the loop, which will continue;
+                                first_timeout = false;
+                                thread_plan_sp->SetStopOthers (false);
+                                if (log)
+                                    log->PutCString ("Process::RunThreadPlan(): About to resume.");
 
-                            continue;
+                                continue;
+                            }
+                            else
+                            {
+                                // Running all threads failed, so return Interrupted.
+                                if (log)
+                                    log->PutCString ("Process::RunThreadPlan(): running all threads timed out.");
+                                return_value = eExecutionInterrupted;
+                                break;
+                            }
                         }
                         else
                         {
-                            // Running all threads failed, so return Interrupted.
                             if (log)
-                                log->PutCString ("Process::RunThreadPlan(): running all threads timed out.");
+                                log->Printf ("Process::RunThreadPlan(): halt failed, I waited and didn't get"
+                                             " a stopped event, instead got %s.", StateAsCString(stop_state));
                             return_value = eExecutionInterrupted;
-                            break;
+                            break;                
                         }
                     }
-                    else
-                    {
-                        if (log)
-                            log->Printf ("Process::RunThreadPlan(): halt failed, I waited and didn't get"
-                                         " a stopped event, instead got %s.", StateAsCString(stop_state));
-                        return_value = eExecutionInterrupted;
-                        break;                
-                    }
                 }
-            }
 
-        }
+            }
+            
+        }  // END WAIT LOOP
         
-    }  // END WAIT LOOP
-    
-    // If we had to start up a temporary private state thread to run this thread plan, shut it down now.
-    if (IS_VALID_LLDB_HOST_THREAD(backup_private_state_thread))
-    {
-        StopPrivateStateThread();
-        Error error;
-        m_private_state_thread = backup_private_state_thread;
-        if (stopper_base_plan_sp != NULL)
+        // If we had to start up a temporary private state thread to run this thread plan, shut it down now.
+        if (IS_VALID_LLDB_HOST_THREAD(backup_private_state_thread))
         {
-            thread->DiscardThreadPlansUpToPlan(stopper_base_plan_sp);
-        }
-        m_public_state.SetValueNoLock(old_state);
-
-    }
-    
-    
-    // Now do some processing on the results of the run:
-    if (return_value == eExecutionInterrupted)
-    {
-        if (log)
-        {
-            StreamString s;
-            if (event_sp)
-                event_sp->Dump (&s);
-            else
+            StopPrivateStateThread();
+            Error error;
+            m_private_state_thread = backup_private_state_thread;
+            if (stopper_base_plan_sp != NULL)
             {
-                log->PutCString ("Process::RunThreadPlan(): Stop event that interrupted us is NULL.");
+                thread->DiscardThreadPlansUpToPlan(stopper_base_plan_sp);
             }
+            m_public_state.SetValueNoLock(old_state);
 
-            StreamString ts;
-
-            const char *event_explanation = NULL;                
-            
-            do 
+        }
+        
+        
+        // Now do some processing on the results of the run:
+        if (return_value == eExecutionInterrupted)
+        {
+            if (log)
             {
-                const Process::ProcessEventData *event_data = Process::ProcessEventData::GetEventDataFromEvent (event_sp.get());
-
-                if (!event_data)
+                StreamString s;
+                if (event_sp)
+                    event_sp->Dump (&s);
+                else
                 {
-                    event_explanation = "<no event data>";
-                    break;
+                    log->PutCString ("Process::RunThreadPlan(): Stop event that interrupted us is NULL.");
                 }
-                
-                Process *process = event_data->GetProcessSP().get();
 
-                if (!process)
-                {
-                    event_explanation = "<no process>";
-                    break;
-                }
-                
-                ThreadList &thread_list = process->GetThreadList();
-                
-                uint32_t num_threads = thread_list.GetSize();
-                uint32_t thread_index;
-                
-                ts.Printf("<%u threads> ", num_threads);
+                StreamString ts;
+
+                const char *event_explanation = NULL;                
                 
-                for (thread_index = 0;
-                     thread_index < num_threads;
-                     ++thread_index)
+                do 
                 {
-                    Thread *thread = thread_list.GetThreadAtIndex(thread_index).get();
+                    const Process::ProcessEventData *event_data = Process::ProcessEventData::GetEventDataFromEvent (event_sp.get());
+
+                    if (!event_data)
+                    {
+                        event_explanation = "<no event data>";
+                        break;
+                    }
                     
-                    if (!thread)
+                    Process *process = event_data->GetProcessSP().get();
+
+                    if (!process)
                     {
-                        ts.Printf("<?> ");
-                        continue;
+                        event_explanation = "<no process>";
+                        break;
                     }
                     
-                    ts.Printf("<0x%4.4llx ", thread->GetID());
-                    RegisterContext *register_context = thread->GetRegisterContext().get();
+                    ThreadList &thread_list = process->GetThreadList();
                     
-                    if (register_context)
-                        ts.Printf("[ip 0x%llx] ", register_context->GetPC());
-                    else
-                        ts.Printf("[ip unknown] ");
+                    uint32_t num_threads = thread_list.GetSize();
+                    uint32_t thread_index;
+                    
+                    ts.Printf("<%u threads> ", num_threads);
                     
-                    lldb::StopInfoSP stop_info_sp = thread->GetStopInfo();
-                    if (stop_info_sp)
+                    for (thread_index = 0;
+                         thread_index < num_threads;
+                         ++thread_index)
                     {
-                        const char *stop_desc = stop_info_sp->GetDescription();
-                        if (stop_desc)
-                            ts.PutCString (stop_desc);
+                        Thread *thread = thread_list.GetThreadAtIndex(thread_index).get();
+                        
+                        if (!thread)
+                        {
+                            ts.Printf("<?> ");
+                            continue;
+                        }
+                        
+                        ts.Printf("<0x%4.4llx ", thread->GetID());
+                        RegisterContext *register_context = thread->GetRegisterContext().get();
+                        
+                        if (register_context)
+                            ts.Printf("[ip 0x%llx] ", register_context->GetPC());
+                        else
+                            ts.Printf("[ip unknown] ");
+                        
+                        lldb::StopInfoSP stop_info_sp = thread->GetStopInfo();
+                        if (stop_info_sp)
+                        {
+                            const char *stop_desc = stop_info_sp->GetDescription();
+                            if (stop_desc)
+                                ts.PutCString (stop_desc);
+                        }
+                        ts.Printf(">");
                     }
-                    ts.Printf(">");
-                }
+                    
+                    event_explanation = ts.GetData();
+                } while (0);
                 
-                event_explanation = ts.GetData();
-            } while (0);
-            
-            if (log)
-            {
-                if (event_explanation)
-                    log->Printf("Process::RunThreadPlan(): execution interrupted: %s %s", s.GetData(), event_explanation);
+                if (log)
+                {
+                    if (event_explanation)
+                        log->Printf("Process::RunThreadPlan(): execution interrupted: %s %s", s.GetData(), event_explanation);
+                    else
+                        log->Printf("Process::RunThreadPlan(): execution interrupted: %s", s.GetData());
+                }                
+                    
+                if (discard_on_error && thread_plan_sp)
+                {
+                    if (log)
+                        log->Printf ("Process::RunThreadPlan: ExecutionInterrupted - discarding thread plans up to %p.", thread_plan_sp.get());
+                    thread->DiscardThreadPlansUpToPlan (thread_plan_sp);
+                    thread_plan_sp->SetPrivate (orig_plan_private);
+                }
                 else
-                    log->Printf("Process::RunThreadPlan(): execution interrupted: %s", s.GetData());
-            }                
+                {
+                    if (log)
+                        log->Printf ("Process::RunThreadPlan: ExecutionInterrupted - for plan: %p not discarding.", thread_plan_sp.get());
+
+                }
+            }
+        }
+        else if (return_value == eExecutionSetupError)
+        {
+            if (log)
+                log->PutCString("Process::RunThreadPlan(): execution set up error.");
                 
             if (discard_on_error && thread_plan_sp)
             {
-                if (log)
-                    log->Printf ("Process::RunThreadPlan: ExecutionInterrupted - discarding thread plans up to %p.", thread_plan_sp.get());
                 thread->DiscardThreadPlansUpToPlan (thread_plan_sp);
                 thread_plan_sp->SetPrivate (orig_plan_private);
             }
+        }
+        else
+        {
+            if (thread->IsThreadPlanDone (thread_plan_sp.get()))
+            {
+                if (log)
+                    log->PutCString("Process::RunThreadPlan(): thread plan is done");
+                return_value = eExecutionCompleted;
+            }
+            else if (thread->WasThreadPlanDiscarded (thread_plan_sp.get()))
+            {
+                if (log)
+                    log->PutCString("Process::RunThreadPlan(): thread plan was discarded");
+                return_value = eExecutionDiscarded;
+            }
             else
             {
                 if (log)
-                    log->Printf ("Process::RunThreadPlan: ExecutionInterrupted - for plan: %p not discarding.", thread_plan_sp.get());
-
+                    log->PutCString("Process::RunThreadPlan(): thread plan stopped in mid course");
+                if (discard_on_error && thread_plan_sp)
+                {
+                    if (log)
+                        log->PutCString("Process::RunThreadPlan(): discarding thread plan 'cause discard_on_error is set.");
+                    thread->DiscardThreadPlansUpToPlan (thread_plan_sp);
+                    thread_plan_sp->SetPrivate (orig_plan_private);
+                }
             }
         }
-    }
-    else if (return_value == eExecutionSetupError)
-    {
-        if (log)
-            log->PutCString("Process::RunThreadPlan(): execution set up error.");
-            
-        if (discard_on_error && thread_plan_sp)
-        {
-            thread->DiscardThreadPlansUpToPlan (thread_plan_sp);
-            thread_plan_sp->SetPrivate (orig_plan_private);
-        }
-    }
-    else
-    {
-        if (thread->IsThreadPlanDone (thread_plan_sp.get()))
-        {
-            if (log)
-                log->PutCString("Process::RunThreadPlan(): thread plan is done");
-            return_value = eExecutionCompleted;
-        }
-        else if (thread->WasThreadPlanDiscarded (thread_plan_sp.get()))
+                    
+        // Thread we ran the function in may have gone away because we ran the target
+        // Check that it's still there, and if it is put it back in the context.  Also restore the
+        // frame in the context if it is still present.
+        thread = GetThreadList().FindThreadByIndexID(thread_idx_id, true).get();
+        if (thread)
         {
-            if (log)
-                log->PutCString("Process::RunThreadPlan(): thread plan was discarded");
-            return_value = eExecutionDiscarded;
+            exe_ctx.SetFrameSP (thread->GetFrameWithStackID (ctx_frame_id));
         }
-        else
+        
+        // Also restore the current process'es selected frame & thread, since this function calling may
+        // be done behind the user's back.
+        
+        if (selected_tid != LLDB_INVALID_THREAD_ID)
         {
-            if (log)
-                log->PutCString("Process::RunThreadPlan(): thread plan stopped in mid course");
-            if (discard_on_error && thread_plan_sp)
+            if (GetThreadList().SetSelectedThreadByIndexID (selected_tid) && selected_stack_id.IsValid())
             {
-                if (log)
-                    log->PutCString("Process::RunThreadPlan(): discarding thread plan 'cause discard_on_error is set.");
-                thread->DiscardThreadPlansUpToPlan (thread_plan_sp);
-                thread_plan_sp->SetPrivate (orig_plan_private);
+                // We were able to restore the selected thread, now restore the frame:
+                StackFrameSP old_frame_sp = GetThreadList().GetSelectedThread()->GetFrameWithStackID(selected_stack_id);
+                if (old_frame_sp)
+                    GetThreadList().GetSelectedThread()->SetSelectedFrame(old_frame_sp.get());
             }
         }
     }
-                
-    // Thread we ran the function in may have gone away because we ran the target
-    // Check that it's still there, and if it is put it back in the context.  Also restore the
-    // frame in the context if it is still present.
-    thread = GetThreadList().FindThreadByIndexID(thread_idx_id, true).get();
-    if (thread)
-    {
-        exe_ctx.SetFrameSP (thread->GetFrameWithStackID (ctx_frame_id));
-    }
     
-    // Also restore the current process'es selected frame & thread, since this function calling may
-    // be done behind the user's back.
+    // If the process exited during the run of the thread plan, notify everyone.
     
-    if (selected_tid != LLDB_INVALID_THREAD_ID)
+    if (event_to_broadcast_sp)
     {
-        if (GetThreadList().SetSelectedThreadByIndexID (selected_tid) && selected_stack_id.IsValid())
-        {
-            // We were able to restore the selected thread, now restore the frame:
-            StackFrameSP old_frame_sp = GetThreadList().GetSelectedThread()->GetFrameWithStackID(selected_stack_id);
-            if (old_frame_sp)
-                GetThreadList().GetSelectedThread()->SetSelectedFrame(old_frame_sp.get());
-        }
+        if (log)
+            log->PutCString("Process::RunThreadPlan(): rebroadcasting event.");
+        BroadcastEvent(event_to_broadcast_sp);
     }
     
     return return_value;
@@ -4866,7 +4836,9 @@
 }
 
 ProcessInstanceSettings::ProcessInstanceSettings (const ProcessInstanceSettings &rhs) :
-    InstanceSettings (Process::GetSettingsController(), CreateInstanceName().AsCString())
+    InstanceSettings (Process::GetSettingsController(), CreateInstanceName().AsCString()),
+    m_disable_memory_cache(rhs.m_disable_memory_cache),
+    m_extra_startup_commands (rhs.m_extra_startup_commands)
 {
     if (m_instance_name != InstanceSettings::GetDefaultName())
     {
@@ -4888,6 +4860,8 @@
 {
     if (this != &rhs)
     {
+        m_disable_memory_cache = rhs.m_disable_memory_cache;
+        m_extra_startup_commands = rhs.m_extra_startup_commands;
     }
 
     return *this;
@@ -4919,6 +4893,10 @@
         }
         
     }
+    else if (var_name == GetExtraStartupCommandVarName())
+    {
+        UserSettingsController::UpdateStringArrayVariable (op, index_value, m_extra_startup_commands, value, err);
+    }
 }
 
 void
@@ -4947,6 +4925,15 @@
         value.AppendString(m_disable_memory_cache ? "true" : "false");
         return true;
     }
+    else if (var_name == GetExtraStartupCommandVarName())
+    {
+        if (m_extra_startup_commands.GetArgumentCount() > 0)
+        {
+            for (int i = 0; i < m_extra_startup_commands.GetArgumentCount(); ++i)
+                value.AppendString (m_extra_startup_commands.GetArgumentAtIndex (i));
+        }
+        return true;
+    }
     else
     {
         if (err)
@@ -4976,6 +4963,14 @@
     return disable_memory_cache_var_name;
 }
 
+const ConstString &
+ProcessInstanceSettings::GetExtraStartupCommandVarName () const
+{
+    static ConstString extra_startup_command_var_name ("extra-startup-command");
+    
+    return extra_startup_command_var_name;
+}
+
 //--------------------------------------------------
 // SettingsController Variable Tables
 //--------------------------------------------------
@@ -4999,6 +4994,7 @@
         "true",
 #endif
         NULL,       false,  false,  "Disable reading and caching of memory in fixed-size units." },
+    { "extra-startup-command", eSetVarTypeArray, NULL, NULL, false,  false,  "A list containing extra commands understood by the particular process plugin used." },
     {  NULL,            eSetVarTypeNone,        NULL,           NULL,       false,  false,  NULL }
 };
 

Modified: lldb/branches/lldb-platform-work/source/Target/SectionLoadList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Target/SectionLoadList.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Target/SectionLoadList.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Target/SectionLoadList.cpp Mon Jul 23 19:12:48 2012
@@ -41,14 +41,14 @@
 }
 
 addr_t
-SectionLoadList::GetSectionLoadAddress (const Section *section) const
+SectionLoadList::GetSectionLoadAddress (const lldb::SectionSP &section) const
 {
     // TODO: add support for the same section having multiple load addresses
     addr_t section_load_addr = LLDB_INVALID_ADDRESS;
     if (section)
     {
         Mutex::Locker locker(m_mutex);
-        sect_to_addr_collection::const_iterator pos = m_sect_to_addr.find (section);
+        sect_to_addr_collection::const_iterator pos = m_sect_to_addr.find (section.get());
         
         if (pos != m_sect_to_addr.end())
             section_load_addr = pos->second;
@@ -57,7 +57,7 @@
 }
 
 bool
-SectionLoadList::SetSectionLoadAddress (const Section *section, addr_t load_addr, bool warn_multiple)
+SectionLoadList::SetSectionLoadAddress (const lldb::SectionSP &section, addr_t load_addr, bool warn_multiple)
 {
     LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_DYNAMIC_LOADER | LIBLLDB_LOG_VERBOSE));
 
@@ -66,7 +66,7 @@
         const FileSpec &module_file_spec (section->GetModule()->GetFileSpec());
         log->Printf ("SectionLoadList::%s (section = %p (%s%s%s.%s), load_addr = 0x%16.16llx)",
                      __FUNCTION__,
-                     section,
+                     section.get(),
                      module_file_spec.GetDirectory().AsCString(),
                      module_file_spec.GetDirectory() ? "/" : "",
                      module_file_spec.GetFilename().AsCString(),
@@ -79,7 +79,7 @@
 
     // Fill in the section -> load_addr map
     Mutex::Locker locker(m_mutex);
-    sect_to_addr_collection::iterator sta_pos = m_sect_to_addr.find(section);
+    sect_to_addr_collection::iterator sta_pos = m_sect_to_addr.find(section.get());
     if (sta_pos != m_sect_to_addr.end())
     {
         if (load_addr == sta_pos->second)
@@ -88,7 +88,7 @@
             sta_pos->second = load_addr;
     }
     else
-        m_sect_to_addr[section] = load_addr;
+        m_sect_to_addr[section.get()] = load_addr;
 
     // Fill in the load_addr -> section map
     addr_to_sect_collection::iterator ats_pos = m_addr_to_sect.find(load_addr);
@@ -126,59 +126,62 @@
 }
 
 size_t
-SectionLoadList::SetSectionUnloaded (const Section *section)
+SectionLoadList::SetSectionUnloaded (const lldb::SectionSP &section_sp)
 {
-    LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_DYNAMIC_LOADER | LIBLLDB_LOG_VERBOSE));
+    size_t unload_count = 0;
 
-    if (log)
+    if (section_sp)
     {
-        const FileSpec &module_file_spec (section->GetModule()->GetFileSpec());
-        log->Printf ("SectionLoadList::%s (section = %p (%s%s%s.%s))",
-                     __FUNCTION__,
-                     section,
-                     module_file_spec.GetDirectory().AsCString(),
-                     module_file_spec.GetDirectory() ? "/" : "",
-                     module_file_spec.GetFilename().AsCString(),
-                     section->GetName().AsCString());
-    }
+        LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_DYNAMIC_LOADER | LIBLLDB_LOG_VERBOSE));
 
-    size_t unload_count = 0;
-    Mutex::Locker locker(m_mutex);
-    
-    sect_to_addr_collection::iterator sta_pos = m_sect_to_addr.find(section);
-    if (sta_pos != m_sect_to_addr.end())
-    {
-        addr_t load_addr = sta_pos->second;
-        m_sect_to_addr.erase (sta_pos);
+        if (log)
+        {
+            const FileSpec &module_file_spec (section_sp->GetModule()->GetFileSpec());
+            log->Printf ("SectionLoadList::%s (section = %p (%s%s%s.%s))",
+                         __FUNCTION__,
+                         section_sp.get(),
+                         module_file_spec.GetDirectory().AsCString(),
+                         module_file_spec.GetDirectory() ? "/" : "",
+                         module_file_spec.GetFilename().AsCString(),
+                         section_sp->GetName().AsCString());
+        }
 
-        addr_to_sect_collection::iterator ats_pos = m_addr_to_sect.find(load_addr);
-        if (ats_pos != m_addr_to_sect.end())
-            m_addr_to_sect.erase (ats_pos);
+        Mutex::Locker locker(m_mutex);
+        
+        sect_to_addr_collection::iterator sta_pos = m_sect_to_addr.find(section_sp.get());
+        if (sta_pos != m_sect_to_addr.end())
+        {
+            addr_t load_addr = sta_pos->second;
+            m_sect_to_addr.erase (sta_pos);
+
+            addr_to_sect_collection::iterator ats_pos = m_addr_to_sect.find(load_addr);
+            if (ats_pos != m_addr_to_sect.end())
+                m_addr_to_sect.erase (ats_pos);
+        }
     }
-    
     return unload_count;
 }
 
 bool
-SectionLoadList::SetSectionUnloaded (const Section *section, addr_t load_addr)
+SectionLoadList::SetSectionUnloaded (const lldb::SectionSP &section_sp, addr_t load_addr)
 {
     LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_DYNAMIC_LOADER | LIBLLDB_LOG_VERBOSE));
 
     if (log)
     {
-        const FileSpec &module_file_spec (section->GetModule()->GetFileSpec());
+        const FileSpec &module_file_spec (section_sp->GetModule()->GetFileSpec());
         log->Printf ("SectionLoadList::%s (section = %p (%s%s%s.%s), load_addr = 0x%16.16llx)",
                      __FUNCTION__,
-                     section,
+                     section_sp.get(),
                      module_file_spec.GetDirectory().AsCString(),
                      module_file_spec.GetDirectory() ? "/" : "",
                      module_file_spec.GetFilename().AsCString(),
-                     section->GetName().AsCString(),
+                     section_sp->GetName().AsCString(),
                      load_addr);
     }
     bool erased = false;
     Mutex::Locker locker(m_mutex);
-    sect_to_addr_collection::iterator sta_pos = m_sect_to_addr.find(section);
+    sect_to_addr_collection::iterator sta_pos = m_sect_to_addr.find(section_sp.get());
     if (sta_pos != m_sect_to_addr.end())
     {
         erased = true;
@@ -247,7 +250,7 @@
     addr_to_sect_collection::const_iterator pos, end;
     for (pos = m_addr_to_sect.begin(), end = m_addr_to_sect.end(); pos != end; ++pos)
     {
-        s.Printf("addr = 0x%16.16llx, section = %p: ", pos->first, pos->second);
+        s.Printf("addr = 0x%16.16llx, section = %p: ", pos->first, pos->second.get());
         pos->second->Dump (&s, target, 0);
     }
 }

Modified: lldb/branches/lldb-platform-work/source/Target/StackFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Target/StackFrame.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Target/StackFrame.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Target/StackFrame.cpp Mon Jul 23 19:12:48 2012
@@ -513,7 +513,7 @@
 
 
 ValueObjectSP
-StackFrame::GetValueForVariableExpressionPath (const char *var_expr_cstr, 
+StackFrame::GetValueForVariableExpressionPath (const char *var_expr_cstr,
                                                DynamicValueType use_dynamic,
                                                uint32_t options, 
                                                VariableSP &var_sp,
@@ -562,13 +562,42 @@
                 name_const_string.SetCStringWithLength (var_path.c_str(), separator_idx);
 
             var_sp = variable_list->FindVariable(name_const_string);
+            
+            bool synthetically_added_instance_object = false;
+
+            if (var_sp)
+            {
+                var_path.erase (0, name_const_string.GetLength ());
+            }
+            else if (options & eExpressionPathOptionsAllowDirectIVarAccess)
+            {
+                // Check for direct ivars access which helps us with implicit
+                // access to ivars with the "this->" or "self->"
+                GetSymbolContext(eSymbolContextFunction|eSymbolContextBlock);
+                lldb::LanguageType method_language = eLanguageTypeUnknown;
+                bool is_instance_method = false;
+                ConstString method_object_name;
+                if (m_sc.GetFunctionMethodInfo (method_language, is_instance_method, method_object_name))
+                {
+                    if (is_instance_method && method_object_name)
+                    {
+                        var_sp = variable_list->FindVariable(method_object_name);
+                        if (var_sp)
+                        {
+                            separator_idx = 0;
+                            var_path.insert(0, "->");
+                            synthetically_added_instance_object = true;
+                        }
+                    }
+                }
+            }
+
             if (var_sp)
             {
                 valobj_sp = GetValueObjectForFrameVariable (var_sp, use_dynamic);
                 if (!valobj_sp)
                     return valobj_sp;
                     
-                var_path.erase (0, name_const_string.GetLength ());
                 // We are dumping at least one child
                 while (separator_idx != std::string::npos)
                 {
@@ -651,23 +680,35 @@
                                 if (no_synth_child || !child_valobj_sp)
                                 {
                                     // No child member with name "child_name"
-                                    valobj_sp->GetExpressionPath (var_expr_path_strm, false);
-                                    if (child_name)
+                                    if (synthetically_added_instance_object)
                                     {
-                                        error.SetErrorStringWithFormat ("\"%s\" is not a member of \"(%s) %s\"", 
-                                                                        child_name.GetCString(), 
-                                                                        valobj_sp->GetTypeName().AsCString("<invalid type>"),
-                                                                        var_expr_path_strm.GetString().c_str());
+                                        // We added a "this->" or "self->" to the beginning of the expression
+                                        // and this is the first pointer ivar access, so just return the normal
+                                        // error
+                                        error.SetErrorStringWithFormat("no variable or instance variable named '%s' found in this frame",
+                                                                       name_const_string.GetCString());
                                     }
                                     else
                                     {
-                                        error.SetErrorStringWithFormat ("incomplete expression path after \"%s\" in \"%s\"",
-                                                                        var_expr_path_strm.GetString().c_str(),
-                                                                        var_expr_cstr);
+                                        valobj_sp->GetExpressionPath (var_expr_path_strm, false);
+                                        if (child_name)
+                                        {
+                                            error.SetErrorStringWithFormat ("\"%s\" is not a member of \"(%s) %s\"", 
+                                                                            child_name.GetCString(), 
+                                                                            valobj_sp->GetTypeName().AsCString("<invalid type>"),
+                                                                            var_expr_path_strm.GetString().c_str());
+                                        }
+                                        else
+                                        {
+                                            error.SetErrorStringWithFormat ("incomplete expression path after \"%s\" in \"%s\"",
+                                                                            var_expr_path_strm.GetString().c_str(),
+                                                                            var_expr_cstr);
+                                        }
                                     }
                                     return ValueObjectSP();
                                 }
                             }
+                            synthetically_added_instance_object = false;
                             // Remove the child name from the path
                             var_path.erase(0, child_name.GetLength());
                             if (use_dynamic != eNoDynamicValues)
@@ -1296,10 +1337,9 @@
 bool
 StackFrame::GetStatus (Stream& strm,
                        bool show_frame_info,
-                       bool show_source,
-                       uint32_t source_lines_before,
-                       uint32_t source_lines_after)
+                       bool show_source)
 {
+    
     if (show_frame_info)
     {
         strm.Indent();
@@ -1312,56 +1352,62 @@
         bool have_source = false;
         DebuggerInstanceSettings::StopDisassemblyType disasm_display = DebuggerInstanceSettings::eStopDisassemblyTypeNever;
         Target *target = exe_ctx.GetTargetPtr();
-        if (target && (source_lines_before || source_lines_after))
+        if (target)
         {
-            GetSymbolContext(eSymbolContextCompUnit | eSymbolContextLineEntry);
+            Debugger &debugger = target->GetDebugger();
+            const uint32_t source_lines_before = debugger.GetStopSourceLineCount(true);
+            const uint32_t source_lines_after = debugger.GetStopSourceLineCount(false);
+            disasm_display = debugger.GetStopDisassemblyDisplay ();
 
-            if (m_sc.comp_unit && m_sc.line_entry.IsValid())
+            if (source_lines_before > 0 || source_lines_after > 0)
             {
-                if (target->GetSourceManager().DisplaySourceLinesWithLineNumbers (m_sc.line_entry.file,
-                                                                                  m_sc.line_entry.line,
-                                                                                  source_lines_before,
-                                                                                  source_lines_after,
-                                                                                  "->",
-                                                                                  &strm))
+                GetSymbolContext(eSymbolContextCompUnit | eSymbolContextLineEntry);
+
+                if (m_sc.comp_unit && m_sc.line_entry.IsValid())
                 {
-                    have_source = true;
+                    if (target->GetSourceManager().DisplaySourceLinesWithLineNumbers (m_sc.line_entry.file,
+                                                                                      m_sc.line_entry.line,
+                                                                                      source_lines_before,
+                                                                                      source_lines_after,
+                                                                                      "->",
+                                                                                      &strm))
+                    {
+                        have_source = true;
+                    }
                 }
             }
-            disasm_display = target->GetDebugger().GetStopDisassemblyDisplay ();
-        }
-        
-        switch (disasm_display)
-        {
-        case DebuggerInstanceSettings::eStopDisassemblyTypeNever:
-            break;
-
-        case DebuggerInstanceSettings::eStopDisassemblyTypeNoSource:
-            if (have_source)
-                break;
-            // Fall through to next case
-        case DebuggerInstanceSettings::eStopDisassemblyTypeAlways:
-            if (target)
+            switch (disasm_display)
             {
-                const uint32_t disasm_lines = target->GetDebugger().GetDisassemblyLineCount();
-                if (disasm_lines > 0)
+            case DebuggerInstanceSettings::eStopDisassemblyTypeNever:
+                break;
+                
+            case DebuggerInstanceSettings::eStopDisassemblyTypeNoSource:
+                if (have_source)
+                    break;
+                // Fall through to next case
+            case DebuggerInstanceSettings::eStopDisassemblyTypeAlways:
+                if (target)
                 {
-                    const ArchSpec &target_arch = target->GetArchitecture();
-                    AddressRange pc_range;
-                    pc_range.GetBaseAddress() = GetFrameCodeAddress();
-                    pc_range.SetByteSize(disasm_lines * target_arch.GetMaximumOpcodeByteSize());
-                    Disassembler::Disassemble (target->GetDebugger(),
-                                               target_arch,
-                                               NULL,
-                                               exe_ctx,
-                                               pc_range,
-                                               disasm_lines,
-                                               0,
-                                               Disassembler::eOptionMarkPCAddress,
-                                               strm);
+                    const uint32_t disasm_lines = debugger.GetDisassemblyLineCount();
+                    if (disasm_lines > 0)
+                    {
+                        const ArchSpec &target_arch = target->GetArchitecture();
+                        AddressRange pc_range;
+                        pc_range.GetBaseAddress() = GetFrameCodeAddress();
+                        pc_range.SetByteSize(disasm_lines * target_arch.GetMaximumOpcodeByteSize());
+                        Disassembler::Disassemble (target->GetDebugger(),
+                                                   target_arch,
+                                                   NULL,
+                                                   exe_ctx,
+                                                   pc_range,
+                                                   disasm_lines,
+                                                   0,
+                                                   Disassembler::eOptionMarkPCAddress,
+                                                   strm);
+                    }
                 }
+                break;
             }
-            break;
         }
     }
     return true;

Modified: lldb/branches/lldb-platform-work/source/Target/StackFrameList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Target/StackFrameList.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Target/StackFrameList.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Target/StackFrameList.cpp Mon Jul 23 19:12:48 2012
@@ -587,9 +587,7 @@
                            uint32_t first_frame,
                            uint32_t num_frames,
                            bool show_frame_info,
-                           uint32_t num_frames_with_source,
-                           uint32_t source_lines_before,
-                           uint32_t source_lines_after)
+                           uint32_t num_frames_with_source)
 {
     size_t num_frames_displayed = 0;
     
@@ -614,9 +612,7 @@
         
         if (!frame_sp->GetStatus (strm,
                                   show_frame_info,
-                                  num_frames_with_source > first_frame - frame_idx,
-                                  source_lines_before,
-                                  source_lines_after))
+                                  num_frames_with_source > (first_frame - frame_idx)))
             break;
         ++num_frames_displayed;
     }

Modified: lldb/branches/lldb-platform-work/source/Target/StopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Target/StopInfo.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Target/StopInfo.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Target/StopInfo.cpp Mon Jul 23 19:12:48 2012
@@ -461,6 +461,36 @@
         if (wp_sp)
         {
             ExecutionContext exe_ctx (m_thread.GetStackFrameAtIndex(0));
+            {
+                // check if this process is running on an architecture where watchpoints trigger
+				// before the associated instruction runs. if so, disable the WP, single-step and then
+				// re-enable the watchpoint
+                Process* process = exe_ctx.GetProcessPtr();
+                if (process)
+                {
+                    uint32_t num; bool wp_triggers_after;
+                    if (process->GetWatchpointSupportInfo(num, wp_triggers_after).Success())
+                    {
+                        if (!wp_triggers_after)
+                        {
+                            process->DisableWatchpoint(wp_sp.get());
+                            
+                            ThreadPlan *new_plan = m_thread.QueueThreadPlanForStepSingleInstruction(false, // step-over
+                                                                                                    false, // abort_other_plans
+                                                                                                    true); // stop_other_threads
+                            new_plan->SetIsMasterPlan (true);
+                            new_plan->SetOkayToDiscard (false);
+                            process->GetThreadList().SetSelectedThreadByID (m_thread.GetID());
+                            process->Resume ();
+                            process->WaitForProcessToStop (NULL);
+                            process->GetThreadList().SetSelectedThreadByID (m_thread.GetID());
+                            MakeStopInfoValid(); // make sure we do not fail to stop because of the single-step taken above
+                            
+                            process->EnableWatchpoint(wp_sp.get());
+                        }
+                    }
+                }
+            }
             StoppointCallbackContext context (event_ptr, exe_ctx, false);
             bool stop_requested = wp_sp->InvokeCallback (&context);
             // Also make sure that the callback hasn't continued the target.  
@@ -490,7 +520,8 @@
                                                                       wp_sp->GetConditionText(),
                                                                       NULL,
                                                                       result_value_sp,
-                                                                      error);
+                                                                      error,
+                                                                      500000);
                 if (result_code == eExecutionCompleted)
                 {
                     if (result_value_sp)

Modified: lldb/branches/lldb-platform-work/source/Target/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Target/Target.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Target/Target.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Target/Target.cpp Mon Jul 23 19:12:48 2012
@@ -1652,7 +1652,8 @@
     bool unwind_on_error,
     bool keep_in_memory,
     lldb::DynamicValueType use_dynamic,
-    lldb::ValueObjectSP &result_valobj_sp
+    lldb::ValueObjectSP &result_valobj_sp,
+    uint32_t single_thread_timeout_usec
 )
 {
     ExecutionResults execution_results = eExecutionSetupError;
@@ -1781,7 +1782,8 @@
                                                                unwind_on_error,
                                                                expr_cstr, 
                                                                prefix, 
-                                                               result_valobj_sp);
+                                                               result_valobj_sp,
+                                                               single_thread_timeout_usec);
         }
     }
     
@@ -2913,7 +2915,11 @@
     { TSC_PREFER_DYNAMIC    , eSetVarTypeEnum   , NULL          , g_dynamic_value_types, false, false, "Should printed values be shown as their dynamic value." },
     { TSC_ENABLE_SYNTHETIC  , eSetVarTypeBoolean, "true"        , NULL,                  false, false, "Should synthetic values be used by default whenever available." },
     { TSC_SKIP_PROLOGUE     , eSetVarTypeBoolean, "true"        , NULL,                  false, false, "Skip function prologues when setting breakpoints by name." },
-    { TSC_SOURCE_MAP        , eSetVarTypeArray  , NULL          , NULL,                  false, false, "Source path remappings to use when locating source files from debug information." },
+    { TSC_SOURCE_MAP        , eSetVarTypeArray  , NULL          , NULL,                  false, false, "Source path remappings used to track the change of location between a source file when built, and "
+                                                                                                       "where it exists on the current system.  It consists of an array of duples, the first element of each duple is "
+                                                                                                       "some part (starting at the root) of the path to the file when it was built, "
+                                                                                                       "and the second is where the remainder of the original build hierarchy is rooted on the local system.  "
+                                                                                                       "Each element of the array is checked in order and the first one that results in a match wins." },
     { TSC_EXE_SEARCH_PATHS  , eSetVarTypeArray  , NULL          , NULL,                  false, false, "Executable search paths to use when locating executable files whose paths don't match the local file system." },
     { TSC_MAX_CHILDREN      , eSetVarTypeInt    , "256"         , NULL,                  true,  false, "Maximum number of children to expand in any level of depth." },
     { TSC_MAX_STRLENSUMMARY , eSetVarTypeInt    , "1024"        , NULL,                  true,  false, "Maximum number of characters to show when using %s in summary strings." },

Modified: lldb/branches/lldb-platform-work/source/Target/Thread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Target/Thread.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Target/Thread.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Target/Thread.cpp Mon Jul 23 19:12:48 2012
@@ -1321,16 +1321,12 @@
         strm.IndentMore();
         
         const bool show_frame_info = true;
-        const uint32_t source_lines_before = 3;
-        const uint32_t source_lines_after = 3;
         strm.IndentMore ();
         num_frames_shown = GetStackFrameList ()->GetStatus (strm,
                                                             start_frame, 
                                                             num_frames, 
                                                             show_frame_info, 
-                                                            num_frames_with_source,
-                                                            source_lines_before,
-                                                            source_lines_after);
+                                                            num_frames_with_source);
         strm.IndentLess();
         strm.IndentLess();
     }
@@ -1342,17 +1338,13 @@
                              uint32_t first_frame,
                              uint32_t num_frames,
                              bool show_frame_info,
-                             uint32_t num_frames_with_source,
-                             uint32_t source_lines_before,
-                             uint32_t source_lines_after)
+                             uint32_t num_frames_with_source)
 {
     return GetStackFrameList()->GetStatus (strm,
                                            first_frame,
                                            num_frames,
                                            show_frame_info,
-                                           num_frames_with_source,
-                                           source_lines_before,
-                                           source_lines_after);
+                                           num_frames_with_source);
 }
 
 bool

Modified: lldb/branches/lldb-platform-work/source/Target/ThreadPlanStepInRange.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Target/ThreadPlanStepInRange.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Target/ThreadPlanStepInRange.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Target/ThreadPlanStepInRange.cpp Mon Jul 23 19:12:48 2012
@@ -242,13 +242,12 @@
         
     if (avoid_regexp_to_use != NULL)
     {
-        SymbolContext sc = frame->GetSymbolContext(eSymbolContextSymbol);
+        SymbolContext sc = frame->GetSymbolContext(eSymbolContextFunction|eSymbolContextBlock|eSymbolContextSymbol);
         if (sc.symbol != NULL)
         {
-            const char *unnamed_symbol = "<UNKNOWN>";
-            const char *sym_name = sc.symbol->GetMangled().GetName().AsCString(unnamed_symbol);
-            if (strcmp (sym_name, unnamed_symbol) != 0)
-               return avoid_regexp_to_use->Execute(sym_name);
+            const char *frame_function_name = sc.GetFunctionName().GetCString();
+            if (frame_function_name)
+               return avoid_regexp_to_use->Execute(frame_function_name);
         }
     }
     return false;

Modified: lldb/branches/lldb-platform-work/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py (original)
+++ lldb/branches/lldb-platform-work/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py Mon Jul 23 19:12:48 2012
@@ -227,14 +227,21 @@
                     substrs = ['(NSNumber *) num1 = ',' (int)5',
                     '(NSNumber *) num2 = ',' (float)3.1',
                     '(NSNumber *) num3 = ',' (double)3.14',
-                    '(NSNumber *) num4 = ',' (long)18446744073709551614',
+                    '(NSNumber *) num4 = ',' (long)-2',
                     '(NSNumber *) num5 = ',' (char)65',
                     '(NSNumber *) num6 = ',' (long)255',
                     '(NSNumber *) num7 = ','2000000',
                     '(NSNumber *) num8_Y = ',' @"1"',
                     '(NSNumber *) num8_N = ',' @"0"',
-                    '(NSNumber *) num9 = ',' (short)33920'])
+                    '(NSNumber *) num9 = ',' (short)-31616'])
 
+        self.expect('frame variable num_at1 num_at2 num_at3 num_at4',
+                    substrs = ['(NSNumber *) num_at1 = ',' (int)12',
+                    '(NSNumber *) num_at2 = ',' (int)-12',
+                    '(NSNumber *) num_at3 = ',' (double)12.5',
+                    '(NSNumber *) num_at4 = ',' (double)-12.5'])
+
+        
         self.expect('frame variable str0 str1 str2 str3 str4 str5 str6 str8 str9 str10 str11 label1 label2 processName str12',
                     substrs = ['(NSString *) str1 = ',' @"A rather short ASCII NSString object is here"',
                     '(NSString *) str0 = ',' @"255"',

Modified: lldb/branches/lldb-platform-work/test/functionalities/data-formatter/data-formatter-objc/main.m
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/test/functionalities/data-formatter/data-formatter-objc/main.m?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/test/functionalities/data-formatter/data-formatter-objc/main.m (original)
+++ lldb/branches/lldb-platform-work/test/functionalities/data-formatter/data-formatter-objc/main.m Mon Jul 23 19:12:48 2012
@@ -153,6 +153,10 @@
 	    NSNumber* num8_Y = [NSNumber numberWithBool:YES];
 	    NSNumber* num8_N = [NSNumber numberWithBool:NO];
 	    NSNumber* num9 = [NSNumber numberWithShort:0x1E8480];
+	    NSNumber* num_at1 = @12;
+	    NSNumber* num_at2 = @-12;
+	    NSNumber* num_at3 = @12.5;
+	    NSNumber* num_at4 = @-12.5;
 
 	    NSString *str0 = [num6 stringValue];
 

Modified: lldb/branches/lldb-platform-work/test/functionalities/process_launch/TestProcessLaunch.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/test/functionalities/process_launch/TestProcessLaunch.py?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/test/functionalities/process_launch/TestProcessLaunch.py (original)
+++ lldb/branches/lldb-platform-work/test/functionalities/process_launch/TestProcessLaunch.py Mon Jul 23 19:12:48 2012
@@ -49,7 +49,7 @@
             pass
 
         launch_command = "process launch -i " + in_file + " -o " + out_file + " -e " + err_file
-        
+
         self.expect (launch_command,
                      patterns = [ "Process .* launched: .*a.out" ])
 
@@ -70,7 +70,7 @@
                 success = False
                 err_msg = err_msg + "    ERROR: stdout file does not contain correct output.\n"
                 out_f.close();
-            
+
         # Try to delete the 'stdout' file
         try:
             os.remove (out_file)
@@ -141,6 +141,15 @@
         except OSError:
             pass
 
+        # Check that we get an error when we have a nonexisting path
+        launch_command = "process launch -w %s -o %s -e %s" % (my_working_dir_path + 'z',
+                                                               out_file_path,
+                                                               err_file_path)
+
+        self.expect(launch_command, error=True,
+                startstr = "error: No such file or directory: %sz" % my_working_dir_path)
+
+        # Really launch the process
         launch_command = "process launch -w %s -o %s -e %s" % (my_working_dir_path,
                                                                out_file_path,
                                                                err_file_path)
@@ -166,7 +175,7 @@
                 success = False
                 err_msg = err_msg + "The current working directory was not set correctly.\n"
                 out_f.close();
-            
+
         # Try to delete the 'stdout' and 'stderr' files
         try:
             os.remove(out_file_path)

Modified: lldb/branches/lldb-platform-work/test/lang/c/struct_types/main.c
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/test/lang/c/struct_types/main.c?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/test/lang/c/struct_types/main.c (original)
+++ lldb/branches/lldb-platform-work/test/lang/c/struct_types/main.c Mon Jul 23 19:12:48 2012
@@ -10,6 +10,7 @@
 {
     struct point_tag {
         int x;
+        char padding[0];
         int y;
     }; // Set break point at this line.
 
@@ -17,7 +18,7 @@
         struct point_tag bottom_left;
         struct point_tag top_right;
     };
-    struct point_tag pt = { 2, 3 }; // This is the first executable statement.
-    struct rect_tag rect = {{1,2}, {3,4}};
+    struct point_tag pt = { 2, {}, 3 }; // This is the first executable statement.
+    struct rect_tag rect = {{1, {}, 2}, {3, {}, 4}};
     return 0;
 }

Modified: lldb/branches/lldb-platform-work/test/lldbutil.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/test/lldbutil.py?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/test/lldbutil.py (original)
+++ lldb/branches/lldb-platform-work/test/lldbutil.py Mon Jul 23 19:12:48 2012
@@ -82,7 +82,7 @@
     import struct
 
     if bytesize == 1:
-        return ba[0]
+        return bytes[0]
 
     # Little endian followed by a format character.
     template = "<%c"

Modified: lldb/branches/lldb-platform-work/tools/darwin-debug/darwin-debug.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/tools/darwin-debug/darwin-debug.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/tools/darwin-debug/darwin-debug.cpp (original)
+++ lldb/branches/lldb-platform-work/tools/darwin-debug/darwin-debug.cpp Mon Jul 23 19:12:48 2012
@@ -164,6 +164,7 @@
 
 int main (int argc, char *const *argv, char *const *envp, const char **apple)
 {
+#if defined (DEBUG_LLDB_LAUNCHER)
     const char *program_name = strrchr(apple[0], '/');
     
     if (program_name)
@@ -171,7 +172,6 @@
     else
         program_name = apple[0];
     
-#if defined (DEBUG_LLDB_LAUNCHER)
     printf("%s called with:\n", program_name);
     for (int i=0; i<argc; ++i)
         printf("argv[%u] = '%s'\n", i, argv[i]);

Modified: lldb/branches/lldb-platform-work/tools/debugserver/debugserver.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/tools/debugserver/debugserver.xcodeproj/project.pbxproj?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/tools/debugserver/debugserver.xcodeproj/project.pbxproj (original)
+++ lldb/branches/lldb-platform-work/tools/debugserver/debugserver.xcodeproj/project.pbxproj Mon Jul 23 19:12:48 2012
@@ -368,7 +368,6 @@
 				26CE05C7115C36870022F371 /* ShellScript */,
 				26CE0591115C31C20022F371 /* Sources */,
 				26CE0592115C31C20022F371 /* Frameworks */,
-				261CE9BE14D327CC006D8EFE /* Codesign */,
 			);
 			buildRules = (
 			);
@@ -407,20 +406,6 @@
 /* End PBXProject section */
 
 /* Begin PBXShellScriptBuildPhase section */
-		261CE9BE14D327CC006D8EFE /* Codesign */ = {
-			isa = PBXShellScriptBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			inputPaths = (
-			);
-			name = Codesign;
-			outputPaths = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-			shellPath = "/bin/sh -x";
-			shellScript = "if [ $CONFIGURATION != BuildAndIntegration -a $PLATFORM_NAME = macosx ]; then /usr/bin/codesign -s lldb_codesign -f \"$TARGET_BUILD_DIR/$TARGET_NAME\"; fi";
-		};
 		26CE05C7115C36870022F371 /* ShellScript */ = {
 			isa = PBXShellScriptBuildPhase;
 			buildActionMask = 2147483647;
@@ -495,10 +480,11 @@
 					i386,
 				);
 				COPY_PHASE_STRIP = NO;
-				CURRENT_PROJECT_VERSION = 187;
+				CURRENT_PROJECT_VERSION = 189;
 				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
+				ONLY_ACTIVE_ARCH = YES;
 				SDKROOT = "";
 				STRIP_INSTALLED_PRODUCT = NO;
 				VALID_ARCHS = "armv4t armv5 armv6 armv7 armv7s i386 ppc ppc64 ppc7400 ppc970 x86_64";
@@ -515,11 +501,12 @@
 					armv7s,
 				);
 				"ARCHS[sdk=macosx*]" = "$(ARCHS_STANDARD_64_BIT)";
-				CURRENT_PROJECT_VERSION = 187;
+				CURRENT_PROJECT_VERSION = 189;
 				DEAD_CODE_STRIPPING = YES;
 				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
+				ONLY_ACTIVE_ARCH = YES;
 				SDKROOT = "";
 				STRIPFLAGS = "-x";
 				STRIP_STYLE = debugging;
@@ -540,7 +527,7 @@
 					x86_64,
 					i386,
 				);
-				CURRENT_PROJECT_VERSION = 187;
+				CURRENT_PROJECT_VERSION = 189;
 				DEAD_CODE_STRIPPING = YES;
 				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
@@ -557,10 +544,9 @@
 		262419A21198A93E00067686 /* BuildAndIntegration */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
-				"ARCHS[sdk=iphoneos*]" = "$(ARCHS_STANDARD_32_BIT)";
 				"CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*]" = "source/debugserver-entitlements.plist";
 				COPY_PHASE_STRIP = YES;
-				CURRENT_PROJECT_VERSION = 187;
+				CURRENT_PROJECT_VERSION = 189;
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				FRAMEWORK_SEARCH_PATHS = $SDKROOT/System/Library/PrivateFrameworks;
 				"FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*][arch=*]" = (
@@ -609,10 +595,11 @@
 		26CE0596115C31C30022F371 /* Debug */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
-				"ARCHS[sdk=iphoneos*]" = "$(ARCHS_STANDARD_32_BIT)";
 				"CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*]" = "source/debugserver-entitlements.plist";
+				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "-";
+				"CODE_SIGN_IDENTITY[sdk=macosx*]" = lldb_codesign;
 				COPY_PHASE_STRIP = YES;
-				CURRENT_PROJECT_VERSION = 187;
+				CURRENT_PROJECT_VERSION = 189;
 				FRAMEWORK_SEARCH_PATHS = $SDKROOT/System/Library/PrivateFrameworks;
 				"FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*][arch=*]" = (
 					"$(SDKROOT)/System/Library/PrivateFrameworks",
@@ -649,6 +636,8 @@
 				);
 				OTHER_MIGFLAGS = "-I$(DERIVED_FILE_DIR)";
 				PRODUCT_NAME = debugserver;
+				"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
+				"PROVISIONING_PROFILE[sdk=macosx*]" = "";
 				SKIP_INSTALL = YES;
 				USER_HEADER_SEARCH_PATHS = "./source ../../source $(DERIVED_SOURCES_DIR)";
 				ZERO_LINK = NO;
@@ -658,10 +647,11 @@
 		26CE0597115C31C30022F371 /* Release */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
-				"ARCHS[sdk=iphoneos*]" = "$(ARCHS_STANDARD_32_BIT)";
 				"CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*]" = "source/debugserver-entitlements.plist";
+				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "-";
+				"CODE_SIGN_IDENTITY[sdk=macosx*]" = lldb_codesign;
 				COPY_PHASE_STRIP = YES;
-				CURRENT_PROJECT_VERSION = 187;
+				CURRENT_PROJECT_VERSION = 189;
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				FRAMEWORK_SEARCH_PATHS = $SDKROOT/System/Library/PrivateFrameworks;
 				"FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*][arch=*]" = (
@@ -698,6 +688,8 @@
 				);
 				OTHER_MIGFLAGS = "-I$(DERIVED_FILE_DIR)";
 				PRODUCT_NAME = debugserver;
+				"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
+				"PROVISIONING_PROFILE[sdk=macosx*]" = "";
 				SKIP_INSTALL = YES;
 				USER_HEADER_SEARCH_PATHS = "./source ../../source $(DERIVED_SOURCES_DIR)";
 				ZERO_LINK = NO;

Modified: lldb/branches/lldb-platform-work/tools/debugserver/debugserver.xcodeproj/xcshareddata/xcschemes/debugserver.xcscheme
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/tools/debugserver/debugserver.xcodeproj/xcshareddata/xcschemes/debugserver.xcscheme?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/tools/debugserver/debugserver.xcodeproj/xcshareddata/xcschemes/debugserver.xcscheme (original)
+++ lldb/branches/lldb-platform-work/tools/debugserver/debugserver.xcodeproj/xcshareddata/xcschemes/debugserver.xcscheme Mon Jul 23 19:12:48 2012
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Scheme
-   LastUpgradeVersion = "0430"
+   LastUpgradeVersion = "0450"
    version = "1.8">
    <BuildAction
       parallelizeBuildables = "NO"
@@ -23,7 +23,7 @@
       </BuildActionEntries>
    </BuildAction>
    <TestAction
-      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
       selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
       shouldUseLaunchSchemeArgsEnv = "YES"
       buildConfiguration = "Debug">
@@ -56,6 +56,7 @@
       buildConfiguration = "Debug"
       ignoresPersistentStateOnLaunch = "NO"
       debugDocumentVersioning = "YES"
+      enableOpenGLFrameCaptureMode = "0"
       allowLocationSimulation = "YES">
       <BuildableProductRunnable>
          <BuildableReference

Modified: lldb/branches/lldb-platform-work/tools/debugserver/source/ChangeLog
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/tools/debugserver/source/ChangeLog?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/tools/debugserver/source/ChangeLog (original)
+++ lldb/branches/lldb-platform-work/tools/debugserver/source/ChangeLog Mon Jul 23 19:12:48 2012
@@ -175,7 +175,7 @@
 	(RNBRemote::GetPacket): Call RNBRemote::HandlePacket_UNIMPLEMENTED()
 	when we don't recognize a packet.
 	(RNBRemote::HandleReceivedPacket): Don't reply to packets we don't
-	recognize with unimplemented in this fucntion as that should have
+	recognize with unimplemented in this function as that should have
 	already been done for us in RNBRemote::GetPacket().
 
 2009-02-10  Greg Clayton  <gclayton at apple.com>

Modified: lldb/branches/lldb-platform-work/tools/debugserver/source/DNB.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/tools/debugserver/source/DNB.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/tools/debugserver/source/DNB.cpp (original)
+++ lldb/branches/lldb-platform-work/tools/debugserver/source/DNB.cpp Mon Jul 23 19:12:48 2012
@@ -440,10 +440,11 @@
         const char *process_name;
         process_name = strrchr (full_process_name, '/');
         if (process_name == NULL)
-          process_name = full_process_name;
+            process_name = full_process_name;
         else
-          process_name++;
+            process_name++;
 
+        const int process_name_len = strlen(process_name);
         std::vector<struct kinfo_proc> proc_infos;
         const size_t num_proc_infos = GetAllInfos(proc_infos);
         if (num_proc_infos > 0)
@@ -457,10 +458,49 @@
 
                 // Check for process by name. We only check the first MAXCOMLEN
                 // chars as that is all that kp_proc.p_comm holds.
-                if (::strncasecmp(proc_infos[i].kp_proc.p_comm, process_name, MAXCOMLEN) == 0)
+                if (::strncasecmp(process_name, proc_infos[i].kp_proc.p_comm, MAXCOMLEN) == 0)
                 {
-                    // We found a matching process, add it to our list
-                    matching_proc_infos.push_back(proc_infos[i]);
+                    if (process_name_len > MAXCOMLEN)
+                    {
+                        // We found a matching process name whose first MAXCOMLEN
+                        // characters match, but there is more to the name than
+                        // this. We need to get the full process name. 
+
+                        int proc_args_mib[3] = { CTL_KERN, KERN_PROCARGS2, proc_infos[i].kp_proc.p_pid };
+                        
+                        // Get PATH_MAX for argv[0] plus 4 bytes for the argc
+                        char arg_data[PATH_MAX+4];
+                        size_t arg_data_size = sizeof(arg_data);
+                         // Skip the 4 byte argc integer value to get to argv[0]
+                        const char *argv0 = arg_data + 4;
+                        if (::sysctl (proc_args_mib, 3, arg_data, &arg_data_size , NULL, 0) == 0)
+                        {
+                            const char *argv_basename = strrchr(argv0, '/');
+                            if (argv_basename)
+                            {
+                                // Skip the '/'
+                                ++argv_basename;
+                            }
+                            else
+                            {
+                                // We didn't find a directory delimiter in the process argv[0], just use what was in there
+                                argv_basename = argv0;
+                            }
+
+                            if (argv_basename)
+                            {
+                                if (::strncasecmp(process_name, argv_basename, PATH_MAX) == 0)
+                                {
+                                    matching_proc_infos.push_back(proc_infos[i]);
+                                }
+                            }
+                        }
+                    }
+                    else
+                    {
+                        // We found a matching process, add it to our list
+                        matching_proc_infos.push_back(proc_infos[i]);
+                    }
                 }
             }
         }
@@ -472,6 +512,7 @@
 nub_process_t
 DNBProcessAttachWait (const char *waitfor_process_name, 
                       nub_launch_flavor_t launch_flavor,
+                      bool ignore_existing,
                       struct timespec *timeout_abstime, 
                       useconds_t waitfor_interval,
                       char *err_str, 
@@ -495,7 +536,12 @@
     }
 
     if (attach_token == NULL)
-        num_exclude_proc_infos = GetAllInfosMatchingName (waitfor_process_name, exclude_proc_infos);
+    {
+        if (ignore_existing)
+            num_exclude_proc_infos = GetAllInfosMatchingName (waitfor_process_name, exclude_proc_infos);
+        else
+            num_exclude_proc_infos = 0;
+    }
 
     DNBLogThreadedIf (LOG_PROCESS, "Waiting for '%s' to appear...\n", waitfor_process_name);
 
@@ -1214,9 +1260,9 @@
         case '%':
             {
                 f++;    // Skip the '%' character
-                int min_field_width = 0;
-                int precision = 0;
-                uint32_t flags = 0;
+//                int min_field_width = 0;
+//                int precision = 0;
+                //uint32_t flags = 0;
                 uint32_t length_modifiers = 0;
                 uint32_t byte_size = 0;
                 uint32_t actual_byte_size = 0;
@@ -1233,12 +1279,12 @@
                 // Decode any flags
                 switch (*f)
                 {
-                case '#': fprintf_format += *f++; flags |= alternate_form;            break;
-                case '0': fprintf_format += *f++; flags |= zero_padding;            break;
-                case '-': fprintf_format += *f++; flags |= negative_field_width;    break;
-                case ' ': fprintf_format += *f++; flags |= blank_space;                break;
-                case '+': fprintf_format += *f++; flags |= show_sign;                break;
-                case ',': fprintf_format += *f++; flags |= show_thousands_separator;break;
+                case '#': fprintf_format += *f++; break; //flags |= alternate_form;          break;
+                case '0': fprintf_format += *f++; break; //flags |= zero_padding;            break;
+                case '-': fprintf_format += *f++; break; //flags |= negative_field_width;    break;
+                case ' ': fprintf_format += *f++; break; //flags |= blank_space;             break;
+                case '+': fprintf_format += *f++; break; //flags |= show_sign;               break;
+                case ',': fprintf_format += *f++; break; //flags |= show_thousands_separator;break;
                 case '{':
                 case '[':
                     {
@@ -1330,7 +1376,8 @@
                 // Check for a minimum field width
                 if (isdigit(*f))
                 {
-                    min_field_width = strtoul(f, &end, 10);
+                    //min_field_width = strtoul(f, &end, 10);
+                    strtoul(f, &end, 10);
                     if (end > f)
                     {
                         fprintf_format.append(f, end - f);
@@ -1346,7 +1393,8 @@
                     if (isdigit(*f))
                     {
                         fprintf_format += '.';
-                        precision = strtoul(f, &end, 10);
+                        //precision = strtoul(f, &end, 10);
+                        strtoul(f, &end, 10);
                         if (end > f)
                         {
                             fprintf_format.append(f, end - f);
@@ -1453,7 +1501,7 @@
                             byte_size = sizeof(char);
                         else if (length_modifiers & length_mod_h)
                             byte_size = sizeof(short);
-                        if (length_modifiers & length_mod_ll)
+                        else if (length_modifiers & length_mod_ll)
                             byte_size = sizeof(long long);
                         else if (length_modifiers & length_mod_l)
                             byte_size = sizeof(long);

Modified: lldb/branches/lldb-platform-work/tools/debugserver/source/DNB.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/tools/debugserver/source/DNB.h?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/tools/debugserver/source/DNB.h (original)
+++ lldb/branches/lldb-platform-work/tools/debugserver/source/DNB.h Mon Jul 23 19:12:48 2012
@@ -48,7 +48,7 @@
 
 nub_process_t   DNBProcessAttach        (nub_process_t pid, struct timespec *timeout, char *err_str, size_t err_len) DNB_EXPORT;
 nub_process_t   DNBProcessAttachByName  (const char *name, struct timespec *timeout, char *err_str, size_t err_len) DNB_EXPORT;
-nub_process_t   DNBProcessAttachWait    (const char *wait_name, nub_launch_flavor_t launch_flavor, struct timespec *timeout, useconds_t interval, char *err_str, size_t err_len, DNBShouldCancelCallback should_cancel = NULL, void *callback_data = NULL) DNB_EXPORT;
+nub_process_t   DNBProcessAttachWait    (const char *wait_name, nub_launch_flavor_t launch_flavor, bool ignore_existing, struct timespec *timeout, useconds_t interval, char *err_str, size_t err_len, DNBShouldCancelCallback should_cancel = NULL, void *callback_data = NULL) DNB_EXPORT;
 // Resume a process with exact instructions on what to do with each thread:
 // - If no thread actions are supplied (actions is NULL or num_actions is zero),
 //   then all threads are continued.

Modified: lldb/branches/lldb-platform-work/tools/debugserver/source/MacOSX/MachException.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/tools/debugserver/source/MacOSX/MachException.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/tools/debugserver/source/MacOSX/MachException.cpp (original)
+++ lldb/branches/lldb-platform-work/tools/debugserver/source/MacOSX/MachException.cpp Mon Jul 23 19:12:48 2012
@@ -122,7 +122,6 @@
     mach_msg_type_number_t *new_stateCnt
 )
 {
-    kern_return_t kret;
     if (DNBLogCheckLogBit(LOG_EXCEPTIONS))
     {
         DNBLogThreaded("::%s ( exc_port = 0x%4.4x, thd_port = 0x%4.4x, tsk_port = 0x%4.4x, exc_type = %d ( %s ), exc_data[%d] = { 0x%llx, 0x%llx })",
@@ -135,8 +134,8 @@
             (uint64_t)(exc_data_count > 0 ? exc_data[0] : 0xBADDBADD),
             (uint64_t)(exc_data_count > 1 ? exc_data[1] : 0xBADDBADD));
     }
-    kret = mach_port_deallocate (mach_task_self (), task_port);
-    kret = mach_port_deallocate (mach_task_self (), thread_port);
+    mach_port_deallocate (mach_task_self (), task_port);
+    mach_port_deallocate (mach_task_self (), thread_port);
 
     return KERN_FAILURE;
 }
@@ -229,7 +228,7 @@
         if (desc < end_desc)
         {
             const char *sig_str = SysSignal::Name(soft_signal);
-            desc += snprintf(desc, end_desc - desc, " EXC_SOFT_SIGNAL( %i ( %s ))", soft_signal, sig_str ? sig_str : "unknown signal");
+            snprintf(desc, end_desc - desc, " EXC_SOFT_SIGNAL( %i ( %s ))", soft_signal, sig_str ? sig_str : "unknown signal");
         }
     }
     else

Modified: lldb/branches/lldb-platform-work/tools/debugserver/source/MacOSX/MachProcess.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/tools/debugserver/source/MacOSX/MachProcess.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/tools/debugserver/source/MacOSX/MachProcess.cpp (original)
+++ lldb/branches/lldb-platform-work/tools/debugserver/source/MacOSX/MachProcess.cpp Mon Jul 23 19:12:48 2012
@@ -421,8 +421,7 @@
     {
         DisableAllBreakpoints (true);
         DisableAllWatchpoints (true);
-        // The static analyzer complains about this, but just leave the following line in.
-         clear_bps_and_wps = false;
+        //clear_bps_and_wps = false;
     }
     uint32_t thread_idx = m_thread_list.GetThreadIndexForThreadStoppedWithSignal (SIGSTOP);
     if (thread_idx_ptr)
@@ -1865,18 +1864,20 @@
 
         // If our parent is setgid, lets make sure we don't inherit those
         // extra powers due to nepotism.
-        ::setgid (getgid ());
+        if (::setgid (getgid ()) == 0)
+        {
 
-        // Let the child have its own process group. We need to execute
-        // this call in both the child and parent to avoid a race condition
-        // between the two processes.
-        ::setpgid (0, 0);    // Set the child process group to match its pid
+            // Let the child have its own process group. We need to execute
+            // this call in both the child and parent to avoid a race condition
+            // between the two processes.
+            ::setpgid (0, 0);    // Set the child process group to match its pid
 
-        // Sleep a bit to before the exec call
-        ::sleep (1);
+            // Sleep a bit to before the exec call
+            ::sleep (1);
 
-        // Turn this process into
-        ::execv (path, (char * const *)argv);
+            // Turn this process into
+            ::execv (path, (char * const *)argv);
+        }
         // Exit with error code. Child process should have taken
         // over in above exec call and if the exec fails it will
         // exit the child process below.

Modified: lldb/branches/lldb-platform-work/tools/debugserver/source/MacOSX/MachThreadList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/tools/debugserver/source/MacOSX/MachThreadList.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/tools/debugserver/source/MacOSX/MachThreadList.cpp (original)
+++ lldb/branches/lldb-platform-work/tools/debugserver/source/MacOSX/MachThreadList.cpp Mon Jul 23 19:12:48 2012
@@ -470,9 +470,9 @@
 uint32_t
 MachThreadList::EnableHardwareWatchpoint (const DNBBreakpoint* wp) const
 {
+    uint32_t hw_index = INVALID_NUB_HW_INDEX;
     if (wp != NULL)
     {
-        uint32_t hw_index;
         PTHREAD_MUTEX_LOCKER (locker, m_threads_mutex);
         const uint32_t num_threads = m_threads.size();
         for (uint32_t idx = 0; idx < num_threads; ++idx)
@@ -492,9 +492,8 @@
         // Use an arbitrary thread to signal the completion of our transaction.
         if (num_threads)
             m_threads[0]->HardwareWatchpointStateChanged();
-        return hw_index;
     }
-    return INVALID_NUB_HW_INDEX;
+    return hw_index;
 }
 
 bool

Modified: lldb/branches/lldb-platform-work/tools/debugserver/source/RNBRemote.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/tools/debugserver/source/RNBRemote.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/tools/debugserver/source/RNBRemote.cpp (original)
+++ lldb/branches/lldb-platform-work/tools/debugserver/source/RNBRemote.cpp Mon Jul 23 19:12:48 2012
@@ -97,7 +97,7 @@
     // Step required to add new packets:
     // 1 - Add new enumeration to RNBRemote::PacketEnum
     // 2 - Create a the RNBRemote::HandlePacket_ function if a new function is needed
-    // 3 - Register the Packet definition with any needed callbacks in this fucntion
+    // 3 - Register the Packet definition with any needed callbacks in this function
     //          - If no response is needed for a command, then use NULL for the normal callback
     //          - If the packet is not supported while the target is running, use NULL for the async callback
     // 4 - If the packet is a standard packet (starts with a '$' character
@@ -141,6 +141,7 @@
     t.push_back (Packet (thread_alive_p,                &RNBRemote::HandlePacket_T,             NULL, "T", "Is thread alive"));
     t.push_back (Packet (vattach,                       &RNBRemote::HandlePacket_v,             NULL, "vAttach", "Attach to a new process"));
     t.push_back (Packet (vattachwait,                   &RNBRemote::HandlePacket_v,             NULL, "vAttachWait", "Wait for a process to start up then attach to it"));
+    t.push_back (Packet (vattachorwait,                 &RNBRemote::HandlePacket_v,             NULL, "vAttachOrWait", "Attach to the process or if it doesn't exist, wait for the process to start up then attach to it"));
     t.push_back (Packet (vattachname,                   &RNBRemote::HandlePacket_v,             NULL, "vAttachName", "Attach to an existing process by name"));
     t.push_back (Packet (vcont_list_actions,            &RNBRemote::HandlePacket_v,             NULL, "vCont;", "Verbose resume with thread actions"));
     t.push_back (Packet (vcont_list_actions,            &RNBRemote::HandlePacket_v,             NULL, "vCont?", "List valid continue-with-thread-actions actions"));
@@ -169,6 +170,7 @@
     t.push_back (Packet (query_register_info,           &RNBRemote::HandlePacket_qRegisterInfo, NULL, "qRegisterInfo", "Dynamically discover remote register context information."));
     t.push_back (Packet (query_shlib_notify_info_addr,  &RNBRemote::HandlePacket_qShlibInfoAddr,NULL, "qShlibInfoAddr", "Returns the address that contains info needed for getting shared library notifications"));
     t.push_back (Packet (query_step_packet_supported,   &RNBRemote::HandlePacket_qStepPacketSupported,NULL, "qStepPacketSupported", "Replys with OK if the 's' packet is supported."));
+    t.push_back (Packet (query_vattachorwait_supported, &RNBRemote::HandlePacket_qVAttachOrWaitSupported,NULL, "qVAttachOrWaitSupported", "Replys with OK if the 'vAttachOrWait' packet is supported."));
     t.push_back (Packet (query_host_info,               &RNBRemote::HandlePacket_qHostInfo,     NULL, "qHostInfo", "Replies with multiple 'key:value;' tuples appended to each other."));
 //  t.push_back (Packet (query_symbol_lookup,           &RNBRemote::HandlePacket_UNIMPLEMENTED, NULL, "qSymbol", "Notify that host debugger is ready to do symbol lookups"));
     t.push_back (Packet (start_noack_mode,              &RNBRemote::HandlePacket_QStartNoAckMode        , NULL, "QStartNoAckMode", "Request that " DEBUGSERVER_PROGRAM_NAME " stop acking remote protocol packets"));
@@ -586,7 +588,7 @@
                 case '$':
                     // Look for a standard gdb packet?
                     end_idx = data.find('#',  idx + 1);
-                    if (end_idx == std::string::npos || end_idx + 2 > data_size)
+                    if (end_idx == std::string::npos || end_idx + 3 > data_size)
                     {
                         end_idx = std::string::npos;
                     }
@@ -594,7 +596,7 @@
                     {
                         // Add two for the checksum bytes and 1 to point to the
                         // byte just past the end of this packet
-                        end_idx += 2 + 1;
+                        end_idx += 3;
                     }
                     break;
 
@@ -1302,6 +1304,13 @@
 }
 
 rnb_err_t
+RNBRemote::HandlePacket_qVAttachOrWaitSupported (const char *p)
+{
+    // We support attachOrWait meaning attach if the process exists, otherwise wait to attach.
+    return SendPacket("OK");
+}
+
+rnb_err_t
 RNBRemote::HandlePacket_qThreadStopInfo (const char *p)
 {
     p += strlen ("qThreadStopInfo");
@@ -1674,7 +1683,7 @@
                 }
             }
             // Did we get a properly formatted logging bitmask?
-            if (*p == ';')
+            if (p && *p == ';')
             {
                 // Enable DNB logging
                 DNBLogSetLogCallback(ASLLogCallback, NULL);
@@ -2028,14 +2037,21 @@
 register_value_in_hex_fixed_width (std::ostream& ostrm,
                                    nub_process_t pid,
                                    nub_thread_t tid,
-                                   const register_map_entry_t* reg)
+                                   const register_map_entry_t* reg,
+                                   const DNBRegisterValue *reg_value_ptr)
 {
     if (reg != NULL)
     {
-        DNBRegisterValue val;
-        if (DNBThreadGetRegisterValueByID (pid, tid, reg->nub_info.set, reg->nub_info.reg, &val))
+        DNBRegisterValue reg_value;
+        if (reg_value_ptr == NULL)
         {
-            append_hex_value (ostrm, val.value.v_uint8, reg->gdb_size, false);
+            if (DNBThreadGetRegisterValueByID (pid, tid, reg->nub_info.set, reg->nub_info.reg, &reg_value))
+                reg_value_ptr = &reg_value;
+        }
+        
+        if (reg_value_ptr)
+        {
+            append_hex_value (ostrm, reg_value_ptr->value.v_uint8, reg->gdb_size, false);
         }
         else
         {
@@ -2063,7 +2079,8 @@
 gdb_regnum_with_fixed_width_hex_register_value (std::ostream& ostrm,
                                                 nub_process_t pid,
                                                 nub_thread_t tid,
-                                                const register_map_entry_t* reg)
+                                                const register_map_entry_t* reg,
+                                                const DNBRegisterValue *reg_value_ptr)
 {
     // Output the register number as 'NN:VVVVVVVV;' where NN is a 2 bytes HEX
     // gdb register number, and VVVVVVVV is the correct number of hex bytes
@@ -2071,7 +2088,7 @@
     if (reg != NULL)
     {
         ostrm << RAWHEX8(reg->gdb_regnum) << ':';
-        register_value_in_hex_fixed_width (ostrm, pid, tid, reg);
+        register_value_in_hex_fixed_width (ostrm, pid, tid, reg, reg_value_ptr);
         ostrm << ';';
     }
 }
@@ -2173,15 +2190,18 @@
         if (g_num_reg_entries == 0)
             InitializeRegisters ();
 
-        DNBRegisterValue reg_value;
-        for (uint32_t reg = 0; reg < g_num_reg_entries; reg++)
+        if (g_reg_entries != NULL)
         {
-            if (g_reg_entries[reg].expedite)
+            DNBRegisterValue reg_value;
+            for (uint32_t reg = 0; reg < g_num_reg_entries; reg++)
             {
-                if (!DNBThreadGetRegisterValueByID (pid, tid, g_reg_entries[reg].nub_info.set, g_reg_entries[reg].nub_info.reg, &reg_value))
-                    continue;
+                if (g_reg_entries[reg].expedite)
+                {
+                    if (!DNBThreadGetRegisterValueByID (pid, tid, g_reg_entries[reg].nub_info.set, g_reg_entries[reg].nub_info.reg, &reg_value))
+                        continue;
 
-                gdb_regnum_with_fixed_width_hex_register_value (ostrm, pid, tid, &g_reg_entries[reg]);
+                    gdb_regnum_with_fixed_width_hex_register_value (ostrm, pid, tid, &g_reg_entries[reg], &reg_value);
+                }
             }
         }
 
@@ -2496,7 +2516,7 @@
     }
     
     for (uint32_t reg = 0; reg < g_num_reg_entries; reg++)
-        register_value_in_hex_fixed_width (ostrm, pid, tid, &g_reg_entries[reg]);
+        register_value_in_hex_fixed_width (ostrm, pid, tid, &g_reg_entries[reg], NULL);
 
     return SendPacket (ostrm.str ());
 }
@@ -2667,6 +2687,31 @@
     return SendPacket ("E54");
 }
 
+static bool
+GetProcessNameFrom_vAttach (const char *&p, std::string &attach_name)
+{
+    bool return_val = true;
+    while (*p != '\0')
+    {
+        char smallbuf[3];
+        smallbuf[0] = *p;
+        smallbuf[1] = *(p + 1);
+        smallbuf[2] = '\0';
+
+        errno = 0;
+        int ch = strtoul (smallbuf, NULL, 16);
+        if (errno != 0 && ch == 0)
+        {
+            return_val = false;
+            break;
+        }
+
+        attach_name.push_back(ch);
+        p += 2;
+    }
+    return return_val;
+}
+
 /*
  vAttach;pid
 
@@ -2695,7 +2740,6 @@
     }
     else if (strstr (p, "vCont") == p)
     {
-        rnb_err_t rnb_err = rnb_success;
         typedef struct
         {
             nub_thread_t tid;
@@ -2747,7 +2791,7 @@
                     break;
 
                 default:
-                    rnb_err = HandlePacket_ILLFORMED (__FILE__, __LINE__, p, "Unsupported action in vCont packet");
+                    HandlePacket_ILLFORMED (__FILE__, __LINE__, p, "Unsupported action in vCont packet");
                     break;
             }
             if (*c == ':')
@@ -2771,51 +2815,37 @@
     {
         nub_process_t attach_pid = INVALID_NUB_PROCESS;
         char err_str[1024]={'\0'};
+        
         if (strstr (p, "vAttachWait;") == p)
         {
             p += strlen("vAttachWait;");
             std::string attach_name;
-            while (*p != '\0')
+            if (!GetProcessNameFrom_vAttach(p, attach_name))
             {
-                char smallbuf[3];
-                smallbuf[0] = *p;
-                smallbuf[1] = *(p + 1);
-                smallbuf[2] = '\0';
-
-                errno = 0;
-                int ch = strtoul (smallbuf, NULL, 16);
-                if (errno != 0 && ch == 0)
-                {
-                    return HandlePacket_ILLFORMED (__FILE__, __LINE__, p, "non-hex char in arg on 'vAttachWait' pkt");
-                }
-
-                attach_name.push_back(ch);
-                p += 2;
+                return HandlePacket_ILLFORMED (__FILE__, __LINE__, p, "non-hex char in arg on 'vAttachWait' pkt");
             }
-
-            attach_pid = DNBProcessAttachWait(attach_name.c_str (), m_ctx.LaunchFlavor(), NULL, 1000, err_str, sizeof(err_str), RNBRemoteShouldCancelCallback);
+            const bool ignore_existing = true;
+            attach_pid = DNBProcessAttachWait(attach_name.c_str (), m_ctx.LaunchFlavor(), ignore_existing, NULL, 1000, err_str, sizeof(err_str), RNBRemoteShouldCancelCallback);
 
         }
+        else if (strstr (p, "vAttachOrWait;") == p)
+        {
+            p += strlen("vAttachOrWait;");
+            std::string attach_name;
+            if (!GetProcessNameFrom_vAttach(p, attach_name))
+            {
+                return HandlePacket_ILLFORMED (__FILE__, __LINE__, p, "non-hex char in arg on 'vAttachOrWait' pkt");
+            }
+            const bool ignore_existing = false;
+            attach_pid = DNBProcessAttachWait(attach_name.c_str (), m_ctx.LaunchFlavor(), ignore_existing, NULL, 1000, err_str, sizeof(err_str), RNBRemoteShouldCancelCallback);
+        }
         else if (strstr (p, "vAttachName;") == p)
         {
             p += strlen("vAttachName;");
             std::string attach_name;
-            while (*p != '\0')
+            if (!GetProcessNameFrom_vAttach(p, attach_name))
             {
-                char smallbuf[3];
-                smallbuf[0] = *p;
-                smallbuf[1] = *(p + 1);
-                smallbuf[2] = '\0';
-
-                errno = 0;
-                int ch = strtoul (smallbuf, NULL, 16);
-                if (errno != 0 && ch == 0)
-                {
-                    return HandlePacket_ILLFORMED (__FILE__, __LINE__, p, "non-hex char in arg on 'vAttachWait' pkt");
-                }
-
-                attach_name.push_back(ch);
-                p += 2;
+                return HandlePacket_ILLFORMED (__FILE__, __LINE__, p, "non-hex char in arg on 'vAttachName' pkt");
             }
 
             attach_pid = DNBProcessAttachByName (attach_name.c_str(), NULL, err_str, sizeof(err_str));
@@ -2835,7 +2865,9 @@
             }
         }
         else
+        {
             return HandlePacket_UNIMPLEMENTED(p);
+        }
 
 
         if (attach_pid != INVALID_NUB_PROCESS)
@@ -3194,7 +3226,7 @@
     }
     else
     {
-        register_value_in_hex_fixed_width (ostrm, pid, tid, reg_entry);
+        register_value_in_hex_fixed_width (ostrm, pid, tid, reg_entry, NULL);
     }
     return SendPacket (ostrm.str());
 }
@@ -3587,10 +3619,13 @@
     if (cputype == CPU_TYPE_ARM)
     {
         strm << "ostype:ios;";
+        // On armv7 we use "synchronous" watchpoints which means the exception is delivered before the instruction executes.
+        strm << "watchpoint_exceptions_received:before;";
     }
     else
     {
         strm << "ostype:macosx;";
+        strm << "watchpoint_exceptions_received:after;";
     }
 //    char ostype[64];
 //    len = sizeof(ostype);

Modified: lldb/branches/lldb-platform-work/tools/debugserver/source/RNBRemote.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/tools/debugserver/source/RNBRemote.h?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/tools/debugserver/source/RNBRemote.h (original)
+++ lldb/branches/lldb-platform-work/tools/debugserver/source/RNBRemote.h Mon Jul 23 19:12:48 2012
@@ -63,6 +63,7 @@
         thread_alive_p,                 // 'T'
         vattach,                        // 'vAttach;pid'
         vattachwait,                    // 'vAttachWait:XX...' where XX is one or more hex encoded process name ASCII bytes
+        vattachorwait,                  // 'vAttachOrWait:XX...' where XX is one or more hex encoded process name ASCII bytes
         vattachname,                    // 'vAttachName:XX...' where XX is one or more hex encoded process name ASCII bytes
         vcont,                          // 'vCont'
         vcont_list_actions,             // 'vCont?'
@@ -91,6 +92,7 @@
         query_register_info,            // 'qRegisterInfo'
         query_shlib_notify_info_addr,   // 'qShlibInfoAddr'
         query_step_packet_supported,    // 'qStepPacketSupported'
+        query_vattachorwait_supported,  // 'qVAttachOrWaitSupported'
         query_host_info,                // 'qHostInfo'
         pass_signals_to_inferior,       // 'QPassSignals'
         start_noack_mode,               // 'QStartNoAckMode'
@@ -164,6 +166,7 @@
     rnb_err_t HandlePacket_qRegisterInfo (const char *p);
     rnb_err_t HandlePacket_qShlibInfoAddr (const char *p);
     rnb_err_t HandlePacket_qStepPacketSupported (const char *p);
+    rnb_err_t HandlePacket_qVAttachOrWaitSupported (const char *p);
     rnb_err_t HandlePacket_qThreadInfo (const char *p);
     rnb_err_t HandlePacket_qThreadExtraInfo (const char *p);
     rnb_err_t HandlePacket_qThreadStopInfo (const char *p);

Modified: lldb/branches/lldb-platform-work/tools/debugserver/source/debugserver.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/tools/debugserver/source/debugserver.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/tools/debugserver/source/debugserver.cpp (original)
+++ lldb/branches/lldb-platform-work/tools/debugserver/source/debugserver.cpp Mon Jul 23 19:12:48 2012
@@ -105,7 +105,7 @@
                 err = remote->HandleReceivedPacket (&type);
 
                 // check if we tried to attach to a process
-                if (type == RNBRemote::vattach || type == RNBRemote::vattachwait)
+                if (type == RNBRemote::vattach || type == RNBRemote::vattachwait || type == RNBRemote::vattachorwait)
                 {
                     if (err == rnb_success)
                         return eRNBRunLoopModeInferiorExecuting;
@@ -1141,6 +1141,7 @@
 
     int listen_port = INT32_MAX;
     char str[PATH_MAX];
+    str[0] = '\0';
 
     if (g_lockdown_opt == 0 && g_applist_opt == 0)
     {
@@ -1318,8 +1319,8 @@
                     }
 
                     ctx.SetLaunchFlavor(launch_flavor);
-
-                    nub_process_t pid = DNBProcessAttachWait (waitfor_pid_name.c_str(), launch_flavor, timeout_ptr, waitfor_interval, err_str, sizeof(err_str));
+                    bool ignore_existing = false;
+                    nub_process_t pid = DNBProcessAttachWait (waitfor_pid_name.c_str(), launch_flavor, ignore_existing, timeout_ptr, waitfor_interval, err_str, sizeof(err_str));
                     g_pid = pid;
 
                     if (pid == INVALID_NUB_PROCESS)

Modified: lldb/branches/lldb-platform-work/tools/driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/tools/driver/Driver.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/tools/driver/Driver.cpp (original)
+++ lldb/branches/lldb-platform-work/tools/driver/Driver.cpp Mon Jul 23 19:12:48 2012
@@ -722,7 +722,7 @@
     {
         // Skip any options we consumed with getopt_long
         argc -= optind;
-        argv += optind;
+        //argv += optind; // Commented out to keep static analyzer happy
 
         if (argc > 0)
             ::fprintf (out_fh, "Warning: program arguments are ignored when attaching.\n");

Modified: lldb/branches/lldb-platform-work/tools/driver/IOChannel.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/tools/driver/IOChannel.cpp?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/tools/driver/IOChannel.cpp (original)
+++ lldb/branches/lldb-platform-work/tools/driver/IOChannel.cpp Mon Jul 23 19:12:48 2012
@@ -212,6 +212,7 @@
     el_set (m_edit_line, EL_BIND, m_completion_key, "lldb_complete", NULL);
     el_set (m_edit_line, EL_BIND, "^r", "em-inc-search-prev", NULL);  // Cycle through backwards search, entering string
     el_set (m_edit_line, EL_BIND, "^w", "ed-delete-prev-word", NULL); // Delete previous word, behave like bash does.
+    el_set (m_edit_line, EL_BIND, "\e[3~", "ed-delete-next-char", NULL); // Fix the delete key.
     el_set (m_edit_line, EL_CLIENTDATA, this);
 
     // Source $PWD/.editrc then $HOME/.editrc

Modified: lldb/branches/lldb-platform-work/www/python-reference.html
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/www/python-reference.html?rev=160654&r1=160653&r2=160654&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/www/python-reference.html (original)
+++ lldb/branches/lldb-platform-work/www/python-reference.html Mon Jul 23 19:12:48 2012
@@ -29,6 +29,54 @@
 
 				</div>
 				<div class="postfooter"></div>
+    		<div class="post">
+    			<h1 class ="postheader">Documentation</h1>
+    			<div class="postcontent">
+
+                    <p>The LLDB API is contained in a python module named <b>lldb</b>. Help is available through the standard python help and documentation. To get an overview of the <b>lldb</b> python module you can execute the following command:</p>
+<code><pre><tt>(lldb) <b>script help(lldb)</b>
+    Help on package lldb:
+
+    NAME
+        lldb - The lldb module contains the public APIs for Python binding.
+
+    FILE
+        /System/Library/PrivateFrameworks/LLDB.framework/Versions/A/Resources/Python/lldb/__init__.py
+
+    DESCRIPTION
+...
+</tt></pre></code>
+                    <p>You can also get help using a module class name. The full API that is exposed for that class will be displayed in a man page style window. Below we want to get help on the lldb.SBFrame class:</p>
+<code><pre><tt>(lldb) <b>script help(lldb.SBFrame)</b>
+    Help on class SBFrame in module lldb:
+
+    class SBFrame(__builtin__.object)
+     |  Represents one of the stack frames associated with a thread.
+     |  SBThread contains SBFrame(s). For example (from test/lldbutil.py),
+     |  
+     |  def print_stacktrace(thread, string_buffer = False):
+     |      '''Prints a simple stack trace of this thread.'''
+     |  
+...
+</tt></pre></code>
+                    <p>Or you can get help using any python object, here we use the <b>lldb.process</b> object which is a global variable in the <b>lldb</b> module which represents the currently selected process:</p>
+<code><pre><tt>(lldb) <b>script help(lldb.process)</b>
+    Help on SBProcess in module lldb object:
+
+    class SBProcess(__builtin__.object)
+     |  Represents the process associated with the target program.
+     |  
+     |  SBProcess supports thread iteration. For example (from test/lldbutil.py),
+     |  
+     |  # ==================================================
+     |  # Utility functions related to Threads and Processes
+     |  # ==================================================
+     |  
+...
+</tt></pre></code>
+
+    				</div>
+    				<div class="postfooter"></div>
 
 			<div class="post">
 				<h1 class ="postheader">Embedded Python Interpreter</h1>





More information about the lldb-commits mailing list