[Lldb-commits] [lldb] r161801 - in /lldb/branches/lldb-platform-work: ./ examples/darwin/heap_find/ examples/darwin/heap_find/heap/ examples/python/ include/lldb/ include/lldb/Breakpoint/ include/lldb/Core/ include/lldb/Expression/ include/lldb/Interpreter/ include/lldb/Target/ lldb.xcodeproj/ resources/ scripts/ scripts/Python/ source/API/ source/Breakpoint/ source/Commands/ source/Core/ source/Expression/ source/Host/macosx/launcherXPCService/ source/Interpreter/ source/Plugins/Disassembler/llvm/ source/Plugins/Dynam...

Johnny Chen johnny.chen at apple.com
Mon Aug 13 15:30:56 PDT 2012


Author: johnny
Date: Mon Aug 13 17:30:55 2012
New Revision: 161801

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

Added:
    lldb/branches/lldb-platform-work/include/lldb/Breakpoint/WatchpointOptions.h
      - copied unchanged from r161795, lldb/trunk/include/lldb/Breakpoint/WatchpointOptions.h
    lldb/branches/lldb-platform-work/source/Breakpoint/WatchpointOptions.cpp
      - copied unchanged from r161795, lldb/trunk/source/Breakpoint/WatchpointOptions.cpp
    lldb/branches/lldb-platform-work/source/Commands/CommandObjectWatchpointCommand.cpp
      - copied unchanged from r161795, lldb/trunk/source/Commands/CommandObjectWatchpointCommand.cpp
    lldb/branches/lldb-platform-work/source/Commands/CommandObjectWatchpointCommand.h
      - copied unchanged from r161795, lldb/trunk/source/Commands/CommandObjectWatchpointCommand.h
    lldb/branches/lldb-platform-work/test/functionalities/data-formatter/rdar-10449092/
      - copied from r161795, lldb/trunk/test/functionalities/data-formatter/rdar-10449092/
    lldb/branches/lldb-platform-work/test/functionalities/data-formatter/rdar-10449092/Makefile
      - copied unchanged from r161795, lldb/trunk/test/functionalities/data-formatter/rdar-10449092/Makefile
    lldb/branches/lldb-platform-work/test/functionalities/data-formatter/rdar-10449092/Test-rdar-10449092.py
      - copied unchanged from r161795, lldb/trunk/test/functionalities/data-formatter/rdar-10449092/Test-rdar-10449092.py
    lldb/branches/lldb-platform-work/test/functionalities/data-formatter/rdar-10449092/main.cpp
      - copied unchanged from r161795, lldb/trunk/test/functionalities/data-formatter/rdar-10449092/main.cpp
    lldb/branches/lldb-platform-work/test/functionalities/watchpoint/watchpoint_commands/command/
      - copied from r161795, lldb/trunk/test/functionalities/watchpoint/watchpoint_commands/command/
    lldb/branches/lldb-platform-work/test/functionalities/watchpoint/watchpoint_commands/command/Makefile
      - copied unchanged from r161795, lldb/trunk/test/functionalities/watchpoint/watchpoint_commands/command/Makefile
    lldb/branches/lldb-platform-work/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandLLDB.py
      - copied unchanged from r161795, lldb/trunk/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandLLDB.py
    lldb/branches/lldb-platform-work/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py
      - copied unchanged from r161795, lldb/trunk/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py
    lldb/branches/lldb-platform-work/test/functionalities/watchpoint/watchpoint_commands/command/main.cpp
      - copied unchanged from r161795, lldb/trunk/test/functionalities/watchpoint/watchpoint_commands/command/main.cpp
    lldb/branches/lldb-platform-work/test/plugins/builder_freebsd9.py
      - copied unchanged from r161795, lldb/trunk/test/plugins/builder_freebsd9.py
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/include/lldb/Breakpoint/BreakpointOptions.h
    lldb/branches/lldb-platform-work/include/lldb/Breakpoint/Watchpoint.h
    lldb/branches/lldb-platform-work/include/lldb/Core/ConnectionFileDescriptor.h
    lldb/branches/lldb-platform-work/include/lldb/Core/Debugger.h
    lldb/branches/lldb-platform-work/include/lldb/Core/Opcode.h
    lldb/branches/lldb-platform-work/include/lldb/Core/ValueObject.h
    lldb/branches/lldb-platform-work/include/lldb/Expression/DWARFExpression.h
    lldb/branches/lldb-platform-work/include/lldb/Interpreter/NamedOptionValue.h
    lldb/branches/lldb-platform-work/include/lldb/Interpreter/OptionGroupVariable.h
    lldb/branches/lldb-platform-work/include/lldb/Interpreter/ScriptInterpreter.h
    lldb/branches/lldb-platform-work/include/lldb/Interpreter/ScriptInterpreterPython.h
    lldb/branches/lldb-platform-work/include/lldb/Target/ExecutionContext.h
    lldb/branches/lldb-platform-work/include/lldb/lldb-enumerations.h
    lldb/branches/lldb-platform-work/include/lldb/lldb-forward.h
    lldb/branches/lldb-platform-work/include/lldb/lldb-private-interfaces.h
    lldb/branches/lldb-platform-work/lldb.xcodeproj/project.pbxproj
    lldb/branches/lldb-platform-work/llvm.zip
    lldb/branches/lldb-platform-work/resources/LLDB-Info.plist
    lldb/branches/lldb-platform-work/scripts/Python/python-wrapper.swig
    lldb/branches/lldb-platform-work/scripts/build-llvm.pl
    lldb/branches/lldb-platform-work/scripts/lldb.swig
    lldb/branches/lldb-platform-work/source/API/SBBreakpoint.cpp
    lldb/branches/lldb-platform-work/source/API/SBWatchpoint.cpp
    lldb/branches/lldb-platform-work/source/Breakpoint/Watchpoint.cpp
    lldb/branches/lldb-platform-work/source/Commands/CommandObjectBreakpointCommand.cpp
    lldb/branches/lldb-platform-work/source/Commands/CommandObjectCommands.cpp
    lldb/branches/lldb-platform-work/source/Commands/CommandObjectDisassemble.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/CommandObjectType.cpp
    lldb/branches/lldb-platform-work/source/Commands/CommandObjectWatchpoint.cpp
    lldb/branches/lldb-platform-work/source/Core/ArchSpec.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/Disassembler.cpp
    lldb/branches/lldb-platform-work/source/Core/FormatManager.cpp
    lldb/branches/lldb-platform-work/source/Core/Opcode.cpp
    lldb/branches/lldb-platform-work/source/Core/ValueObject.cpp
    lldb/branches/lldb-platform-work/source/Core/cxa_demangle.cpp
    lldb/branches/lldb-platform-work/source/Expression/ClangExpressionDeclMap.cpp
    lldb/branches/lldb-platform-work/source/Expression/ClangExpressionParser.cpp
    lldb/branches/lldb-platform-work/source/Expression/ClangFunction.cpp
    lldb/branches/lldb-platform-work/source/Expression/ClangUserExpression.cpp
    lldb/branches/lldb-platform-work/source/Expression/DWARFExpression.cpp
    lldb/branches/lldb-platform-work/source/Expression/IRInterpreter.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/CommandInterpreter.cpp
    lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupValueObjectDisplay.cpp
    lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupVariable.cpp
    lldb/branches/lldb-platform-work/source/Interpreter/ScriptInterpreter.cpp
    lldb/branches/lldb-platform-work/source/Interpreter/ScriptInterpreterPython.cpp
    lldb/branches/lldb-platform-work/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
    lldb/branches/lldb-platform-work/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
    lldb/branches/lldb-platform-work/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
    lldb/branches/lldb-platform-work/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
    lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.h
    lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
    lldb/branches/lldb-platform-work/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
    lldb/branches/lldb-platform-work/source/Symbol/ClangASTType.cpp
    lldb/branches/lldb-platform-work/source/Symbol/UnwindPlan.cpp
    lldb/branches/lldb-platform-work/source/Target/LanguageRuntime.cpp
    lldb/branches/lldb-platform-work/source/Target/Process.cpp
    lldb/branches/lldb-platform-work/source/Target/StopInfo.cpp
    lldb/branches/lldb-platform-work/source/Target/Thread.cpp
    lldb/branches/lldb-platform-work/source/Target/ThreadPlanCallFunction.cpp
    lldb/branches/lldb-platform-work/source/Target/ThreadPlanStepUntil.cpp
    lldb/branches/lldb-platform-work/test/dotest.py
    lldb/branches/lldb-platform-work/test/functionalities/abbreviation/TestAbbreviations.py
    lldb/branches/lldb-platform-work/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
    lldb/branches/lldb-platform-work/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py
    lldb/branches/lldb-platform-work/test/functionalities/breakpoint/breakpoint_ignore_count/main.c
    lldb/branches/lldb-platform-work/test/functionalities/completion/TestCompletion.py
    lldb/branches/lldb-platform-work/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
    lldb/branches/lldb-platform-work/test/functionalities/data-formatter/data-formatter-cpp/main.cpp
    lldb/branches/lldb-platform-work/test/lang/objc/foundation/TestObjCMethods2.py
    lldb/branches/lldb-platform-work/test/lang/objc/print-obj/TestPrintObj.py
    lldb/branches/lldb-platform-work/tools/debugserver/debugserver.xcodeproj/project.pbxproj
    lldb/branches/lldb-platform-work/www/python-reference.html
    lldb/branches/lldb-platform-work/www/varformats.html

Propchange: lldb/branches/lldb-platform-work/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Aug 13 17:30:55 2012
@@ -1 +1 @@
-/lldb/trunk:154223-161360
+/lldb/trunk:154223-161795

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=161801&r1=161800&r2=161801&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 Aug 13 17:30:55 2012
@@ -131,6 +131,7 @@
     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)
+    parser.add_option('-O', '--offset', type='int', dest='offset', help='the matching data must be at this offset', default=-1)
 
 def dump_stack_history_entry(stack_history_entry, idx):
     address = int(stack_history_entry.address)
@@ -192,6 +193,7 @@
         if expr_sbvalue.unsigned:
             match_value = lldb.value(expr_sbvalue)  
             i = 0
+            match_idx = 0
             while 1:
                 print_entry = True
                 match_entry = match_value[i]; i += 1
@@ -203,44 +205,49 @@
                     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)
-                description = '[%u] %s: addr = 0x%x' % (i, arg_str_description, malloc_addr)
-                if offset != 0:
-                    description += ' + %u' % (offset)
-                description += ', size = %u' % (malloc_size)
-                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!)'
-                else:
-                    derefed_dynamic_value = dynamic_value.deref
-                    if derefed_dynamic_value:                        
-                        derefed_dynamic_type = derefed_dynamic_value.type
-                        derefed_dynamic_type_size = derefed_dynamic_type.size
-                        derefed_dynamic_type_name = derefed_dynamic_type.name
-                        description += ', 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 options.offset >= 0 and options.offset != offset:
+                    print_entry = False
+                else:                    
+                    match_addr = malloc_addr + offset
+                    dynamic_value = match_entry.addr.sbvalue.GetDynamicValue(lldb.eDynamicCanRunTarget)
+                    description = '[%u] %s: addr = 0x%x' % (match_idx, arg_str_description, malloc_addr)
+                    if offset != 0:
+                        description += ' + %u' % (offset)
+                    description += ', size = %u' % (malloc_size)
+                    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!)'
+                    else:
+                        derefed_dynamic_value = dynamic_value.deref
+                        if derefed_dynamic_value:                        
+                            derefed_dynamic_type = derefed_dynamic_value.type
+                            derefed_dynamic_type_size = derefed_dynamic_type.size
+                            derefed_dynamic_type_name = derefed_dynamic_type.name
+                            description += ', 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:
+                    match_idx += 1
                     if description:
                         print description
                         if options.print_type and derefed_dynamic_value:
@@ -248,7 +255,7 @@
                         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)
+                                print ', po=%s\n' % (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)
@@ -279,6 +286,12 @@
         arg_str_description = 'malloc block containing pointer %s' % arg_str
         if options.format == None: 
             options.format = "A" # 'A' is "address" format
+    elif options.type == 'isa':
+        expr = 'find_pointer_in_heap((void *)%s)' % (arg_str)
+        arg_str_description = 'objective C classes with isa %s' % arg_str
+        options.offset = 0
+        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
@@ -430,6 +443,37 @@
     else:
         print 'error: no sections were found that match any of %s' % (', '.join(options.section_names))
 
+def objc_refs(debugger, command, result, dict):
+    command_args = shlex.split(command)
+    usage = "usage: %prog [options] <EXPR> [EXPR ...]"
+    description='''Find all heap allocations given one or more objective C class names.'''
+    parser = optparse.OptionParser(description=description, prog='object_refs',usage=usage)
+    add_common_options(parser)
+    try:
+        (options, args) = parser.parse_args(command_args)
+    except:
+        return
+
+    dylid_load_err = load_dylib()
+    if dylid_load_err:
+        print dylid_load_err
+    else:
+        if args:
+            for class_name in args:
+                addr_expr_str = "(void *)[%s class]" % class_name
+                expr_sbvalue = lldb.frame.EvaluateExpression (addr_expr_str)
+                if expr_sbvalue.error.Success():
+                    isa = expr_sbvalue.unsigned
+                    if isa:
+                        options.type = 'isa'
+                        heap_search (options, '0x%x' % isa)
+                    else:
+                        print 'error: Can\'t find isa for an ObjC class named "%s"' % (class_name)
+                else:
+                    print 'error: expression error for "%s": %s' % (addr_expr_str, expr_sbvalue.error)
+        else:
+            print 'error: no address expressions were specified'
+
 if __name__ == '__main__':
     lldb.debugger = lldb.SBDebugger.Create()
 
@@ -440,6 +484,7 @@
 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')
 lldb.debugger.HandleCommand('command script add -f lldb.macosx.heap.section_ptr_refs section_ptr_refs')
+lldb.debugger.HandleCommand('command script add -f lldb.macosx.heap.objc_refs objc_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=161801&r1=161800&r2=161801&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 Aug 13 17:30:55 2012
@@ -399,16 +399,19 @@
     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_callback_info_t info = { enumerate_range_in_zone, range_info_callback, &data_info };
-    foreach_zone_in_this_process (&info);
+    if (addr)
+    {
+        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_callback_info_t info = { enumerate_range_in_zone, range_info_callback, &data_info };
+        foreach_zone_in_this_process (&info);
+    }
     if (g_matches.empty())
         return NULL;
     malloc_match match = { NULL, 0, 0 };

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=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/examples/python/crashlog.py (original)
+++ lldb/branches/lldb-platform-work/examples/python/crashlog.py Mon Aug 13 17:30:55 2012
@@ -219,7 +219,7 @@
                 # print 'PARSE_MODE_NORMAL'
             elif parse_mode == PARSE_MODE_NORMAL:
                 if line.startswith ('Process:'):
-                    (self.process_name, pid_with_brackets) = line[8:].strip().split()
+                    (self.process_name, pid_with_brackets) = line[8:].strip().split(' [')
                     self.process_id = pid_with_brackets.strip('[]')
                 elif line.startswith ('Path:'):
                     self.process_path = line[5:].strip()

Modified: lldb/branches/lldb-platform-work/include/lldb/Breakpoint/BreakpointOptions.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Breakpoint/BreakpointOptions.h?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Breakpoint/BreakpointOptions.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Breakpoint/BreakpointOptions.h Mon Aug 13 17:30:55 2012
@@ -142,8 +142,8 @@
     //------------------------------------------------------------------
     /// Used in InvokeCallback to tell whether it is the right time to run this kind of callback.
     ///
-    /// @param[in] condition
-    ///    The condition expression to evaluate when the breakpoint is hit.
+    /// @return
+    ///     The synchronicity of our callback.
     //------------------------------------------------------------------
     bool IsCallbackSynchronous () {
         return m_callback_is_synchronous;

Modified: lldb/branches/lldb-platform-work/include/lldb/Breakpoint/Watchpoint.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Breakpoint/Watchpoint.h?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Breakpoint/Watchpoint.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Breakpoint/Watchpoint.h Mon Aug 13 17:30:55 2012
@@ -22,6 +22,7 @@
 #include "lldb/lldb-private.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Core/UserID.h"
+#include "lldb/Breakpoint/WatchpointOptions.h"
 #include "lldb/Breakpoint/StoppointLocation.h"
 
 namespace lldb_private {
@@ -52,17 +53,67 @@
     uint32_t    GetIgnoreCount () const;
     void        SetIgnoreCount (uint32_t n);
     void        SetWatchpointType (uint32_t type);
-    bool        SetCallback (WatchpointHitCallback callback, void *callback_baton);
-    void        ClearCallback();
-    void        SetDeclInfo (std::string &str);
-    void        SetWatchSpec (std::string &str);
+    void        SetDeclInfo (const std::string &str);
+    std::string GetWatchSpec();
+    void        SetWatchSpec (const std::string &str);
+
+    // Snapshot management interface.
+    bool        IsWatchVariable() const;
+    void        SetWatchVariable(bool val);
+    std::string GetOldSnapshot() const;
+    void        SetOldSnapshot (const std::string &str);
+    std::string GetNewSnapshot() const;
+    void        SetNewSnapshot (const std::string &str);
+    uint64_t    GetOldSnapshotVal() const;
+    void        SetOldSnapshotVal (uint64_t val);
+    uint64_t    GetNewSnapshotVal() const;
+    void        SetNewSnapshotVal (uint64_t val);
+
     void        GetDescription (Stream *s, lldb::DescriptionLevel level);
     void        Dump (Stream *s) const;
+    void        DumpSnapshots (const char * prefix, Stream *s) const;
     void        DumpWithLevel (Stream *s, lldb::DescriptionLevel description_level) const;
     Target      &GetTarget() { return *m_target; }
     const Error &GetError() { return m_error; }
 
     //------------------------------------------------------------------
+    /// Returns the WatchpointOptions structure set for this watchpoint.
+    ///
+    /// @return
+    ///     A pointer to this watchpoint's WatchpointOptions.
+    //------------------------------------------------------------------
+    WatchpointOptions *
+    GetOptions () { return &m_options; }
+
+    //------------------------------------------------------------------
+    /// Set the callback action invoked when the watchpoint is hit.  
+    /// 
+    /// @param[in] callback
+    ///    The method that will get called when the watchpoint is hit.
+    /// @param[in] callback_baton
+    ///    A void * pointer that will get passed back to the callback function.
+    /// @param[in] is_synchronous
+    ///    If \b true the callback will be run on the private event thread
+    ///    before the stop event gets reported.  If false, the callback will get
+    ///    handled on the public event thead after the stop has been posted.
+    ///
+    /// @return
+    ///    \b true if the process should stop when you hit the watchpoint.
+    ///    \b false if it should continue.
+    //------------------------------------------------------------------
+    void
+    SetCallback (WatchpointHitCallback callback, 
+                 void *callback_baton,
+                 bool is_synchronous = false);
+
+    void
+    SetCallback (WatchpointHitCallback callback, 
+                 const lldb::BatonSP &callback_baton_sp,
+                 bool is_synchronous = false);
+
+    void        ClearCallback();
+
+    //------------------------------------------------------------------
     /// Invoke the callback action when the watchpoint is hit.
     ///
     /// @param[in] context
@@ -78,10 +129,10 @@
     // Condition
     //------------------------------------------------------------------
     //------------------------------------------------------------------
-    /// Set the breakpoint's condition.
+    /// Set the watchpoint's condition.
     ///
     /// @param[in] condition
-    ///    The condition expression to evaluate when the breakpoint is hit.
+    ///    The condition expression to evaluate when the watchpoint is hit.
     ///    Pass in NULL to clear the condition.
     //------------------------------------------------------------------
     void SetCondition (const char *condition);
@@ -100,22 +151,26 @@
     friend class WatchpointList;
 
     void        SetTarget(Target *target_ptr) { m_target = target_ptr; }
-    std::string GetWatchSpec() { return m_watch_spec_str; }
     void        ResetHitCount() { m_hit_count = 0; }
 
     Target      *m_target;
     bool        m_enabled;             // Is this watchpoint enabled
     bool        m_is_hardware;         // Is this a hardware watchpoint
+    bool        m_is_watch_variable;   // True if set via 'watchpoint set variable'.
     uint32_t    m_watch_read:1,        // 1 if we stop when the watched data is read from
                 m_watch_write:1,       // 1 if we stop when the watched data is written to
                 m_watch_was_read:1,    // Set to 1 when watchpoint is hit for a read access
                 m_watch_was_written:1; // Set to 1 when watchpoint is hit for a write access
     uint32_t    m_ignore_count;        // Number of times to ignore this breakpoint
-    WatchpointHitCallback m_callback;
-    void *      m_callback_baton;      // Callback user data to pass to callback
     std::string m_decl_str;            // Declaration information, if any.
-    std::string m_watch_spec_str;      // Spec for the watchpoint (for future use).
+    std::string m_watch_spec_str;      // Spec for the watchpoint.
+    std::string m_snapshot_old_str;    // Old snapshot for the watchpoint value as by ValueObject::DumpValueObject().
+    std::string m_snapshot_new_str;    // New Snapshot for the watchpoint value as by ValueObject::DumpValueObject().
+    uint64_t    m_snapshot_old_val;    // Old snapshot for the watchpoint bytes.
+    uint64_t    m_snapshot_new_val;    // New Snapshot for the watchpoint bytes.
     Error       m_error;               // An error object describing errors associated with this watchpoint.
+    WatchpointOptions m_options;       // Settable watchpoint options, which is a delegate to handle
+                                       // the callback machinery.
 
     std::auto_ptr<ClangUserExpression> m_condition_ap;  // The condition to test.
 

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=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Core/ConnectionFileDescriptor.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Core/ConnectionFileDescriptor.h Mon Aug 13 17:30:55 2012
@@ -72,10 +72,10 @@
 protected:
     
     void
-    InitializeCommandFileDescriptor ();
+    OpenCommandPipe ();
     
     void
-    CloseCommandFileDescriptor ();
+    CloseCommandPipe ();
 
     lldb::ConnectionStatus
     BytesAvailable (uint32_t timeout_usec, Error *error_ptr);
@@ -110,13 +110,13 @@
     FDType m_fd_send_type;
     FDType m_fd_recv_type;
     SocketAddress m_udp_send_sockaddr;
-    bool m_should_close_fd; // True if this class should close the file descriptor when it goes away.
+    bool m_should_close_fd;     // True if this class should close the file descriptor when it goes away.
     uint32_t m_socket_timeout_usec;
-    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.
+    int m_pipe_read;            // A pipe that we select on the reading end of along with
+    int m_pipe_write;           // 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.
+    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/Debugger.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Core/Debugger.h?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Core/Debugger.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Core/Debugger.h Mon Aug 13 17:30:55 2012
@@ -146,6 +146,12 @@
             m_prompt.assign ("(lldb) ");
         BroadcastPromptChange (m_instance_name, m_prompt.c_str());
     }
+    
+    bool
+    GetNotifyVoid() const
+    {
+        return m_notify_void;
+    }
 
     const char *
     GetFrameFormat() const
@@ -247,6 +253,7 @@
     uint32_t m_stop_disassembly_count;
     StopDisassemblyType m_stop_disassembly_display;
     std::string m_prompt;
+    bool m_notify_void;
     std::string m_frame_format;
     std::string m_thread_format;
     lldb::ScriptLanguage m_script_lang;

Modified: lldb/branches/lldb-platform-work/include/lldb/Core/Opcode.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Core/Opcode.h?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Core/Opcode.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Core/Opcode.h Mon Aug 13 17:30:55 2012
@@ -225,8 +225,7 @@
         
         // Get the opcode exactly as it would be laid out in memory.
         uint32_t
-        GetData (DataExtractor &data,
-                 lldb::AddressClass address_class) const;
+        GetData (DataExtractor &data) const;
 
     protected:
 

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=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Core/ValueObject.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Core/ValueObject.h Mon Aug 13 17:30:55 2012
@@ -231,6 +231,7 @@
         lldb::Format m_format;
         lldb::TypeSummaryImplSP m_summary_sp;
         std::string m_root_valobj_name;
+        bool m_hide_root_type;
         
         DumpValueObjectOptions() :
             m_max_ptr_depth(0),
@@ -246,7 +247,8 @@
             m_ignore_cap(false), 
             m_format (lldb::eFormatDefault),
             m_summary_sp(),
-            m_root_valobj_name()
+            m_root_valobj_name(),
+            m_hide_root_type(false)  // <rdar://problem/11505459> provide a special compact display for "po",
         {}
         
         static const DumpValueObjectOptions
@@ -271,7 +273,8 @@
             m_ignore_cap(rhs.m_ignore_cap),
             m_format(rhs.m_format),
             m_summary_sp(rhs.m_summary_sp),
-            m_root_valobj_name(rhs.m_root_valobj_name)
+            m_root_valobj_name(rhs.m_root_valobj_name),
+            m_hide_root_type(rhs.m_hide_root_type)
         {}
         
         DumpValueObjectOptions&
@@ -402,6 +405,13 @@
                 m_root_valobj_name.clear();
             return *this;
         }
+                
+        DumpValueObjectOptions&
+        SetHideRootType (bool hide_root_type = false)
+        {
+            m_hide_root_type = hide_root_type;
+            return *this;
+        }
 
     };
 

