[Lldb-commits] [lldb] r161774 - in /lldb/branches/apple/python-GIL: ./ examples/darwin/heap_find/ examples/darwin/heap_find/heap/ include/lldb/ include/lldb/Breakpoint/ include/lldb/Core/ include/lldb/Expression/ include/lldb/Interpreter/ include/lldb/Target/ lldb.xcodeproj/ scripts/ scripts/Python/ source/API/ source/Breakpoint/ source/Commands/ source/Core/ source/Expression/ source/Interpreter/ source/Plugins/DynamicLoader/MacOSX-DYLD/ source/Plugins/ObjectFile/Mach-O/ source/Plugins/Process/Utility/ source/Plugins/...

Enrico Granata egranata at apple.com
Mon Aug 13 11:48:10 PDT 2012


Author: enrico
Date: Mon Aug 13 13:48:10 2012
New Revision: 161774

URL: http://llvm.org/viewvc/llvm-project?rev=161774&view=rev
Log:
Merging ToT into the GIL branch

Added:
    lldb/branches/apple/python-GIL/include/lldb/Breakpoint/WatchpointOptions.h
      - copied unchanged from r161768, lldb/trunk/include/lldb/Breakpoint/WatchpointOptions.h
    lldb/branches/apple/python-GIL/source/Breakpoint/WatchpointOptions.cpp
      - copied unchanged from r161768, lldb/trunk/source/Breakpoint/WatchpointOptions.cpp
    lldb/branches/apple/python-GIL/source/Commands/CommandObjectWatchpointCommand.cpp
      - copied unchanged from r161768, lldb/trunk/source/Commands/CommandObjectWatchpointCommand.cpp
    lldb/branches/apple/python-GIL/source/Commands/CommandObjectWatchpointCommand.h
      - copied unchanged from r161768, lldb/trunk/source/Commands/CommandObjectWatchpointCommand.h
    lldb/branches/apple/python-GIL/test/functionalities/data-formatter/rdar-10449092/
      - copied from r161768, lldb/trunk/test/functionalities/data-formatter/rdar-10449092/
    lldb/branches/apple/python-GIL/test/functionalities/data-formatter/rdar-10449092/Makefile
      - copied unchanged from r161768, lldb/trunk/test/functionalities/data-formatter/rdar-10449092/Makefile
    lldb/branches/apple/python-GIL/test/functionalities/data-formatter/rdar-10449092/Test-rdar-10449092.py
      - copied unchanged from r161768, lldb/trunk/test/functionalities/data-formatter/rdar-10449092/Test-rdar-10449092.py
    lldb/branches/apple/python-GIL/test/functionalities/data-formatter/rdar-10449092/main.cpp
      - copied unchanged from r161768, lldb/trunk/test/functionalities/data-formatter/rdar-10449092/main.cpp
    lldb/branches/apple/python-GIL/test/functionalities/watchpoint/watchpoint_commands/command/
      - copied from r161768, lldb/trunk/test/functionalities/watchpoint/watchpoint_commands/command/
    lldb/branches/apple/python-GIL/test/functionalities/watchpoint/watchpoint_commands/command/Makefile
      - copied unchanged from r161768, lldb/trunk/test/functionalities/watchpoint/watchpoint_commands/command/Makefile
    lldb/branches/apple/python-GIL/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandLLDB.py
      - copied unchanged from r161768, lldb/trunk/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandLLDB.py
    lldb/branches/apple/python-GIL/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py
      - copied unchanged from r161768, lldb/trunk/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py
    lldb/branches/apple/python-GIL/test/functionalities/watchpoint/watchpoint_commands/command/main.cpp
      - copied unchanged from r161768, lldb/trunk/test/functionalities/watchpoint/watchpoint_commands/command/main.cpp
