Remove double double words

I ran the thing below (piped to “grep -v namespace”), fixed things up,
and rewrapped comments in the affected file.

import re
import sys

LAST_WORD_RE = re.compile('^.*[\s]+([\w]+)$')
FIRST_WORD_RE = re.compile('^[^\w]+([\w]+).*$')

for path in sys.argv[1:]:
  with open(path) as file:
    line_number = 0
    last_word = None
    for line in file:
      line_number += 1
      first_word = FIRST_WORD_RE.match(line)
      if first_word and first_word.group(1) == last_word:
        print('%s:%u: %s' % (path, line_number - 1, last_word))
      last_word = LAST_WORD_RE.match(line)
      if last_word:
        last_word = last_word.group(1)

Change-Id: Iea9f2a6453d9d9ec17e2f238e09252535d7408bd
Reviewed-on: https://chromium-review.googlesource.com/780284
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
This commit is contained in:
Mark Mentovai 2017-11-20 18:19:22 -05:00 committed by Commit Bot
parent 20e5aba1af
commit e9f40ae176
12 changed files with 38 additions and 40 deletions

View File

@ -61,7 +61,7 @@ enum MinidumpContextFlags : uint32_t {
//!
//! If this bit is set, it indicates that the bits indicating how the thread
//! had entered kernel mode (::kMinidumpContextExceptionActive and
//! and ::kMinidumpContextServiceActive) are valid. This bit is only used on
//! ::kMinidumpContextServiceActive) are valid. This bit is only used on
//! Windows.
kMinidumpContextExceptionReporting = 0x80000000,
};
@ -154,8 +154,8 @@ struct MinidumpContextX86 {
uint32_t dr6;
uint32_t dr7;
// CPUContextX86::Fsave has identical layout to what the x86 CONTEXT
// structure places here.
// CPUContextX86::Fsave has identical layout to what the x86 CONTEXT structure
// places here.
CPUContextX86::Fsave fsave;
union {
uint32_t spare_0; // As in the native x86 CONTEXT structure since Windows 8
@ -324,9 +324,8 @@ struct alignas(16) MinidumpContextAMD64 {
//!
//! See Intel Software Developers Manual, Volume 3B: System Programming, Part
//! 2 (253669-051), 17.4 “Last Branch, Interrupt, and Exception Recording
//! Overview”, and AMD Architecture Programmers Manual, Volume 2:
//! System Programming (24593-3.24), 13.1.6 “Control-Transfer Breakpoint
//! Features”.
//! Overview”, and AMD Architecture Programmers Manual, Volume 2: System
//! Programming (24593-3.24), 13.1.6 “Control-Transfer Breakpoint Features”.
//!
//! \{
uint64_t debug_control;

View File

@ -317,8 +317,8 @@ class MinidumpModuleListWriter final : public internal::MinidumpStreamWriter {
//! \param[in] module_snapshots The module snapshots to use as source data.
//!
//! \note Valid in #kStateMutable. AddModule() may not be called before this
//! this method, and it is not normally necessary to call AddModule()
//! after this method.
//! method, and it is not normally necessary to call AddModule() after
//! this method.
void InitializeFromSnapshot(
const std::vector<const ModuleSnapshot*>& module_snapshots);

View File

@ -83,7 +83,7 @@ TEST(MinidumpModuleWriter, EmptyModuleList) {
// If |expected_pdb_name| is not nullptr, |codeview_record| is used to locate a
// CodeView record in |file_contents|, and its fields are compared against the
// the |expected_pdb_*| values. If |expected_pdb_uuid| is supplied, the CodeView
// |expected_pdb_*| values. If |expected_pdb_uuid| is supplied, the CodeView
// record must be a PDB 7.0 link, otherwise, it must be a PDB 2.0 link. If
// |expected_pdb_name| is nullptr, |codeview_record| must not point to anything.
void ExpectCodeViewRecord(const MINIDUMP_LOCATION_DESCRIPTOR* codeview_record,

View File

@ -127,9 +127,9 @@ class MinidumpWritable {
//! Some objects, such as those capturing memory region snapshots, are
//! written to minidump files after all other objects. This “late” phase
//! identifies such objects. This is useful to improve spatial locality in
//! in minidump files in accordance with expected access patterns: unlike
//! most other data, memory snapshots are large and the entire snapshots do
//! not need to be consulted in order to process a minidump file.
//! minidump files in accordance with expected access patterns: unlike most
//! other data, memory snapshots are large and do not usually need to be
//! consulted in their entirety in order to process a minidump file.
kPhaseLate,
};

View File

@ -23,14 +23,14 @@ namespace crashpad {
//! \brief Options represented in a clients CrashpadInfo structure.
//!
//! The CrashpadInfo structure is not suitable to expose client options
//! in a generic way at the snapshot level. This structure duplicates
//! option-related fields from the client structure for general use within the
//! snapshot layer and by users of this layer.
//! The CrashpadInfo structure is not suitable to expose client options in a
//! generic way at the snapshot level. This structure duplicates option-related
//! fields from the client structure for general use within the snapshot layer
//! and by users of this layer.
//!
//! For objects of this type corresponding to a module, option values are taken
//! from the modules CrashpadInfo structure directly. If the module has no such
//! such structure, option values appear unset.
//! structure, option values appear unset.
//!
//! For objects of this type corresponding to an entire process, option values
//! are taken from the CrashpadInfo structures of modules within the process.

View File

@ -70,9 +70,8 @@ bool ModuleSnapshotWin::Initialize(
// If we fully supported all old debugging formats, we would want to extract
// and emit a different type of CodeView record here (as old Microsoft tools
// would do). As we don't expect to ever encounter a module that wouldn't be
// be using .PDB that we actually have symbols for, we simply set a
// plausible name here, but this will never correspond to symbols that we
// have.
// using .PDB that we actually have symbols for, we simply set a plausible
// name here, but this will never correspond to symbols that we have.
pdb_name_ = base::UTF16ToUTF8(name_);
}
@ -177,8 +176,8 @@ std::string ModuleSnapshotWin::DebugFileName() const {
std::vector<std::string> ModuleSnapshotWin::AnnotationsVector() const {
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
// These correspond to system-logged things on Mac. We don't currently track
// any of these on Windows, but could in the future.
// See https://crashpad.chromium.org/bug/38.
// any of these on Windows, but could in the future. See
// https://crashpad.chromium.org/bug/38.
return std::vector<std::string>();
}

View File

@ -118,7 +118,7 @@ class ModuleSnapshotWin final : public ModuleSnapshot {
InitializationStateDcheck initialized_;
// VSFixedFileInfo() is logically const, but updates these members on the
// the call. See https://crashpad.chromium.org/bug/9.
// call. See https://crashpad.chromium.org/bug/9.
mutable VS_FIXEDFILEINFO vs_fixed_file_info_;
mutable InitializationState initialized_vs_fixed_file_info_;

View File

@ -35,7 +35,7 @@ namespace test {
//! \brief Formats an error message using an `errno` value.
//!
//! The returned string will combine the \a base string, if supplied, with a
//! a textual and numeric description of the error.
//! textual and numeric description of the error.
//!
//! The message is formatted using `strerror()`. \a err may be `0` or outside of
//! the range of known error codes, and the message returned will contain the
@ -53,7 +53,7 @@ std::string ErrnoMessage(int err, const std::string& base = std::string());
//! \brief Formats an error message using `errno`.
//!
//! The returned string will combine the \a base string, if supplied, with a
//! a textual and numeric description of the error.
//! textual and numeric description of the error.
//!
//! The message is formatted using `strerror()`. `errno` may be `0` or outside
//! of the range of known error codes, and the message returned will contain the
@ -71,8 +71,8 @@ std::string ErrnoMessage(const std::string& base = std::string());
//! \brief Formats an error message using `GetLastError()`.
//!
//! The returned string will combine the \a base string, if supplied, with a
//! a textual and numeric description of the error. The format is the same as
//! the `PLOG()` formatting in base.
//! textual and numeric description of the error. The format is the same as the
//! `PLOG()` formatting in base.
std::string ErrorMessage(const std::string& base = std::string());
#endif

View File

@ -34,7 +34,7 @@ namespace test {
//! \brief Formats a Mach error message.
//!
//! The returned string will combine the \a base string, if supplied, with a
//! a textual and numeric description of the error.
//! textual and numeric description of the error.
//!
//! \param[in] mach_err The Mach error code, which may be a `kern_return_t` or
//! related type.
@ -50,7 +50,7 @@ std::string MachErrorMessage(mach_error_t mach_err,
//! \brief Formats a bootstrap error message.
//!
//! The returned string will combine the \a base string, if supplied, with a
//! a textual and numeric description of the error.
//! textual and numeric description of the error.
//!
//! \param[in] bootstrap_err The bootstrap error code.
//! \param[in] base A string to prepend to the error description.

View File

@ -18,14 +18,14 @@
// child_port provides an interface for port rights to be transferred between
// tasks. Its expected usage is for processes to be able to pass port rights
// across IPC boundaries. A child process may wish to give its parent a copy of
// of a send right to its own task port, or a parent process may wish to give a
// a send right to its own task port, or a parent process may wish to give a
// receive right to a child process that implements a server.
//
// This Mach subsystem defines the lowest-level interface for these rights to
// be transferred. Most users will not user this interface directly, but will
// use ChildPortHandshake, which builds on this interface by providing client
// and server implementations, along with a protocol for establishing
// communication in a parent-child process relationship.
// This Mach subsystem defines the lowest-level interface for these rights to be
// transferred. Most users will not user this interface directly, but will use
// ChildPortHandshake, which builds on this interface by providing client and
// server implementations, along with a protocol for establishing communication
// in a parent-child process relationship.
subsystem child_port 10011;
serverprefix handle_;

View File

@ -29,7 +29,7 @@ namespace crashpad {
//! simultaneous use in a single MachMessageServer::Run() call.
//!
//! This class implements a MachMessageServer::Interface that contains other
//! other MachMessageServer::Interface objects.
//! MachMessageServer::Interface objects.
//!
//! In some situations, it may be desirable for a Mach message server to handle
//! messages from distinct MIG subsystems with distinct
@ -59,9 +59,9 @@ class CompositeMachMessageServer : public MachMessageServer::Interface {
//! \copydoc MachMessageServer::Interface::MachMessageServerFunction()
//!
//! This implementation forwards the message to an appropriate handler added
//! by AddHandler() on the basis of the \a in request messages message ID.
//! If no appropriate handler exists, the \a out reply message is treated as
//! a `mig_reply_error_t`, its return code is set to `MIG_BAD_ID`, and `false`
//! by AddHandler() on the basis of the \a in request messages message ID. If
//! no appropriate handler exists, the \a out reply message is treated as a
//! `mig_reply_error_t`, its return code is set to `MIG_BAD_ID`, and `false`
//! is returned.
bool MachMessageServerFunction(const mach_msg_header_t* in,
mach_msg_header_t* out,

View File

@ -44,7 +44,7 @@ namespace crashpad {
//!
//! \a thread and \a task are only used when \a behavior indicates that the
//! exception message will carry identity information, when it has the value
//! value `EXCEPTION_DEFAULT` or `EXCEPTION_STATE_IDENTITY`, possibly with
//! `EXCEPTION_DEFAULT` or `EXCEPTION_STATE_IDENTITY`, possibly with
//! `MACH_EXCEPTION_CODES` also set. In other cases, these parameters are unused
//! and may be set to `THREAD_NULL` and `TASK_NULL`, respectively.
//!