Fix typos in source code. Patch by Dmitriy (olshevskiy87@bk.ru).
Fixes BZ #349874


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15394 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/m_addrinfo.c b/coregrind/m_addrinfo.c
index e6f58ee..46b4487 100644
--- a/coregrind/m_addrinfo.c
+++ b/coregrind/m_addrinfo.c
@@ -100,7 +100,7 @@
 
    (void) VG_(get_data_description)( ai->Addr.Variable.descr1,
                                      ai->Addr.Variable.descr2, a );
-   /* If there's nothing in descr1/2, free them.  Why is it safe to to
+   /* If there's nothing in descr1/2, free them.  Why is it safe to
       VG_(indexXA) at zero here?  Because VG_(get_data_description)
       guarantees to zero terminate descr1/2 regardless of the outcome
       of the call.  So there's always at least one element in each XA
diff --git a/coregrind/m_aspacemgr/aspacemgr-linux.c b/coregrind/m_aspacemgr/aspacemgr-linux.c
index a3df416..a41d4dc 100644
--- a/coregrind/m_aspacemgr/aspacemgr-linux.c
+++ b/coregrind/m_aspacemgr/aspacemgr-linux.c
@@ -1288,7 +1288,7 @@
 
    case SkResvn: {
       if (seg->smode != SmUpper) return False;
-      /* If the the abutting segment towards higher addresses is an SkAnonC
+      /* If the abutting segment towards higher addresses is an SkAnonC
          segment, then ADDR is a future stack pointer. */
       const NSegment *next = VG_(am_next_nsegment)(seg, /*forward*/ True);
       if (next == NULL || next->kind != SkAnonC) return False;
@@ -2829,9 +2829,9 @@
       }
 
       /* Ok, success with the kernel.  Update our structures. */
-      nsegments[segR].start += delta;
-      nsegments[segA].end += delta;
-      aspacem_assert(nsegments[segR].start <= nsegments[segR].end);
+      NSegment seg_copy = nsegments[segA];
+      seg_copy.end += delta;
+      add_segment(&seg_copy);
 
    } else {
 
@@ -2868,9 +2868,9 @@
       }
 
       /* Ok, success with the kernel.  Update our structures. */
-      nsegments[segR].end -= delta;
-      nsegments[segA].start -= delta;
-      aspacem_assert(nsegments[segR].start <= nsegments[segR].end);
+      NSegment seg_copy = nsegments[segA];
+      seg_copy.start -= delta;
+      add_segment(&seg_copy);
    }
 
    AM_SANITY_CHECK;
diff --git a/coregrind/m_aspacemgr/aspacemgr-segnames.c b/coregrind/m_aspacemgr/aspacemgr-segnames.c
index 73a9472..761608d 100644
--- a/coregrind/m_aspacemgr/aspacemgr-segnames.c
+++ b/coregrind/m_aspacemgr/aspacemgr-segnames.c
@@ -92,7 +92,7 @@
 
    Free slots are chained together in a singly linked list. An index of
    zero indicates the end of the chain. Note that zero cannot conflict
-   with an index into the string table as the minumum index is at least
+   with an index into the string table as the minimum index is at least
    four (see above).
 
    The typical way to traverse the segment names is:
diff --git a/coregrind/m_debuginfo/debuginfo.c b/coregrind/m_debuginfo/debuginfo.c
index 0dc78a3..8f2178e 100644
--- a/coregrind/m_debuginfo/debuginfo.c
+++ b/coregrind/m_debuginfo/debuginfo.c
@@ -118,7 +118,7 @@
 static DebugInfo* debugInfo_list = NULL;
 
 
-/* Find 'di' in the debugInfo_list and move it one step closer the the
+/* Find 'di' in the debugInfo_list and move it one step closer to the
    front of the list, so as to make subsequent searches for it
    cheaper.  When used in a controlled way, makes a major improvement
    in some DebugInfo-search-intensive situations, most notably stack
diff --git a/coregrind/m_debuginfo/readdwarf.c b/coregrind/m_debuginfo/readdwarf.c
index 4a0f750..3909327 100644
--- a/coregrind/m_debuginfo/readdwarf.c
+++ b/coregrind/m_debuginfo/readdwarf.c
@@ -454,9 +454,9 @@
 
       It seems to me that the Intel Fortran compiler generates bad
       DWARF2 line info code: It sets "is_stmt" of the state machine in
-      the the line info reader to be always false. Thus, there is
-      never a statement boundary generated and therefore never a
-      instruction range/line number mapping generated for valgrind.
+      the line info reader to be always false. Thus, there is never
+      a statement boundary generated and therefore never an instruction
+      range/line number mapping generated for valgrind.
 
       Please have a look at the DWARF2 specification, Ch. 6.2
       (x86.ddj.com/ftp/manuals/tools/dwarf.pdf).  Perhaps I understand
@@ -464,7 +464,7 @@
 
       I just had a look at the GDB DWARF2 reader...  They completely
       ignore "is_stmt" when recording line info ;-) That's the reason
-      "objdump -S" works on files from the the intel fortran compiler.
+      "objdump -S" works on files from the intel fortran compiler.
 
       Therefore: */
    info.li_default_is_stmt = True; 
