Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH 0/3] [gdb/contrib] A few improvements for spellcheck.sh
@ 2024-11-12 16:07 Tom de Vries
  2024-11-12 16:07 ` [PATCH 1/3] [gdb/contrib] Handle parentheses in spellcheck.sh Tom de Vries
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Tom de Vries @ 2024-11-12 16:07 UTC (permalink / raw)
  To: gdb-patches

Add a few improvements for gdb/contrib/spellcheck.sh:
- handle parentheses
- handle double quotes
- fix the "doens't" typo

Tom de Vries (3):
  [gdb/contrib] Handle parentheses in spellcheck.sh
  [gdb/contrib] Handle double quotes in spellcheck.sh
  [gdb/contrib] Add "doens't->doesn't" to common-misspellings.txt

 gdb/contrib/common-misspellings.txt         |  1 +
 gdb/contrib/spellcheck.sh                   | 43 ++++++++++++++++-----
 gdb/darwin-nat-info.c                       |  4 +-
 gdb/objc-lang.c                             |  2 +-
 gdb/sparc-tdep.c                            |  2 +-
 gdb/sparc64-tdep.c                          |  2 +-
 gdb/testsuite/config/slite.exp              |  2 +-
 gdb/testsuite/gdb.ada/str_chars.exp         |  2 +-
 gdb/testsuite/gdb.dwarf2/dw2-bad-elf.exp    |  4 +-
 gdb/testsuite/gdb.reverse/step-precsave.exp |  4 +-
 gdb/testsuite/gdb.reverse/step-reverse.exp  |  4 +-
 gdb/testsuite/lib/tuiterm.exp               |  2 +-
 12 files changed, 49 insertions(+), 23 deletions(-)


base-commit: 06b8b0ad976aa3ad5864bbe4b196ba737f677efb
-- 
2.35.3


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/3] [gdb/contrib] Handle parentheses in spellcheck.sh
  2024-11-12 16:07 [PATCH 0/3] [gdb/contrib] A few improvements for spellcheck.sh Tom de Vries
@ 2024-11-12 16:07 ` Tom de Vries
  2024-11-12 16:07 ` [PATCH 2/3] [gdb/contrib] Handle double quotes " Tom de Vries
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Tom de Vries @ 2024-11-12 16:07 UTC (permalink / raw)
  To: gdb-patches

Currently, text adjacent to parentheses is not spell-checked:
...
$ cat tmp.txt
(upto)
$ ./gdb/contrib/spellcheck.sh tmp.txt
$
...

Add handling of parentheses, such that we get:
...
$ ./gdb/contrib/spellcheck.sh tmp.txt
upto -> up to
$
...

Rerun spellcheck.sh, resulting in a few "thru->through" replacements.

Tested on x86_64--linux.
---
 gdb/contrib/spellcheck.sh                   | 41 ++++++++++++++++-----
 gdb/objc-lang.c                             |  2 +-
 gdb/testsuite/gdb.reverse/step-precsave.exp |  4 +-
 gdb/testsuite/gdb.reverse/step-reverse.exp  |  4 +-
 4 files changed, 37 insertions(+), 14 deletions(-)

diff --git a/gdb/contrib/spellcheck.sh b/gdb/contrib/spellcheck.sh
index 1b3e88e259b..3399e41ea7f 100755
--- a/gdb/contrib/spellcheck.sh
+++ b/gdb/contrib/spellcheck.sh
@@ -47,6 +47,32 @@ sed_separators=(
     ","
 )
 
+# Pre: start of line, left parenthesis.
+declare -a grep_pre
+grep_pre=(
+    "^"
+    "\("
+)
+declare -a sed_pre
+sed_pre=(
+    "^"
+    "("
+)
+
+# Post: dot, right parenthesis, end of line.
+declare -a grep_post
+grep_post=(
+    "\."
+    "\)"
+    "$"
+)
+declare -a sed_post
+sed_post=(
+    "\."
+    ")"
+    "$"
+)
+
 join ()
 {
     local or
@@ -223,12 +249,11 @@ find_files_matching_words ()
 
 	local before after
 	before=$(grep_join \
-		     "^" \
+		     "${grep_pre[@]}" \
 		     "${grep_separators[@]}")
 	after=$(grep_join \
 		    "${grep_separators[@]}" \
-		    "\." \
-		    "$")
+		    "${grep_post[@]}")
 
 	pat="$before$pat$after"
 
@@ -250,12 +275,11 @@ find_files_matching_word ()
 
     local before after
     before=$(grep_join \
-		 "^" \
+		 "${grep_pre[@]}" \
 		 "${grep_separators[@]}")
     after=$(grep_join \
 		"${grep_separators[@]}" \
-		"\." \
-		"$")
+		"${grep_post[@]}")
 
     pat="$before$pat$after"
 
@@ -278,12 +302,11 @@ replace_word_in_file ()
 
     local before after
     before=$(sed_join \
-		 "^" \
+		 "${sed_pre[@]}" \
 		 "${sed_separators[@]}")
     after=$(sed_join \
 		"${sed_separators[@]}" \
-		"\." \
-		"$")
+		"${sed_post[@]}")
 
     local repl
     repl="s%$before$word$after%\1$replacement\2%g"
diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c
index fa2befd1a35..58aca298dbc 100644
--- a/gdb/objc-lang.c
+++ b/gdb/objc-lang.c
@@ -1203,7 +1203,7 @@ print_object_command (const char *args, int from_tty)
   gdb_printf ("\n");
 }
 
-/* The data structure 'methcalls' is used to detect method calls (thru
+/* The data structure 'methcalls' is used to detect method calls (through
  * ObjC runtime lib functions objc_msgSend, objc_msgSendSuper, etc.),
  * and ultimately find the method being called.
  */
diff --git a/gdb/testsuite/gdb.reverse/step-precsave.exp b/gdb/testsuite/gdb.reverse/step-precsave.exp
index 27b417ec262..04880085cb8 100644
--- a/gdb/testsuite/gdb.reverse/step-precsave.exp
+++ b/gdb/testsuite/gdb.reverse/step-precsave.exp
@@ -268,12 +268,12 @@ gdb_test_multiple "stepi" "$test_message" {
     }
 }
 
-# step backward into function (thru return)
+# step backward into function (through return)
 
 gdb_test "step" "(RETURN FROM CALLEE|ARRIVED IN CALLEE).*" \
     "reverse step into fn call"
 
-# step backward out of called function (thru call)
+# step backward out of called function (through call)
 
 set test_message "reverse step out of called fn"
 gdb_test_multiple "step" "$test_message" {
diff --git a/gdb/testsuite/gdb.reverse/step-reverse.exp b/gdb/testsuite/gdb.reverse/step-reverse.exp
index a3c3b5a5cd1..4bfe289ea73 100644
--- a/gdb/testsuite/gdb.reverse/step-reverse.exp
+++ b/gdb/testsuite/gdb.reverse/step-reverse.exp
@@ -230,12 +230,12 @@ gdb_test_multiple "stepi" "$test_message" {
     }
 }
 
-# step backward into function (thru return)
+# step backward into function (through return)
 
 gdb_test "step" "(RETURN FROM CALLEE|ARRIVED IN CALLEE).*" \
     "reverse step into fn call"
 
-# step backward out of called function (thru call)
+# step backward out of called function (through call)
 
 set test_message "reverse step out of called fn"
 gdb_test_multiple "step" "$test_message" {
-- 
2.35.3


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 2/3] [gdb/contrib] Handle double quotes in spellcheck.sh
  2024-11-12 16:07 [PATCH 0/3] [gdb/contrib] A few improvements for spellcheck.sh Tom de Vries
  2024-11-12 16:07 ` [PATCH 1/3] [gdb/contrib] Handle parentheses in spellcheck.sh Tom de Vries
