From 27e9d982eb1e5aaa4c06a8771a3430eb803c1edf Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Sun, 21 Apr 2019 12:48:53 +0000 Subject: [PATCH] modify-python-lldb.py: Remove docstring formatting code The strings have been already cleaned up in r358683, so this code is not doing anything anymore. While comparing the outputs before and after removing the formatting code, I've found a couple of docstrings that managed to escape my perl script in r358683, so I format them manually with this patch. llvm-svn: 358846 --- lldb/scripts/Python/modify-python-lldb.py | 16 +-- lldb/scripts/interface/SBProcess.i | 6 +- lldb/scripts/interface/SBTarget.i | 117 +++++++++++----------- 3 files changed, 60 insertions(+), 79 deletions(-) diff --git a/lldb/scripts/Python/modify-python-lldb.py b/lldb/scripts/Python/modify-python-lldb.py index 4df1df94dfba..2881d4ead62b 100644 --- a/lldb/scripts/Python/modify-python-lldb.py +++ b/lldb/scripts/Python/modify-python-lldb.py @@ -43,9 +43,6 @@ else: # # Residues to be removed. # -c_comment_marker = "//------------" -# The pattern for recognizing the doxygen comment block line. -doxygen_comment_start = re.compile("^\s*(/// ?)") # The demarcation point for turning on/off residue removal state. # When bracketed by the lines, the CLEANUP_DOCSTRING state (see below) is ON. toggle_docstring_cleanup_line = ' """' @@ -119,25 +116,14 @@ for line in content.splitlines(): if line == toggle_docstring_cleanup_line: if state & CLEANUP_DOCSTRING: - # Special handling of the trailing blank line right before the '"""' - # end docstring marker. - new_content.del_blank_line() state ^= CLEANUP_DOCSTRING else: state |= CLEANUP_DOCSTRING if (state & CLEANUP_DOCSTRING): - # Remove the comment marker line. - if c_comment_marker in line: - continue - - # Also remove the '\a ' and '\b 'substrings. + # Remove the '\a ' and '\b 'substrings. line = line.replace('\a ', '') line = line.replace('\b ', '') - # And the leading '///' substring. - doxygen_comment_match = doxygen_comment_start.match(line) - if doxygen_comment_match: - line = line.replace(doxygen_comment_match.group(1), '', 1) line = char_to_str_xform(line) diff --git a/lldb/scripts/interface/SBProcess.i b/lldb/scripts/interface/SBProcess.i index ab73f33d6b75..38e99f34afbb 100644 --- a/lldb/scripts/interface/SBProcess.i +++ b/lldb/scripts/interface/SBProcess.i @@ -289,8 +289,7 @@ public: if error.Success(): print('integer: %u' % uint) else - print('error: ', error) -") ReadUnsignedFromMemory; + print('error: ', error)") ReadUnsignedFromMemory; uint64_t ReadUnsignedFromMemory (addr_t addr, uint32_t byte_size, lldb::SBError &error); @@ -304,8 +303,7 @@ public: if error.Success(): print('pointer: 0x%x' % ptr) else - print('error: ', error) -") ReadPointerFromMemory; + print('error: ', error)") ReadPointerFromMemory; lldb::addr_t ReadPointerFromMemory (addr_t addr, lldb::SBError &error); diff --git a/lldb/scripts/interface/SBTarget.i b/lldb/scripts/interface/SBTarget.i index 8bf473548179..a7f277259fa8 100644 --- a/lldb/scripts/interface/SBTarget.i +++ b/lldb/scripts/interface/SBTarget.i @@ -180,7 +180,6 @@ public: @return A process object for the newly created process. - //------------------------------------------------------------------ For example, @@ -232,7 +231,6 @@ public: @return A process object for the newly created process. - //------------------------------------------------------------------ For example, @@ -260,7 +258,6 @@ public: @return A process object for the newly created core file. - //------------------------------------------------------------------ For example, @@ -688,63 +685,63 @@ public: BreakpointCreateBySBAddress (SBAddress &sb_address); %feature("docstring", " - /// Create a breakpoint using a scripted resolver. - /// - /// @param[in] class_name - /// This is the name of the class that implements a scripted resolver. - /// The class should have the following signature: - /// class Resolver: - /// def __init__(self, bkpt, extra_args): - /// # bkpt - the breakpoint for which this is the resolver. When - /// # the resolver finds an interesting address, call AddLocation - /// # on this breakpoint to add it. - /// # - /// # extra_args - an SBStructuredData that can be used to - /// # parametrize this instance. Same as the extra_args passed - /// # to BreakpointCreateFromScript. - /// - /// def __get_depth__ (self): - /// # This is optional, but if defined, you should return the - /// # depth at which you want the callback to be called. The - /// # available options are: - /// # lldb.eSearchDepthModule - /// # lldb.eSearchDepthCompUnit - /// # The default if you don't implement this method is - /// # eSearchDepthModule. - /// - /// def __callback__(self, sym_ctx): - /// # sym_ctx - an SBSymbolContext that is the cursor in the - /// # search through the program to resolve breakpoints. - /// # The sym_ctx will be filled out to the depth requested in - /// # __get_depth__. - /// # Look in this sym_ctx for new breakpoint locations, - /// # and if found use bkpt.AddLocation to add them. - /// # Note, you will only get called for modules/compile_units that - /// # pass the SearchFilter provided by the module_list & file_list - /// # passed into BreakpointCreateFromScript. - /// - /// def get_short_help(self): - /// # Optional, but if implemented return a short string that will - /// # be printed at the beginning of the break list output for the - /// # breakpoint. - /// - /// @param[in] extra_args - /// This is an SBStructuredData object that will get passed to the - /// constructor of the class in class_name. You can use this to - /// reuse the same class, parametrizing it with entries from this - /// dictionary. - /// - /// @param module_list - /// If this is non-empty, this will be used as the module filter in the - /// SearchFilter created for this breakpoint. - /// - /// @param file_list - /// If this is non-empty, this will be used as the comp unit filter in the - /// SearchFilter created for this breakpoint. - /// - /// @return - /// An SBBreakpoint that will set locations based on the logic in the - /// resolver's search callback.") BreakpointCreateFromScript; + Create a breakpoint using a scripted resolver. + + @param[in] class_name + This is the name of the class that implements a scripted resolver. + The class should have the following signature: + class Resolver: + def __init__(self, bkpt, extra_args): + # bkpt - the breakpoint for which this is the resolver. When + # the resolver finds an interesting address, call AddLocation + # on this breakpoint to add it. + # + # extra_args - an SBStructuredData that can be used to + # parametrize this instance. Same as the extra_args passed + # to BreakpointCreateFromScript. + + def __get_depth__ (self): + # This is optional, but if defined, you should return the + # depth at which you want the callback to be called. The + # available options are: + # lldb.eSearchDepthModule + # lldb.eSearchDepthCompUnit + # The default if you don't implement this method is + # eSearchDepthModule. + + def __callback__(self, sym_ctx): + # sym_ctx - an SBSymbolContext that is the cursor in the + # search through the program to resolve breakpoints. + # The sym_ctx will be filled out to the depth requested in + # __get_depth__. + # Look in this sym_ctx for new breakpoint locations, + # and if found use bkpt.AddLocation to add them. + # Note, you will only get called for modules/compile_units that + # pass the SearchFilter provided by the module_list & file_list + # passed into BreakpointCreateFromScript. + + def get_short_help(self): + # Optional, but if implemented return a short string that will + # be printed at the beginning of the break list output for the + # breakpoint. + + @param[in] extra_args + This is an SBStructuredData object that will get passed to the + constructor of the class in class_name. You can use this to + reuse the same class, parametrizing it with entries from this + dictionary. + + @param module_list + If this is non-empty, this will be used as the module filter in the + SearchFilter created for this breakpoint. + + @param file_list + If this is non-empty, this will be used as the comp unit filter in the + SearchFilter created for this breakpoint. + + @return + An SBBreakpoint that will set locations based on the logic in the + resolver's search callback.") BreakpointCreateFromScript; lldb::SBBreakpoint BreakpointCreateFromScript( const char *class_name, SBStructuredData &extra_args,