Modified: lldb/branches/lldb-platform-work/include/lldb/Expression/DWARFExpression.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Expression/DWARFExpression.h?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Expression/DWARFExpression.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Expression/DWARFExpression.h Mon Aug 13 17:30:55 2012
@@ -187,6 +187,36 @@
     SetOpcodeData(const DataExtractor& data, uint32_t data_offset, uint32_t data_length);
 
     //------------------------------------------------------------------
+    /// Copy the DWARF location expression into a local buffer.
+    ///
+    /// It is a good idea to copy the data so we don't keep the entire
+    /// object file worth of data around just for a few bytes of location
+    /// expression. LLDB typically will mmap the entire contents of debug
+    /// information files, and if we use SetOpcodeData, it will get a
+    /// shared reference to all of this data for the and cause the object
+    /// file to have to stay around. Even worse, a very very large ".a"
+    /// that contains one or more .o files could end up being referenced.
+    /// Location lists are typically small so even though we are copying
+    /// the data, it shouldn't amount to that much for the variables we
+    /// end up parsing.
+    ///
+    /// @param[in] data
+    ///     A data extractor configured to read and copy the DWARF
+    ///     location expression's bytecode.
+    ///
+    /// @param[in] data_offset
+    ///     The offset of the location expression in the extractor.
+    ///
+    /// @param[in] data_length
+    ///     The byte length of the location expression.
+    //------------------------------------------------------------------
+    void
+    CopyOpcodeData (const DataExtractor& data,
+                    uint32_t data_offset,
+                    uint32_t data_length);
+    
+
+    //------------------------------------------------------------------
     /// Tells the expression that it refers to a location list.
     ///
     /// @param[in] slide

Modified: lldb/branches/lldb-platform-work/include/lldb/Interpreter/NamedOptionValue.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Interpreter/NamedOptionValue.h?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Interpreter/NamedOptionValue.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Interpreter/NamedOptionValue.h Mon Aug 13 17:30:55 2012
@@ -522,11 +522,23 @@
             return m_current_value.c_str();
         }
         
+        bool
+        IsCurrentValueEmpty () const
+        {
+            return m_current_value.empty();
+        }
+        
         const char *
         GetDefaultValue() const
         {
             return m_default_value.c_str();
         }
+
+        bool
+        IsDefaultValueEmpty () const
+        {
+            return m_default_value.empty();
+        }
         
         void
         SetCurrentValue (const char *value)

Modified: lldb/branches/lldb-platform-work/include/lldb/Interpreter/OptionGroupVariable.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Interpreter/OptionGroupVariable.h?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Interpreter/OptionGroupVariable.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Interpreter/OptionGroupVariable.h Mon Aug 13 17:30:55 2012
@@ -14,6 +14,7 @@
 // C++ Includes
 // Other libraries and framework includes
 // Project includes
+#include "lldb/Interpreter/NamedOptionValue.h"
 #include "lldb/Interpreter/Options.h"
 
 namespace lldb_private {
@@ -52,7 +53,8 @@
              use_regex:1,
              show_scope:1,
              show_decl:1;
-        std::string summary;
+        OptionValueString summary;            // the name of a named summary
+        OptionValueString summary_string;     // a summary string
 
     private:
         DISALLOW_COPY_AND_ASSIGN(OptionGroupVariable);

Modified: lldb/branches/lldb-platform-work/include/lldb/Interpreter/ScriptInterpreter.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Interpreter/ScriptInterpreter.h?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Interpreter/ScriptInterpreter.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Interpreter/ScriptInterpreter.h Mon Aug 13 17:30:55 2012
@@ -68,6 +68,11 @@
                                                     const lldb::StackFrameSP& frame_sp,
                                                     const lldb::BreakpointLocationSP &bp_loc_sp);
     
+    typedef bool (*SWIGWatchpointCallbackFunction) (const char *python_function_name,
+                                                    const char *session_dictionary_name,
+                                                    const lldb::StackFrameSP& frame_sp,
+                                                    const lldb::WatchpointSP &wp_sp);
+    
     typedef bool (*SWIGPythonTypeScriptCallbackFunction) (const char *python_function_name,
                                                           void *session_dictionary,
                                                           const lldb::ValueObjectSP& valobj_sp,
@@ -148,6 +153,12 @@
     }
     
     virtual bool
+    GenerateWatchpointCommandCallbackData (StringList &input, std::string& output)
+    {
+        return false;
+    }
+    
+    virtual bool
     GenerateTypeScriptFunction (const char* oneliner, std::string& output, void* name_token = NULL)
     {
         return false;
@@ -194,6 +205,10 @@
     CollectDataForBreakpointCommandCallback (BreakpointOptions *bp_options,
                                              CommandReturnObject &result);
 
+    virtual void 
+    CollectDataForWatchpointCommandCallback (WatchpointOptions *wp_options,
+                                             CommandReturnObject &result);
+
     /// Set a one-liner as the callback for the breakpoint.
     virtual void 
     SetBreakpointCommandCallback (BreakpointOptions *bp_options,
@@ -202,6 +217,14 @@
         return;
     }
     
+    /// Set a one-liner as the callback for the watchpoint.
+    virtual void 
+    SetWatchpointCommandCallback (WatchpointOptions *wp_options,
+                                  const char *oneliner)
+    {
+        return;
+    }
+    
     virtual bool
     GetScriptedSummary (const char *function_name,
                         lldb::ValueObjectSP valobj,

Modified: lldb/branches/lldb-platform-work/include/lldb/Interpreter/ScriptInterpreterPython.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Interpreter/ScriptInterpreterPython.h?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Interpreter/ScriptInterpreterPython.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Interpreter/ScriptInterpreterPython.h Mon Aug 13 17:30:55 2012
@@ -101,6 +101,9 @@
     bool
     GenerateBreakpointCommandCallbackData (StringList &input, std::string& output);
 
+    bool
+    GenerateWatchpointCommandCallbackData (StringList &input, std::string& output);
+
     static size_t
     GenerateBreakpointOptionsCommandCallback (void *baton, 
                                               InputReader &reader, 
@@ -108,12 +111,24 @@
                                               const char *bytes, 
                                               size_t bytes_len);
         
+    static size_t
+    GenerateWatchpointOptionsCommandCallback (void *baton, 
+                                              InputReader &reader, 
+                                              lldb::InputReaderAction notification,
+                                              const char *bytes, 
+                                              size_t bytes_len);
+        
     static bool
     BreakpointCallbackFunction (void *baton, 
                                 StoppointCallbackContext *context, 
                                 lldb::user_id_t break_id,
                                 lldb::user_id_t break_loc_id);
     
+    static bool
+    WatchpointCallbackFunction (void *baton, 
+                                StoppointCallbackContext *context, 
+                                lldb::user_id_t watch_id);
+    
     virtual bool
     GetScriptedSummary (const char *function_name,
                         lldb::ValueObjectSP valobj,
@@ -135,11 +150,20 @@
     CollectDataForBreakpointCommandCallback (BreakpointOptions *bp_options,
                                              CommandReturnObject &result);
 
+    void 
+    CollectDataForWatchpointCommandCallback (WatchpointOptions *wp_options,
+                                             CommandReturnObject &result);
+
     /// Set a Python one-liner as the callback for the breakpoint.
     void 
     SetBreakpointCommandCallback (BreakpointOptions *bp_options,
                                   const char *oneliner);
 
+    /// Set a one-liner as the callback for the watchpoint.
+    void 
+    SetWatchpointCommandCallback (WatchpointOptions *wp_options,
+                                  const char *oneliner);
+
     StringList
     ReadCommandInputFromUser (FILE *in_file);
     

Modified: lldb/branches/lldb-platform-work/include/lldb/Target/ExecutionContext.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Target/ExecutionContext.h?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Target/ExecutionContext.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Target/ExecutionContext.h Mon Aug 13 17:30:55 2012
@@ -729,7 +729,7 @@
     bool
     HasTargetScope () const
     {
-        return m_target_sp;
+        return (bool) m_target_sp;
     }
 
     //------------------------------------------------------------------

Modified: lldb/branches/lldb-platform-work/include/lldb/lldb-enumerations.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/lldb-enumerations.h?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/lldb-enumerations.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/lldb-enumerations.h Mon Aug 13 17:30:55 2012
@@ -100,6 +100,7 @@
         eFormatDecimal,
         eFormatEnum,
         eFormatHex,
+        eFormatHexUppercase,
         eFormatFloat,
         eFormatOctal,
         eFormatOSType,          // OS character codes encoded into an integer 'PICT' 'text' etc...
@@ -124,6 +125,7 @@
         eFormatAddressInfo,         // Describe what an address points to (func + offset with file/line, symbol + offset, data, etc)
         eFormatHexFloat,            // ISO C99 hex float string
         eFormatInstruction,         // Disassemble an opcode
+        eFormatVoid,                // Do not print this
         kNumFormats
     } Format;
 

Modified: lldb/branches/lldb-platform-work/include/lldb/lldb-forward.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/lldb-forward.h?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/lldb-forward.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/lldb-forward.h Mon Aug 13 17:30:55 2012
@@ -237,6 +237,7 @@
 class   VariableList;
 class   Watchpoint;
 class   WatchpointList;
+class   WatchpointOptions;
 struct  LineEntry;
 
 } // namespace lldb_private

Modified: lldb/branches/lldb-platform-work/include/lldb/lldb-private-interfaces.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/lldb-private-interfaces.h?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/lldb-private-interfaces.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/lldb-private-interfaces.h Mon Aug 13 17:30:55 2012
@@ -31,7 +31,7 @@
     typedef SymbolFile* (*SymbolFileCreateInstance) (ObjectFile* obj_file);
     typedef SymbolVendor* (*SymbolVendorCreateInstance) (const lldb::ModuleSP &module_sp);   // Module can be NULL for default system symbol vendor
     typedef bool (*BreakpointHitCallback) (void *baton, StoppointCallbackContext *context, lldb::user_id_t break_id, lldb::user_id_t break_loc_id);
-    typedef bool (*WatchpointHitCallback) (void *baton, StoppointCallbackContext *context, lldb::user_id_t watch_id, uint32_t type);
+    typedef bool (*WatchpointHitCallback) (void *baton, StoppointCallbackContext *context, lldb::user_id_t watch_id);
     typedef ThreadPlan * (*ThreadPlanShouldStopHereCallback) (ThreadPlan *current_plan, Flags &flags, void *baton);
     typedef UnwindAssembly* (*UnwindAssemblyCreateInstance) (const ArchSpec &arch);
     typedef int (*ComparisonFunction)(const void *, const void *);

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=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/branches/lldb-platform-work/lldb.xcodeproj/project.pbxproj Mon Aug 13 17:30:55 2012
@@ -524,6 +524,8 @@
 		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 */; };
+		B2B7CCEB15D1BD6700EEFB57 /* CommandObjectWatchpointCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2B7CCEA15D1BD6600EEFB57 /* CommandObjectWatchpointCommand.cpp */; };
+		B2B7CCF015D1C20F00EEFB57 /* WatchpointOptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2B7CCEF15D1C20F00EEFB57 /* WatchpointOptions.cpp */; };
 		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 */; };
@@ -1572,6 +1574,10 @@
 		B2A58721143119810092BFBA /* SBWatchpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBWatchpoint.h; path = include/lldb/API/SBWatchpoint.h; sourceTree = "<group>"; };
 		B2A58723143119D50092BFBA /* SBWatchpoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBWatchpoint.cpp; path = source/API/SBWatchpoint.cpp; sourceTree = "<group>"; };
 		B2A5872514313B480092BFBA /* SBWatchpoint.i */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; path = SBWatchpoint.i; sourceTree = "<group>"; };
+		B2B7CCEA15D1BD6600EEFB57 /* CommandObjectWatchpointCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectWatchpointCommand.cpp; path = source/Commands/CommandObjectWatchpointCommand.cpp; sourceTree = "<group>"; };
+		B2B7CCEC15D1BD9600EEFB57 /* CommandObjectWatchpointCommand.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CommandObjectWatchpointCommand.h; path = source/Commands/CommandObjectWatchpointCommand.h; sourceTree = "<group>"; };
+		B2B7CCED15D1BFB700EEFB57 /* WatchpointOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WatchpointOptions.h; path = include/lldb/Breakpoint/WatchpointOptions.h; sourceTree = "<group>"; };
+		B2B7CCEF15D1C20F00EEFB57 /* WatchpointOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WatchpointOptions.cpp; path = source/Breakpoint/WatchpointOptions.cpp; sourceTree = "<group>"; };
 		B2D3033612EFA5C500F84EB3 /* InstructionUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InstructionUtils.h; path = Utility/InstructionUtils.h; sourceTree = "<group>"; };
 		ED88244F15114CA200BC98B9 /* main.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = main.mm; sourceTree = "<group>"; };
 		ED88245215114CFC00BC98B9 /* LauncherRootXPCService.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LauncherRootXPCService.mm; sourceTree = "<group>"; };
@@ -2616,6 +2622,8 @@
 				B27318431416AC43006039C8 /* WatchpointList.h */,
 				26BC7E1810F1B83100F91463 /* Watchpoint.cpp */,
 				B27318411416AC12006039C8 /* WatchpointList.cpp */,
+				B2B7CCED15D1BFB700EEFB57 /* WatchpointOptions.h */,
+				B2B7CCEF15D1C20F00EEFB57 /* WatchpointOptions.cpp */,
 			);
 			name = Breakpoint;
 			sourceTree = "<group>";
@@ -2671,6 +2679,8 @@
 				B296983412C2FB2B002D92C3 /* CommandObjectVersion.cpp */,
 				B207C4941429609C00F36E4E /* CommandObjectWatchpoint.h */,
 				B207C4921429607D00F36E4E /* CommandObjectWatchpoint.cpp */,
+				B2B7CCEC15D1BD9600EEFB57 /* CommandObjectWatchpointCommand.h */,
+				B2B7CCEA15D1BD6600EEFB57 /* CommandObjectWatchpointCommand.cpp */,
 			);
 			name = Commands;
 			sourceTree = "<group>";
@@ -3960,6 +3970,8 @@
 				945759671534941F005A9070 /* PlatformPOSIX.cpp in Sources */,
 				26B1EFAE154638AF00E2DAC7 /* DWARFDeclContext.cpp in Sources */,
 				B21EB71515CC99F100E60059 /* cxa_demangle.cpp in Sources */,
