[Lldb-commits] [lldb] r134360 - in /lldb/trunk: include/lldb/API/SBFrame.h scripts/Python/modify-python-lldb.py

Johnny Chen johnny.chen at apple.com
Sat Jul 2 18:43:29 PDT 2011


Author: johnny
Date: Sat Jul  2 20:43:29 2011
New Revision: 134360

URL: http://llvm.org/viewvc/llvm-project?rev=134360&view=rev
Log:
Add swig docstrings for SBFrame.h.
Add post-processing step to remove the trailing blank lines from the docstrings of lldb.py.

Modified:
    lldb/trunk/include/lldb/API/SBFrame.h
    lldb/trunk/scripts/Python/modify-python-lldb.py

Modified: lldb/trunk/include/lldb/API/SBFrame.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBFrame.h?rev=134360&r1=134359&r2=134360&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBFrame.h (original)
+++ lldb/trunk/include/lldb/API/SBFrame.h Sat Jul  2 20:43:29 2011
@@ -77,41 +77,84 @@
     lldb::SBSymbol
     GetSymbol () const;
 
-    // Gets the deepest block that contains the frame PC
+#ifdef SWIG
+    %feature("docstring", "
+#endif
+    /// Gets the deepest block that contains the frame PC.
+    ///
+    /// See also GetFrameBlock().
+#ifdef SWIG
+    ") GetBlock;
+#endif
     lldb::SBBlock
     GetBlock () const;
 
-    // Get the appropriate function name for this frame. Inlined functions in
-    // LLDB are represented by Blocks that have inlined function information, so
-    // just looking at the SBFunction or SBSymbol for a frame isn't enough.
-    // This function will return the appriopriate function, symbol or inlined
-    // function name for the frame.
+#ifdef SWIG
+    %feature("docstring", "
+#endif
+    /// Get the appropriate function name for this frame. Inlined functions in
+    /// LLDB are represented by Blocks that have inlined function information, so
+    /// just looking at the SBFunction or SBSymbol for a frame isn't enough.
+    /// This function will return the appriopriate function, symbol or inlined
+    /// function name for the frame.
+    ///
+    /// This function returns:
+    /// - the name of the inlined function (if there is one)
+    /// - the name of the concrete function (if there is one)
+    /// - the name of the symbol (if there is one)
+    /// - NULL
+    ///
+    /// See also IsInlined().
+#ifdef SWIG
+    ") GetFunctionName;
+#endif
     const char *
     GetFunctionName();
 
-    // Return true if this frame represents and an inlined function.
+#ifdef SWIG
+    %feature("docstring", "
+#endif
+    /// Return true if this frame represents an inlined function.
+    ///
+    /// See also GetFunctionName().
+#ifdef SWIG
+    ") IsInlined;
+#endif
     bool
     IsInlined();
     
-    // The version that doesn't supply a "use_dynamic" value will use the target's default.
+#ifdef SWIG
+    %feature("docstring", "
+#endif
+    /// The version that doesn't supply a 'use_dynamic' value will use the
+    /// target's default.
+#ifdef SWIG
+    ") EvaluateExpression;
+#endif
     lldb::SBValue
     EvaluateExpression (const char *expr);    
 
     lldb::SBValue
     EvaluateExpression (const char *expr, lldb::DynamicValueType use_dynamic);
 
-    // Gets the lexical block that defines the stack frame. Another way to think
-    // of this is it will return the block that contains all of the variables
-    // for a stack frame. Inlined functions are represented as SBBlock objects
-    // that have inlined function information: the name of the inlined function,
-    // where it was called from. The block that is returned will be the first 
-    // block at or above the block for the PC (SBFrame::GetBlock()) that defines
-    // the scope of the frame. When a function contains no inlined functions,
-    // this will be the top most lexical block that defines the function. 
-    // When a function has inlined functions and the PC is currently
-    // in one of those inlined functions, this method will return the inlined
-    // block that defines this frame. If the PC isn't currently in an inlined
-    // function, the lexical block that defines the function is returned.
+#ifdef SWIG
+    %feature("docstring", "
+#endif
+    /// Gets the lexical block that defines the stack frame. Another way to think
+    /// of this is it will return the block that contains all of the variables
+    /// for a stack frame. Inlined functions are represented as SBBlock objects
+    /// that have inlined function information: the name of the inlined function,
+    /// where it was called from. The block that is returned will be the first 
+    /// block at or above the block for the PC (SBFrame::GetBlock()) that defines
+    /// the scope of the frame. When a function contains no inlined functions,
+    /// this will be the top most lexical block that defines the function. 
+    /// When a function has inlined functions and the PC is currently
+    /// in one of those inlined functions, this method will return the inlined
+    /// block that defines this frame. If the PC isn't currently in an inlined
+    /// function, the lexical block that defines the function is returned.
+#ifdef SWIG
+    ") GetFrameBlock;
+#endif
     lldb::SBBlock
     GetFrameBlock () const;
 
@@ -136,13 +179,20 @@
 
 #endif
 
+#ifdef SWIG
+    %feature("docstring", "
+#endif
+    /// The version that doesn't supply a 'use_dynamic' value will use the
+    /// target's default.
+#ifdef SWIG
+    ") GetVariables;
+#endif
     lldb::SBValueList
     GetVariables (bool arguments,
                   bool locals,
                   bool statics,
                   bool in_scope_only);
 
-    // The version that doesn't supply a "use_dynamic" value will use the target's default.
     lldb::SBValueList
     GetVariables (bool arguments,
                   bool locals,
@@ -153,15 +203,31 @@
     lldb::SBValueList
     GetRegisters ();
 
-    // The version that doesn't supply a "use_dynamic" value will use the target's default.
+#ifdef SWIG
+    %feature("docstring", "
+#endif
+    /// The version that doesn't supply a 'use_dynamic' value will use the
+    /// target's default.
+#ifdef SWIG
+    ") FindVariable;
+#endif
     lldb::SBValue
     FindVariable (const char *var_name);
 
     lldb::SBValue
     FindVariable (const char *var_name, lldb::DynamicValueType use_dynamic);
 
-    // Find variables, register sets, registers, or persistent variables using
-    // the frame as the scope
+#ifdef SWIG
+    %feature("docstring", "
+#endif
+    /// Find variables, register sets, registers, or persistent variables using
+    /// the frame as the scope.
+    ///
+    /// The version that doesn't supply a 'use_dynamic' value will use the
+    /// target's default.
+#ifdef SWIG
+    ") FindValue;
+#endif
     lldb::SBValue
     FindValue (const char *name, ValueType value_type);
 

Modified: lldb/trunk/scripts/Python/modify-python-lldb.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/modify-python-lldb.py?rev=134360&r1=134359&r2=134360&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/modify-python-lldb.py (original)
+++ lldb/trunk/scripts/Python/modify-python-lldb.py Sat Jul  2 20:43:29 2011
@@ -29,6 +29,7 @@
 c_endif_swig = "#endif"
 c_ifdef_swig = "#ifdef SWIG"
 c_comment_marker = "//------------"
+trailing_blank_line = '            '
 # The pattern for recognizing the doxygen comment block line.
 doxygen_comment_start = re.compile("^\s*(    /// ?)")
 
@@ -164,8 +165,8 @@
     # Cleanse the lldb.py of the autodoc'ed residues.
     if c_ifdef_swig in line or c_endif_swig in line:
         continue
-    # As well as the comment marker line.
-    if c_comment_marker in line:
+    # As well as the comment marker line and trailing blank line.
+    if c_comment_marker in line or line == trailing_blank_line:
         continue
     # Also remove the '\a ' substrings.
     line = line.replace('\a ', '')





More information about the lldb-commits mailing list