Modified:
    lldb/branches/apple/python-GIL/   (props changed)
    lldb/branches/apple/python-GIL/examples/darwin/heap_find/heap.py
    lldb/branches/apple/python-GIL/examples/darwin/heap_find/heap/heap_find.cpp
    lldb/branches/apple/python-GIL/include/lldb/Breakpoint/BreakpointOptions.h
    lldb/branches/apple/python-GIL/include/lldb/Breakpoint/Watchpoint.h
    lldb/branches/apple/python-GIL/include/lldb/Core/ConnectionFileDescriptor.h
    lldb/branches/apple/python-GIL/include/lldb/Core/Debugger.h
    lldb/branches/apple/python-GIL/include/lldb/Core/ValueObject.h
    lldb/branches/apple/python-GIL/include/lldb/Expression/DWARFExpression.h
    lldb/branches/apple/python-GIL/include/lldb/Interpreter/NamedOptionValue.h
    lldb/branches/apple/python-GIL/include/lldb/Interpreter/OptionGroupVariable.h
    lldb/branches/apple/python-GIL/include/lldb/Interpreter/ScriptInterpreter.h
    lldb/branches/apple/python-GIL/include/lldb/Interpreter/ScriptInterpreterPython.h
    lldb/branches/apple/python-GIL/include/lldb/Target/ExecutionContext.h
    lldb/branches/apple/python-GIL/include/lldb/lldb-enumerations.h
    lldb/branches/apple/python-GIL/include/lldb/lldb-forward.h
    lldb/branches/apple/python-GIL/include/lldb/lldb-private-interfaces.h
    lldb/branches/apple/python-GIL/lldb.xcodeproj/project.pbxproj
    lldb/branches/apple/python-GIL/llvm.zip
    lldb/branches/apple/python-GIL/scripts/Python/python-wrapper.swig
    lldb/branches/apple/python-GIL/scripts/build-llvm.pl
    lldb/branches/apple/python-GIL/scripts/lldb.swig
    lldb/branches/apple/python-GIL/source/API/SBBreakpoint.cpp
    lldb/branches/apple/python-GIL/source/API/SBWatchpoint.cpp
    lldb/branches/apple/python-GIL/source/Breakpoint/Watchpoint.cpp
    lldb/branches/apple/python-GIL/source/Commands/CommandObjectDisassemble.cpp
    lldb/branches/apple/python-GIL/source/Commands/CommandObjectExpression.cpp
    lldb/branches/apple/python-GIL/source/Commands/CommandObjectFrame.cpp
    lldb/branches/apple/python-GIL/source/Commands/CommandObjectMemory.cpp
    lldb/branches/apple/python-GIL/source/Commands/CommandObjectProcess.cpp
    lldb/branches/apple/python-GIL/source/Commands/CommandObjectWatchpoint.cpp
    lldb/branches/apple/python-GIL/source/Core/ConnectionFileDescriptor.cpp
    lldb/branches/apple/python-GIL/source/Core/DataExtractor.cpp
    lldb/branches/apple/python-GIL/source/Core/Debugger.cpp
    lldb/branches/apple/python-GIL/source/Core/FormatManager.cpp
    lldb/branches/apple/python-GIL/source/Core/ValueObject.cpp
    lldb/branches/apple/python-GIL/source/Expression/ClangExpressionDeclMap.cpp
    lldb/branches/apple/python-GIL/source/Expression/ClangExpressionParser.cpp
    lldb/branches/apple/python-GIL/source/Expression/ClangFunction.cpp
    lldb/branches/apple/python-GIL/source/Expression/ClangUserExpression.cpp
    lldb/branches/apple/python-GIL/source/Expression/DWARFExpression.cpp
    lldb/branches/apple/python-GIL/source/Expression/IRInterpreter.cpp
    lldb/branches/apple/python-GIL/source/Interpreter/CommandInterpreter.cpp
    lldb/branches/apple/python-GIL/source/Interpreter/OptionGroupVariable.cpp
    lldb/branches/apple/python-GIL/source/Interpreter/ScriptInterpreter.cpp
    lldb/branches/apple/python-GIL/source/Interpreter/ScriptInterpreterPython.cpp
    lldb/branches/apple/python-GIL/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
    lldb/branches/apple/python-GIL/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
    lldb/branches/apple/python-GIL/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
    lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.h
    lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
    lldb/branches/apple/python-GIL/source/Symbol/ClangASTType.cpp
    lldb/branches/apple/python-GIL/source/Symbol/UnwindPlan.cpp
    lldb/branches/apple/python-GIL/source/Target/LanguageRuntime.cpp
    lldb/branches/apple/python-GIL/source/Target/Process.cpp
    lldb/branches/apple/python-GIL/source/Target/StopInfo.cpp
    lldb/branches/apple/python-GIL/source/Target/Thread.cpp
    lldb/branches/apple/python-GIL/source/Target/ThreadPlanCallFunction.cpp
    lldb/branches/apple/python-GIL/source/Target/ThreadPlanStepUntil.cpp
    lldb/branches/apple/python-GIL/test/dotest.py
    lldb/branches/apple/python-GIL/test/functionalities/abbreviation/TestAbbreviations.py
    lldb/branches/apple/python-GIL/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py
    lldb/branches/apple/python-GIL/test/functionalities/breakpoint/breakpoint_ignore_count/main.c
    lldb/branches/apple/python-GIL/test/functionalities/completion/TestCompletion.py
    lldb/branches/apple/python-GIL/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
    lldb/branches/apple/python-GIL/test/functionalities/data-formatter/data-formatter-cpp/main.cpp
    lldb/branches/apple/python-GIL/test/lang/objc/foundation/TestObjCMethods2.py
    lldb/branches/apple/python-GIL/test/lang/objc/print-obj/TestPrintObj.py