@@ -1437,7 +1437,7 @@
 	 }        
       }  
 
-      /* Move on the the next DIE. */
+      /* Move on the next DIE. */
       die_offset += die_szb;
 
    } /* Looping over DIEs */
diff --git a/coregrind/m_debuginfo/readdwarf3.c b/coregrind/m_debuginfo/readdwarf3.c
index 89f247a..85070e4 100644
--- a/coregrind/m_debuginfo/readdwarf3.c
+++ b/coregrind/m_debuginfo/readdwarf3.c
@@ -1614,7 +1614,7 @@
          (DW_AT_subprogram), and for those, we also note the GExpr
          derived from its DW_AT_frame_base attribute, if any.
          Consequently it should be possible to find, for any
-         variable's DIE, the GExpr for the the containing function's
+         variable's DIE, the GExpr for the containing function's
          DW_AT_frame_base by scanning back through the stack to find
          the nearest entry associated with a function.  This somewhat
          elaborate scheme is provided so as to make it possible to
@@ -3411,7 +3411,7 @@
       if (is_decl && (!is_spec)) {
          /* It's a DW_AT_declaration.  We require the name but
             nothing else. */
-         /* JRS 2012-06-28: following discussion w/ tromey, if the the
+         /* JRS 2012-06-28: following discussion w/ tromey, if the
             type doesn't have name, just make one up, and accept it.
             It might be referred to by other DIEs, so ignoring it
             doesn't seem like a safe option. */
diff --git a/coregrind/m_debuginfo/readexidx.c b/coregrind/m_debuginfo/readexidx.c
index 727deb3..35d07c5 100644
--- a/coregrind/m_debuginfo/readexidx.c
+++ b/coregrind/m_debuginfo/readexidx.c
@@ -287,7 +287,7 @@
       GET_EXTAB_U32(data, extbl_data);
       if (!(data & ARM_EXIDX_COMPACT)) {
          // This denotes a "generic model" handler.  That will involve
-         // executing arbitary machine code, which is something we
+         // executing arbitrary machine code, which is something we
          // can't represent here; hence reject it.
          return ExCantRepresent;
       }
@@ -299,9 +299,9 @@
       extbl_data++;
    }
 
-   // Now look at the the handler table entry.  The first word is
-   // |data| and subsequent words start at |*extbl_data|.  The number
-   // of extra words to use is |extra|, provided that the personality
+   // Now look at the handler table entry.  The first word is |data|
+   // and subsequent words start at |*extbl_data|.  The number of
+   // extra words to use is |extra|, provided that the personality
    // allows extra words.  Even if it does, none may be available --
    // extra_allowed is the maximum number of extra words allowed. */
    if (pers == 0) {
diff --git a/coregrind/m_debuginfo/storage.c b/coregrind/m_debuginfo/storage.c
index 89afca6..f4b1d2f 100644
--- a/coregrind/m_debuginfo/storage.c
+++ b/coregrind/m_debuginfo/storage.c
@@ -32,7 +32,7 @@
 
 /* This file manages the data structures built by the debuginfo
    system.  These are: the top level SegInfo list.  For each SegInfo,
-   there are tables for for address-to-symbol mappings,
+   there are tables for address-to-symbol mappings,
    address-to-src-file/line mappings, and address-to-CFI-info
    mappings.
 */
diff --git a/coregrind/m_demangle/cplus-dem.c b/coregrind/m_demangle/cplus-dem.c
index 7fc2722..46cc3b5 100644
--- a/coregrind/m_demangle/cplus-dem.c
+++ b/coregrind/m_demangle/cplus-dem.c
@@ -2666,7 +2666,7 @@
   /* Iterate over occurrences of __, allowing names and types to have a
      "__" sequence in them.  We must start with the first (not the last)
      occurrence, since "__" most often occur between independent mangled
-     parts, hence starting at the last occurence inside a signature
+     parts, hence starting at the last occurrence inside a signature
      might get us a "successful" demangling of the signature.  */
 
   while (scan[2])
diff --git a/coregrind/m_gdbserver/m_gdbserver.c b/coregrind/m_gdbserver/m_gdbserver.c
index 888340a..263bd4a 100644
--- a/coregrind/m_gdbserver/m_gdbserver.c
+++ b/coregrind/m_gdbserver/m_gdbserver.c
@@ -773,7 +773,7 @@
 }
 
 /* busy > 0 when gdbserver is currently being called.
-   busy is used to to avoid vgdb invoking gdbserver
+   busy is used to avoid vgdb invoking gdbserver
    while gdbserver by Valgrind. */
 static volatile int busy = 0;
 