+				B2B7CCEB15D1BD6700EEFB57 /* CommandObjectWatchpointCommand.cpp in Sources */,
+				B2B7CCF015D1C20F00EEFB57 /* WatchpointOptions.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -4085,9 +4097,11 @@
 					x86_64,
 					i386,
 				);
+				CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
+				CLANG_CXX_LIBRARY = "libc++";
 				COPY_PHASE_STRIP = NO;
 				DEBUG_INFORMATION_FORMAT = dwarf;
-				GCC_C_LANGUAGE_STANDARD = gnu99;
+				GCC_C_LANGUAGE_STANDARD = c99;
 				GCC_OPTIMIZATION_LEVEL = 0;
 				GCC_PREPROCESSOR_DEFINITIONS = (
 					__STDC_CONSTANT_MACROS,
@@ -4142,9 +4156,11 @@
 				ARCHS = "$(NATIVE_ARCH)";
 				"ARCHS[sdk=iphoneos*]" = armv7;
 				"ARCHS[sdk=macosx*]" = "$(ARCHS_STANDARD_64_BIT)";
+				CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
+				CLANG_CXX_LIBRARY = "libc++";
 				COPY_PHASE_STRIP = NO;
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-				GCC_C_LANGUAGE_STANDARD = gnu99;
+				GCC_C_LANGUAGE_STANDARD = c99;
 				GCC_PREPROCESSOR_DEFINITIONS = (
 					__STDC_CONSTANT_MACROS,
 					__STDC_LIMIT_MACROS,
@@ -4237,9 +4253,9 @@
 				CLANG_LINK_OBJC_RUNTIME = NO;
 				CLANG_OBJC_RUNTIME = NO;
 				COMBINE_HIDPI_IMAGES = YES;
-				CURRENT_PROJECT_VERSION = 164;
+				CURRENT_PROJECT_VERSION = 165;
 				DYLIB_COMPATIBILITY_VERSION = 1;
-				DYLIB_CURRENT_VERSION = 164;
+				DYLIB_CURRENT_VERSION = 165;
 				EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports";
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -4296,10 +4312,10 @@
 				CLANG_LINK_OBJC_RUNTIME = NO;
 				CLANG_OBJC_RUNTIME = NO;
 				COMBINE_HIDPI_IMAGES = YES;
-				CURRENT_PROJECT_VERSION = 164;
+				CURRENT_PROJECT_VERSION = 165;
 				DEAD_CODE_STRIPPING = YES;
 				DYLIB_COMPATIBILITY_VERSION = 1;
-				DYLIB_CURRENT_VERSION = 164;
+				DYLIB_CURRENT_VERSION = 165;
 				EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports";
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -4356,7 +4372,7 @@
 				ARCHS = "$(ARCHS_STANDARD_64_BIT)";
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COMBINE_HIDPI_IMAGES = YES;
-				CURRENT_PROJECT_VERSION = 164;
+				CURRENT_PROJECT_VERSION = 165;
 				DEBUGGING_SYMBOLS = YES;
 				GCC_DYNAMIC_NO_PIC = NO;
 				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
@@ -4383,7 +4399,7 @@
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COMBINE_HIDPI_IMAGES = YES;
 				COPY_PHASE_STRIP = YES;
-				CURRENT_PROJECT_VERSION = 164;
+				CURRENT_PROJECT_VERSION = 165;
 				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
 				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
 				MACOSX_DEPLOYMENT_TARGET = 10.7;
@@ -4401,7 +4417,7 @@
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COMBINE_HIDPI_IMAGES = YES;
 				COPY_PHASE_STRIP = YES;
-				CURRENT_PROJECT_VERSION = 164;
+				CURRENT_PROJECT_VERSION = 165;
 				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
 				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
 				MACOSX_DEPLOYMENT_TARGET = 10.7;
@@ -4416,8 +4432,8 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				COMBINE_HIDPI_IMAGES = YES;
-				CURRENT_PROJECT_VERSION = 164;
-				DYLIB_CURRENT_VERSION = 164;
+				CURRENT_PROJECT_VERSION = 165;
+				DYLIB_CURRENT_VERSION = 165;
 				EXECUTABLE_EXTENSION = a;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -4428,7 +4444,7 @@
 				HEADER_SEARCH_PATHS = /usr/include/libxml2;
 				LD_DYLIB_INSTALL_NAME = "$(DEVELOPER_DIR)/Library/PrivateFrameworks/LLDB.framework/Resources/lldb-core.a";
 				MACH_O_TYPE = staticlib;
-				MACOSX_DEPLOYMENT_TARGET = 10.6;
+				MACOSX_DEPLOYMENT_TARGET = 10.7;
 				OTHER_CPLUSPLUSFLAGS = (
 					"-fno-rtti",
 					"-Wglobal-constructors",
@@ -4447,8 +4463,8 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				COMBINE_HIDPI_IMAGES = YES;
-				CURRENT_PROJECT_VERSION = 164;
-				DYLIB_CURRENT_VERSION = 164;
+				CURRENT_PROJECT_VERSION = 165;
+				DYLIB_CURRENT_VERSION = 165;
 				EXECUTABLE_EXTENSION = a;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -4459,7 +4475,7 @@
 				HEADER_SEARCH_PATHS = /usr/include/libxml2;
 				LD_DYLIB_INSTALL_NAME = "$(DEVELOPER_DIR)/Library/PrivateFrameworks/LLDB.framework/Resources/lldb-core.a";
 				MACH_O_TYPE = staticlib;
-				MACOSX_DEPLOYMENT_TARGET = 10.6;
+				MACOSX_DEPLOYMENT_TARGET = 10.7;
 				OTHER_CPLUSPLUSFLAGS = (
 					"-fno-rtti",
 					"-Wglobal-constructors",
@@ -4478,8 +4494,8 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				COMBINE_HIDPI_IMAGES = YES;
-				CURRENT_PROJECT_VERSION = 164;
-				DYLIB_CURRENT_VERSION = 164;
+				CURRENT_PROJECT_VERSION = 165;
+				DYLIB_CURRENT_VERSION = 165;
 				EXECUTABLE_EXTENSION = a;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -4490,7 +4506,7 @@
 				HEADER_SEARCH_PATHS = /usr/include/libxml2;
 				LD_DYLIB_INSTALL_NAME = "$(DEVELOPER_DIR)/Library/PrivateFrameworks/LLDB.framework/Resources/lldb-core.a";
 				MACH_O_TYPE = staticlib;
-				MACOSX_DEPLOYMENT_TARGET = 10.6;
+				MACOSX_DEPLOYMENT_TARGET = 10.7;
 				OTHER_CPLUSPLUSFLAGS = (
 					"-fno-rtti",
 					"-Wglobal-constructors",
@@ -4515,9 +4531,11 @@
 					x86_64,
 					i386,
 				);
+				CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
+				CLANG_CXX_LIBRARY = "libc++";
 				COPY_PHASE_STRIP = NO;
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-				GCC_C_LANGUAGE_STANDARD = gnu99;
+				GCC_C_LANGUAGE_STANDARD = c99;
 				GCC_PREPROCESSOR_DEFINITIONS = (
 					__STDC_CONSTANT_MACROS,
 					__STDC_LIMIT_MACROS,
@@ -4569,7 +4587,7 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				COPY_PHASE_STRIP = YES;
-				CURRENT_PROJECT_VERSION = 164;
+				CURRENT_PROJECT_VERSION = 165;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
 					"\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
@@ -4610,10 +4628,10 @@
 				CLANG_OBJC_RUNTIME = NO;
 				COMBINE_HIDPI_IMAGES = YES;
 				COPY_PHASE_STRIP = YES;
-				CURRENT_PROJECT_VERSION = 164;
+				CURRENT_PROJECT_VERSION = 165;
 				DEAD_CODE_STRIPPING = YES;
 				DYLIB_COMPATIBILITY_VERSION = 1;
-				DYLIB_CURRENT_VERSION = 164;
+				DYLIB_CURRENT_VERSION = 165;
 				EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports";
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
@@ -4932,7 +4950,7 @@
 		26F5C26C10F3D9A5009D5894 /* Debug */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
-				CURRENT_PROJECT_VERSION = 164;
+				CURRENT_PROJECT_VERSION = 165;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
 					"\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",
@@ -4962,7 +4980,7 @@
 		26F5C26D10F3D9A5009D5894 /* Release */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
-				CURRENT_PROJECT_VERSION = 164;
+				CURRENT_PROJECT_VERSION = 165;
 				FRAMEWORK_SEARCH_PATHS = (
 					"$(inherited)",
 					"\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"",

Modified: lldb/branches/lldb-platform-work/llvm.zip
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/llvm.zip?rev=161801&r1=161800&r2=161801&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=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/resources/LLDB-Info.plist (original)
+++ lldb/branches/lldb-platform-work/resources/LLDB-Info.plist Mon Aug 13 17:30:55 2012
@@ -17,7 +17,7 @@
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleVersion</key>
-	<string>164</string>
+	<string>165</string>
 	<key>CFBundleName</key>
 	<string>${EXECUTABLE_NAME}</string>
 </dict>

Modified: lldb/branches/lldb-platform-work/scripts/Python/python-wrapper.swig
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/Python/python-wrapper.swig?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/Python/python-wrapper.swig (original)
+++ lldb/branches/lldb-platform-work/scripts/Python/python-wrapper.swig Mon Aug 13 17:30:55 2012
@@ -176,6 +176,85 @@
     return stop_at_breakpoint;
 }
 
+// This function is called by lldb_private::ScriptInterpreterPython::WatchpointCallbackFunction(...)
+// and is used when a script command is attached to a watchpoint for execution.
+
+SWIGEXPORT bool
+LLDBSwigPythonWatchpointCallbackFunction 
+(
+    const char *python_function_name,
+    const char *session_dictionary_name,
+    const lldb::StackFrameSP& frame_sp, 
+    const lldb::WatchpointSP& wp_sp
+)
+{
+    lldb::SBFrame sb_frame (frame_sp);
+    lldb::SBWatchpoint sb_wp(wp_sp);
+
+    bool stop_at_watchpoint = true;
+    PyObject *Frame_PyObj = SWIG_NewPointerObj((void *) &sb_frame, SWIGTYPE_p_lldb__SBFrame, 0);
+    PyObject *Wp_PyObj = SWIG_NewPointerObj ((void *) &sb_wp, SWIGTYPE_p_lldb__SBWatchpoint, 0);
+    
+    if (Frame_PyObj == NULL || Wp_PyObj == NULL)
+        return stop_at_watchpoint;
+        
+    if (!python_function_name || !session_dictionary_name)
+        return stop_at_watchpoint;
+
+    PyObject *session_dict, *pfunc;
+    PyObject *pargs, *pvalue;
+    
+    session_dict = FindSessionDictionary (session_dictionary_name);
+    if (session_dict != NULL)
+    {
+        pfunc = ResolvePythonName (python_function_name, session_dict);
+        if (pfunc != NULL)
+        {
+            // Set up the arguments and call the function.
+                
+            if (PyCallable_Check (pfunc))
+            {
+                pargs = PyTuple_New (3);
+                if (pargs == NULL)
+                {
+                    if (PyErr_Occurred())
+                        PyErr_Clear();
+                    return stop_at_watchpoint;
+                }
+                
+                PyTuple_SetItem (pargs, 0, Frame_PyObj);  // This "steals" a reference to Frame_PyObj
+                PyTuple_SetItem (pargs, 1, Wp_PyObj);     // This "steals" a reference to Wp_PyObj
+                PyTuple_SetItem (pargs, 2, session_dict); // This "steals" a reference to session_dict
+                pvalue = PyObject_CallObject (pfunc, pargs);
+                Py_DECREF (pargs);
+                
+                if (pvalue != NULL)
+                {
+                    Py_DECREF (pvalue);
+                }
+                else if (PyErr_Occurred ())
+                {
+                    PyErr_Clear();
+                }
+                Py_INCREF (session_dict);
+            }
+            else if (PyErr_Occurred())
+            {
+                PyErr_Clear();
+            }
+        }
+        else if (PyErr_Occurred())
+        {
+            PyErr_Clear();
+        }
+    }
+    else if (PyErr_Occurred ())
+    {
+        PyErr_Clear ();
+    }
+    return stop_at_watchpoint;
+}
+
 SWIGEXPORT bool
 LLDBSwigPythonCallTypeScript 
 (

Modified: lldb/branches/lldb-platform-work/scripts/build-llvm.pl
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/build-llvm.pl?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/build-llvm.pl (original)
+++ lldb/branches/lldb-platform-work/scripts/build-llvm.pl Mon Aug 13 17:30:55 2012
@@ -32,10 +32,10 @@
 my $original_env_path = $ENV{PATH};
 
 our %llvm_config_info = (
- 'Debug'         => { configure_options => '--disable-optimized --disable-assertions', make_options => 'DEBUG_SYMBOLS=1'},
- 'Debug+Asserts' => { configure_options => '--disable-optimized --enable-assertions' , make_options => 'DEBUG_SYMBOLS=1'},
- 'Release'       => { configure_options => '--enable-optimized --disable-assertions' , make_options => ''},
- 'Release+Debug' => { configure_options => '--enable-optimized --disable-assertions' , make_options => 'DEBUG_SYMBOLS=1'},
+ 'Debug'         => { configure_options => '--disable-optimized --disable-assertions --enable-libcpp', make_options => 'DEBUG_SYMBOLS=1'},
+ 'Debug+Asserts' => { configure_options => '--disable-optimized --enable-assertions --enable-libcpp' , make_options => 'DEBUG_SYMBOLS=1'},
+ 'Release'       => { configure_options => '--enable-optimized --disable-assertions --enable-libcpp' , make_options => ''},
+ 'Release+Debug' => { configure_options => '--enable-optimized --disable-assertions --enable-libcpp' , make_options => 'DEBUG_SYMBOLS=1'},
 );
 
 our $llvm_config_href = undef;

Modified: lldb/branches/lldb-platform-work/scripts/lldb.swig
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/scripts/lldb.swig?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/scripts/lldb.swig (original)
+++ lldb/branches/lldb-platform-work/scripts/lldb.swig Mon Aug 13 17:30:55 2012
@@ -44,6 +44,11 @@
 %}
 %include "./Python/python-typemaps.swig"
 
+/* C++ headers to be included. */
+%{
+#include <string>
+%}
+
 /* The liblldb header files to be included. */
 %{
 #include "lldb/lldb-public.h"

Modified: lldb/branches/lldb-platform-work/source/API/SBBreakpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/API/SBBreakpoint.cpp?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/API/SBBreakpoint.cpp (original)
+++ lldb/branches/lldb-platform-work/source/API/SBBreakpoint.cpp Mon Aug 13 17:30:55 2012
@@ -124,7 +124,7 @@
 bool
 SBBreakpoint::IsValid() const
 {
-    return m_opaque_sp;
+    return (bool) m_opaque_sp;
 }
 
 void

Modified: lldb/branches/lldb-platform-work/source/API/SBWatchpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/API/SBWatchpoint.cpp?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/API/SBWatchpoint.cpp (original)
+++ lldb/branches/lldb-platform-work/source/API/SBWatchpoint.cpp Mon Aug 13 17:30:55 2012
@@ -87,7 +87,7 @@
 bool
 SBWatchpoint::IsValid() const
 {
-    return m_opaque_sp;
+    return (bool) m_opaque_sp;
 }
 
 SBError

Modified: lldb/branches/lldb-platform-work/source/Breakpoint/Watchpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Breakpoint/Watchpoint.cpp?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Breakpoint/Watchpoint.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Breakpoint/Watchpoint.cpp Mon Aug 13 17:30:55 2012
@@ -28,16 +28,20 @@
     m_target(NULL),
     m_enabled(false),
     m_is_hardware(hardware),
+    m_is_watch_variable(false),
     m_watch_read(0),
     m_watch_write(0),
     m_watch_was_read(0),
     m_watch_was_written(0),
     m_ignore_count(0),
-    m_callback(NULL),
-    m_callback_baton(NULL),
     m_decl_str(),
     m_watch_spec_str(),
-    m_error()
+    m_snapshot_old_str(),
+    m_snapshot_new_str(),
+    m_snapshot_old_val(0),
+    m_snapshot_new_val(0),
+    m_error(),
+    m_options ()
 {
 }
 
@@ -45,28 +49,105 @@
 {
 }
 
-bool
-Watchpoint::SetCallback (WatchpointHitCallback callback, void *callback_baton)
+// This function is used when "baton" doesn't need to be freed
+void
+Watchpoint::SetCallback (WatchpointHitCallback callback, void *baton, bool is_synchronous)
 {
-    m_callback = callback;
-    m_callback_baton = callback_baton;
-    return true;
+    // The default "Baton" class will keep a copy of "baton" and won't free
+    // or delete it when it goes goes out of scope.
+    m_options.SetCallback(callback, BatonSP (new Baton(baton)), is_synchronous);
+    
+    //SendWatchpointChangedEvent (eWatchpointEventTypeCommandChanged);
 }
 
+// This function is used when a baton needs to be freed and therefore is 
+// contained in a "Baton" subclass.
 void
-Watchpoint::SetDeclInfo (std::string &str)
+Watchpoint::SetCallback (WatchpointHitCallback callback, const BatonSP &callback_baton_sp, bool is_synchronous)
+{
+    m_options.SetCallback(callback, callback_baton_sp, is_synchronous);
+}
+
+void
+Watchpoint::ClearCallback ()
+{
+    m_options.ClearCallback ();
+}
+
+void
+Watchpoint::SetDeclInfo (const std::string &str)
 {
     m_decl_str = str;
     return;
 }
 
+std::string
+Watchpoint::GetWatchSpec()
+{
+    return m_watch_spec_str;
+}
+
 void
-Watchpoint::SetWatchSpec (std::string &str)
+Watchpoint::SetWatchSpec (const std::string &str)
 {
     m_watch_spec_str = str;
     return;
 }
 
+std::string
+Watchpoint::GetOldSnapshot() const
+{
+    return m_snapshot_old_str;
+}
+
+void
+Watchpoint::SetOldSnapshot (const std::string &str)
+{
+    m_snapshot_old_str = str;
+    return;
+}
+
+std::string
+Watchpoint::GetNewSnapshot() const
+{
+    return m_snapshot_new_str;
+}
+
+void
+Watchpoint::SetNewSnapshot (const std::string &str)
+{
+    m_snapshot_old_str = m_snapshot_new_str;
+    m_snapshot_new_str = str;
+    return;
+}
+
+uint64_t
+Watchpoint::GetOldSnapshotVal() const
+{
+    return m_snapshot_old_val;
+}
+
+void
+Watchpoint::SetOldSnapshotVal (uint64_t val)
+{
+    m_snapshot_old_val = val;
+    return;
+}
+
+uint64_t
+Watchpoint::GetNewSnapshotVal() const
+{
+    return m_snapshot_new_val;
+}
+
+void
+Watchpoint::SetNewSnapshotVal (uint64_t val)
+{
+    m_snapshot_old_val = m_snapshot_new_val;
+    m_snapshot_new_val = val;
+    return;
+}
+
 // Override default impl of StoppointLocation::IsHardware() since m_is_hardware
 // member field is more accurate.
 bool
@@ -75,6 +156,18 @@
     return m_is_hardware;
 }
 
+bool
+Watchpoint::IsWatchVariable() const
+{
+    return m_is_watch_variable;
+}
+
+void
+Watchpoint::SetWatchVariable(bool val)
+{
+    m_is_watch_variable = val;
+}
+
 // RETURNS - true if we should stop at this breakpoint, false if we
 // should continue.
 
@@ -106,6 +199,24 @@
 }
 
 void
+Watchpoint::DumpSnapshots(const char *prefix, Stream *s) const
+{
+    if (IsWatchVariable())
+    {
+        if (!m_snapshot_old_str.empty())
+            s->Printf("\n%swatchpoint old value:\n\t%s", prefix, m_snapshot_old_str.c_str());
+        if (!m_snapshot_new_str.empty())
+            s->Printf("\n%swatchpoint new value:\n\t%s", prefix, m_snapshot_new_str.c_str());
+    }
+    else
+    {
+        uint32_t num_hex_digits = GetByteSize() * 2;
+        s->Printf("\n%swatchpoint old value:0x%0*.*llx", prefix, num_hex_digits, num_hex_digits, m_snapshot_old_val);
+        s->Printf("\n%swatchpoint new value:0x%0*.*llx", prefix, num_hex_digits, num_hex_digits, m_snapshot_new_val);
+    }
+}
+
+void
 Watchpoint::DumpWithLevel(Stream *s, lldb::DescriptionLevel description_level) const
 {
     if (s == NULL)
@@ -126,29 +237,22 @@
         if (!m_decl_str.empty())
             s->Printf("\n    declare @ '%s'", m_decl_str.c_str());
         if (!m_watch_spec_str.empty())
-            s->Printf("\n    static watchpoint spec = '%s'", m_watch_spec_str.c_str());
+            s->Printf("\n    watchpoint spec = '%s'", m_watch_spec_str.c_str());
+
+        // Dump the snapshots we have taken.
+        DumpSnapshots("   ", s);
+
         if (GetConditionText())
             s->Printf("\n    condition = '%s'", GetConditionText());
+        m_options.GetCallbackDescription(s, description_level);
     }
 
     if (description_level >= lldb::eDescriptionLevelVerbose)
     {
-        if (m_callback)
-        {
-            s->Printf("\n    hw_index = %i  hit_count = %-4u  ignore_count = %-4u  callback = %8p baton = %8p",
-                      GetHardwareIndex(),
-                      GetHitCount(),
-                      GetIgnoreCount(),
-                      m_callback,
-                      m_callback_baton);
-        }
-        else
-        {
-            s->Printf("\n    hw_index = %i  hit_count = %-4u  ignore_count = %-4u",
-                      GetHardwareIndex(),
-                      GetHitCount(),
-                      GetIgnoreCount());
-        }
+        s->Printf("\n    hw_index = %i  hit_count = %-4u  ignore_count = %-4u",
+                  GetHardwareIndex(),
+                  GetHitCount(),
+                  GetIgnoreCount());
     }
 }
 