Propchange: lldb/branches/apple/python-GIL/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Aug 13 13:48:10 2012
@@ -1 +1 @@
-/lldb/trunk:156467-161467
+/lldb/trunk:156467-161467,161483-161768

Modified: lldb/branches/apple/python-GIL/examples/darwin/heap_find/heap.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/examples/darwin/heap_find/heap.py?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/examples/darwin/heap_find/heap.py (original)
+++ lldb/branches/apple/python-GIL/examples/darwin/heap_find/heap.py Mon Aug 13 13:48:10 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/apple/python-GIL/examples/darwin/heap_find/heap/heap_find.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/examples/darwin/heap_find/heap/heap_find.cpp?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/examples/darwin/heap_find/heap/heap_find.cpp (original)
+++ lldb/branches/apple/python-GIL/examples/darwin/heap_find/heap/heap_find.cpp Mon Aug 13 13:48:10 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/apple/python-GIL/include/lldb/Breakpoint/BreakpointOptions.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Breakpoint/BreakpointOptions.h?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Breakpoint/BreakpointOptions.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Breakpoint/BreakpointOptions.h Mon Aug 13 13:48:10 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/apple/python-GIL/include/lldb/Breakpoint/Watchpoint.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Breakpoint/Watchpoint.h?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Breakpoint/Watchpoint.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Breakpoint/Watchpoint.h Mon Aug 13 13:48:10 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,8 +53,6 @@
     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        GetDescription (Stream *s, lldb::DescriptionLevel level);
@@ -63,6 +62,43 @@
     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 +114,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);
@@ -111,11 +147,11 @@
                 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).
     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/apple/python-GIL/include/lldb/Core/ConnectionFileDescriptor.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Core/ConnectionFileDescriptor.h?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Core/ConnectionFileDescriptor.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Core/ConnectionFileDescriptor.h Mon Aug 13 13:48:10 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/apple/python-GIL/include/lldb/Core/Debugger.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Core/Debugger.h?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Core/Debugger.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Core/Debugger.h Mon Aug 13 13:48:10 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/apple/python-GIL/include/lldb/Core/ValueObject.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Core/ValueObject.h?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Core/ValueObject.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Core/ValueObject.h Mon Aug 13 13:48:10 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/apple/python-GIL/include/lldb/Expression/DWARFExpression.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Expression/DWARFExpression.h?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Expression/DWARFExpression.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Expression/DWARFExpression.h Mon Aug 13 13:48:10 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/apple/python-GIL/include/lldb/Interpreter/NamedOptionValue.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Interpreter/NamedOptionValue.h?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Interpreter/NamedOptionValue.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Interpreter/NamedOptionValue.h Mon Aug 13 13:48:10 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/apple/python-GIL/include/lldb/Interpreter/OptionGroupVariable.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Interpreter/OptionGroupVariable.h?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Interpreter/OptionGroupVariable.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Interpreter/OptionGroupVariable.h Mon Aug 13 13:48:10 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/apple/python-GIL/include/lldb/Interpreter/ScriptInterpreter.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Interpreter/ScriptInterpreter.h?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Interpreter/ScriptInterpreter.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Interpreter/ScriptInterpreter.h Mon Aug 13 13:48:10 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/apple/python-GIL/include/lldb/Interpreter/ScriptInterpreterPython.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Interpreter/ScriptInterpreterPython.h?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Interpreter/ScriptInterpreterPython.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Interpreter/ScriptInterpreterPython.h Mon Aug 13 13:48:10 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/apple/python-GIL/include/lldb/Target/ExecutionContext.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/Target/ExecutionContext.h?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/Target/ExecutionContext.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/Target/ExecutionContext.h Mon Aug 13 13:48:10 2012
@@ -729,7 +729,7 @@
     bool
     HasTargetScope () const
     {
-        return m_target_sp;
+        return (bool) m_target_sp;
     }
 
     //------------------------------------------------------------------

Modified: lldb/branches/apple/python-GIL/include/lldb/lldb-enumerations.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/lldb-enumerations.h?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/lldb-enumerations.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/lldb-enumerations.h Mon Aug 13 13:48:10 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/apple/python-GIL/include/lldb/lldb-forward.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/lldb-forward.h?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/lldb-forward.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/lldb-forward.h Mon Aug 13 13:48:10 2012
@@ -235,6 +235,7 @@
 class   VariableList;
 class   Watchpoint;
 class   WatchpointList;
+class   WatchpointOptions;
 struct  LineEntry;
 
 } // namespace lldb_private

Modified: lldb/branches/apple/python-GIL/include/lldb/lldb-private-interfaces.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/include/lldb/lldb-private-interfaces.h?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/include/lldb/lldb-private-interfaces.h (original)
+++ lldb/branches/apple/python-GIL/include/lldb/lldb-private-interfaces.h Mon Aug 13 13:48:10 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/apple/python-GIL/lldb.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/lldb.xcodeproj/project.pbxproj?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/branches/apple/python-GIL/lldb.xcodeproj/project.pbxproj Mon Aug 13 13:48:10 2012
@@ -520,6 +520,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 */; };
@@ -1557,6 +1559,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>"; };
@@ -2599,6 +2605,8 @@
 				B27318431416AC43006039C8 /* WatchpointList.h */,
 				26BC7E1810F1B83100F91463 /* Watchpoint.cpp */,
 				B27318411416AC12006039C8 /* WatchpointList.cpp */,
+				B2B7CCED15D1BFB700EEFB57 /* WatchpointOptions.h */,
+				B2B7CCEF15D1C20F00EEFB57 /* WatchpointOptions.cpp */,
 			);
 			name = Breakpoint;
 			sourceTree = "<group>";
@@ -2654,6 +2662,8 @@
 				B296983412C2FB2B002D92C3 /* CommandObjectVersion.cpp */,
 				B207C4941429609C00F36E4E /* CommandObjectWatchpoint.h */,
 				B207C4921429607D00F36E4E /* CommandObjectWatchpoint.cpp */,
+				B2B7CCEC15D1BD9600EEFB57 /* CommandObjectWatchpointCommand.h */,
+				B2B7CCEA15D1BD6600EEFB57 /* CommandObjectWatchpointCommand.cpp */,
 			);
 			name = Commands;
 			sourceTree = "<group>";
