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
This commit is contained in:
Pavel Labath 2019-04-21 12:48:53 +00:00
parent 0d741507f7
commit 27e9d982eb
3 changed files with 60 additions and 79 deletions

View File

@ -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)

View File

@ -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);

View File

@ -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,