@@ -198,17 +302,7 @@
 bool
 Watchpoint::InvokeCallback (StoppointCallbackContext *context)
 {
-    if (m_callback && context->is_synchronous)
-    {
-        uint32_t access = 0;
-        if (m_watch_was_read)
-            access |= LLDB_WATCH_TYPE_READ;
-        if (m_watch_was_written)
-            access |= LLDB_WATCH_TYPE_WRITE;
-        return m_callback(m_callback_baton, context, GetID(), access);
-    }
-    else
-        return true;
+    return m_options.InvokeCallback (context, GetID());
 }
 
 void 

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=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Commands/CommandObjectBreakpointCommand.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Commands/CommandObjectBreakpointCommand.cpp Mon Aug 13 17:30:55 2012
@@ -558,7 +558,7 @@
                         else if (m_options.m_function_name.size())
                         {
                             std::string oneliner(m_options.m_function_name);
-                            oneliner += "(frame, bp_loc, dict)";
+                            oneliner += "(frame, bp_loc, internal_dict)";
                             m_interpreter.GetScriptInterpreter()->SetBreakpointCommandCallback (bp_options,
                                                                                                 oneliner.c_str());
                         }

Modified: lldb/branches/lldb-platform-work/source/Commands/CommandObjectCommands.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Commands/CommandObjectCommands.cpp?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Commands/CommandObjectCommands.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Commands/CommandObjectCommands.cpp Mon Aug 13 17:30:55 2012
@@ -330,7 +330,7 @@
 
 static const char *g_python_command_instructions =   "Enter your Python command(s). Type 'DONE' to end.\n"
                                                      "You must define a Python function with this signature:\n"
-                                                     "def my_command_impl(debugger, args, result, dict):";
+                                                     "def my_command_impl(debugger, args, result, internal_dict):";
 
 
 class CommandObjectCommandsAlias : public CommandObjectRaw

Modified: lldb/branches/lldb-platform-work/source/Commands/CommandObjectDisassemble.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Commands/CommandObjectDisassemble.cpp?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Commands/CommandObjectDisassemble.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Commands/CommandObjectDisassemble.cpp Mon Aug 13 17:30:55 2012
@@ -245,7 +245,7 @@
     const char *plugin_name = m_options.GetPluginName ();
     DisassemblerSP disassembler = Disassembler::FindPlugin(m_options.arch, plugin_name);
 
-    if (disassembler == NULL)
+    if (!disassembler)
     {
         if (plugin_name)
             result.AppendErrorWithFormat ("Unable to find Disassembler plug-in named '%s' that supports the '%s' architecture.\n", 

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=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Commands/CommandObjectExpression.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Commands/CommandObjectExpression.cpp Mon Aug 13 17:30:55 2012
@@ -335,41 +335,49 @@
                 }
             }
         }
-
+        
         if (result_valobj_sp)
         {
+            Format format = m_format_options.GetFormat();
+
             if (result_valobj_sp->GetError().Success())
             {
-                Format format = m_format_options.GetFormat();
-                if (format != eFormatDefault)
-                    result_valobj_sp->SetFormat (format);
-
-                ValueObject::DumpValueObjectOptions options;
-                options.SetMaximumPointerDepth(0)
-                .SetMaximumDepth(UINT32_MAX)
-                .SetShowLocation(false)
-                .SetShowTypes(m_command_options.show_types)
-                .SetUseObjectiveC(m_command_options.print_object)
-                .SetUseDynamicType(use_dynamic)
-                .SetScopeChecked(true)
-                .SetFlatOutput(false)
-                .SetUseSyntheticValue(true)
-                .SetIgnoreCap(false)
-                .SetFormat(format)
-                .SetSummary()
-                .SetShowSummary(!m_command_options.print_object);
-                
-                ValueObject::DumpValueObject (*(output_stream),
-                                              result_valobj_sp.get(),   // Variable object to dump
-                                              options);
-                if (result)
-                    result->SetStatus (eReturnStatusSuccessFinishResult);
+                if (format != eFormatVoid)
+                {
+                    if (format != eFormatDefault)
+                        result_valobj_sp->SetFormat (format);
+
+                    ValueObject::DumpValueObjectOptions options;
+                    options.SetMaximumPointerDepth(0)
+                    .SetMaximumDepth(UINT32_MAX)
+                    .SetShowLocation(false)
+                    .SetShowTypes(m_command_options.show_types)
+                    .SetUseObjectiveC(m_command_options.print_object)
+                    .SetUseDynamicType(use_dynamic)
+                    .SetScopeChecked(true)
+                    .SetFlatOutput(false)
+                    .SetUseSyntheticValue(true)
+                    .SetIgnoreCap(false)
+                    .SetFormat(format)
+                    .SetSummary()
+                    .SetShowSummary(!m_command_options.print_object)
+                    .SetHideRootType(m_command_options.print_object);
+                    
+                    ValueObject::DumpValueObject (*(output_stream),
+                                                  result_valobj_sp.get(),   // Variable object to dump
+                                                  options);
+                    if (result)
+                        result->SetStatus (eReturnStatusSuccessFinishResult);
+                }
             }
             else
             {
                 if (result_valobj_sp->GetError().GetError() == ClangUserExpression::kNoResult)
                 {
-                    error_stream->PutCString("<no result>\n");
+                    if (format != eFormatVoid && m_interpreter.GetDebugger().GetNotifyVoid())
+                    {
+                        error_stream->PutCString("(void)\n");
+                    }
                     
                     if (result)
                         result->SetStatus (eReturnStatusSuccessFinishResult);

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=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Commands/CommandObjectFrame.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Commands/CommandObjectFrame.cpp Mon Aug 13 17:30:55 2012
@@ -394,8 +394,10 @@
         size_t idx;
         
         TypeSummaryImplSP summary_format_sp;
-        if (!m_option_variable.summary.empty())
-            DataVisualization::NamedSummaryFormats::GetSummaryFormat(ConstString(m_option_variable.summary.c_str()), summary_format_sp);
+        if (!m_option_variable.summary.IsCurrentValueEmpty())
+            DataVisualization::NamedSummaryFormats::GetSummaryFormat(ConstString(m_option_variable.summary.GetCurrentValue()), summary_format_sp);
+        else if (!m_option_variable.summary_string.IsCurrentValueEmpty())
+            summary_format_sp.reset(new StringSummaryFormat(TypeSummaryImpl::Flags(),m_option_variable.summary_string.GetCurrentValue()));
         
         ValueObject::DumpValueObjectOptions options;
         

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=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Commands/CommandObjectMemory.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Commands/CommandObjectMemory.cpp Mon Aug 13 17:30:55 2012
@@ -1108,6 +1108,7 @@
             case eFormatAddressInfo:
             case eFormatHexFloat:
             case eFormatInstruction:
+            case eFormatVoid:
                 result.AppendError("unsupported format for writing memory");
                 result.SetStatus(eReturnStatusFailed);
                 return false;
@@ -1115,6 +1116,7 @@
             case eFormatDefault:
             case eFormatBytes:
             case eFormatHex:
+            case eFormatHexUppercase:
             case eFormatPointer:
                 
                 // Decode hex bytes

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=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Commands/CommandObjectProcess.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Commands/CommandObjectProcess.cpp Mon Aug 13 17:30:55 2012
@@ -13,14 +13,18 @@
 // C++ Includes
 // Other libraries and framework includes
 // Project includes
-#include "lldb/Interpreter/Args.h"
-#include "lldb/Interpreter/Options.h"
+#include "lldb/Breakpoint/Breakpoint.h"
+#include "lldb/Breakpoint/BreakpointLocation.h"
+#include "lldb/Breakpoint/BreakpointSite.h"
 #include "lldb/Core/State.h"
 #include "lldb/Host/Host.h"
+#include "lldb/Interpreter/Args.h"
+#include "lldb/Interpreter/Options.h"
 #include "lldb/Interpreter/CommandInterpreter.h"
 #include "lldb/Interpreter/CommandReturnObject.h"
 #include "lldb/Target/Platform.h"
 #include "lldb/Target/Process.h"
+#include "lldb/Target/StopInfo.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Target/Thread.h"
 
@@ -61,6 +65,30 @@
     {
     }
 
+    int
+    HandleArgumentCompletion (Args &input,
+                              int &cursor_index,
+                              int &cursor_char_position,
+                              OptionElementVector &opt_element_vector,
+                              int match_start_point,
+                              int max_return_elements,
+                              bool &word_complete,
+                              StringList &matches)
+    {
+        std::string completion_str (input.GetArgumentAtIndex(cursor_index));
+        completion_str.erase (cursor_char_position);
+        
+        CommandCompletions::InvokeCommonCompletionCallbacks (m_interpreter, 
+                                                             CommandCompletions::eDiskFileCompletion,
+                                                             completion_str.c_str(),
+                                                             match_start_point,
+                                                             max_return_elements,
+                                                             NULL,
+                                                             word_complete,
+                                                             matches);
+        return matches.GetSize();
+    }
+
     Options *
     GetOptions ()
     {
@@ -646,7 +674,8 @@
                              "process continue",
                              "Continue execution of all threads in the current process.",
                              "process continue",
-                             eFlagProcessMustBeLaunched | eFlagProcessMustBePaused)
+                             eFlagProcessMustBeLaunched | eFlagProcessMustBePaused),
+        m_options(interpreter)
     {
     }
 
@@ -656,6 +685,62 @@
     }
 
 protected:
+
+    class CommandOptions : public Options
+    {
+    public:
+
+        CommandOptions (CommandInterpreter &interpreter) :
+            Options(interpreter)
+        {
+            // Keep default values of all options in one place: OptionParsingStarting ()
+            OptionParsingStarting ();
+        }
+
+        ~CommandOptions ()
+        {
+        }
+
+        Error
+        SetOptionValue (uint32_t option_idx, const char *option_arg)
+        {
+            Error error;
+            char short_option = (char) m_getopt_table[option_idx].val;
+            bool success = false;
+            switch (short_option)
+            {
+                case 'i':
+                    m_ignore = Args::StringToUInt32 (option_arg, 0, 0, &success);
+                    if (!success)
+                        error.SetErrorStringWithFormat ("invalid value for ignore option: \"%s\", should be a number.", option_arg);
+                    break;
+
+                default:
+                    error.SetErrorStringWithFormat("invalid short option character '%c'", short_option);
+                    break;
+            }
+            return error;
+        }
+
+        void
+        OptionParsingStarting ()
+        {
+            m_ignore = 0;
+        }
+
+        const OptionDefinition*
+        GetDefinitions ()
+        {
+            return g_option_table;
+        }
+
+        // Options table: Required for subclasses of Options.
+
+        static OptionDefinition g_option_table[];
+
+        uint32_t m_ignore;
+    };
+    
     bool
     DoExecute (Args& command,
              CommandReturnObject &result)
@@ -680,6 +765,32 @@
                 return false;
             }
 
