From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id cDV/B638M2e05C8AWB0awg (envelope-from ) for ; Tue, 12 Nov 2024 20:11:09 -0500 Authentication-Results: simark.ca; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=ZzGwDgKV; dkim=fail reason="signature verification failed" header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=0hMOj1vX; dkim=fail reason="signature verification failed" (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=ZzGwDgKV; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=0hMOj1vX; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id EE6A91E11F; Tue, 12 Nov 2024 20:11:08 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.0 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id E861F1E116 for ; Tue, 12 Nov 2024 20:11:05 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 66CB43858C66 for ; Wed, 13 Nov 2024 01:11:05 +0000 (GMT) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by sourceware.org (Postfix) with ESMTPS id 9845A3858D29 for ; Wed, 13 Nov 2024 01:08:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9845A3858D29 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 9845A3858D29 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1731460123; cv=none; b=EP9wdGp9vITYN80mHV9cbZBEdq24TQyYJzpjvJ0Tye/M5XGb0KzicZO5fmCW8BiHR0qxMfoe/opcswM8kg1FYC8NzEoOHyBAV69STDF0GucmtKCOFSR8PozfTQnheJ9PUjnAiC5qVgtNaTaG6BtZ0h5sGw2fl42piw0qfEoMl28= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1731460123; c=relaxed/simple; bh=lxJXrIkrSr8dD85/XOGvPbeDnIPY3ZcIkeO13mOzwSE=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:From: To:Subject:Date:Message-Id:MIME-Version; b=tGokFpq2Gja0aAkMVXmNsiFCAVR5pf6GsUcn3rm1/c9yj/Ztw56iRH3NhoumCbVWNEv2AM0TqEWo8dVyEdHTFpvku/ZTpxx60WMx0d3Y7Un+oAQCS6jvSYTJ9h91aDFct2cpYB6f8bIg8KiqheeudlT1vEPlJKzExCZ5pcchCzA= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 8016F1F365 for ; Wed, 13 Nov 2024 01:08:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1731460110; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=LrUi3wIB2aUPkvPkYK0EhknamMflW+lIM1Am/0QG5EA=; b=ZzGwDgKVuBuZOgU33rlyGFEbi0VXB7BBa6/x64HsMJzmZefXtx9Y/BRyBugzAUp28dbCvM H1E6ypJ7idb8iHx9FjZd03CjkOKYrqegv+jKMQezMu6DeZv77fXK1J022hnFD7dNG51oxU aRZvKatHzTfccLzUgPpE5jlga24Lu+0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1731460110; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=LrUi3wIB2aUPkvPkYK0EhknamMflW+lIM1Am/0QG5EA=; b=0hMOj1vXD21lpmU1PyNSVqke+DtKc1RCVBwmdNj2LlwWHQwKxBkN92XEZ1gyDl8ZICxRzF hooWpbSPyiHHujDA== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=ZzGwDgKV; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=0hMOj1vX DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1731460110; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=LrUi3wIB2aUPkvPkYK0EhknamMflW+lIM1Am/0QG5EA=; b=ZzGwDgKVuBuZOgU33rlyGFEbi0VXB7BBa6/x64HsMJzmZefXtx9Y/BRyBugzAUp28dbCvM H1E6ypJ7idb8iHx9FjZd03CjkOKYrqegv+jKMQezMu6DeZv77fXK1J022hnFD7dNG51oxU aRZvKatHzTfccLzUgPpE5jlga24Lu+0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1731460110; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=LrUi3wIB2aUPkvPkYK0EhknamMflW+lIM1Am/0QG5EA=; b=0hMOj1vXD21lpmU1PyNSVqke+DtKc1RCVBwmdNj2LlwWHQwKxBkN92XEZ1gyDl8ZICxRzF hooWpbSPyiHHujDA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 6A37E13301 for ; Wed, 13 Nov 2024 01:08:30 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id xpmuGA78M2f5MAAAD6G6ig (envelope-from ) for ; Wed, 13 Nov 2024 01:08:30 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH] [gdb/contrib] Handle capitalized words in spellcheck.sh Date: Wed, 13 Nov 2024 02:08:52 +0100 Message-Id: <20241113010852.13952-1-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8016F1F365 X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; RCVD_TLS_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:mid]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; TO_DN_NONE(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; MIME_TRACE(0.00)[0:+]; DKIM_TRACE(0.00)[suse.de:+] X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Rspamd-Action: no action X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org The dictionary contains a few entries with capital letters: ... $ grep -E '[A-Z]' .git/wikipedia-common-misspellings.txt | wc -l 143 ... but they don't look too interesting in the gdb context (for instance, Habsbourg->Habsburg), so filter them out. That leaves us with entries looking only like "foobat->foobar", so add handling of capitalized words, such that we also rewrite "Foobat" to "Foobar". Tested on aarch64-linux. Verified with shellcheck. --- gdb/amd64-linux-nat.c | 4 ++-- gdb/amd64-tdep.c | 2 +- gdb/contrib/spellcheck.sh | 25 ++++++++++++++++------ gdb/i386-linux-nat.c | 6 +++--- gdb/linux-tdep.c | 2 +- gdb/m2-exp.y | 2 +- gdb/m32r-linux-nat.c | 4 ++-- gdb/m68k-linux-nat.c | 2 +- gdb/or1k-linux-nat.c | 2 +- gdb/target.h | 2 +- gdb/testsuite/gdb.arch/arc-decode-insn.S | 2 +- gdb/testsuite/gdb.cp/static-print-quit.exp | 2 +- gdb/tilegx-linux-nat.c | 4 ++-- 13 files changed, 36 insertions(+), 23 deletions(-) diff --git a/gdb/amd64-linux-nat.c b/gdb/amd64-linux-nat.c index 742fc81f832..c3b7a19b5cb 100644 --- a/gdb/amd64-linux-nat.c +++ b/gdb/amd64-linux-nat.c @@ -90,7 +90,7 @@ static int amd64_linux_gregset32_reg_offset[] = }; -/* Transfering the general-purpose registers between GDB, inferiors +/* Transferring the general-purpose registers between GDB, inferiors and core files. */ /* See amd64_collect_native_gregset. This linux specific version handles @@ -178,7 +178,7 @@ fill_gregset (const struct regcache *regcache, amd64_linux_collect_native_gregset (regcache, gregsetp, regnum); } -/* Transfering floating-point registers between GDB, inferiors and cores. */ +/* Transferring floating-point registers between GDB, inferiors and cores. */ /* Fill GDB's register cache with the floating-point and SSE register values in *FPREGSETP. */ diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c index c17b5f7f6f3..ba6532fcee7 100644 --- a/gdb/amd64-tdep.c +++ b/gdb/amd64-tdep.c @@ -1227,7 +1227,7 @@ amd64_get_unused_input_int_reg (const struct amd64_insn *details) /* Avoid RAX. */ used_regs_mask |= 1 << EAX_REG_NUM; - /* Similarily avoid RDX, implicit operand in divides. */ + /* Similarly avoid RDX, implicit operand in divides. */ used_regs_mask |= 1 << EDX_REG_NUM; /* Avoid RSP. */ used_regs_mask |= 1 << ESP_REG_NUM; diff --git a/gdb/contrib/spellcheck.sh b/gdb/contrib/spellcheck.sh index 1b3e88e259b..f8d9274440c 100755 --- a/gdb/contrib/spellcheck.sh +++ b/gdb/contrib/spellcheck.sh @@ -190,8 +190,10 @@ output_local_dictionary () output_dictionaries () { - output_local_dictionary - cat "$dictionary" + ( + output_local_dictionary + cat "$dictionary" + ) | grep -E -v "[A-Z]" } parse_dictionary () @@ -219,7 +221,14 @@ find_files_matching_words () else rm -f "$cache_dir/$cache_file2".* - pat=$(grep_join "${words[@]}") + declare -a re_words + mapfile -t re_words \ + < <(for f in "${words[@]}"; do + echo "$f" + done \ + | sed "s/^\(.\)/[\u\1\1]/") + + pat=$(grep_join "${re_words[@]}") local before after before=$(grep_join \ @@ -257,6 +266,8 @@ find_files_matching_word () "\." \ "$") + pat="(${pat@u}|$pat)" + pat="$before$pat$after" grep -E \ @@ -285,11 +296,13 @@ replace_word_in_file () "\." \ "$") - local repl - repl="s%$before$word$after%\1$replacement\2%g" + local repl1 + local repl2 + repl1="s%$before$word$after%\1$replacement\2%g" + repl2="s%$before${word@u}$after%\1${replacement@u}\2%g" sed -i \ - "$repl" \ + "$repl1;$repl2" \ "$file" } diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c index 41c1113257c..d2cbe51e72b 100644 --- a/gdb/i386-linux-nat.c +++ b/gdb/i386-linux-nat.c @@ -137,7 +137,7 @@ store_register (const struct regcache *regcache, int regno) } -/* Transfering the general-purpose registers between GDB, inferiors +/* Transferring the general-purpose registers between GDB, inferiors and core files. */ /* Fill GDB's register array with the general-purpose register values @@ -234,7 +234,7 @@ static void store_regs (const struct regcache *regcache, int tid, int regno) {} #endif -/* Transfering floating-point registers between GDB, inferiors and cores. */ +/* Transferring floating-point registers between GDB, inferiors and cores. */ /* Fill GDB's register array with the floating-point register values in *FPREGSETP. */ @@ -304,7 +304,7 @@ store_fpregs (const struct regcache *regcache, int tid, int regno) #endif -/* Transfering floating-point and SSE registers to and from GDB. */ +/* Transferring floating-point and SSE registers to and from GDB. */ /* Fetch all registers covered by the PTRACE_GETREGSET request from process/thread TID and store their values in GDB's register array. diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c index 65ec221ef48..d3452059ce2 100644 --- a/gdb/linux-tdep.c +++ b/gdb/linux-tdep.c @@ -2104,7 +2104,7 @@ linux_make_corefile_notes (struct gdbarch *gdbarch, bfd *obfd, int *note_size) if (!note_data) return NULL; - /* Auxillary vector. */ + /* Auxiliary vector. */ std::optional auxv = target_read_alloc (current_inferior ()->top_target (), TARGET_OBJECT_AUXV, NULL); diff --git a/gdb/m2-exp.y b/gdb/m2-exp.y index 2887ad2be21..0201f84cfa5 100644 --- a/gdb/m2-exp.y +++ b/gdb/m2-exp.y @@ -961,7 +961,7 @@ yylex (void) case LOC_LABEL: case LOC_UNRESOLVED: - error (_("internal: Unforseen case in m2lex()")); + error (_("internal: Unforeseen case in m2lex()")); default: error (_("unhandled token in m2lex()")); diff --git a/gdb/m32r-linux-nat.c b/gdb/m32r-linux-nat.c index 08a4db1d39a..bb8667539b5 100644 --- a/gdb/m32r-linux-nat.c +++ b/gdb/m32r-linux-nat.c @@ -66,7 +66,7 @@ static int regmap[] = { -/* Transfering the general-purpose registers between GDB, inferiors +/* Transferring the general-purpose registers between GDB, inferiors and core files. */ /* Fill GDB's register array with the general-purpose register values @@ -176,7 +176,7 @@ store_regs (const struct regcache *regcache, int tid, int regno) -/* Transfering floating-point registers between GDB, inferiors and cores. +/* Transferring floating-point registers between GDB, inferiors and cores. Since M32R has no floating-point registers, these functions do nothing. */ void diff --git a/gdb/m68k-linux-nat.c b/gdb/m68k-linux-nat.c index 49cd49193bb..7ea5847a2a6 100644 --- a/gdb/m68k-linux-nat.c +++ b/gdb/m68k-linux-nat.c @@ -300,7 +300,7 @@ static void store_regs (const struct regcache *regcache, int tid, int regno) #endif -/* Transfering floating-point registers between GDB, inferiors and cores. */ +/* Transferring floating-point registers between GDB, inferiors and cores. */ /* What is the address of fpN within the floating-point register set F? */ #define FPREG_ADDR(f, n) (&(f)->fpregs[(n) * 3]) diff --git a/gdb/or1k-linux-nat.c b/gdb/or1k-linux-nat.c index 21392245f48..e6cc9c70293 100644 --- a/gdb/or1k-linux-nat.c +++ b/gdb/or1k-linux-nat.c @@ -106,7 +106,7 @@ fill_gregset (const struct regcache *regcache, prgregset_t *gregs, int regnum) regcache->raw_collect (OR1K_NPC_REGNUM, regp + 32); } -/* Transfering floating-point registers between GDB, inferiors and cores. +/* Transferring floating-point registers between GDB, inferiors and cores. Since OpenRISC floating-point registers are the same as GPRs these do nothing. */ diff --git a/gdb/target.h b/gdb/target.h index 6da58c7e179..d8729913b3b 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -1651,7 +1651,7 @@ struct memory_write_request : begin (begin_), end (end_), data (data_), baton (baton_) {} - /* Begining address that must be written. */ + /* Beginning address that must be written. */ ULONGEST begin; /* Past-the-end address. */ ULONGEST end; diff --git a/gdb/testsuite/gdb.arch/arc-decode-insn.S b/gdb/testsuite/gdb.arch/arc-decode-insn.S index ea37455d890..6b37d545c31 100644 --- a/gdb/testsuite/gdb.arch/arc-decode-insn.S +++ b/gdb/testsuite/gdb.arch/arc-decode-insn.S @@ -394,7 +394,7 @@ start_branch_tests: #ifdef TEST_B .Lb_target: - ; Artifical nop, so that first b will not branch to itself. + ; Artificial nop, so that first b will not branch to itself. nop_s ; b s25 .set b_s25_target, @.Lb_target diff --git a/gdb/testsuite/gdb.cp/static-print-quit.exp b/gdb/testsuite/gdb.cp/static-print-quit.exp index 109bf8dc336..72364390ceb 100644 --- a/gdb/testsuite/gdb.cp/static-print-quit.exp +++ b/gdb/testsuite/gdb.cp/static-print-quit.exp @@ -55,7 +55,7 @@ gdb_test_multiple "" $test { gdb_test "q" ".*" -# Now the obstack is uninitialized. Excercise it. +# Now the obstack is uninitialized. Exercise it. gdb_test_no_output "set pagination off" gdb_test "print c" ".*" "first print" diff --git a/gdb/tilegx-linux-nat.c b/gdb/tilegx-linux-nat.c index 440a5cc89ce..5755e7078e7 100644 --- a/gdb/tilegx-linux-nat.c +++ b/gdb/tilegx-linux-nat.c @@ -72,7 +72,7 @@ static const int regmap[] = 56, 58 }; -/* Transfering the general-purpose registers between GDB, inferiors +/* Transferring the general-purpose registers between GDB, inferiors and core files. */ /* Fill GDB's register array with the general-purpose register values @@ -105,7 +105,7 @@ fill_gregset (const struct regcache* regcache, regcache->raw_collect (i, regp + regmap[i]); } -/* Transfering floating-point registers between GDB, inferiors and cores. */ +/* Transferring floating-point registers between GDB, inferiors and cores. */ /* Fill GDB's register array with the floating-point register values in *FPREGSETP. */ base-commit: 2e7d431af880736d6a6e8144a8e3d6d1e65008f5 -- 2.35.3