diff --git a/coregrind/m_gdbserver/server.c b/coregrind/m_gdbserver/server.c
index 485050b..29290e3 100644
--- a/coregrind/m_gdbserver/server.c
+++ b/coregrind/m_gdbserver/server.c
@@ -244,7 +244,7 @@
 "  v.do   expensive_sanity_check_general : do an expensive sanity check now\n"
 "  v.info gdbserver_status : show gdbserver status\n"
 "  v.info memory [aspacemgr] : show valgrind heap memory stats\n"
-"     (with aspacemgr arg, also shows valgrind segments on log ouput)\n"
+"     (with aspacemgr arg, also shows valgrind segments on log output)\n"
 "  v.info exectxt          : show stacktraces and stats of all execontexts\n"
 "  v.info scheduler        : show valgrind thread state and stacktrace\n"
 "  v.info stats            : show various valgrind and tool stats\n"
diff --git a/coregrind/m_gdbserver/target.h b/coregrind/m_gdbserver/target.h
index 1cacc1e..2ea8de9 100644
--- a/coregrind/m_gdbserver/target.h
+++ b/coregrind/m_gdbserver/target.h
@@ -211,7 +211,7 @@
    Returns True if the address of the variable could be found.
       *tls_addr is then set to this address.
    Returns False if tls support is not available for this arch, or