+            if (m_options.m_ignore > 0)
+            {
+                ThreadSP sel_thread_sp(process->GetThreadList().GetSelectedThread());
+                if (sel_thread_sp)
+                {
+                    StopInfoSP stop_info_sp = sel_thread_sp->GetStopInfo();
+                    if (stop_info_sp && stop_info_sp->GetStopReason() == eStopReasonBreakpoint)
+                    {
+                        uint64_t bp_site_id = stop_info_sp->GetValue();
+                        BreakpointSiteSP bp_site_sp(process->GetBreakpointSiteList().FindByID(bp_site_id));
+                        if (bp_site_sp)
+                        {
+                            uint32_t num_owners = bp_site_sp->GetNumberOfOwners();
+                            for (uint32_t i = 0; i < num_owners; i++)
+                            {
+                                Breakpoint &bp_ref = bp_site_sp->GetOwnerAtIndex(i)->GetBreakpoint();
+                                if (!bp_ref.IsInternal())
+                                {
+                                    bp_ref.SetIgnoreCount(m_options.m_ignore);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+            
             const uint32_t num_threads = process->GetThreadList().GetSize();
 
             // Set the actions that the threads should each take when resuming
@@ -719,6 +830,23 @@
         }
         return result.Succeeded();
     }
+
+    Options *
+    GetOptions ()
+    {
+        return &m_options;
+    }
+    
+    CommandOptions m_options;
+
+};
+
+OptionDefinition
+CommandObjectProcessContinue::CommandOptions::g_option_table[] =
+{
+{ LLDB_OPT_SET_ALL, false, "ignore-count",'i', required_argument,         NULL, 0, eArgTypeUnsignedInteger,
+                           "Ignore <N> crossings of the breakpoint (if it exists) for the currently selected thread."},
+{ 0, false, NULL, 0, 0, NULL, 0, eArgTypeNone, NULL }
 };
 
 //-------------------------------------------------------------------------

Modified: lldb/branches/lldb-platform-work/source/Commands/CommandObjectType.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Commands/CommandObjectType.cpp?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Commands/CommandObjectType.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Commands/CommandObjectType.cpp Mon Aug 13 17:30:55 2012
@@ -742,7 +742,7 @@
 //-------------------------------------------------------------------------
 
 static const char *g_summary_addreader_instructions = "Enter your Python command(s). Type 'DONE' to end.\n"
-                                                       "def function (valobj,dict):";
+                                                       "def function (valobj,internal_dict):";
 
 class TypeScriptAddInputReader : public InputReaderEZ
 {
@@ -1050,7 +1050,7 @@
             return false;
         }
         
-        std::string code = ("     " + m_options.m_python_function + "(valobj,dict)");
+        std::string code = ("     " + m_options.m_python_function + "(valobj,internal_dict)");
         
         script_format.reset(new ScriptSummaryFormat(m_options.m_flags,
                                                     funct_name,

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=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Commands/CommandObjectWatchpoint.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Commands/CommandObjectWatchpoint.cpp Mon Aug 13 17:30:55 2012
@@ -8,6 +8,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "CommandObjectWatchpoint.h"
+#include "CommandObjectWatchpointCommand.h"
 
 // C Includes
 // C++ Includes
@@ -1046,6 +1047,8 @@
         error.Clear();
         Watchpoint *wp = target->CreateWatchpoint(addr, size, watch_type, error).get();
         if (wp) {
+            wp->SetWatchSpec(command.GetArgumentAtIndex(0));
+            wp->SetWatchVariable(true);
             if (var_sp && var_sp->GetDeclaration().GetFile()) {
                 StreamString ss;
                 // True to show fullpath for declaration file.
@@ -1053,13 +1056,15 @@
                 wp->SetDeclInfo(ss.GetString());
             }
             StreamString ss;
+            ValueObject::DumpValueObject(ss, valobj_sp.get());
+            wp->SetNewSnapshot(ss.GetString());
             output_stream.Printf("Watchpoint created: ");
             wp->GetDescription(&output_stream, lldb::eDescriptionLevelFull);
             output_stream.EOL();
             result.SetStatus(eReturnStatusSuccessFinishResult);
         } else {
-            result.AppendErrorWithFormat("Watchpoint creation failed (addr=0x%llx, size=%lu).\n",
-                                         addr, size);
+            result.AppendErrorWithFormat("Watchpoint creation failed (addr=0x%llx, size=%lu, variable expression='%s').\n",
+                                         addr, size, command.GetArgumentAtIndex(0));
             if (error.AsCString(NULL))
                 result.AppendError(error.AsCString());
             result.SetStatus(eReturnStatusFailed);
@@ -1237,8 +1242,12 @@
                 var_sp->GetDeclaration().DumpStopContext(&ss, true);
                 wp->SetDeclInfo(ss.GetString());
             }
-            StreamString ss;
             output_stream.Printf("Watchpoint created: ");
+            uint64_t val = target->GetProcessSP()->ReadUnsignedIntegerFromMemory(addr, size, 0, error);
+            if (error.Success())
+                wp->SetNewSnapshotVal(val);
+            else
+                output_stream.Printf("watchpoint snapshot failed: %s", error.AsCString());
             wp->GetDescription(&output_stream, lldb::eDescriptionLevelFull);
             output_stream.EOL();
             result.SetStatus(eReturnStatusSuccessFinishResult);
@@ -1300,6 +1309,7 @@
     CommandObjectSP disable_command_object (new CommandObjectWatchpointDisable (interpreter));
     CommandObjectSP delete_command_object (new CommandObjectWatchpointDelete (interpreter));
     CommandObjectSP ignore_command_object (new CommandObjectWatchpointIgnore (interpreter));
+    CommandObjectSP command_command_object (new CommandObjectWatchpointCommand (interpreter));
     CommandObjectSP modify_command_object (new CommandObjectWatchpointModify (interpreter));
     CommandObjectSP set_command_object (new CommandObjectWatchpointSet (interpreter));
 
@@ -1308,6 +1318,7 @@
     disable_command_object->SetCommandName("watchpoint disable");
     delete_command_object->SetCommandName("watchpoint delete");
     ignore_command_object->SetCommandName("watchpoint ignore");
+    command_command_object->SetCommandName ("watchpoint command");
     modify_command_object->SetCommandName("watchpoint modify");
     set_command_object->SetCommandName("watchpoint set");
 
@@ -1316,6 +1327,7 @@
     LoadSubCommand ("disable",    disable_command_object);
     LoadSubCommand ("delete",     delete_command_object);
     LoadSubCommand ("ignore",     ignore_command_object);
+    LoadSubCommand ("command",    command_command_object);
     LoadSubCommand ("modify",     modify_command_object);
     LoadSubCommand ("set",        set_command_object);
 }

Modified: lldb/branches/lldb-platform-work/source/Core/ArchSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Core/ArchSpec.cpp?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Core/ArchSpec.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Core/ArchSpec.cpp Mon Aug 13 17:30:55 2012
@@ -16,6 +16,7 @@
 #include "llvm/Support/ELF.h"
 #include "llvm/Support/Host.h"
 #include "llvm/Support/MachO.h"
+#include "lldb/Core/RegularExpression.h"
 #include "lldb/Host/Endian.h"
 #include "lldb/Host/Host.h"
 #include "lldb/Target/Platform.h"
@@ -487,6 +488,44 @@
 {
     if (triple_cstr && triple_cstr[0])
     {
+        if (isdigit(triple_cstr[0]))
+        {
+            // Accept "12-10" or "12.10" as cpu type/subtype
+            char *end = NULL;
+            uint32_t cpu = ::strtoul (triple_cstr, &end, 0);
+            if (cpu != 0 && end && ((*end == '-') || (*end == '.')))
+            {
+                uint32_t sub = ::strtoul (end + 1, &end, 0);
+                if (sub != 0 && end && ((*end == '-') || (*end == '.') || (*end == '\0')))
+                {
+                    if (SetArchitecture (eArchTypeMachO, cpu, sub))
+                    {
+                        if (*end == '-')
+                        {
+                            llvm::StringRef vendor_os (end + 1);
+                            size_t dash_pos = vendor_os.find('-');
+                            if (dash_pos != llvm::StringRef::npos)
+                            {
+                                llvm::StringRef vendor_str(vendor_os.substr(0, dash_pos));
+                                m_triple.setVendorName(vendor_str);
+                                const size_t vendor_start_pos = dash_pos+1;
+                                dash_pos = vendor_os.find(vendor_start_pos, '-');
+                                if (dash_pos == llvm::StringRef::npos)
+                                {
+                                    if (vendor_start_pos < vendor_os.size())
+                                        m_triple.setOSName(vendor_os.substr(vendor_start_pos));
+                                }
+                                else
+                                {
+                                    m_triple.setOSName(vendor_os.substr(vendor_start_pos, dash_pos - vendor_start_pos));
+                                }
+                            }
+                        }
+                        return true;
+                    }
+                }
+            }
+        }
         llvm::StringRef triple_stref (triple_cstr);
         if (triple_stref.startswith (LLDB_ARCH_DEFAULT))
         {

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=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Core/ConnectionFileDescriptor.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Core/ConnectionFileDescriptor.cpp Mon Aug 13 17:30:55 2012
@@ -75,8 +75,8 @@
     m_udp_send_sockaddr (),
     m_should_close_fd (false), 
     m_socket_timeout_usec(0),
-    m_command_fd_send(-1),
-    m_command_fd_receive(-1),
+    m_pipe_read(-1),
+    m_pipe_write(-1),
     m_mutex (Mutex::eMutexTypeRecursive),
     m_shutting_down (false)
 {
@@ -94,14 +94,15 @@
     m_udp_send_sockaddr (),
     m_should_close_fd (owns_fd),
     m_socket_timeout_usec(0),
-    m_command_fd_send(-1),
-    m_command_fd_receive(-1),
+    m_pipe_read(-1),
+    m_pipe_write(-1),
     m_mutex (Mutex::eMutexTypeRecursive),
     m_shutting_down (false)
 {
     LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_CONNECTION |  LIBLLDB_LOG_OBJECT));
     if (log)
         log->Printf ("%p ConnectionFileDescriptor::ConnectionFileDescriptor (fd = %i, owns_fd = %i)", this, fd, owns_fd);
+    OpenCommandPipe ();
 }
 
 
@@ -111,13 +112,13 @@
     if (log)
         log->Printf ("%p ConnectionFileDescriptor::~ConnectionFileDescriptor ()", this);
     Disconnect (NULL);
-    CloseCommandFileDescriptor ();
+    CloseCommandPipe ();
 }
 
 void
-ConnectionFileDescriptor::InitializeCommandFileDescriptor ()
+ConnectionFileDescriptor::OpenCommandPipe ()
 {
-    CloseCommandFileDescriptor();
+    CloseCommandPipe();
     
     LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_CONNECTION |  LIBLLDB_LOG_OBJECT));
     // Make the command file descriptor here:
@@ -132,24 +133,24 @@
     }
     else
     {
-        m_command_fd_receive = filedes[0];
-        m_command_fd_send    = filedes[1];
+        m_pipe_read  = filedes[0];
+        m_pipe_write = filedes[1];
     }
 }
 
 void
-ConnectionFileDescriptor::CloseCommandFileDescriptor ()
+ConnectionFileDescriptor::CloseCommandPipe ()
 {
-    if (m_command_fd_receive != -1)
+    if (m_pipe_read != -1)
     {
-        close (m_command_fd_receive);
-        m_command_fd_receive = -1;
+        close (m_pipe_read);
+        m_pipe_read = -1;
     }
     
-    if (m_command_fd_send != -1)
+    if (m_pipe_write != -1)
     {
-        close (m_command_fd_send);
-        m_command_fd_send = -1;
+        close (m_pipe_write);
+        m_pipe_write = -1;
     }
 }
 
@@ -167,7 +168,7 @@
     if (log)
         log->Printf ("%p ConnectionFileDescriptor::Connect (url = '%s')", this, s);
 
-    InitializeCommandFileDescriptor();
+    OpenCommandPipe();
     
     if (s && s[0])
     {
@@ -309,11 +310,11 @@
     
     if (!got_lock)
     {
-        if (m_command_fd_send != -1 )
+        if (m_pipe_write != -1 )
         {
-            write (m_command_fd_send, "q", 1);
-            close (m_command_fd_send);
-            m_command_fd_send = -1;
+            write (m_pipe_write, "q", 1);
+            close (m_pipe_write);
+            m_pipe_write = -1;
         }
         locker.Lock (m_mutex);
     }
@@ -613,14 +614,14 @@
         tv_ptr = &tv;
     }
 
-    while (IsConnected())
+    while (m_fd_recv >= 0)
     {
         fd_set read_fds;
         FD_ZERO (&read_fds);
         FD_SET (m_fd_recv, &read_fds);
-        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;
+        if (m_pipe_read != -1)
+            FD_SET (m_pipe_read, &read_fds);
+        int nfds = std::max<int>(m_fd_recv, m_pipe_read) + 1;
         
         Error error;
 
@@ -668,7 +669,7 @@
         }
         else if (num_set_fds > 0)
         {
-            if (m_command_fd_receive != -1 && FD_ISSET(m_command_fd_receive, &read_fds))
+            if (m_pipe_read != -1 && FD_ISSET(m_pipe_read, &read_fds))
             {
                 // We got a command to exit.  Read the data from that pipe:
                 char buffer[16];
@@ -676,7 +677,7 @@
                 
                 do
                 {
-                    bytes_read = ::read (m_command_fd_receive, buffer, sizeof(buffer));
+                    bytes_read = ::read (m_pipe_read, buffer, sizeof(buffer));
                 } while (bytes_read < 0 && errno == EINTR);
                 assert (bytes_read == 1 && buffer[0] == 'q');
                 

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=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Core/DataExtractor.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Core/DataExtractor.cpp Mon Aug 13 17:30:55 2012
@@ -1675,27 +1675,31 @@
         default:
         case eFormatDefault:
         case eFormatHex:
-            if (item_byte_size <= 8)
+        case eFormatHexUppercase:
             {
-                s->Printf("0x%*.*llx", 2 * item_byte_size, 2 * item_byte_size, GetMaxU64Bitfield(&offset, item_byte_size, item_bit_size, item_bit_offset));
-            }
-            else
-            {
-                assert (item_bit_size == 0 && item_bit_offset == 0);
-                s->PutCString("0x");
-                const uint8_t *bytes = (const uint8_t* )GetData(&offset, item_byte_size);
-                if (bytes)
+                bool wantsuppercase  = (item_format == eFormatHexUppercase);
+                if (item_byte_size <= 8)
                 {
-                    uint32_t idx;
-                    if (m_byte_order == eByteOrderBig)
-                    {
-                        for (idx = 0; idx < item_byte_size; ++idx)
-                            s->Printf("%2.2x", bytes[idx]);
-                    }
-                    else
+                    s->Printf(wantsuppercase ? "0x%*.*llX" : "0x%*.*llx", 2 * item_byte_size, 2 * item_byte_size, GetMaxU64Bitfield(&offset, item_byte_size, item_bit_size, item_bit_offset));
+                }
+                else
+                {
+                    assert (item_bit_size == 0 && item_bit_offset == 0);
+                    s->PutCString("0x");
+                    const uint8_t *bytes = (const uint8_t* )GetData(&offset, item_byte_size);
+                    if (bytes)
                     {
-                        for (idx = 0; idx < item_byte_size; ++idx)
-                            s->Printf("%2.2x", bytes[item_byte_size - 1 - idx]);
+                        uint32_t idx;
+                        if (m_byte_order == eByteOrderBig)
+                        {
+                            for (idx = 0; idx < item_byte_size; ++idx)
+                                s->Printf(wantsuppercase ? "%2.2X" : "%2.2x", bytes[idx]);
+                        }
+                        else
+                        {
+                            for (idx = 0; idx < item_byte_size; ++idx)
+                                s->Printf(wantsuppercase ? "%2.2X" : "%2.2x", bytes[item_byte_size - 1 - idx]);
+                        }
                     }
                 }
             }

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=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Core/Debugger.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Core/Debugger.cpp Mon Aug 13 17:30:55 2012
@@ -73,6 +73,13 @@
 }
 
 static const ConstString &
+GetNotifyVoidName ()
+{
+    static ConstString g_const_string ("notify-void");
+    return g_const_string;
+}
+
+static const ConstString &
 GetFrameFormatName ()
 {
     static ConstString g_const_string ("frame-format");
@@ -2327,7 +2334,7 @@
     Log::Callbacks log_callbacks;
 
     StreamSP log_stream_sp;
-    if (m_log_callback_stream_sp != NULL)
+    if (m_log_callback_stream_sp)
     {
         log_stream_sp = m_log_callback_stream_sp;
         // For now when using the callback mode you always get thread & timestamp.
@@ -2425,6 +2432,7 @@
     m_stop_disassembly_count (4),
     m_stop_disassembly_display (eStopDisassemblyTypeNoSource),
     m_prompt (),
+    m_notify_void (false),
     m_frame_format (),
     m_thread_format (),    
     m_script_lang (),
@@ -2452,6 +2460,7 @@
 DebuggerInstanceSettings::DebuggerInstanceSettings (const DebuggerInstanceSettings &rhs) :
     InstanceSettings (Debugger::GetSettingsController(), CreateInstanceName ().AsCString()),
     m_prompt (rhs.m_prompt),
+    m_notify_void (rhs.m_notify_void),
     m_frame_format (rhs.m_frame_format),
     m_thread_format (rhs.m_thread_format),
     m_script_lang (rhs.m_script_lang),
@@ -2477,6 +2486,7 @@
     {
         m_term_width = rhs.m_term_width;
         m_prompt = rhs.m_prompt;
+        m_notify_void = rhs.m_notify_void;
         m_frame_format = rhs.m_frame_format;
         m_thread_format = rhs.m_thread_format;
         m_script_lang = rhs.m_script_lang;
@@ -2560,6 +2570,10 @@
             BroadcastPromptChange (new_name, m_prompt.c_str());
         }
     }
+    else if (var_name == GetNotifyVoidName())
+    {
+        UserSettingsController::UpdateBooleanVariable (op, m_notify_void, value, false, err);
+    }
     else if (var_name == GetFrameFormatName())
     {
         UserSettingsController::UpdateStringVariable (op, m_frame_format, value, err);
@@ -2624,7 +2638,10 @@
     if (var_name == PromptVarName())
     {
         value.AppendString (m_prompt.c_str(), m_prompt.size());
-        
+    }
+    else if (var_name == GetNotifyVoidName())
+    {
+        value.AppendString (m_notify_void ? "true" : "false");
     }
     else if (var_name == ScriptLangVarName())
     {
@@ -2715,6 +2732,7 @@
 
         BroadcastPromptChange (new_name, m_prompt.c_str());
     }
+    m_notify_void = new_debugger_settings->m_notify_void;
     m_frame_format = new_debugger_settings->m_frame_format;
     m_thread_format = new_debugger_settings->m_thread_format;
     m_term_width = new_debugger_settings->m_term_width;
@@ -2789,7 +2807,7 @@
     {  NULL, eSetVarTypeNone, NULL, NULL, 0, 0, NULL }
 };
 
-#define MODULE_WITH_FUNC "{ ${module.file.basename}{`${function.name}${function.pc-offset}}}"
+#define MODULE_WITH_FUNC "{ ${module.file.basename}{`${function.name-with-args}${function.pc-offset}}}"
 #define FILE_AND_LINE "{ at ${line.file.basename}:${line.number}}"
 
 #define DEFAULT_THREAD_FORMAT "thread #${thread.index}: tid = ${thread.id}"\
@@ -2821,6 +2839,7 @@
 //  ======================= ======================= ======================  ====  ====== ====== ======================
 {   "frame-format",         eSetVarTypeString,      DEFAULT_FRAME_FORMAT,   NULL, false, false, "The default frame format string to use when displaying thread information." },
 {   "prompt",               eSetVarTypeString,      "(lldb) ",              NULL, false, false, "The debugger command line prompt displayed for the user." },
+{   "notify-void",          eSetVarTypeBoolean,     "false",                NULL, false, false, "Notify the user explicitly if an expression returns void." },
 {   "script-lang",          eSetVarTypeString,      "python",               NULL, false, false, "The script language to be used for evaluating user-written scripts." },
 {   "term-width",           eSetVarTypeInt,         "80"    ,               NULL, false, false, "The maximum number of columns to use for displaying text." },
 {   "thread-format",        eSetVarTypeString,      DEFAULT_THREAD_FORMAT,  NULL, false, false, "The default thread format string to use when displaying thread information." },

Modified: lldb/branches/lldb-platform-work/source/Core/Disassembler.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Core/Disassembler.cpp?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Core/Disassembler.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Core/Disassembler.cpp Mon Aug 13 17:30:55 2012
@@ -893,7 +893,7 @@
 uint32_t
 Instruction::GetData (DataExtractor &data)
 {
-    return m_opcode.GetData(data, GetAddressClass ());
+    return m_opcode.GetData(data);
 }
 
 InstructionList::InstructionList() :

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=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Core/FormatManager.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Core/FormatManager.cpp Mon Aug 13 17:30:55 2012
@@ -42,6 +42,7 @@
     { eFormatDecimal        , 'd'   , "decimal"             },
     { eFormatEnum           , 'E'   , "enumeration"         },
     { eFormatHex            , 'x'   , "hex"                 },
+    { eFormatHexUppercase   , 'X'   , "uppercase hex"       },
     { eFormatFloat          , 'f'   , "float"               },
     { eFormatOctal          , 'o'   , "octal"               },
     { eFormatOSType         , 'O'   , "OSType"              },
@@ -64,8 +65,9 @@
     { eFormatComplexInteger , 'I'   , "complex integer"     },
     { eFormatCharArray      , 'a'   , "character array"     },
     { eFormatAddressInfo    , 'A'   , "address"             },
-    { eFormatHexFloat       , 'X'   , "hex float"           },
-    { eFormatInstruction    , 'i'   , "instruction"         }
+    { eFormatHexFloat       , '\0'  , "hex float"           },
+    { eFormatInstruction    , 'i'   , "instruction"         },
+    { eFormatVoid           , 'v'   , "void"                }
 };
 
 static uint32_t 
@@ -772,7 +774,7 @@
     .SetHideItemNames(false);
     
 #ifndef LLDB_DISABLE_PYTHON
-    std::string code("     lldb.formatters.cpp.libcxx.stdstring_SummaryProvider(valobj,dict)");
+    std::string code("     lldb.formatters.cpp.libcxx.stdstring_SummaryProvider(valobj,internal_dict)");
     lldb::TypeSummaryImplSP std_string_summary_sp(new ScriptSummaryFormat(stl_summary_flags, "lldb.formatters.cpp.libcxx.stdstring_SummaryProvider",code.c_str()));
     
     TypeCategoryImpl::SharedPointer libcxx_category_sp = GetCategory(m_libcxx_category_name);
@@ -868,7 +870,7 @@
 {
     
     std::string code("     ");
-    code.append(funct_name).append("(valobj,dict)");
+    code.append(funct_name).append("(valobj,internal_dict)");
     
     lldb::TypeSummaryImplSP summary_sp(new ScriptSummaryFormat(flags,
                                                                funct_name,

Modified: lldb/branches/lldb-platform-work/source/Core/Opcode.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Core/Opcode.cpp?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Core/Opcode.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Core/Opcode.cpp Mon Aug 13 17:30:55 2012
@@ -41,12 +41,6 @@
         bytes_written = s->Printf ("0x%4.4x", m_data.inst16); 
         break;
     case Opcode::eType16_2:
-        if (GetDataByteOrder() == eByteOrderLittle)
-            bytes_written = s->Printf ("0x%4.4x%4.4x", m_data.inst32 & 0xffff, m_data.inst32 >> 16);
-        else
-            bytes_written = s->Printf ("0x%2.2x%2.2x%2.2x%2.2x", (m_data.inst32 >> 16) & 0xff, (m_data.inst32 >> 24),
-                                                                 (m_data.inst32 & 0xff), (m_data.inst32 >> 8) & 0xff); 
-        break;
     case Opcode::eType32:
         bytes_written = s->Printf ("0x%8.8x", m_data.inst32); 
         break;
@@ -92,7 +86,7 @@
 }
 
 uint32_t
-Opcode::GetData (DataExtractor &data, lldb::AddressClass address_class) const
+Opcode::GetData (DataExtractor &data) const
 {
     uint32_t byte_size = GetByteSize ();
     
@@ -106,8 +100,20 @@
                 
             case Opcode::eType8:    buffer_sp.reset (new DataBufferHeap (&m_data.inst8,  byte_size)); break;
             case Opcode::eType16:   buffer_sp.reset (new DataBufferHeap (&m_data.inst16, byte_size)); break;
-            case Opcode::eType16_2: // passthrough
-            case Opcode::eType32:   buffer_sp.reset (new DataBufferHeap (&m_data.inst32, byte_size)); break;
+            case Opcode::eType16_2:
+                {
+                    // 32 bit thumb instruction, we need to sizzle this a bit
+                    uint8_t buf[4];
+                    buf[0] = m_data.inst.bytes[2];
+                    buf[1] = m_data.inst.bytes[3];
+                    buf[2] = m_data.inst.bytes[0];
+                    buf[3] = m_data.inst.bytes[1];
+                    buffer_sp.reset (new DataBufferHeap (buf, byte_size));
+                }
+                break;
+            case Opcode::eType32:
+                buffer_sp.reset (new DataBufferHeap (&m_data.inst32, byte_size));
+                break;
             case Opcode::eType64:   buffer_sp.reset (new DataBufferHeap (&m_data.inst64, byte_size)); break;
             case Opcode::eTypeBytes:buffer_sp.reset (new DataBufferHeap (GetOpcodeBytes(), byte_size)); break;
                 break;

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=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Core/ValueObject.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Core/ValueObject.cpp Mon Aug 13 17:30:55 2012
@@ -843,6 +843,7 @@
                     ModuleSP module_sp (GetModule());
                     if (module_sp)
                     {
+                        addr = addr + offset;
                         Address so_addr;
                         module_sp->ResolveFileAddress(addr, so_addr);
                         ExecutionContext exe_ctx (GetExecutionContextRef());
@@ -1425,6 +1426,7 @@
                 (custom_format == eFormatComplexFloat) ||
                 (custom_format == eFormatDecimal) ||
                 (custom_format == eFormatHex) ||
+                (custom_format == eFormatHexUppercase) ||
                 (custom_format == eFormatFloat) ||
                 (custom_format == eFormatOctal) ||
                 (custom_format == eFormatOSType) ||
@@ -3190,9 +3192,16 @@
             }
 
             s.Indent();
-
-            // Always show the type for the top level items.
-            if (options.m_show_types || (curr_depth == 0 && !options.m_flat_output))
+            
+            bool show_type = true;
+            // if we are at the root-level and been asked to hide the root's type, then hide it
+            if (curr_depth == 0 && options.m_hide_root_type)
+                show_type = false;
+            else
+            // otherwise decide according to the usual rules (asked to show types - always at the root level)
+                show_type = options.m_show_types || (curr_depth == 0 && !options.m_flat_output);
+            
+            if (show_type)
             {
                 const char* typeName = valobj->GetQualifiedTypeName().AsCString("<invalid type>");
                 //const char* typeName = valobj->GetTypeName().AsCString("<invalid type>");

Modified: lldb/branches/lldb-platform-work/source/Core/cxa_demangle.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Core/cxa_demangle.cpp?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Core/cxa_demangle.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Core/cxa_demangle.cpp Mon Aug 13 17:30:55 2012
@@ -7,7 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "cxa_demangle.h"
+#include "lldb/Core/cxa_demangle.h"
 
 #include <stdlib.h>
 #include <string.h>

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=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Expression/ClangExpressionDeclMap.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Expression/ClangExpressionDeclMap.cpp Mon Aug 13 17:30:55 2012
@@ -2657,7 +2657,7 @@
                                                               err);
             
             // If we found a variable in scope, no need to pull up function names
-            if (err.Success() && var != NULL)
+            if (err.Success() && var)
             {
                 AddOneVariable(context, var, valobj, current_id);
                 context.m_found.variable = true;
@@ -3135,7 +3135,7 @@
                 if (log)
                     log->Printf("ClangExpressionDeclMap::ResolveUnknownType - Couldn't import the type for a variable");
                 
-                return lldb::ClangExpressionVariableSP();
+                return (bool) lldb::ClangExpressionVariableSP();
             }
             
             TypeFromUser user_type(copied_type, scratch_ast_context);

Modified: lldb/branches/lldb-platform-work/source/Expression/ClangExpressionParser.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Expression/ClangExpressionParser.cpp?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Expression/ClangExpressionParser.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Expression/ClangExpressionParser.cpp Mon Aug 13 17:30:55 2012
@@ -756,7 +756,7 @@
     
     lldb::DisassemblerSP disassembler = Disassembler::FindPlugin(arch, NULL);
     
-    if (disassembler == NULL)
+    if (!disassembler)
     {
         ret.SetErrorToGenericError();
         ret.SetErrorStringWithFormat("Unable to find disassembler plug-in for %s architecture.", arch.GetArchitectureName());

Modified: lldb/branches/lldb-platform-work/source/Expression/ClangFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Expression/ClangFunction.cpp?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Expression/ClangFunction.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Expression/ClangFunction.cpp Mon Aug 13 17:30:55 2012
@@ -499,7 +499,7 @@
                                                                                  stop_others, 
                                                                                  discard_on_error, 
                                                                                  this_arg));
-    if (call_plan_sp == NULL)
+    if (!call_plan_sp)
         return eExecutionSetupError;
     
     call_plan_sp->SetPrivate(true);

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=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Expression/ClangUserExpression.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Expression/ClangUserExpression.cpp Mon Aug 13 17:30:55 2012
@@ -572,7 +572,7 @@
                                                                           ((m_needs_object_ptr && m_objectivec) ? &cmd_ptr : NULL),
                                                                           shared_ptr_to_me));
         
-        if (call_plan_sp == NULL || !call_plan_sp->ValidatePlan (NULL))
+        if (!call_plan_sp || !call_plan_sp->ValidatePlan (NULL))
             return eExecutionSetupError;
         
         lldb::addr_t function_stack_pointer = static_cast<ThreadPlanCallFunction *>(call_plan_sp.get())->GetFunctionStackPointer();

Modified: lldb/branches/lldb-platform-work/source/Expression/DWARFExpression.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Expression/DWARFExpression.cpp?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Expression/DWARFExpression.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Expression/DWARFExpression.cpp Mon Aug 13 17:30:55 2012
@@ -261,6 +261,18 @@
 }
 
 void
+DWARFExpression::CopyOpcodeData (const DataExtractor& data, uint32_t data_offset, uint32_t data_length)
+{
+    const uint8_t *bytes = data.PeekData(data_offset, data_length);
+    if (bytes)
+    {
+        m_data.SetData(DataBufferSP(new DataBufferHeap(bytes, data_length)));
+        m_data.SetByteOrder(data.GetByteOrder());
+        m_data.SetAddressByteSize(data.GetAddressByteSize());
+    }
+}
+
+void
 DWARFExpression::SetOpcodeData (const DataExtractor& data, uint32_t data_offset, uint32_t data_length)
 {
     m_data.SetData(data, data_offset, data_length);

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=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Expression/IRInterpreter.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Expression/IRInterpreter.cpp Mon Aug 13 17:30:55 2012
@@ -159,12 +159,12 @@
         
         bool IsValid ()
         {
-            return m_allocation != NULL;
+            return (bool) m_allocation;
         }
         
         bool IsInvalid ()
         {
-            return m_allocation == NULL;
+            return !m_allocation;
         }
     };
     

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=161801&r1=161800&r2=161801&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 Aug 13 17:30:55 2012
@@ -25,7 +25,7 @@
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleVersion</key>
-	<string>164</string>
+	<string>165</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=161801&r1=161800&r2=161801&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 Aug 13 17:30:55 2012
@@ -25,7 +25,7 @@
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleVersion</key>
-	<string>164</string>
+	<string>165</string>
 	<key>NSHumanReadableCopyright</key>
 	<string>Copyright © 2012 Apple Inc. All rights reserved.</string>
 	<key>XPCService</key>

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=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Interpreter/CommandInterpreter.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Interpreter/CommandInterpreter.cpp Mon Aug 13 17:30:55 2012
@@ -80,6 +80,7 @@
     m_script_interpreter_ap (),
     m_comment_char ('#'),
     m_repeat_char ('!'),
+    m_batch_command_mode (false),
     m_truncation_warning(eNoTruncation),
     m_command_source_depth (0)
 {
@@ -231,8 +232,10 @@
         ProcessAliasOptionsArgs (cmd_obj_sp, "--", alias_arguments_vector_sp);
         AddAlias ("p", cmd_obj_sp);
         AddAlias ("print", cmd_obj_sp);
+        AddAlias ("call", cmd_obj_sp);
         AddOrReplaceAliasOptions ("p", alias_arguments_vector_sp);
         AddOrReplaceAliasOptions ("print", alias_arguments_vector_sp);
+        AddOrReplaceAliasOptions ("call", alias_arguments_vector_sp);
 
         alias_arguments_vector_sp.reset (new OptionArgVector);
         ProcessAliasOptionsArgs (cmd_obj_sp, "-o --", alias_arguments_vector_sp);
@@ -462,7 +465,7 @@
             ret_val = pos->second;
     }
 
-    if (!exact && ret_val == NULL)
+    if (!exact && !ret_val)
     {
         // We will only get into here if we didn't find any exact matches.
         
@@ -532,7 +535,7 @@
                 return user_match_sp;
         }
     }
-    else if (matches && ret_val != NULL)
+    else if (matches && ret_val)
     {
         matches->AppendString (cmd_cstr);
     }
@@ -760,7 +763,7 @@
     help_string.Printf ("'%s", command_name);
     OptionArgVectorSP option_arg_vector_sp = GetAliasOptions (alias_name);
 
-    if (option_arg_vector_sp != NULL)
+    if (option_arg_vector_sp)
     {
         OptionArgVector *options = option_arg_vector_sp.get();
         for (int i = 0; i < options->size(); ++i)
@@ -1934,7 +1937,7 @@
 {
     CommandObjectSP cmd_obj_sp = GetCommandSPExact (dest_cmd, true);
 
-    if (cmd_obj_sp != NULL)
+    if (cmd_obj_sp)
     {
         CommandObject *cmd_obj = cmd_obj_sp.get();
         if (cmd_obj->IsCrossRefObject ())

Modified: lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupValueObjectDisplay.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupValueObjectDisplay.cpp?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupValueObjectDisplay.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupValueObjectDisplay.cpp Mon Aug 13 17:30:55 2012
@@ -40,7 +40,7 @@
     { LLDB_OPT_SET_1, false, "objc",             'O', no_argument,       NULL, 0, eArgTypeNone,      "Print as an Objective-C object."},
     { LLDB_OPT_SET_1, false, "ptr-depth",        'P', required_argument, NULL, 0, eArgTypeCount,     "The number of pointers to be traversed when dumping values (default is zero)."},
     { LLDB_OPT_SET_1, false, "show-types",       'T', no_argument,       NULL, 0, eArgTypeNone,      "Show variable types when dumping values."},
-    { LLDB_OPT_SET_1, false, "no-summary-depth", 'Y', optional_argument, NULL, 0, eArgTypeCount,     "Set a depth for omitting summary information (default is 1)."},
+    { LLDB_OPT_SET_1, false, "no-summary-depth", 'Y', optional_argument, NULL, 0, eArgTypeCount,     "Set the depth at which omitting summary information stops (default is 1)."},
     { LLDB_OPT_SET_1, false, "raw-output",       'R', no_argument,       NULL, 0, eArgTypeNone,      "Don't use formatting options."},
     { LLDB_OPT_SET_1, false, "show-all-children",'A', no_argument,       NULL, 0, eArgTypeNone,      "Ignore the upper bound on the number of children to show."},
     { 0, false, NULL, 0, 0, NULL, NULL, eArgTypeNone, NULL }

Modified: lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupVariable.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupVariable.cpp?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupVariable.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Interpreter/OptionGroupVariable.cpp Mon Aug 13 17:30:55 2012
@@ -24,13 +24,14 @@
 static OptionDefinition
 g_option_table[] =
 {
-    { LLDB_OPT_SET_1, false, "no-args",         'a', no_argument,       NULL, 0, eArgTypeNone,    "Omit function arguments."},
-    { LLDB_OPT_SET_1, false, "no-locals",       'l', no_argument,       NULL, 0, eArgTypeNone,    "Omit local variables."},
-    { LLDB_OPT_SET_1, false, "show-globals",    'g', no_argument,       NULL, 0, eArgTypeNone,    "Show the current frame source file global and static variables."},
-    { LLDB_OPT_SET_1, false, "show-declaration",'c', no_argument,       NULL, 0, eArgTypeNone,    "Show variable declaration information (source file and line where the variable was declared)."},
-    { LLDB_OPT_SET_1, false, "regex",           'r', no_argument,       NULL, 0, eArgTypeRegularExpression,    "The <variable-name> argument for name lookups are regular expressions."},
-    { LLDB_OPT_SET_1, false, "scope",           's', no_argument,       NULL, 0, eArgTypeNone,    "Show variable scope (argument, local, global, static)."},
+    { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "no-args",         'a', no_argument,       NULL, 0, eArgTypeNone,    "Omit function arguments."},
+    { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "no-locals",       'l', no_argument,       NULL, 0, eArgTypeNone,    "Omit local variables."},
+    { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "show-globals",    'g', no_argument,       NULL, 0, eArgTypeNone,    "Show the current frame source file global and static variables."},
+    { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "show-declaration",'c', no_argument,       NULL, 0, eArgTypeNone,    "Show variable declaration information (source file and line where the variable was declared)."},
+    { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "regex",           'r', no_argument,       NULL, 0, eArgTypeRegularExpression,    "The <variable-name> argument for name lookups are regular expressions."},
+    { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "scope",           's', no_argument,       NULL, 0, eArgTypeNone,    "Show variable scope (argument, local, global, static)."},
     { LLDB_OPT_SET_1, false, "summary",         'y', required_argument, NULL, 0, eArgTypeName,  "Specify the summary that the variable output should use."},
+    { LLDB_OPT_SET_2, false, "summary-string",  'z', required_argument, NULL, 0, eArgTypeName,  "Specify a summary string to use to format the variable output."},
 };
 
 
@@ -64,7 +65,10 @@
             show_scope = true;
             break;
         case 'y':
-            summary = std::string(option_arg);
+            summary.SetCurrentValue(option_arg);
+            break;
+        case 'z':
+            summary_string.SetCurrentValue(option_arg);
             break;
         default:
             error.SetErrorStringWithFormat("unrecognized short option '%c'", short_option);
@@ -83,7 +87,8 @@
     show_decl     = false;
     use_regex     = false;
     show_scope    = false;
-    summary       = "";
+    summary.Clear();
+    summary_string.Clear();
 }
 
 #define NUM_FRAME_OPTS 3

Modified: lldb/branches/lldb-platform-work/source/Interpreter/ScriptInterpreter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Interpreter/ScriptInterpreter.cpp?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Interpreter/ScriptInterpreter.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Interpreter/ScriptInterpreter.cpp Mon Aug 13 17:30:55 2012
@@ -50,6 +50,17 @@
     result.AppendError ("ScriptInterpreter::GetScriptCommands(StringList &) is not implemented.");
 }
 
+void 
+ScriptInterpreter::CollectDataForWatchpointCommandCallback 
+(
+    WatchpointOptions *bp_options,
+    CommandReturnObject &result
+)
+{
+    result.SetStatus (eReturnStatusFailed);
+    result.AppendError ("ScriptInterpreter::GetScriptCommands(StringList &) is not implemented.");
+}
+
 std::string
 ScriptInterpreter::LanguageToString (lldb::ScriptLanguage language)
 {

Modified: lldb/branches/lldb-platform-work/source/Interpreter/ScriptInterpreterPython.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Interpreter/ScriptInterpreterPython.cpp?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Interpreter/ScriptInterpreterPython.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Interpreter/ScriptInterpreterPython.cpp Mon Aug 13 17:30:55 2012
@@ -31,6 +31,7 @@
 #include "lldb/API/SBValue.h"
 #include "lldb/Breakpoint/BreakpointLocation.h"
 #include "lldb/Breakpoint/StoppointCallbackContext.h"
+#include "lldb/Breakpoint/WatchpointOptions.h"
 #include "lldb/Core/Debugger.h"
 #include "lldb/Core/Timer.h"
 #include "lldb/Host/Host.h"
@@ -44,6 +45,7 @@
 
 static ScriptInterpreter::SWIGInitCallback g_swig_init_callback = NULL;
 static ScriptInterpreter::SWIGBreakpointCallbackFunction g_swig_breakpoint_callback = NULL;
+static ScriptInterpreter::SWIGWatchpointCallbackFunction g_swig_watchpoint_callback = NULL;
 static ScriptInterpreter::SWIGPythonTypeScriptCallbackFunction g_swig_typescript_callback = NULL;
 static ScriptInterpreter::SWIGPythonCreateSyntheticProvider g_swig_synthetic_script = NULL;
 static ScriptInterpreter::SWIGPythonCalculateNumChildren g_swig_calc_children = NULL;
@@ -69,6 +71,15 @@
  );
 
 extern "C" bool
+LLDBSwigPythonWatchpointCallbackFunction 
+(
+ const char *python_function_name,
+ const char *session_dictionary_name,
+ const lldb::StackFrameSP& sb_frame, 
+ const lldb::WatchpointSP& sb_wp
+ );
+
+extern "C" bool
 LLDBSwigPythonCallTypeScript 
 (
  const char *python_function_name,
@@ -1388,6 +1399,112 @@
     return bytes_len;
 }
 
+size_t
+ScriptInterpreterPython::GenerateWatchpointOptionsCommandCallback
+(
+    void *baton, 
+    InputReader &reader, 
+    InputReaderAction notification,
+    const char *bytes, 
+    size_t bytes_len
+)
+{
+    static StringList commands_in_progress;
+    
+    StreamSP out_stream = reader.GetDebugger().GetAsyncOutputStream();
+    bool batch_mode = reader.GetDebugger().GetCommandInterpreter().GetBatchCommandMode();
+    
+    switch (notification)
+    {
+    case eInputReaderActivate:
+        {
+            commands_in_progress.Clear();
+            if (!batch_mode)
+            {
+                out_stream->Printf ("%s\n", g_reader_instructions);
+                if (reader.GetPrompt())
+                    out_stream->Printf ("%s", reader.GetPrompt());
+                out_stream->Flush ();
+            }
+        }
+        break;
+
+    case eInputReaderDeactivate:
+        break;
+
+    case eInputReaderReactivate:
+        if (reader.GetPrompt() && !batch_mode)
+        {
+            out_stream->Printf ("%s", reader.GetPrompt());
+            out_stream->Flush ();
+        }
+        break;
+
+    case eInputReaderAsynchronousOutputWritten:
+        break;
+        
+    case eInputReaderGotToken:
+        {
+            std::string temp_string (bytes, bytes_len);
+            commands_in_progress.AppendString (temp_string.c_str());
+            if (!reader.IsDone() && reader.GetPrompt() && !batch_mode)
+            {
+                out_stream->Printf ("%s", reader.GetPrompt());
+                out_stream->Flush ();
+            }
+        }
+        break;
+
+    case eInputReaderEndOfFile:
+    case eInputReaderInterrupt:
+        // Control-c (SIGINT) & control-d both mean finish & exit.
+        reader.SetIsDone(true);
+        
+        // Control-c (SIGINT) ALSO means cancel; do NOT create a breakpoint command.
+        if (notification == eInputReaderInterrupt)
+            commands_in_progress.Clear();  
+        
+        // Fall through here...
+
+    case eInputReaderDone:
+        {
+            WatchpointOptions *wp_options = (WatchpointOptions *)baton;
+            std::auto_ptr<WatchpointOptions::CommandData> data_ap(new WatchpointOptions::CommandData());
+            data_ap->user_source.AppendList (commands_in_progress);
+            if (data_ap.get())
+            {
+                ScriptInterpreter *interpreter = reader.GetDebugger().GetCommandInterpreter().GetScriptInterpreter();
+                if (interpreter)
+                {
+                    if (interpreter->GenerateWatchpointCommandCallbackData (data_ap->user_source, 
+                                                                            data_ap->script_source))
+                    {
+                        BatonSP baton_sp (new WatchpointOptions::CommandBaton (data_ap.release()));
+                        wp_options->SetCallback (ScriptInterpreterPython::WatchpointCallbackFunction, baton_sp);
+                    }
+                    else if (!batch_mode)
+                    {
+                        out_stream->Printf ("Warning: No command attached to breakpoint.\n");
+                        out_stream->Flush();
+                    }
+                }
+                else
+                {
+		            if (!batch_mode)
+                    {
+                        out_stream->Printf ("Warning:  Unable to find script intepreter; no command attached to breakpoint.\n");
+                        out_stream->Flush();
+                    }
+                }
+            }
+        }
+        break;
+        
+    }
+
+    return bytes_len;
+}
+
 void
 ScriptInterpreterPython::CollectDataForBreakpointCommandCallback (BreakpointOptions *bp_options,
                                                                   CommandReturnObject &result)
@@ -1421,6 +1538,39 @@
     }
 }
 