@ 2024-11-12 16:07 ` Tom de Vries
  2024-11-12 16:07 ` [PATCH 3/3] [gdb/contrib] Add "doens't->doesn't" to common-misspellings.txt Tom de Vries
  2024-11-13 19:40 ` [PATCH 0/3] [gdb/contrib] A few improvements for spellcheck.sh Kevin Buettner
  3 siblings, 0 replies; 6+ messages in thread
From: Tom de Vries @ 2024-11-12 16:07 UTC (permalink / raw)
  To: gdb-patches

Add handling of double quotes in gdb/contrib/spellcheck.sh, and fix the
following typos:
...
inheritence -> inheritance
psuedo -> pseudo
succeded -> succeeded
...

Tested on x86_64-linux.
---
 gdb/contrib/spellcheck.sh      | 2 ++
 gdb/darwin-nat-info.c          | 4 ++--
 gdb/sparc-tdep.c               | 2 +-
 gdb/sparc64-tdep.c             | 2 +-
 gdb/testsuite/config/slite.exp | 2 +-
 5 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/gdb/contrib/spellcheck.sh b/gdb/contrib/spellcheck.sh
index 3399e41ea7f..a95b325ffb3 100755
--- a/gdb/contrib/spellcheck.sh
+++ b/gdb/contrib/spellcheck.sh
@@ -37,6 +37,7 @@ grep_separators=(
     "	"
     ":"
     ","
+    "\""
 )
 declare -a sed_separators
 sed_separators=(
@@ -45,6 +46,7 @@ sed_separators=(
     "\t"
     ":"
     ","
+    "\""
 )
 
 # Pre: start of line, left parenthesis.
diff --git a/gdb/darwin-nat-info.c b/gdb/darwin-nat-info.c
index 121c3a58388..0157dfbb460 100644
--- a/gdb/darwin-nat-info.c
+++ b/gdb/darwin-nat-info.c
@@ -630,7 +630,7 @@ darwin_debug_regions_recurse (task_t task)
     }
   uiout->table_header (3, ui_left, "min-prot", "Min");
   uiout->table_header (3, ui_left, "max-prot", "Max");
-  uiout->table_header (5, ui_left, "inheritence", "Inh");
+  uiout->table_header (5, ui_left, "inheritance", "Inh");
   uiout->table_header (9, ui_left, "share-mode", "Shr");
   uiout->table_header (1, ui_left, "depth", "D");
   uiout->table_header (3, ui_left, "submap", "Sm");
@@ -662,7 +662,7 @@ darwin_debug_regions_recurse (task_t task)
 			     unparse_protection (r_info.protection));
 	uiout->field_string ("max-prot",
 			     unparse_protection (r_info.max_protection));
-	uiout->field_string ("inheritence",
+	uiout->field_string ("inheritance",
 			     unparse_inheritance (r_info.inheritance));
 	uiout->field_string ("share-mode",
 			     unparse_share_mode (r_info.share_mode));
diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c
index 43e70364d17..b48b130c0c5 100644
--- a/gdb/sparc-tdep.c
+++ b/gdb/sparc-tdep.c
@@ -380,7 +380,7 @@ static const char * const sparc32_register_names[] =
 #define SPARC32_NUM_REGS ARRAY_SIZE (sparc32_register_names)
 
 /* We provide the aliases %d0..%d30 for the floating registers as
-   "psuedo" registers.  */
+   "pseudo" registers.  */
 
 static const char * const sparc32_pseudo_register_names[] =
 {
diff --git a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c
index d1e3ae155bf..dc8032f2969 100644
--- a/gdb/sparc64-tdep.c
+++ b/gdb/sparc64-tdep.c
@@ -786,7 +786,7 @@ static const char * const sparc64_register_names[] =
 #define SPARC64_NUM_REGS ARRAY_SIZE (sparc64_register_names)
 
 /* We provide the aliases %d0..%d62 and %q0..%q60 for the floating
-   registers as "psuedo" registers.  */
+   registers as "pseudo" registers.  */
 
 static const char * const sparc64_pseudo_register_names[] =
 {
diff --git a/gdb/testsuite/config/slite.exp b/gdb/testsuite/config/slite.exp
index e1068b74911..d472a63523d 100644
--- a/gdb/testsuite/config/slite.exp
+++ b/gdb/testsuite/config/slite.exp
@@ -139,7 +139,7 @@ proc gdb_load { arg } {
 	sleep 2
 	send_gdb "\x03"
 	gdb_expect {
-	     -re ".*$gdb_prompt $" { verbose "Run command succeded" }
+	     -re ".*$gdb_prompt $" { verbose "Run command succeeded" }
 	     default {
 		perror "error sending monitor run command"
 	    }
-- 
2.35.3


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 3/3] [gdb/contrib] Add "doens't->doesn't" to common-misspellings.txt
  2024-11-12 16:07 [PATCH 0/3] [gdb/contrib] A few improvements for spellcheck.sh Tom de Vries
  2024-11-12 16:07 ` [PATCH 1/3] [gdb/contrib] Handle parentheses in spellcheck.sh Tom de Vries
  2024-11-12 16:07 ` [PATCH 2/3] [gdb/contrib] Handle double quotes " Tom de Vries
@ 2024-11-12 16:07 ` Tom de Vries
  2024-11-13 19:40 ` [PATCH 0/3] [gdb/contrib] A few improvements for spellcheck.sh Kevin Buettner
  3 siblings, 0 replies; 6+ messages in thread
From: Tom de Vries @ 2024-11-12 16:07 UTC (permalink / raw)
  To: gdb-patches

Add "doens't->doesn't" to gdb/contrib/common-misspellings.txt, and run
gdb/contrib/spellcheck.sh to fix this in a few files.

Tested on x86_64-linux.
---
 gdb/contrib/common-misspellings.txt      | 1 +
 gdb/testsuite/gdb.ada/str_chars.exp      | 2 +-
 gdb/testsuite/gdb.dwarf2/dw2-bad-elf.exp | 4 ++--
 gdb/testsuite/lib/tuiterm.exp            | 2 +-
 4 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/gdb/contrib/common-misspellings.txt b/gdb/contrib/common-misspellings.txt
index 62e2c510ae3..23a43461fb1 100644
--- a/gdb/contrib/common-misspellings.txt
+++ b/gdb/contrib/common-misspellings.txt
@@ -16,3 +16,4 @@
 
 inbetween->between, in between, in-between
 sofar->so far
+doens't->doesn't
diff --git a/gdb/testsuite/gdb.ada/str_chars.exp b/gdb/testsuite/gdb.ada/str_chars.exp
index 951ee9765a9..6d494d3ee2c 100644
--- a/gdb/testsuite/gdb.ada/str_chars.exp
+++ b/gdb/testsuite/gdb.ada/str_chars.exp
@@ -57,7 +57,7 @@ gdb_test "print Arg" \
 
 # The 'set print elements' command used to control printing of characters
 # in a string, before we created 'set print characters'.  This test makes
-# sure that 'set print elements' doens't effect string printing any more.
+# sure that 'set print elements' doesn't effect string printing any more.
 gdb_test_no_output "set print elements 12"
 gdb_test "print Arg" \
     " = \"abcdefghijklmnopqrstuvwxyz\"" \
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-bad-elf.exp b/gdb/testsuite/gdb.dwarf2/dw2-bad-elf.exp
index 63d83fb9416..c678c209473 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-bad-elf.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-bad-elf.exp
@@ -123,7 +123,7 @@ Dwarf::assemble $asm_file {
 	include_dir "${srcdir}/${subdir}"
 	file_name "$srcfile" 1
 
-	# Line data doens't need to be correct, just present.
+	# Line data doesn't need to be correct, just present.
 	program {
 	    DW_LNE_set_address [lindex $main_result 0]
 	    DW_LNS_advance_line 10
@@ -142,7 +142,7 @@ Dwarf::assemble $asm_file {
 	include_dir "${srcdir}/${subdir}"
 	file_name "dw2-bad-elf-other.c" 1
 
-	# Line data doens't need to be correct, just present.
+	# Line data doesn't need to be correct, just present.
 	program {
 	    DW_LNE_set_address some_func
 	    DW_LNS_advance_line 5
diff --git a/gdb/testsuite/lib/tuiterm.exp b/gdb/testsuite/lib/tuiterm.exp
index 25f597b56fb..0c4e3d10003 100644
--- a/gdb/testsuite/lib/tuiterm.exp
+++ b/gdb/testsuite/lib/tuiterm.exp
@@ -1178,7 +1178,7 @@ namespace eval Term {
     }
 
     # Check the contents of a box on the screen.  This is a little
-    # like check_contents, but doens't check the whole screen
+    # like check_contents, but doesn't check the whole screen
     # contents, only the contents of a single box.  This procedure
     # includes (effectively) a call to check_box to ensure there is a
     # box where expected, if there is then the contents of the box are
-- 
2.35.3


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/3] [gdb/contrib] A few improvements for spellcheck.sh
  2024-11-12 16:07 [PATCH 0/3] [gdb/contrib] A few improvements for spellcheck.sh Tom de Vries
                   ` (2 preceding siblings ...)
  2024-11-12 16:07 ` [PATCH 3/3] [gdb/contrib] Add "doens't->doesn't" to common-misspellings.txt Tom de Vries
@ 2024-11-13 19:40 ` Kevin Buettner
  2024-11-13 20:07   ` Tom de Vries
  3 siblings, 1 reply; 6+ messages in thread
From: Kevin Buettner @ 2024-11-13 19:40 UTC (permalink / raw)
  To: Tom de Vries; +Cc: gdb-patches

On Tue, 12 Nov 2024 17:07:49 +0100
Tom de Vries <tdevries@suse.de> wrote:

> Add a few improvements for gdb/contrib/spellcheck.sh:
> - handle parentheses
> - handle double quotes
> - fix the "doens't" typo
> 
> Tom de Vries (3):
>   [gdb/contrib] Handle parentheses in spellcheck.sh
>   [gdb/contrib] Handle double quotes in spellcheck.sh
>   [gdb/contrib] Add "doens't->doesn't" to common-misspellings.txt

I've looked over all three patches.  They all LGTM.

Approved-by: Kevin Buettner <kevinb@redhat.com>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 0/3] [gdb/contrib] A few improvements for spellcheck.sh
  2024-11-13 19:40 ` [PATCH 0/3] [gdb/contrib] A few improvements for spellcheck.sh Kevin Buettner