-   if an error occured. *tls_addr is set to NULL. */
+   if an error occurred. *tls_addr is set to NULL. */
 extern Bool valgrind_get_tls_addr (ThreadState *tst,
                                    CORE_ADDR offset,
                                    CORE_ADDR lm,
diff --git a/coregrind/m_libcbase.c b/coregrind/m_libcbase.c
index 60cad36..0f55b08 100644
--- a/coregrind/m_libcbase.c
+++ b/coregrind/m_libcbase.c
@@ -653,7 +653,7 @@
    }
 
    /* If we're unlucky, the alignment constraints for the fast case
-      above won't apply, and we'll have to to it all here.  Hence the
+      above won't apply, and we'll have to do it all here.  Hence the
       unrolling. */
    while (sz >= 4) {
       d[0] = s[0];
diff --git a/coregrind/m_machine.c b/coregrind/m_machine.c
index 99afb7d..e7b826f 100644
--- a/coregrind/m_machine.c
+++ b/coregrind/m_machine.c
@@ -526,7 +526,7 @@
 
 
 /* Helper function for VG_(machine_get_hwcaps), assumes the SIGILL/etc
- * handlers are installed.  Determines the the sizes affected by dcbz
+ * handlers are installed.  Determines the sizes affected by dcbz
  * and dcbzl instructions and updates the given VexArchInfo structure
  * accordingly.
  *
diff --git a/coregrind/m_mallocfree.c b/coregrind/m_mallocfree.c
index 1c4ac50..42f029c 100644
--- a/coregrind/m_mallocfree.c
+++ b/coregrind/m_mallocfree.c
@@ -2113,8 +2113,8 @@
 
 /*
    The idea for malloc_aligned() is to allocate a big block, base, and
-   then split it into two parts: frag, which is returned to the the
-   free pool, and align, which is the bit we're really after.  Here's
+   then split it into two parts: frag, which is returned to the free
+   pool, and align, which is the bit we're really after.  Here's
    a picture.  L and H denote the block lower and upper overheads, in
    bytes.  The details are gruesome.  Note it is slightly complicated
    because the initial request to generate base may return a bigger
diff --git a/coregrind/m_replacemalloc/vg_replace_malloc.c b/coregrind/m_replacemalloc/vg_replace_malloc.c
index 060cb15..fefb8e9 100644
--- a/coregrind/m_replacemalloc/vg_replace_malloc.c
+++ b/coregrind/m_replacemalloc/vg_replace_malloc.c
@@ -1055,7 +1055,7 @@
 }
 
 /* Note that the (void*) casts below are a kludge which stops
-   compilers complaining about the fact that the the replacement
+   compilers complaining about the fact that the replacement
    functions aren't really of the right type. */
 static vki_malloc_zone_t vg_default_zone = {
     NULL, // reserved1
diff --git a/coregrind/m_sigframe/sigframe-tilegx-linux.c b/coregrind/m_sigframe/sigframe-tilegx-linux.c
index 3448ff8..4d4fc94 100644
--- a/coregrind/m_sigframe/sigframe-tilegx-linux.c
+++ b/coregrind/m_sigframe/sigframe-tilegx-linux.c
@@ -262,7 +262,7 @@
     struct vki_ucontext *ucp = &frame->rs_uc;
 
     if (0)
-      VG_(printf)("destory signal frame; sp = %lx, "
+      VG_(printf)("destroy signal frame; sp = %lx, "
                   " %pc = %lx, status=%d\n",
                   (Addr)frame, tst->arch.vex.guest_pc, tst->status);
 
diff --git a/coregrind/m_signals.c b/coregrind/m_signals.c
index 78e2a6d..4aa24f5 100644
--- a/coregrind/m_signals.c
+++ b/coregrind/m_signals.c
@@ -160,7 +160,7 @@
    So what we have to do, when doing any syscall which SfMayBlock, is to
    quickly switch in the SCSS-specified signal mask just before the
    syscall, and switch it back just afterwards, and hope that we don't
-   get caught up in some wierd race condition.  This is the primary
+   get caught up in some weird race condition.  This is the primary
    purpose of the ultra-magical pieces of assembly code in
    coregrind/m_syswrap/syscall-<plat>.S
 
diff --git a/coregrind/m_stacks.c b/coregrind/m_stacks.c
index 9a2319f..1a56f41 100644
--- a/coregrind/m_stacks.c
+++ b/coregrind/m_stacks.c
@@ -103,7 +103,7 @@
  */
 static Stack *current_stack;
 
-/* Find 'st' in the stacks_list and move it one step closer the the
+/* Find 'st' in the stacks_list and move it one step closer to the
    front of the list, so as to make subsequent searches for it
    cheaper. */
 static void move_Stack_one_step_forward ( Stack* st )
diff --git a/coregrind/m_syswrap/syswrap-amd64-linux.c b/coregrind/m_syswrap/syswrap-amd64-linux.c
index de3288e..fcdd9b4 100644
--- a/coregrind/m_syswrap/syswrap-amd64-linux.c
+++ b/coregrind/m_syswrap/syswrap-amd64-linux.c
@@ -188,7 +188,7 @@
 
 /* 
    When a client clones, we need to keep track of the new thread.  This means:
-   1. allocate a ThreadId+ThreadState+stack for the the thread
+   1. allocate a ThreadId+ThreadState+stack for the thread
 
    2. initialize the thread's new VCPU state
 
diff --git a/coregrind/m_syswrap/syswrap-arm-linux.c b/coregrind/m_syswrap/syswrap-arm-linux.c
index 32c41ca..4de7c41 100644
--- a/coregrind/m_syswrap/syswrap-arm-linux.c
+++ b/coregrind/m_syswrap/syswrap-arm-linux.c
@@ -154,7 +154,7 @@
             
 /* 
    When a client clones, we need to keep track of the new thread.  This means:
-   1. allocate a ThreadId+ThreadState+stack for the the thread
+   1. allocate a ThreadId+ThreadState+stack for the thread
 
    2. initialize the thread's new VCPU state
 
diff --git a/coregrind/m_syswrap/syswrap-arm64-linux.c b/coregrind/m_syswrap/syswrap-arm64-linux.c
index 7551e8a..bb75c23 100644
--- a/coregrind/m_syswrap/syswrap-arm64-linux.c
+++ b/coregrind/m_syswrap/syswrap-arm64-linux.c
@@ -198,7 +198,7 @@
             
 /* 
    When a client clones, we need to keep track of the new thread.  This means:
-   1. allocate a ThreadId+ThreadState+stack for the the thread
+   1. allocate a ThreadId+ThreadState+stack for the thread
 
    2. initialize the thread's new VCPU state
 
diff --git a/coregrind/m_syswrap/syswrap-mips32-linux.c b/coregrind/m_syswrap/syswrap-mips32-linux.c
index 7a71576..d477a9c 100644
--- a/coregrind/m_syswrap/syswrap-mips32-linux.c
+++ b/coregrind/m_syswrap/syswrap-mips32-linux.c
@@ -227,7 +227,7 @@
                                  UWord arg4, UWord arg5, Off64T arg6);
 /* 
    When a client clones, we need to keep track of the new thread.  This means:
-   1. allocate a ThreadId+ThreadState+stack for the the thread
+   1. allocate a ThreadId+ThreadState+stack for the thread
    2. initialize the thread's new VCPU state
    3. create the thread using the same args as the client requested,
    but using the scheduler entrypoint for IP, and a separate stack
diff --git a/coregrind/m_syswrap/syswrap-mips64-linux.c b/coregrind/m_syswrap/syswrap-mips64-linux.c
index 3a5e979..8eea1fb 100644
--- a/coregrind/m_syswrap/syswrap-mips64-linux.c
+++ b/coregrind/m_syswrap/syswrap-mips64-linux.c
@@ -185,7 +185,7 @@
 static SysRes sys_set_tls ( ThreadId tid, Addr tlsptr);
 
 /* When a client clones, we need to keep track of the new thread. This means:
-   1. allocate a ThreadId+ThreadState+stack for the the thread
+   1. allocate a ThreadId+ThreadState+stack for the thread
 
    2. initialize the thread's new VCPU state
 
diff --git a/coregrind/m_syswrap/syswrap-ppc32-linux.c b/coregrind/m_syswrap/syswrap-ppc32-linux.c
index 9c9937b..a80e554 100644
--- a/coregrind/m_syswrap/syswrap-ppc32-linux.c
+++ b/coregrind/m_syswrap/syswrap-ppc32-linux.c
@@ -221,7 +221,7 @@
 
 /* 
    When a client clones, we need to keep track of the new thread.  This means:
-   1. allocate a ThreadId+ThreadState+stack for the the thread
+   1. allocate a ThreadId+ThreadState+stack for the thread
 
    2. initialize the thread's new VCPU state
 
diff --git a/coregrind/m_syswrap/syswrap-ppc64-linux.c b/coregrind/m_syswrap/syswrap-ppc64-linux.c
index e2432fd..5799b08 100644
--- a/coregrind/m_syswrap/syswrap-ppc64-linux.c
+++ b/coregrind/m_syswrap/syswrap-ppc64-linux.c
@@ -371,7 +371,7 @@
 
 /* 
    When a client clones, we need to keep track of the new thread.  This means:
-   1. allocate a ThreadId+ThreadState+stack for the the thread
+   1. allocate a ThreadId+ThreadState+stack for the thread
 
    2. initialize the thread's new VCPU state
 
diff --git a/coregrind/m_syswrap/syswrap-s390x-linux.c b/coregrind/m_syswrap/syswrap-s390x-linux.c
index db374f4..9cd68a9 100644
--- a/coregrind/m_syswrap/syswrap-s390x-linux.c
+++ b/coregrind/m_syswrap/syswrap-s390x-linux.c
@@ -194,7 +194,7 @@
 
 /*
    When a client clones, we need to keep track of the new thread.  This means:
-   1. allocate a ThreadId+ThreadState+stack for the the thread
+   1. allocate a ThreadId+ThreadState+stack for the thread
 
    2. initialize the thread's new VCPU state
 
diff --git a/coregrind/m_syswrap/syswrap-tilegx-linux.c b/coregrind/m_syswrap/syswrap-tilegx-linux.c
index fbdf4bf..cbc8e3f 100644
--- a/coregrind/m_syswrap/syswrap-tilegx-linux.c
+++ b/coregrind/m_syswrap/syswrap-tilegx-linux.c
@@ -319,7 +319,7 @@
 static SysRes sys_set_tls ( ThreadId tid, Addr tlsptr );
  /*
    When a client clones, we need to keep track of the new thread.  This means:
-   1. allocate a ThreadId+ThreadState+stack for the the thread
+   1. allocate a ThreadId+ThreadState+stack for the thread
    2. initialize the thread's new VCPU state
    3. create the thread using the same args as the client requested,
    but using the scheduler entrypoint for IP, and a separate stack
diff --git a/coregrind/m_syswrap/syswrap-x86-linux.c b/coregrind/m_syswrap/syswrap-x86-linux.c
index e08af76..168d4fc 100644
--- a/coregrind/m_syswrap/syswrap-x86-linux.c
+++ b/coregrind/m_syswrap/syswrap-x86-linux.c
@@ -195,7 +195,7 @@
 
 /* 
    When a client clones, we need to keep track of the new thread.  This means:
-   1. allocate a ThreadId+ThreadState+stack for the the thread
+   1. allocate a ThreadId+ThreadState+stack for the thread
 
    2. initialize the thread's new VCPU state
 
diff --git a/coregrind/pub_core_errormgr.h b/coregrind/pub_core_errormgr.h
index 110c206..5454882 100644
--- a/coregrind/pub_core_errormgr.h
+++ b/coregrind/pub_core_errormgr.h
@@ -57,7 +57,7 @@
 // else                         print all errors and suppressions used.
 extern void VG_(show_all_errors)          ( Int verbosity, Bool xml );
 
-/* Print (in readable format) the last error that occured. */
+/* Print (in readable format) the last error that occurred. */
 extern void VG_(show_last_error)          ( void );
 
 extern void VG_(show_error_counts_as_XML) ( void );
diff --git a/coregrind/pub_core_gdbserver.h b/coregrind/pub_core_gdbserver.h
index 6ec9daf..71fc711 100644
--- a/coregrind/pub_core_gdbserver.h
+++ b/coregrind/pub_core_gdbserver.h
@@ -83,7 +83,7 @@
 
    Note that gdbserver assumes that software breakpoint is supported
    (as this will be done by re-instrumenting the code).
-   Note that len is ignored for sofware breakpoints. hardware_breakpoint
+   Note that len is ignored for software breakpoints. hardware_breakpoint
    are not supported.
 
    Returns True if the point has properly been inserted or removed
diff --git a/coregrind/vgdb-invoker-ptrace.c b/coregrind/vgdb-invoker-ptrace.c
index 8e7e42e..ca882c3 100644
--- a/coregrind/vgdb-invoker-ptrace.c
+++ b/coregrind/vgdb-invoker-ptrace.c
@@ -329,7 +329,7 @@
 }
 
 /* Stops the given pid, wait for the process to be stopped.
-   Returns True if succesful, False otherwise.
+   Returns True if successful, False otherwise.
    msg is used in tracing and error reporting. */
 static
 Bool stop (pid_t pid, const char *msg)
@@ -348,7 +348,7 @@
 }
 
 /* Attaches to given pid, wait for the process to be stopped.
-   Returns True if succesful, False otherwise.
+   Returns True if successful, False otherwise.
    msg is used in tracing and error reporting. */
 static
 Bool attach (pid_t pid, const char *msg)
@@ -572,7 +572,7 @@
       res = ptrace (PTRACE_GETREGSET, pid, NT_PRSTATUS, &iovec);
       if (res == 0) {
          if (has_working_ptrace_getregset == -1) {
-            // First call to PTRACE_GETREGSET succesful =>
+            // First call to PTRACE_GETREGSET successful =>
             has_working_ptrace_getregset = 1;
             DEBUG(1, "detected a working PTRACE_GETREGSET\n");
          }
@@ -607,7 +607,7 @@
       res = ptrace (PTRACE_GETREGS, pid, NULL, regs);
       if (res == 0) {
          if (has_working_ptrace_getregs == -1) {
-            // First call to PTRACE_GETREGS succesful =>
+            // First call to PTRACE_GETREGS successful =>
             has_working_ptrace_getregs = 1;
             DEBUG(1, "detected a working PTRACE_GETREGS\n");
          }
diff --git a/coregrind/vgdb.c b/coregrind/vgdb.c
index 9057e46..a85f26b 100644
--- a/coregrind/vgdb.c
+++ b/coregrind/vgdb.c
@@ -290,7 +290,7 @@
                last invoke. */
             if (invoked_written != written_by_vgdb_before_sleep) {
                if (invoker_invoke_gdbserver(pid)) {
-                  /* If invoke succesful, no need to invoke again
+                  /* If invoke successful, no need to invoke again
                      for the same value of written_by_vgdb_before_sleep. */
                   invoked_written = written_by_vgdb_before_sleep;
                }