+void
+ScriptInterpreterPython::CollectDataForWatchpointCommandCallback (WatchpointOptions *wp_options,
+                                                                  CommandReturnObject &result)
+{
+    Debugger &debugger = GetCommandInterpreter().GetDebugger();
+    
+    InputReaderSP reader_sp (new InputReader (debugger));
+
+    if (reader_sp)
+    {
+        Error err = reader_sp->Initialize (
+                ScriptInterpreterPython::GenerateWatchpointOptionsCommandCallback,
+                wp_options,                 // baton
+                eInputReaderGranularityLine, // token size, for feeding data to callback function
+                "DONE",                     // end token
+                "> ",                       // prompt
+                true);                      // echo input
+    
+        if (err.Success())
+            debugger.PushInputReader (reader_sp);
+        else
+        {
+            result.AppendError (err.AsCString());
+            result.SetStatus (eReturnStatusFailed);
+        }
+    }
+    else
+    {
+        result.AppendError("out of memory");
+        result.SetStatus (eReturnStatusFailed);
+    }
+}
+
 // Set a Python one-liner as the callback for the breakpoint.
 void
 ScriptInterpreterPython::SetBreakpointCommandCallback (BreakpointOptions *bp_options,
@@ -1433,6 +1583,7 @@
     // while the latter is used for Python to interpret during the actual callback.
 
     data_ap->user_source.AppendString (oneliner);
+    data_ap->script_source.assign (oneliner);
 
     if (GenerateBreakpointCommandCallbackData (data_ap->user_source, data_ap->script_source))
     {
@@ -1443,6 +1594,29 @@
     return;
 }
 
+// Set a Python one-liner as the callback for the watchpoint.
+void
+ScriptInterpreterPython::SetWatchpointCommandCallback (WatchpointOptions *wp_options,
+                                                       const char *oneliner)
+{
+    std::auto_ptr<WatchpointOptions::CommandData> data_ap(new WatchpointOptions::CommandData());
+
+    // It's necessary to set both user_source and script_source to the oneliner.
+    // The former is used to generate callback description (as in watchpoint command list)
+    // while the latter is used for Python to interpret during the actual callback.
+
+    data_ap->user_source.AppendString (oneliner);
+    data_ap->script_source.assign (oneliner);
+
+    if (GenerateWatchpointCommandCallbackData (data_ap->user_source, data_ap->script_source))
+    {
+        BatonSP baton_sp (new WatchpointOptions::CommandBaton (data_ap.release()));
+        wp_options->SetCallback (ScriptInterpreterPython::WatchpointCallbackFunction, baton_sp);
+    }
+    
+    return;
+}
+
 bool
 ScriptInterpreterPython::ExportFunctionDefinitionToInterpreter (StringList &function_def)
 {
@@ -1466,9 +1640,9 @@
     StringList auto_generated_function;
     auto_generated_function.AppendString (signature);
     auto_generated_function.AppendString ("     global_dict = globals()");   // Grab the global dictionary
-    auto_generated_function.AppendString ("     new_keys = dict.keys()");    // Make a list of keys in the session dict
+    auto_generated_function.AppendString ("     new_keys = internal_dict.keys()");    // Make a list of keys in the session dict
     auto_generated_function.AppendString ("     old_keys = global_dict.keys()"); // Save list of keys in global dict
-    auto_generated_function.AppendString ("     global_dict.update (dict)"); // Add the session dictionary to the 
+    auto_generated_function.AppendString ("     global_dict.update (internal_dict)"); // Add the session dictionary to the 
     // global dictionary.
     
     // Wrap everything up inside the function, increasing the indentation.
@@ -1480,7 +1654,7 @@
         auto_generated_function.AppendString (sstr.GetData());
     }
     auto_generated_function.AppendString ("     for key in new_keys:");  // Iterate over all the keys from session dict
-    auto_generated_function.AppendString ("         dict[key] = global_dict[key]");  // Update session dict values
+    auto_generated_function.AppendString ("         internal_dict[key] = global_dict[key]");  // Update session dict values
     auto_generated_function.AppendString ("         if key not in old_keys:");       // If key was not originally in global dict
     auto_generated_function.AppendString ("             del global_dict[key]");      //  ...then remove key/value from global dict
     
@@ -1508,7 +1682,7 @@
     // ValueObject as parameter to the function.
     
     std::string auto_generated_function_name(GenerateUniqueName("lldb_autogen_python_type_print_func", num_created_functions, name_token));
-    sstr.Printf ("def %s (valobj, dict):", auto_generated_function_name.c_str());
+    sstr.Printf ("def %s (valobj, internal_dict):", auto_generated_function_name.c_str());
     
     if (!GenerateFunction(sstr.GetData(), user_input))
         return false;
@@ -1531,7 +1705,7 @@
     
     std::string auto_generated_function_name(GenerateUniqueName("lldb_autogen_python_cmd_alias_func", num_created_functions));
 
-    sstr.Printf ("def %s (debugger, args, result, dict):", auto_generated_function_name.c_str());
+    sstr.Printf ("def %s (debugger, args, result, internal_dict):", auto_generated_function_name.c_str());
     
     if (!GenerateFunction(sstr.GetData(),user_input))
         return false;
@@ -1651,7 +1825,28 @@
         return false;
 
     std::string auto_generated_function_name(GenerateUniqueName("lldb_autogen_python_bp_callback_func_",num_created_functions));
-    sstr.Printf ("def %s (frame, bp_loc, dict):", auto_generated_function_name.c_str());
+    sstr.Printf ("def %s (frame, bp_loc, internal_dict):", auto_generated_function_name.c_str());
+    
+    if (!GenerateFunction(sstr.GetData(), user_input))
+        return false;
+    
+    // Store the name of the auto-generated function to be called.
+    output.assign(auto_generated_function_name);
+    return true;
+}
+
+bool
+ScriptInterpreterPython::GenerateWatchpointCommandCallbackData (StringList &user_input, std::string& output)
+{
+    static uint32_t num_created_functions = 0;
+    user_input.RemoveBlankLines ();
+    StreamString sstr;
+
+    if (user_input.GetSize() == 0)
+        return false;
+
+    std::string auto_generated_function_name(GenerateUniqueName("lldb_autogen_python_wp_callback_func_",num_created_functions));
+    sstr.Printf ("def %s (frame, wp, internal_dict):", auto_generated_function_name.c_str());
     
     if (!GenerateFunction(sstr.GetData(), user_input))
         return false;
@@ -1764,6 +1959,59 @@
     return true;
 }
 