@ 2024-11-13 20:07   ` Tom de Vries
  0 siblings, 0 replies; 6+ messages in thread
From: Tom de Vries @ 2024-11-13 20:07 UTC (permalink / raw)
  To: Kevin Buettner; +Cc: gdb-patches

On 11/13/24 20:40, Kevin Buettner wrote:
> On Tue, 12 Nov 2024 17:07:49 +0100
> Tom de Vries <tdevries@suse.de> wrote:
> 
>> Add a few improvements for gdb/contrib/spellcheck.sh:
>> - handle parentheses
>> - handle double quotes
>> - fix the "doens't" typo
>>
>> Tom de Vries (3):
>>    [gdb/contrib] Handle parentheses in spellcheck.sh
>>    [gdb/contrib] Handle double quotes in spellcheck.sh
>>    [gdb/contrib] Add "doens't->doesn't" to common-misspellings.txt
> 
> I've looked over all three patches.  They all LGTM.
> 
> Approved-by: Kevin Buettner <kevinb@redhat.com>
> 

Hi Kevin,

thanks for the reviewed, pushed.

- Tom

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-11-13 20:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-12 16:07 [PATCH 0/3] [gdb/contrib] A few improvements for spellcheck.sh Tom de Vries
2024-11-12 16:07 ` [PATCH 1/3] [gdb/contrib] Handle parentheses in spellcheck.sh Tom de Vries
2024-11-12 16:07 ` [PATCH 2/3] [gdb/contrib] Handle double quotes " Tom de Vries
2024-11-12 16:07 ` [PATCH 3/3] [gdb/contrib] Add "doens't->doesn't" to common-misspellings.txt Tom de Vries
2024-11-13 19:40 ` [PATCH 0/3] [gdb/contrib] A few improvements for spellcheck.sh Kevin Buettner
2024-11-13 20:07   ` Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox