[Lldb-commits] [lldb] r156099 - in /lldb/branches/lldb-platform-work: ./ examples/python/ include/lldb/Core/ scripts/ source/Commands/ test/functionalities/data-formatter/data-formatter-disabling/ www/

Johnny Chen johnny.chen at apple.com
Thu May 3 13:34:38 PDT 2012


Author: johnny
Date: Thu May  3 15:34:38 2012
New Revision: 156099

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

svn merge -r 155973:156088 https://johnny@llvm.org/svn/llvm-project/lldb/trunk .

Added:
    lldb/branches/lldb-platform-work/scripts/clang.tail-padded-arrays.diff
      - copied unchanged from r156088, lldb/trunk/scripts/clang.tail-padded-arrays.diff
    lldb/branches/lldb-platform-work/test/functionalities/data-formatter/data-formatter-disabling/
      - copied from r156088, lldb/trunk/test/functionalities/data-formatter/data-formatter-disabling/
    lldb/branches/lldb-platform-work/test/functionalities/data-formatter/data-formatter-disabling/Makefile
      - copied unchanged from r156088, lldb/trunk/test/functionalities/data-formatter/data-formatter-disabling/Makefile
    lldb/branches/lldb-platform-work/test/functionalities/data-formatter/data-formatter-disabling/TestDataFormatterDisabling.py
      - copied unchanged from r156088, lldb/trunk/test/functionalities/data-formatter/data-formatter-disabling/TestDataFormatterDisabling.py
    lldb/branches/lldb-platform-work/test/functionalities/data-formatter/data-formatter-disabling/main.cpp
      - copied unchanged from r156088, lldb/trunk/test/functionalities/data-formatter/data-formatter-disabling/main.cpp
Modified:
    lldb/branches/lldb-platform-work/   (props changed)
    lldb/branches/lldb-platform-work/examples/python/crashlog.py
    lldb/branches/lldb-platform-work/include/lldb/Core/FormatManager.h
    lldb/branches/lldb-platform-work/llvm.zip
    lldb/branches/lldb-platform-work/source/Commands/CommandObjectType.cpp
    lldb/branches/lldb-platform-work/www/python-reference.html
    lldb/branches/lldb-platform-work/www/varformats.html

Propchange: lldb/branches/lldb-platform-work/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu May  3 15:34:38 2012
@@ -1 +1 @@
-/lldb/trunk:154223-155973
+/lldb/trunk:154223-156088

Modified: lldb/branches/lldb-platform-work/examples/python/crashlog.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/examples/python/crashlog.py?rev=156099&r1=156098&r2=156099&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/examples/python/crashlog.py (original)
+++ lldb/branches/lldb-platform-work/examples/python/crashlog.py Thu May  3 15:34:38 2012
@@ -95,7 +95,10 @@
             if self.description:
                 return "[%3u] 0x%16.16x %s" % (self.index, self.pc, self.description)
             else:
-                return "[%3u] 0x%16.16x" % (self.index, self.pc)        
+                return "[%3u] 0x%16.16x" % (self.index, self.pc)
+
+        def dump(self, prefix):
+            print "%s%s" % (prefix, str(self))
     
     class DarwinImage(lldb.utils.symbolication.Image):
         """Class that represents a binary images in a darwin crash log"""