+bool
+ScriptInterpreterPython::WatchpointCallbackFunction 
+(
+    void *baton,
+    StoppointCallbackContext *context,
+    user_id_t watch_id
+)
+{
+    WatchpointOptions::CommandData *wp_option_data = (WatchpointOptions::CommandData *) baton;
+    const char *python_function_name = wp_option_data->script_source.c_str();
+
+    if (!context)
+        return true;
+        
+    ExecutionContext exe_ctx (context->exe_ctx_ref);
+    Target *target = exe_ctx.GetTargetPtr();
+    
+    if (!target)
+        return true;
+        
+    Debugger &debugger = target->GetDebugger();
+    ScriptInterpreter *script_interpreter = debugger.GetCommandInterpreter().GetScriptInterpreter();
+    ScriptInterpreterPython *python_interpreter = (ScriptInterpreterPython *) script_interpreter;
+    
+    if (!script_interpreter)
+        return true;
+    
+    if (python_function_name != NULL 
+        && python_function_name[0] != '\0')
+    {
+        const StackFrameSP stop_frame_sp (exe_ctx.GetFrameSP());
+        WatchpointSP wp_sp = target->GetWatchpointList().FindByID (watch_id);
+        if (wp_sp)
+        {
+            if (stop_frame_sp && wp_sp)
+            {
+                bool ret_val = true;
+                {
+                    Locker py_lock(python_interpreter);
+                    ret_val = g_swig_watchpoint_callback (python_function_name, 
+                                                          python_interpreter->m_dictionary_name.c_str(),
+                                                          stop_frame_sp, 
+                                                          wp_sp);
+                }
+                return ret_val;
+            }
+        }
+    }
+    // We currently always true so we stop in case anything goes wrong when
+    // trying to call the script function
+    return true;
+}
+
 lldb::thread_result_t
 ScriptInterpreterPython::RunEmbeddedPythonInterpreter (lldb::thread_arg_t baton)
 {
@@ -2176,6 +2424,7 @@
 {
     g_swig_init_callback = python_swig_init_callback;
     g_swig_breakpoint_callback = LLDBSwigPythonBreakpointCallbackFunction;
+    g_swig_watchpoint_callback = LLDBSwigPythonWatchpointCallbackFunction;
     g_swig_typescript_callback = LLDBSwigPythonCallTypeScript;
     g_swig_synthetic_script = LLDBSwigPythonCreateSyntheticProvider;
     g_swig_calc_children = LLDBSwigPython_CalculateNumChildren;

Modified: lldb/branches/lldb-platform-work/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp Mon Aug 13 17:30:55 2012
@@ -130,7 +130,7 @@
             {
                 if (machine == llvm::Triple::thumb || is_altnernate_isa)
                 {
-                    uint16_t thumb_opcode = data.GetU16(&data_offset);
+                    uint32_t thumb_opcode = data.GetU16(&data_offset);
                     if ((thumb_opcode & 0xe000) != 0xe000 || ((thumb_opcode & 0x1800u) == 0))
                     {
                         m_opcode.SetOpcode16 (thumb_opcode);
@@ -138,8 +138,9 @@
                     }
                     else
                     {
-                        data_offset -= 2;
-                        m_opcode.SetOpcode16_2 (data.GetU32(&data_offset));
+                        thumb_opcode <<= 16;
+                        thumb_opcode |= data.GetU16(&data_offset);
+                        m_opcode.SetOpcode16_2 (thumb_opcode);
                         m_is_valid = true;
                     }
                 }
@@ -197,7 +198,7 @@
         DataExtractor data;
         const AddressClass address_class = GetAddressClass ();
 
-        if (m_opcode.GetData(data, address_class))
+        if (m_opcode.GetData(data))
         {
             char out_string[512];
             

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=161801&r1=161800&r2=161801&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 Aug 13 17:30:55 2012
@@ -313,7 +313,7 @@
             }
 
             if (did_create_ptr)
-                *did_create_ptr = module_sp;
+                *did_create_ptr = (bool) module_sp;
         }
     }
     return module_sp;
@@ -582,7 +582,7 @@
     ExecutionContext exe_ctx (context->exe_ctx_ref);
     Process *process = exe_ctx.GetProcessPtr();
     const lldb::ABISP &abi = process->GetABI();
-    if (abi != NULL)
+    if (abi)
     {
         // Build up the value array to store the three arguments given above, then get the values from the ABI:
         

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=161801&r1=161800&r2=161801&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 Aug 13 17:30:55 2012
@@ -1133,7 +1133,7 @@
             {
                 SectionSP section_sp (m_section_list->FindSectionByID (n_sect));
                 m_section_infos[n_sect].section_sp = section_sp;
-                if (section_sp != NULL)
+                if (section_sp)
                 {
                     m_section_infos[n_sect].vm_range.SetBaseAddress (section_sp->GetFileAddress());
                     m_section_infos[n_sect].vm_range.SetByteSize (section_sp->GetByteSize());
@@ -2716,7 +2716,7 @@
                     {
                         symbol_section = section_info.GetSection (nlist.n_sect, nlist.n_value);
 
-                        if (symbol_section == NULL)
+                        if (!symbol_section)
                         {
                             // TODO: warn about this?
                             add_nlist = false;

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=161801&r1=161800&r2=161801&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 Aug 13 17:30:55 2012
@@ -256,7 +256,7 @@
         m_frame_type = eNotAValidFrame;
         return;
     }
-    if (m_thread.GetRegisterContext() == NULL)
+    if (!m_thread.GetRegisterContext())
     {
         m_frame_type = eNotAValidFrame;
         return;
@@ -896,6 +896,10 @@
     case UnwindLLDB::RegisterLocation::eRegisterInRegister:
         {
             const RegisterInfo *other_reg_info = GetRegisterInfoAtIndex(regloc.location.register_number);
+            
+            if (!other_reg_info)
+                return false;
+            
             if (IsFrameZero ()) 
             {
                 success = m_thread.GetRegisterContext()->ReadRegister (other_reg_info, value);

Modified: lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.h?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.h (original)
+++ lldb/branches/lldb-platform-work/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.h Mon Aug 13 17:30:55 2012
@@ -13,7 +13,11 @@
 #include "SymbolFileDWARF.h"
 #include <string>
 #include <vector>
+#if __cplusplus >= 201103L
+#include <unordered_map>
+#else
 #include <ext/hash_map>
+#endif
 
 class DWARFDebugPubnamesSet
 {
@@ -83,7 +87,11 @@
 
     dw_offset_t     m_offset;
     Header          m_header;
+#if __cplusplus >= 201103L
+    typedef std::unordered_multimap<const char*, uint32_t, std::hash<const char*>, CStringEqualBinaryPredicate> cstr_to_index_mmap;
+#else
     typedef __gnu_cxx::hash_multimap<const char*, uint32_t, __gnu_cxx::hash<const char*>, CStringEqualBinaryPredicate> cstr_to_index_mmap;
+#endif
     DescriptorColl  m_descriptors;
     mutable cstr_to_index_mmap m_name_to_descriptor_index;
 };

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=161801&r1=161800&r2=161801&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 Aug 13 17:30:55 2012
@@ -1012,7 +1012,7 @@
                 // this address is resolved. If they are the same, then the
                 // function for this address didn't make it into the final
                 // executable.
-                bool curr_in_final_executable = info->curr_section_sp->GetLinkedSection () != NULL;
+                bool curr_in_final_executable = (bool) info->curr_section_sp->GetLinkedSection ();
 
                 // If we are doing DWARF with debug map, then we need to carefully
                 // add each line table entry as there may be gaps as functions
@@ -6542,7 +6542,7 @@
 
                                 uint32_t block_offset = form_value.BlockData() - debug_info_data.GetDataStart();
                                 uint32_t block_length = form_value.Unsigned();
-                                location.SetOpcodeData(get_debug_info_data(), block_offset, block_length);
+                                location.CopyOpcodeData(get_debug_info_data(), block_offset, block_length);
                             }
                             else
                             {
@@ -6552,7 +6552,7 @@
                                 size_t loc_list_length = DWARFLocationList::Size(debug_loc_data, debug_loc_offset);
                                 if (loc_list_length > 0)
                                 {
-                                    location.SetOpcodeData(debug_loc_data, debug_loc_offset, loc_list_length);
+                                    location.CopyOpcodeData(debug_loc_data, debug_loc_offset, loc_list_length);
                                     assert (func_low_pc != LLDB_INVALID_ADDRESS);
                                     location.SetLocationListSlide (func_low_pc - dwarf_cu->GetBaseAddress());
                                 }

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=161801&r1=161800&r2=161801&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 Aug 13 17:30:55 2012
@@ -350,6 +350,7 @@
         context.Dump(strm, instruction);
         log->PutCString (strm.GetData ());
     }
+    memset (dst, 0, dst_len);
     return dst_len;
 }
 

Modified: lldb/branches/lldb-platform-work/source/Symbol/ClangASTType.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Symbol/ClangASTType.cpp?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Symbol/ClangASTType.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Symbol/ClangASTType.cpp Mon Aug 13 17:30:55 2012
@@ -1030,6 +1030,7 @@
                     case eFormatDecimal:
                     case eFormatEnum:
                     case eFormatHex:
+                    case eFormatHexUppercase:
                     case eFormatFloat:
                     case eFormatOctal:
                     case eFormatOSType:

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=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Symbol/UnwindPlan.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Symbol/UnwindPlan.cpp Mon Aug 13 17:30:55 2012
@@ -172,7 +172,7 @@
         s.Printf ("%s", reg_info->name);
     else
         s.Printf ("reg(%u)", GetCFARegister());
-    s.Printf ("%+3d =>", GetCFAOffset ());
+    s.Printf ("%+3d => ", GetCFAOffset ());
     for (collection::const_iterator idx = m_register_locations.begin (); idx != m_register_locations.end (); ++idx)
     {
         reg_info = unwind_plan->GetRegisterInfo (thread, idx->first);
@@ -399,21 +399,6 @@
         m_plan_valid_address_range.Dump (&s, target_sp.get(), Address::DumpStyleSectionNameOffset);
         s.EOL();
     }
-    else
-    {
-        s.PutCString ("No valid address range recorded for this UnwindPlan.\n");
-    }
-    s.Printf ("UnwindPlan register kind %d", m_register_kind);
-    switch (m_register_kind)
-    {
-        case eRegisterKindGCC:      s.PutCString (" [eRegisterKindGCC]"); break;
-        case eRegisterKindDWARF:    s.PutCString (" [eRegisterKindDWARF]"); break;
-        case eRegisterKindGeneric:  s.PutCString (" [eRegisterKindGeneric]"); break;
-        case eRegisterKindGDB:      s.PutCString (" [eRegisterKindGDB]"); break;
-        case eRegisterKindLLDB:     s.PutCString (" [eRegisterKindLLDB]"); break;
-        default: s.PutCString (" [eRegisterKind???]"); break; 
-    }
-    s.EOL();
     collection::const_iterator pos, begin = m_row_list.begin(), end = m_row_list.end();
     for (pos = begin; pos != end; ++pos)
     {

Modified: lldb/branches/lldb-platform-work/source/Target/LanguageRuntime.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Target/LanguageRuntime.cpp?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Target/LanguageRuntime.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Target/LanguageRuntime.cpp Mon Aug 13 17:30:55 2012
@@ -128,7 +128,7 @@
             if (runtime)
             {
                 m_actual_resolver_sp = runtime->CreateExceptionResolver (m_breakpoint, m_catch_bp, m_throw_bp);
-                return m_actual_resolver_sp;
+                return (bool) m_actual_resolver_sp;
             }
             else
                 return false;

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=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Target/Process.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Target/Process.cpp Mon Aug 13 17:30:55 2012
@@ -4319,7 +4319,7 @@
                             if (stop_state == eStateExited)
                                 event_to_broadcast_sp = event_sp;
                                 
-                            errors.Printf ("Execution stopped with unexpected state.");
+                            errors.Printf ("Execution stopped with unexpected state.\n");
                             return_value = eExecutionInterrupted;
                             break;
                         }
@@ -4515,7 +4515,7 @@
             StopPrivateStateThread();
             Error error;
             m_private_state_thread = backup_private_state_thread;
-            if (stopper_base_plan_sp != NULL)
+            if (stopper_base_plan_sp)
             {
                 thread->DiscardThreadPlansUpToPlan(stopper_base_plan_sp);
             }

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=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Target/StopInfo.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Target/StopInfo.cpp Mon Aug 13 17:30:55 2012
@@ -451,7 +451,7 @@
     virtual void
     PerformAction (Event *event_ptr)
     {
-        LogSP log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_BREAKPOINTS);
+        LogSP log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_WATCHPOINTS);
         // We're going to calculate if we should stop or not in some way during the course of
         // this code.  Also by default we're going to stop, so set that here.
         m_should_stop = true;
@@ -461,11 +461,11 @@
         if (wp_sp)
         {
             ExecutionContext exe_ctx (m_thread.GetStackFrameAtIndex(0));
+            Process* process = exe_ctx.GetProcessPtr();
             {
                 // 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;
@@ -491,17 +491,62 @@
                     }
                 }
             }
-            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.  
-            // If it did, when we'll set m_should_start to false and get out of here.
-            if (HasTargetRunSinceMe ())
-                m_should_stop = false;
-            
-            if (m_should_stop && !stop_requested)
+
+            // Record the snapshot of our watchpoint.
+            VariableSP var_sp;
+            ValueObjectSP valobj_sp;        
+            StackFrame *frame = exe_ctx.GetFramePtr();
+            if (frame)
             {
-                // We have been vetoed.
-                m_should_stop = false;
+                if (!wp_sp->IsWatchVariable())
+                {
+                    // We are not watching a variable, just read from the process memory for the watched location.
+                    assert (process);
+                    Error error;
+                    uint64_t val = process->ReadUnsignedIntegerFromMemory(wp_sp->GetLoadAddress(),
+                                                                          wp_sp->GetByteSize(),
+                                                                          0,
+                                                                          error);
+                    if (log)
+                    {
+                        if (error.Success())
+                            log->Printf("Watchpoint snapshot val taken: 0x%llx\n", val);
+                        else
+                            log->Printf("Watchpoint snapshot val taking failed.\n");
+                    }                        
+                    wp_sp->SetNewSnapshotVal(val);
+                }
+                else if (!wp_sp->GetWatchSpec().empty())
+                {
+                    // Use our frame to evaluate the variable expression.
+                    Error error;
+                    uint32_t expr_path_options = StackFrame::eExpressionPathOptionCheckPtrVsMember |
+                                                 StackFrame::eExpressionPathOptionsAllowDirectIVarAccess;
+                    valobj_sp = frame->GetValueForVariableExpressionPath (wp_sp->GetWatchSpec().c_str(), 
+                                                                          eNoDynamicValues, 
+                                                                          expr_path_options,
+                                                                          var_sp,
+                                                                          error);
+                    if (valobj_sp)
+                    {
+                        // We're in business.
+                        StreamString ss;
+                        ValueObject::DumpValueObject(ss, valobj_sp.get());
+                        wp_sp->SetNewSnapshot(ss.GetString());
+                    }
+                    else
+                        wp_sp->SetNewSnapshot("snapshot attempt failed.");
+
+                    if (log)
+                        log->Printf("Watchpoint snapshot taken: '%s'\n", wp_sp->GetNewSnapshot().c_str());
+                }
+
+                // Now dump the snapshots we have taken.
+                Debugger &debugger = exe_ctx.GetTargetRef().GetDebugger();
+                StreamSP output_sp = debugger.GetAsyncOutputStream ();
+                wp_sp->DumpSnapshots("!!! ", output_sp.get());
+                //output_sp->EOL();
+                output_sp->Flush();
             }
 
             if (m_should_stop && wp_sp->GetConditionText() != NULL)
@@ -571,6 +616,23 @@
                     m_should_stop = true;
                 }
             }
+
+            // If the condition says to stop, we run the callback to further decide whether to stop.
+            if (m_should_stop)
+            {
+                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.  
+                // If it did, when we'll set m_should_stop to false and get out of here.
+                if (HasTargetRunSinceMe ())
+                    m_should_stop = false;
+                
+                if (m_should_stop && !stop_requested)
+                {
+                    // We have been vetoed by the callback mechanism.
+                    m_should_stop = false;
+                }
+            }
         }
         else
         {

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=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Target/Thread.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Target/Thread.cpp Mon Aug 13 17:30:55 2012
@@ -136,7 +136,7 @@
 bool
 Thread::ThreadStoppedForAReason (void)
 {
-    return GetPrivateStopReason () != NULL;
+    return (bool) GetPrivateStopReason ();
 }
 
 bool

Modified: lldb/branches/lldb-platform-work/source/Target/ThreadPlanCallFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Target/ThreadPlanCallFunction.cpp?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Target/ThreadPlanCallFunction.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Target/ThreadPlanCallFunction.cpp Mon Aug 13 17:30:55 2012
@@ -398,7 +398,7 @@
         // If we want to discard the plan, then we say we explain the stop
         // but if we are going to be discarded, let whoever is above us
         // explain the stop.
-        if (m_subplan_sp != NULL)
+        if (m_subplan_sp)
         {
             if (m_discard_on_error)
             {

Modified: lldb/branches/lldb-platform-work/source/Target/ThreadPlanStepUntil.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Target/ThreadPlanStepUntil.cpp?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Target/ThreadPlanStepUntil.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Target/ThreadPlanStepUntil.cpp Mon Aug 13 17:30:55 2012
@@ -317,7 +317,7 @@
     // we will stop.
 
     StopInfoSP stop_info_sp = GetPrivateStopReason();
-    if (stop_info_sp == NULL || stop_info_sp->GetStopReason() == eStopReasonNone)
+    if (!stop_info_sp || stop_info_sp->GetStopReason() == eStopReasonNone)
         return false;
 
     AnalyzeStop();

Modified: lldb/branches/lldb-platform-work/test/dotest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/test/dotest.py?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/test/dotest.py (original)
+++ lldb/branches/lldb-platform-work/test/dotest.py Mon Aug 13 17:30:55 2012
@@ -664,8 +664,9 @@
         #
         # where the make directory contains the Makefile.rules file.
         if len(testdirs) != 1 or os.path.basename(orig_testdirs[0]) != 'test':
+            scriptdir = os.path.dirname(__file__)
             # Don't copy the .svn stuffs.
-            copytree('make', os.path.join(rdir, 'make'),
+            copytree(os.path.join(scriptdir, 'make'), os.path.join(rdir, 'make'),
                      ignore=ignore_patterns('.svn'))
 
     #print "testdirs:", testdirs
@@ -748,7 +749,7 @@
     sys.path.append(scriptPath)
     sys.path.append(pluginPath)
     sys.path.append(pexpectPath)
-    
+
     # This is our base name component.
     base = os.path.abspath(os.path.join(scriptPath, os.pardir))
 
@@ -814,7 +815,7 @@
     else:
         os.environ["LLDB_EXEC"] = lldbExec
         #print "The 'lldb' from PATH env variable", lldbExec
-    
+
     if os.path.isdir(os.path.join(base, '.svn')):
         pipe = subprocess.Popen(["svn", "info", base], stdout = subprocess.PIPE)
         svn_info = pipe.stdout.read()
@@ -829,7 +830,7 @@
     # The '-i' option is used to skip looking for lldb.py in the build tree.
     if ignore:
         return
-        
+
     dbgPath  = os.path.join(base, *(xcode3_build_dir + dbg + python_resource_dir))
     dbgPath2 = os.path.join(base, *(xcode4_build_dir + dbg + python_resource_dir))
     relPath  = os.path.join(base, *(xcode3_build_dir + rel + python_resource_dir))
@@ -945,7 +946,7 @@
             # and no '-g' option is specified
             if filters and fs4all and not filtered:
                 continue
-                
+
             # Add either the filtered test case(s) (which is done before) or the entire test class.
             if not filterspec or not filtered:
                 # A simple case of just the module name.  Also the failover case
@@ -1230,7 +1231,7 @@
                     new_stdout.close()
                 new_stdout = open("%s.%s" % (old_stdout.name, configPostfix), "w")
                 sys.stdout = new_stdout
- 
+
             # If we specified a relocated directory to run the test suite, do
             # the extra housekeeping to copy the testdirs to a configStringified
             # directory and to update sys.path before invoking the test runner.
@@ -1246,7 +1247,7 @@
                     rmtree(newrdir)
                 copytree(rdir, newrdir, ignore=ignore_patterns('*.pyc', '*.o', '*.d'))
 
-               # Update the LLDB_TEST environment variable to reflect new top
+                # Update the LLDB_TEST environment variable to reflect new top
                 # level test directory.
                 #
                 # See also lldbtest.TestBase.setUpClass(cls).
@@ -1374,7 +1375,7 @@
                                                   verbosity=(1 if progress_bar else verbose),
                                                   failfast=failfast,
                                                   resultclass=LLDBTestResult).run(suite)
-        
+
 
 if sdir_has_content:
     sys.stderr.write("Session logs for test failures/errors/unexpected successes"

Modified: lldb/branches/lldb-platform-work/test/functionalities/abbreviation/TestAbbreviations.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/test/functionalities/abbreviation/TestAbbreviations.py?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/test/functionalities/abbreviation/TestAbbreviations.py (original)
+++ lldb/branches/lldb-platform-work/test/functionalities/abbreviation/TestAbbreviations.py Mon Aug 13 17:30:55 2012
@@ -136,7 +136,7 @@
                     patterns = [ "Process .* stopped",
                                  "thread #1:",
                                  "a.out",
-                                 "sum\(int, int\)",
+                                 "sum\(a=1238, b=78392\)",
                                  "at main.cpp\:25", 
                                  "stop reason = breakpoint 2.1" ])
 

Modified: lldb/branches/lldb-platform-work/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py (original)
+++ lldb/branches/lldb-platform-work/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py Mon Aug 13 17:30:55 2012
@@ -86,7 +86,7 @@
                           "here.close()"])
         self.expect("breakpoint command list 3", "Breakpoint 3 command ok",
             substrs = ["Breakpoint commands:",
-                          "bktptcmd.function(frame, bp_loc, dict)"])
+                          "bktptcmd.function(frame, bp_loc, internal_dict)"])
 
         self.runCmd("command script import --allow-reload ./bktptcmd.py")
 