@@ -3928,6 +3938,8 @@
 				2694E9A414FC0BBD0076DE67 /* PlatformLinux.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;
 		};
@@ -4048,9 +4060,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,
@@ -4105,9 +4119,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,
@@ -4391,7 +4407,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",
@@ -4422,7 +4438,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",
@@ -4453,7 +4469,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,9 +4494,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,

Modified: lldb/branches/apple/python-GIL/llvm.zip
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/llvm.zip?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
Binary files - no diff available.

Modified: lldb/branches/apple/python-GIL/scripts/Python/python-wrapper.swig
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/scripts/Python/python-wrapper.swig?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/scripts/Python/python-wrapper.swig (original)
+++ lldb/branches/apple/python-GIL/scripts/Python/python-wrapper.swig Mon Aug 13 13:48:10 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/apple/python-GIL/scripts/build-llvm.pl
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/scripts/build-llvm.pl?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/scripts/build-llvm.pl (original)
+++ lldb/branches/apple/python-GIL/scripts/build-llvm.pl Mon Aug 13 13:48:10 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/apple/python-GIL/scripts/lldb.swig
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/scripts/lldb.swig?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/scripts/lldb.swig (original)
+++ lldb/branches/apple/python-GIL/scripts/lldb.swig Mon Aug 13 13:48:10 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/apple/python-GIL/source/API/SBBreakpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/API/SBBreakpoint.cpp?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/API/SBBreakpoint.cpp (original)
+++ lldb/branches/apple/python-GIL/source/API/SBBreakpoint.cpp Mon Aug 13 13:48:10 2012
@@ -124,7 +124,7 @@
 bool
 SBBreakpoint::IsValid() const
 {
-    return m_opaque_sp;
+    return (bool) m_opaque_sp;
 }
 
 void

Modified: lldb/branches/apple/python-GIL/source/API/SBWatchpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/API/SBWatchpoint.cpp?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/API/SBWatchpoint.cpp (original)
+++ lldb/branches/apple/python-GIL/source/API/SBWatchpoint.cpp Mon Aug 13 13:48:10 2012
@@ -87,7 +87,7 @@
 bool
 SBWatchpoint::IsValid() const
 {
-    return m_opaque_sp;
+    return (bool) m_opaque_sp;
 }
 
 SBError

Modified: lldb/branches/apple/python-GIL/source/Breakpoint/Watchpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Breakpoint/Watchpoint.cpp?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Breakpoint/Watchpoint.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Breakpoint/Watchpoint.cpp Mon Aug 13 13:48:10 2012
@@ -33,11 +33,10 @@
     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_error(),
+    m_options ()
 {
 }
 
@@ -45,12 +44,29 @@
 {
 }
 
-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::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
@@ -129,26 +145,15 @@
             s->Printf("\n    static watchpoint spec = '%s'", m_watch_spec_str.c_str());
         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 +203,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/apple/python-GIL/source/Commands/CommandObjectDisassemble.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Commands/CommandObjectDisassemble.cpp?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Commands/CommandObjectDisassemble.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Commands/CommandObjectDisassemble.cpp Mon Aug 13 13:48:10 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/apple/python-GIL/source/Commands/CommandObjectExpression.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Commands/CommandObjectExpression.cpp?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Commands/CommandObjectExpression.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Commands/CommandObjectExpression.cpp Mon Aug 13 13:48:10 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/apple/python-GIL/source/Commands/CommandObjectFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Commands/CommandObjectFrame.cpp?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Commands/CommandObjectFrame.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Commands/CommandObjectFrame.cpp Mon Aug 13 13:48:10 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/apple/python-GIL/source/Commands/CommandObjectMemory.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Commands/CommandObjectMemory.cpp?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Commands/CommandObjectMemory.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Commands/CommandObjectMemory.cpp Mon Aug 13 13:48:10 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/apple/python-GIL/source/Commands/CommandObjectProcess.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Commands/CommandObjectProcess.cpp?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Commands/CommandObjectProcess.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Commands/CommandObjectProcess.cpp Mon Aug 13 13:48:10 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/apple/python-GIL/source/Commands/CommandObjectWatchpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Commands/CommandObjectWatchpoint.cpp?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Commands/CommandObjectWatchpoint.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Commands/CommandObjectWatchpoint.cpp Mon Aug 13 13:48:10 2012
@@ -8,6 +8,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "CommandObjectWatchpoint.h"
+#include "CommandObjectWatchpointCommand.h"
 
 // C Includes
 // C++ Includes
@@ -1300,6 +1301,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 +1310,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 +1319,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/apple/python-GIL/source/Core/ConnectionFileDescriptor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Core/ConnectionFileDescriptor.cpp?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Core/ConnectionFileDescriptor.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Core/ConnectionFileDescriptor.cpp Mon Aug 13 13:48:10 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/apple/python-GIL/source/Core/DataExtractor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Core/DataExtractor.cpp?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Core/DataExtractor.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Core/DataExtractor.cpp Mon Aug 13 13:48:10 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/apple/python-GIL/source/Core/Debugger.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Core/Debugger.cpp?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Core/Debugger.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Core/Debugger.cpp Mon Aug 13 13:48:10 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/apple/python-GIL/source/Core/FormatManager.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Core/FormatManager.cpp?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Core/FormatManager.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Core/FormatManager.cpp Mon Aug 13 13:48:10 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 

Modified: lldb/branches/apple/python-GIL/source/Core/ValueObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Core/ValueObject.cpp?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Core/ValueObject.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Core/ValueObject.cpp Mon Aug 13 13:48:10 2012
@@ -1426,6 +1426,7 @@
                 (custom_format == eFormatComplexFloat) ||
                 (custom_format == eFormatDecimal) ||
                 (custom_format == eFormatHex) ||
+                (custom_format == eFormatHexUppercase) ||
                 (custom_format == eFormatFloat) ||
                 (custom_format == eFormatOctal) ||
                 (custom_format == eFormatOSType) ||
@@ -3191,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/apple/python-GIL/source/Expression/ClangExpressionDeclMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Expression/ClangExpressionDeclMap.cpp?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Expression/ClangExpressionDeclMap.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Expression/ClangExpressionDeclMap.cpp Mon Aug 13 13:48:10 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/apple/python-GIL/source/Expression/ClangExpressionParser.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Expression/ClangExpressionParser.cpp?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Expression/ClangExpressionParser.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Expression/ClangExpressionParser.cpp Mon Aug 13 13:48:10 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/apple/python-GIL/source/Expression/ClangFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Expression/ClangFunction.cpp?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Expression/ClangFunction.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Expression/ClangFunction.cpp Mon Aug 13 13:48:10 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/apple/python-GIL/source/Expression/ClangUserExpression.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Expression/ClangUserExpression.cpp?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Expression/ClangUserExpression.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Expression/ClangUserExpression.cpp Mon Aug 13 13:48:10 2012
@@ -574,10 +574,8 @@
                                                                           ((m_needs_object_ptr && m_objectivec) ? &cmd_ptr : NULL),
                                                                           shared_ptr_to_me));
         
-        if (call_plan_sp == NULL || !call_plan_sp->ValidatePlan (NULL)) {
-            error_stream.Printf("Errored out in %s, couldn't ValidatePlan", __FUNCTION__);
+        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/apple/python-GIL/source/Expression/DWARFExpression.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Expression/DWARFExpression.cpp?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Expression/DWARFExpression.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Expression/DWARFExpression.cpp Mon Aug 13 13:48:10 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/apple/python-GIL/source/Expression/IRInterpreter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Expression/IRInterpreter.cpp?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Expression/IRInterpreter.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Expression/IRInterpreter.cpp Mon Aug 13 13:48:10 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/apple/python-GIL/source/Interpreter/CommandInterpreter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Interpreter/CommandInterpreter.cpp?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Interpreter/CommandInterpreter.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Interpreter/CommandInterpreter.cpp Mon Aug 13 13:48:10 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)
 {
@@ -464,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.
         
@@ -534,7 +535,7 @@
                 return user_match_sp;
         }
     }
-    else if (matches && ret_val != NULL)
+    else if (matches && ret_val)
     {
         matches->AppendString (cmd_cstr);
     }
@@ -762,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)
@@ -1936,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/apple/python-GIL/source/Interpreter/OptionGroupVariable.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Interpreter/OptionGroupVariable.cpp?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Interpreter/OptionGroupVariable.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Interpreter/OptionGroupVariable.cpp Mon Aug 13 13:48:10 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/apple/python-GIL/source/Interpreter/ScriptInterpreter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Interpreter/ScriptInterpreter.cpp?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Interpreter/ScriptInterpreter.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Interpreter/ScriptInterpreter.cpp Mon Aug 13 13:48:10 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/apple/python-GIL/source/Interpreter/ScriptInterpreterPython.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Interpreter/ScriptInterpreterPython.cpp?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Interpreter/ScriptInterpreterPython.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Interpreter/ScriptInterpreterPython.cpp Mon Aug 13 13:48:10 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,
@@ -1315,6 +1326,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)
@@ -1348,6 +1465,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,
@@ -1360,6 +1510,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))
     {
@@ -1370,6 +1521,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)
 {
@@ -1589,6 +1763,27 @@
 }
 
 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;
+    
+    // Store the name of the auto-generated function to be called.
+    output.assign(auto_generated_function_name);
+    return true;
+}
+
+bool
 ScriptInterpreterPython::GetScriptedSummary (const char *python_function_name,
                                              lldb::ValueObjectSP valobj,
                                              lldb::ScriptInterpreterObjectSP& callee_wrapper_sp,
@@ -1691,6 +1886,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)
 {
@@ -2097,6 +2345,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/apple/python-GIL/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp Mon Aug 13 13:48:10 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/apple/python-GIL/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Mon Aug 13 13:48:10 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/apple/python-GIL/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/Process/Utility/RegisterContextLLDB.cpp?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/Process/Utility/RegisterContextLLDB.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/Process/Utility/RegisterContextLLDB.cpp Mon Aug 13 13:48:10 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/apple/python-GIL/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.h?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.h (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.h Mon Aug 13 13:48:10 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/apple/python-GIL/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Mon Aug 13 13:48:10 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/apple/python-GIL/source/Symbol/ClangASTType.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Symbol/ClangASTType.cpp?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Symbol/ClangASTType.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Symbol/ClangASTType.cpp Mon Aug 13 13:48:10 2012
@@ -1030,6 +1030,7 @@
                     case eFormatDecimal:
                     case eFormatEnum:
                     case eFormatHex:
+                    case eFormatHexUppercase:
                     case eFormatFloat:
                     case eFormatOctal:
                     case eFormatOSType:

Modified: lldb/branches/apple/python-GIL/source/Symbol/UnwindPlan.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Symbol/UnwindPlan.cpp?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Symbol/UnwindPlan.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Symbol/UnwindPlan.cpp Mon Aug 13 13:48:10 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/apple/python-GIL/source/Target/LanguageRuntime.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Target/LanguageRuntime.cpp?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Target/LanguageRuntime.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Target/LanguageRuntime.cpp Mon Aug 13 13:48:10 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/apple/python-GIL/source/Target/Process.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Target/Process.cpp?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Target/Process.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Target/Process.cpp Mon Aug 13 13:48:10 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/apple/python-GIL/source/Target/StopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Target/StopInfo.cpp?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Target/StopInfo.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Target/StopInfo.cpp Mon Aug 13 13:48:10 2012
@@ -492,17 +492,6 @@
                 }
             }
             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)
-            {
-                // We have been vetoed.
-                m_should_stop = false;
-            }
 
             if (m_should_stop && wp_sp->GetConditionText() != NULL)
             {
@@ -571,6 +560,22 @@
                     m_should_stop = true;
                 }
             }
+
+            // If the condition says to stop, we run the callback to further decide whether to stop.
+            if (m_should_stop)
+            {
+                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/apple/python-GIL/source/Target/Thread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Target/Thread.cpp?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Target/Thread.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Target/Thread.cpp Mon Aug 13 13:48:10 2012
@@ -136,7 +136,7 @@
 bool
 Thread::ThreadStoppedForAReason (void)
 {
-    return GetPrivateStopReason () != NULL;
+    return (bool) GetPrivateStopReason ();
 }
 
 bool

Modified: lldb/branches/apple/python-GIL/source/Target/ThreadPlanCallFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Target/ThreadPlanCallFunction.cpp?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Target/ThreadPlanCallFunction.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Target/ThreadPlanCallFunction.cpp Mon Aug 13 13:48:10 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/apple/python-GIL/source/Target/ThreadPlanStepUntil.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/source/Target/ThreadPlanStepUntil.cpp?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/source/Target/ThreadPlanStepUntil.cpp (original)
+++ lldb/branches/apple/python-GIL/source/Target/ThreadPlanStepUntil.cpp Mon Aug 13 13:48:10 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/apple/python-GIL/test/dotest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/test/dotest.py?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/test/dotest.py (original)
+++ lldb/branches/apple/python-GIL/test/dotest.py Mon Aug 13 13:48:10 2012
@@ -661,8 +661,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
@@ -741,7 +742,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))
 
@@ -807,7 +808,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()
@@ -822,7 +823,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))
@@ -938,7 +939,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
@@ -1212,7 +1213,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.
@@ -1228,7 +1229,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).
@@ -1356,7 +1357,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/apple/python-GIL/test/functionalities/abbreviation/TestAbbreviations.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/test/functionalities/abbreviation/TestAbbreviations.py?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/test/functionalities/abbreviation/TestAbbreviations.py (original)
+++ lldb/branches/apple/python-GIL/test/functionalities/abbreviation/TestAbbreviations.py Mon Aug 13 13:48:10 2012
@@ -133,7 +133,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/apple/python-GIL/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py (original)
+++ lldb/branches/apple/python-GIL/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py Mon Aug 13 13:48:10 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/apple/python-GIL/test/functionalities/breakpoint/breakpoint_ignore_count/main.c
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/test/functionalities/breakpoint/breakpoint_ignore_count/main.c?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/test/functionalities/breakpoint/breakpoint_ignore_count/main.c (original)
+++ lldb/branches/apple/python-GIL/test/functionalities/breakpoint/breakpoint_ignore_count/main.c Mon Aug 13 13:48:10 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/apple/python-GIL/test/functionalities/completion/TestCompletion.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/test/functionalities/completion/TestCompletion.py?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/test/functionalities/completion/TestCompletion.py (original)
+++ lldb/branches/apple/python-GIL/test/functionalities/completion/TestCompletion.py Mon Aug 13 13:48:10 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/apple/python-GIL/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py (original)
+++ lldb/branches/apple/python-GIL/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py Mon Aug 13 13:48:10 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/apple/python-GIL/test/functionalities/data-formatter/data-formatter-cpp/main.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/test/functionalities/data-formatter/data-formatter-cpp/main.cpp?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/test/functionalities/data-formatter/data-formatter-cpp/main.cpp (original)
+++ lldb/branches/apple/python-GIL/test/functionalities/data-formatter/data-formatter-cpp/main.cpp Mon Aug 13 13:48:10 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/apple/python-GIL/test/lang/objc/foundation/TestObjCMethods2.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/test/lang/objc/foundation/TestObjCMethods2.py?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/test/lang/objc/foundation/TestObjCMethods2.py (original)
+++ lldb/branches/apple/python-GIL/test/lang/objc/foundation/TestObjCMethods2.py Mon Aug 13 13:48:10 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/apple/python-GIL/test/lang/objc/print-obj/TestPrintObj.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/apple/python-GIL/test/lang/objc/print-obj/TestPrintObj.py?rev=161774&r1=161773&r2=161774&view=diff
==============================================================================
--- lldb/branches/apple/python-GIL/test/lang/objc/print-obj/TestPrintObj.py (original)
+++ lldb/branches/apple/python-GIL/test/lang/objc/print-obj/TestPrintObj.py Mon Aug 13 13:48:10 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__':





More information about the lldb-commits mailing list