Modified: lldb/branches/lldb-platform-work/include/lldb/Core/FormatManager.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/include/lldb/Core/FormatManager.h?rev=156099&r1=156098&r2=156099&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/include/lldb/Core/FormatManager.h (original)
+++ lldb/branches/lldb-platform-work/include/lldb/Core/FormatManager.h Thu May  3 15:34:38 2012
@@ -357,7 +357,7 @@
         if (category.get())
         {
             Position pos_w = pos;
-            if (pos == First)
+            if (pos == First || m_active_categories.size() == 0)
                 m_active_categories.push_front(category);
             else if (pos == Last || pos == m_active_categories.size())
                 m_active_categories.push_back(category);

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

Modified: lldb/branches/lldb-platform-work/source/Commands/CommandObjectType.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/source/Commands/CommandObjectType.cpp?rev=156099&r1=156098&r2=156099&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/source/Commands/CommandObjectType.cpp (original)
+++ lldb/branches/lldb-platform-work/source/Commands/CommandObjectType.cpp Thu May  3 15:34:38 2012
@@ -1985,10 +1985,10 @@
     {
         CommandArgumentEntry type_arg;
         CommandArgumentData type_style_arg;
-        
+          
         type_style_arg.arg_type = eArgTypeName;
         type_style_arg.arg_repetition = eArgRepeatPlus;
-        
+                
         type_arg.push_back (type_style_arg);
         
         m_arguments.push_back (type_arg);
@@ -2083,19 +2083,33 @@
             return false;
         }
         
-        // the order is not relevant here
-        for (int i = argc - 1; i >= 0; i--)
+        if (argc == 1 && strcmp(command.GetArgumentAtIndex(0),"*") == 0)
         {
-            const char* typeA = command.GetArgumentAtIndex(i);
-            ConstString typeCS(typeA);
-            
-            if (!typeCS)
+            uint32_t num_categories = DataVisualization::Categories::GetCount();
+            for (uint32_t i = 0; i < num_categories; i++)
             {
-                result.AppendError("empty category name not allowed");
-                result.SetStatus(eReturnStatusFailed);
-                return false;
+                lldb::TypeCategoryImplSP category_sp = DataVisualization::Categories::GetCategoryAtIndex(i);
+                // no need to check if the category is enabled - disabling a disabled category has no effect
+                if (category_sp)
+                    DataVisualization::Categories::Disable(category_sp);
+            }
+        }
+        else
+        {
+            // the order is not relevant here
+            for (int i = argc - 1; i >= 0; i--)
+            {
+                const char* typeA = command.GetArgumentAtIndex(i);
+                ConstString typeCS(typeA);
+                
+                if (!typeCS)
+                {
+                    result.AppendError("empty category name not allowed");
+                    result.SetStatus(eReturnStatusFailed);
+                    return false;
+                }
+                DataVisualization::Categories::Disable(typeCS);
             }
-            DataVisualization::Categories::Disable(typeCS);
         }
 
         result.SetStatus(eReturnStatusSuccessFinishResult);

Modified: lldb/branches/lldb-platform-work/www/python-reference.html
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/www/python-reference.html?rev=156099&r1=156098&r2=156099&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/www/python-reference.html (original)
+++ lldb/branches/lldb-platform-work/www/python-reference.html Thu May  3 15:34:38 2012
@@ -255,6 +255,13 @@
         <code><pre><tt>def command_function(<b>debugger</b>, <b>command</b>, <b>result</b>, <b>dict</b>):
           <font color=green># Your code goes here</font>
         </tt></pre></code>
+
+		Optionally, you can also provide a Python docstring, and LLDB will use it when providing help for your command, as in:
+        <code><pre><tt>def command_function(<b>debugger</b>, <b>command</b>, <b>result</b>, <b>dict</b>):
+          <font color=green>"""This command takes a lot of options and does many fancy things"""</font>    
+          <font color=green># Your code goes here</font>
+        </tt></pre></code>
+
         <p><table class="stats" width="620" cellspacing="0">
         <tr>
             <td class="hed" width="10%">Argument</td>

Modified: lldb/branches/lldb-platform-work/www/varformats.html
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/lldb-platform-work/www/varformats.html?rev=156099&r1=156098&r2=156099&view=diff
==============================================================================
--- lldb/branches/lldb-platform-work/www/varformats.html (original)
+++ lldb/branches/lldb-platform-work/www/varformats.html Thu May  3 15:34:38 2012
@@ -1191,15 +1191,16 @@
 			  or OS release.</p>
 			  <p>By default, several categories are created in LLDB: 
 				<ul>
-					<li><code>default</code>: this is the category where every formatter ends up, unless an other category is explicitly 			<li><code>objc</code>: formatters for basic and common Objective-C types that do not specifically depend on Mac OS X
+					<li><code>default</code>: this is the category where every formatter ends up, unless another category is specified
+		 			<li><code>objc</code>: formatters for basic and common Objective-C types that do not specifically depend on Mac OS X
 					<li><code>gnu-libstdc++</code>: formatters for std::string, std::vector, std::list and std::map as implemented by libstdcpp
-					<li><code>libcxx</code>: formatters for std::string, std::vector, std::list and std::map as implemented by libcxx
+					<li><code>libcxx</code>: formatters for std::string, std::vector, std::list and std::map as implemented by <a href="http://libcxx.llvm.org/">libcxx</a>
 					<li><code>system</code>: truly basic types for which a formatter is required
-					<li><a href="https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/ObjC_classic/_index.html#//apple_ref/doc/uid/20001091"><code>AppKit</code></a>: Cocoa classes - disabled by default since this is Mac OS X specific
-					<li><a href="https://developer.apple.com/corefoundation/"><code>CoreFoundation</code></a>: CF classes - disabled by default since this is Mac OS X specific
-					<li><a href="https://developer.apple.com/library/mac/#documentation/CoreGraphics/Reference/CoreGraphicsConstantsRef/Reference/reference.html"><code>CoreGraphics</code></a>: CG classes - disabled by default since this is Mac OS X specific
-					<li><a href="http://developer.apple.com/library/mac/#documentation/Carbon/reference/CoreServicesReferenceCollection/_index.html"><code>CoreServices</code></a>: CS classes - disabled by default since this is Mac OS X specific
-					<li><code>VectorTypes</code>: compact display for several vector types - disabled by default since this is Mac OS X specific
+					<li><a href="https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/ObjC_classic/_index.html#//apple_ref/doc/uid/20001091"><code>AppKit</code></a>: Cocoa classes
+					<li><a href="https://developer.apple.com/corefoundation/"><code>CoreFoundation</code></a>: CF classes
+					<li><a href="https://developer.apple.com/library/mac/#documentation/CoreGraphics/Reference/CoreGraphicsConstantsRef/Reference/reference.html"><code>CoreGraphics</code></a>: CG classes
+					<li><a href="http://developer.apple.com/library/mac/#documentation/Carbon/reference/CoreServicesReferenceCollection/_index.html"><code>CoreServices</code></a>: CS classes
+					<li><code>VectorTypes</code>: compact display for several vector types
 				</ul>
 				If you want to use a custom category for your formatters, all the <code>type ... add</code> (except for <code>type format add</code>),
 				provide a <code>--category</code> (<code>-w</code>) option, that names the category to add the formatter to.
@@ -1209,8 +1210,19 @@
 					the command to use is <code>type category disable</code>. 
 					<p>The order in which categories are enabled or disabled
 					is significant, in that LLDB uses that order when looking for formatters. Therefore, when you enable a category, it becomes
-					the second one to be searched (after <code>default</code>, which always stays on top of the list). The default categories are enabled in such a way that the search order is: <code>default</code>, <code>objc</code>,
-					then <code>gnu-libstdc++</code>, <code>libcxx</code> and finally <code>system</code>.
+					the second one to be searched (after <code>default</code>, which always stays on top of the list). The default categories are enabled in such a way that the search order is: 
+					<ul>
+					<li>default</li>
+					<li>objc</li>
+					<li>CoreFoundation</li>
+					<li>AppKit</li>
+					<li>CoreServices</li>
+					<li>CoreGraphics</li>
+					<li>gnu-libstdc++</li>
+					<li>libcxx</li>
+					<li>VectorTypes</li>
+					<li>system</li>
+					</ul>
 					<p>As said, <code>gnu-libstdc++</code> and <code>libcxx</code> contain formatters for C++ STL
 					data types. <code>system</code> contains formatters for <code>char*</code> and <code>char[]</code>, which reflect the behavior
 					of older versions of LLDB which had built-in formatters for these types. Because now these are formatters, you can even





More information about the lldb-commits mailing list