Modified: lldb/branches/lldb-platform-work/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py (original)
+++ lldb/branches/lldb-platform-work/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py Mon Aug 13 17:30:55 2012
@@ -48,6 +48,7 @@
         self.line2 = line_number('main.c', '// b(2) -> c(2) Find the call site of b(2).')
         self.line3 = line_number('main.c', '// a(3) -> c(3) Find the call site of c(3).')
         self.line4 = line_number('main.c', '// a(3) -> c(3) Find the call site of a(3).')
+        self.line5 = line_number('main.c', '// Find the call site of c in main.')
 
     def breakpoint_ignore_count(self):
         """Exercise breakpoint ignore count with 'breakpoint set -i <count>'."""
@@ -78,6 +79,28 @@
             patterns = ["frame #0.*main.c:%d" % self.line1,
                         "frame #2.*main.c:%d" % self.line2])
 
+        # continue -i 1 is the same as setting the ignore count to 1 again, try that:
+        # Now run the program.
+        self.runCmd("process continue -i 1", RUN_SUCCEEDED)
+
+        # The process should be stopped at this point.
+        self.expect("process status", PROCESS_STOPPED,
+            patterns = ['Process .* stopped'])
+
+        # Also check the hit count, which should be 2, due to ignore count of 1.
+        self.expect("breakpoint list -f", BREAKPOINT_HIT_THRICE,
+            substrs = ["resolved = 1",
+                       "hit count = 4"])
+
+        # The frame #0 should correspond to main.c:37, the executable statement
+        # in function name 'c'.  And frame #2 should point to main.c:45.
+        self.expect("thread backtrace", STOPPED_DUE_TO_BREAKPOINT_IGNORE_COUNT,
+            #substrs = ["stop reason = breakpoint"],
+            patterns = ["frame #0.*main.c:%d" % self.line1,
+                        "frame #1.*main.c:%d" % self.line5])
+
+        
+
     def breakpoint_ignore_count_python(self):
         """Use Python APIs to set breakpoint ignore count."""
         exe = os.path.join(os.getcwd(), "a.out")

Modified: lldb/branches/lldb-platform-work/test/functionalities/breakpoint/breakpoint_ignore_count/main.c
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/test/functionalities/breakpoint/breakpoint_ignore_count/main.c?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/test/functionalities/breakpoint/breakpoint_ignore_count/main.c (original)
+++ lldb/branches/lldb-platform-work/test/functionalities/breakpoint/breakpoint_ignore_count/main.c Mon Aug 13 17:30:55 2012
@@ -48,5 +48,7 @@
     int A3 = a(3);  // a(3) -> c(3) Find the call site of a(3).
     printf("a(3) returns %d\n", A3);
     
+    int C1 = c(5); // Find the call site of c in main.
+    printf ("c(5) returns %d\n", C1);
     return 0;
 }

Modified: lldb/branches/lldb-platform-work/test/functionalities/completion/TestCompletion.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/test/functionalities/completion/TestCompletion.py?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/test/functionalities/completion/TestCompletion.py (original)
+++ lldb/branches/lldb-platform-work/test/functionalities/completion/TestCompletion.py Mon Aug 13 17:30:55 2012
@@ -28,6 +28,10 @@
         self.complete_from_to('process print hello\\', 'process print hello\\',
                               turn_off_re_match=True)
 
+    def test_watchpoint_command_dash_w_space(self):
+        """Test that 'watchpoint command' completes to ['Available completions:', 'add', 'delete', 'list']."""
+        self.complete_from_to('watchpoint command', ['Available completions:', 'add', 'delete', 'list'])
+
     def test_watchpoint_set_variable_dash_w(self):
         """Test that 'watchpoint set variable -w' completes to 'watchpoint set variable -w '."""
         self.complete_from_to('watchpoint set variable -w', 'watchpoint set variable -w ')

Modified: lldb/branches/lldb-platform-work/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py (original)
+++ lldb/branches/lldb-platform-work/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py Mon Aug 13 17:30:55 2012
@@ -119,9 +119,7 @@
             substrs = ['low bits are',
                        'tgt is 6'])
 
-        self.runCmd("type summary add --summary-string \"${*var[0-1]}\" -x \"int \[[0-9]\]\"")
-
-        self.expect("frame variable int_array",
+        self.expect("frame variable int_array --summary-string \"${*var[0-1]}\"",
             substrs = ['3'])
 
         self.runCmd("type summary clear")
@@ -162,21 +160,25 @@
 
         self.runCmd("type summary clear")
 
-        self.runCmd("type summary add --summary-string \"${var[0][0-2]%hex}\" -x \"int \[[0-9]\]\"")
-
-        self.expect("frame variable int_array",
+        self.expect("frame variable int_array --summary-string \"${var[0][0-2]%hex}\"",
             substrs = ['0x',
                        '7'])
 
         self.runCmd("type summary clear")
 
         self.runCmd("type summary add --summary-string \"${*var[].x[0-3]%hex} is a bitfield on a set of integers\" -x \"SimpleWithPointers \[[0-9]\]\"")
-        self.runCmd("type summary add --summary-string \"${*var.sp.x[0-2]} are low bits of integer ${*var.sp.x}. If I pretend it is an array I get ${var.sp.x[0-5]}\" Couple")
 
-        self.expect("frame variable couple",
+        self.expect("frame variable couple --summary-string \"${*var.sp.x[0-2]} are low bits of integer ${*var.sp.x}. If I pretend it is an array I get ${var.sp.x[0-5]}\"",
             substrs = ['1 are low bits of integer 9.',
                        'If I pretend it is an array I get [9,'])
 
+        # if the summary has an error, we still display the value
+        self.expect("frame variable couple --summary-string \"${*var.sp.foo[0-2]\"",
+            substrs = ['(Couple) couple =  {','sp = {','z =','"X"'])
+
+
+        self.runCmd("type summary add --summary-string \"${*var.sp.x[0-2]} are low bits of integer ${*var.sp.x}. If I pretend it is an array I get ${var.sp.x[0-5]}\" Couple")
+
         self.expect("frame variable sparray",
             substrs = ['[0x0000000f,0x0000000c,0x00000009]'])
         

Modified: lldb/branches/lldb-platform-work/test/functionalities/data-formatter/data-formatter-cpp/main.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/test/functionalities/data-formatter/data-formatter-cpp/main.cpp?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/test/functionalities/data-formatter/data-formatter-cpp/main.cpp (original)
+++ lldb/branches/lldb-platform-work/test/functionalities/data-formatter/data-formatter-cpp/main.cpp Mon Aug 13 17:30:55 2012
@@ -96,7 +96,10 @@
     
     Point iAmSomewhere(4,6);
     
-	i_am_cool *cool_pointer = new i_am_cool(3,-3.141592,'E');
+	i_am_cool *cool_pointer = (i_am_cool*)malloc(sizeof(i_am_cool)*3);
+	cool_pointer[0] = i_am_cool(3,-3.141592,'E');
+	cool_pointer[1] = i_am_cool(0,-3.141592,'E');
+	cool_pointer[2] = i_am_cool(0,-3.141592,'E');
     
     i_am_cool cool_array[5];
     

Modified: lldb/branches/lldb-platform-work/test/lang/objc/foundation/TestObjCMethods2.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/test/lang/objc/foundation/TestObjCMethods2.py?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/test/lang/objc/foundation/TestObjCMethods2.py (original)
+++ lldb/branches/lldb-platform-work/test/lang/objc/foundation/TestObjCMethods2.py Mon Aug 13 17:30:55 2012
@@ -225,7 +225,7 @@
         self.runCmd("run", RUN_SUCCEEDED)
 
         self.expect("po [NSError errorWithDomain:@\"Hello\" code:35 userInfo:nil]",
-            patterns = ["\(id\) \$.* = ", "Error Domain=Hello", "Code=35", "be completed."])
+            substrs = ["$", "= 0x", "Error Domain=Hello", "Code=35", "be completed."])
         self.runCmd("process continue")
 
     def NSError_p(self):

Modified: lldb/branches/lldb-platform-work/test/lang/objc/print-obj/TestPrintObj.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/test/lang/objc/print-obj/TestPrintObj.py?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/test/lang/objc/print-obj/TestPrintObj.py (original)
+++ lldb/branches/lldb-platform-work/test/lang/objc/print-obj/TestPrintObj.py Mon Aug 13 17:30:55 2012
@@ -94,7 +94,7 @@
                 break
 
         self.expect("po lock_me", OBJECT_PRINTED_CORRECTLY,
-            substrs = ['LockMe *', 'I am pretty special.'])
+            substrs = ['I am pretty special.'])
 
 
 if __name__ == '__main__':

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=161801&r1=161800&r2=161801&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 Aug 13 17:30:55 2012
@@ -480,7 +480,7 @@
 					i386,
 				);
 				COPY_PHASE_STRIP = NO;
-				CURRENT_PROJECT_VERSION = 191;
+				CURRENT_PROJECT_VERSION = 192;
 				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
@@ -501,7 +501,7 @@
 					armv7s,
 				);
 				"ARCHS[sdk=macosx*]" = "$(ARCHS_STANDARD_64_BIT)";
-				CURRENT_PROJECT_VERSION = 191;
+				CURRENT_PROJECT_VERSION = 192;
 				DEAD_CODE_STRIPPING = YES;
 				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
@@ -527,7 +527,7 @@
 					x86_64,
 					i386,
 				);
-				CURRENT_PROJECT_VERSION = 191;
+				CURRENT_PROJECT_VERSION = 192;
 				DEAD_CODE_STRIPPING = YES;
 				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
@@ -546,7 +546,7 @@
 			buildSettings = {
 				"CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*]" = "source/debugserver-entitlements.plist";
 				COPY_PHASE_STRIP = YES;
-				CURRENT_PROJECT_VERSION = 191;
+				CURRENT_PROJECT_VERSION = 192;
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				FRAMEWORK_SEARCH_PATHS = $SDKROOT/System/Library/PrivateFrameworks;
 				"FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*][arch=*]" = (
@@ -599,7 +599,7 @@
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "-";
 				"CODE_SIGN_IDENTITY[sdk=macosx*]" = lldb_codesign;
 				COPY_PHASE_STRIP = YES;
-				CURRENT_PROJECT_VERSION = 191;
+				CURRENT_PROJECT_VERSION = 192;
 				FRAMEWORK_SEARCH_PATHS = $SDKROOT/System/Library/PrivateFrameworks;
 				"FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*][arch=*]" = (
 					"$(SDKROOT)/System/Library/PrivateFrameworks",
@@ -651,7 +651,7 @@
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "-";
 				"CODE_SIGN_IDENTITY[sdk=macosx*]" = lldb_codesign;
 				COPY_PHASE_STRIP = YES;
-				CURRENT_PROJECT_VERSION = 191;
+				CURRENT_PROJECT_VERSION = 192;
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				FRAMEWORK_SEARCH_PATHS = $SDKROOT/System/Library/PrivateFrameworks;
 				"FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*][arch=*]" = (

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=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/www/python-reference.html (original)
+++ lldb/branches/lldb-platform-work/www/python-reference.html Mon Aug 13 17:30:55 2012
@@ -300,12 +300,12 @@
                     debugging requirements. </p>
                 <p>To write a python function that implements a new LDB command define the function to take four arguments as follows:</p>
                         
-        <code><pre><tt>def command_function(<b>debugger</b>, <b>command</b>, <b>result</b>, <b>dict</b>):
+        <code><pre><tt>def command_function(<b>debugger</b>, <b>command</b>, <b>result</b>, <b>internal_dict</b>):
           <font color=green># Your code goes here</font>
         </tt></pre></code>
 
 		Optionally, you can also provide a Python docstring, and LLDB will use it when providing help for your command, as in:
-        <code><pre><tt>def command_function(<b>debugger</b>, <b>command</b>, <b>result</b>, <b>dict</b>):
+        <code><pre><tt>def command_function(<b>debugger</b>, <b>command</b>, <b>result</b>, <b>internal_dict</b>):
           <font color=green>"""This command takes a lot of options and does many fancy things"""</font>    
           <font color=green># Your code goes here</font>
         </tt></pre></code>
@@ -357,7 +357,7 @@
         </tr>
         <tr>
             <td class="content">
-                <b>dict</b>
+                <b>internal_dict</b>
             </td>
             <td class="content">
                 <b>python dict object</b>
@@ -373,11 +373,11 @@
           don't have to change your PYTHONPATH for temporary scripts.  It also has another convenience
           that if your new script module has a function of the form:</p>
 
-<code><pre><tt>def __lldb_init_module(<b>debugger</b>, <b>dict</b>):
+<code><pre><tt>def __lldb_init_module(<b>debugger</b>, <b>internal_dict</b>):
     <font color=green># Command Initialization code goes here</font>
 </tt></pre></code>
 
-        <p>where <b>debugger</b> and <b>dict</b> are as above, that function will get run when the module is loaded
+        <p>where <b>debugger</b> and <b>internal_dict</b> are as above, that function will get run when the module is loaded
            allowing you to add whatever commands you want into the current debugger. Note that
            this function will only be run when using the LLDB comand <b>command script import</b>,
            it will not get run if anyone imports your module from another module. 
@@ -410,11 +410,11 @@
 import optparse
 import shlex
 
-def ls(debugger, command, result, dict):
+def ls(debugger, command, result, internal_dict):
     result.PutCString(commands.getoutput('/bin/ls %s' % command))
 
 <font color=green># And the initialization code to add your commands </font>
-def __lldb_init_module(debugger, dict):
+def __lldb_init_module(debugger, internal_dict):
     debugger.HandleCommand('command script add -f ls.ls ls')
     print 'The "ls" python command has been installed and is ready for use.'
 </tt></pre></code>

Modified: lldb/branches/lldb-platform-work/www/varformats.html
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/www/varformats.html?rev=161801&r1=161800&r2=161801&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/www/varformats.html (original)
+++ lldb/branches/lldb-platform-work/www/varformats.html Mon Aug 13 17:30:55 2012
@@ -819,7 +819,7 @@
                         <td class="content">
                             <b>(lldb)</b> type summary add -P Rectangle<br/>
                             Enter your Python command(s). Type 'DONE' to end.<br/>
-def function (valobj,dict):<br/>
+def function (valobj,internal_dict):<br/>
          height_val = valobj.GetChildMemberWithName('height')<br/>
          width_val = valobj.GetChildMemberWithName('width')<br/>
          height = height_val.GetValueAsUnsigned(0)<br/>
@@ -841,9 +841,9 @@
             the LLDB <a href="docs.html">doxygen documentation</a> when it becomes available.</p>
             
             <p>As a brief introduction, your script is encapsulated into a function that is
-            passed two parameters: <code>valobj</code> and <code>dict</code>.</p>
+            passed two parameters: <code>valobj</code> and <code>internal_dict</code>.</p>
             
-            <p><code>dict</code> is an internal support parameter used by LLDB and you should
+            <p><code>internal_dict</code> is an internal support parameter used by LLDB and you should
             not touch it.<br/><code>valobj</code> is the object encapsulating the actual
             variable being displayed, and its type is <a href="http://llvm.org/svn/llvm-project/lldb/trunk/include/lldb/API/SBValue.h">SBValue</a>.
  			Out of the many possible operations on an SBValue, the basic one is retrieve the children objects
@@ -1029,7 +1029,7 @@
 			  must be implemented by the Python class):</p>
 		<code>
 			<font color=blue>class</font> SyntheticChildrenProvider:<br/>
-			    <font color=blue>def</font> __init__(self, valobj, dict):<br/>
+			    <font color=blue>def</font> __init__(self, valobj, internal_dict):<br/>
 			        <i>this call should initialize the Python object using valobj as the variable to provide synthetic children for</i> <br/>
 			    <font color=blue>def</font> num_children(self): <br/>
 			        <i>this call should return the number of children that you want your object to have</i> <br/>





More information about the lldb-commits mailing list