public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] [gdb/testsuite] Add -q to INTERNAL_GDBFLAGS
@ 2023-04-05 18:34 Tom de Vries
  2023-04-06  0:17 ` Simon Marchi
  0 siblings, 1 reply; 7+ messages in thread
From: Tom de Vries @ 2023-04-05 18:34 UTC (permalink / raw)
  To: gdb-patches

Whenever we start gdb in the testsuite, we have the rather verbose:
...
$ gdb
GNU gdb (GDB) 14.0.50.20230405-git
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb)
...

This makes gdb.log longer than necessary and harder to read.

We do need to test that the output is produced, but that should be limited to
one or a few test-cases.

Fix this by adding -q to INTERNAL_GDBFLAGS, such that we simply have:
...
$ gdb -q
(gdb)
...

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.base/early-init-file.exp    |   9 +-
 gdb/testsuite/gdb.base/libsegfault.exp        |   5 +-
 .../gdb.base/paginate-execution-startup.exp   |  14 +-
 gdb/testsuite/gdb.base/style.exp              |   7 +-
 gdb/testsuite/gdb.gdb/selftest.exp            |   5 +-
 gdb/testsuite/gdb.python/py-prompt.exp        | 176 +++++++++---------
 gdb/testsuite/lib/gdb.exp                     |   9 +
 gdb/testsuite/lib/mi-support.exp              |   4 +
 8 files changed, 132 insertions(+), 97 deletions(-)

diff --git a/gdb/testsuite/gdb.base/early-init-file.exp b/gdb/testsuite/gdb.base/early-init-file.exp
index 07159d45f0c..fcd1ff041a1 100644
--- a/gdb/testsuite/gdb.base/early-init-file.exp
+++ b/gdb/testsuite/gdb.base/early-init-file.exp
@@ -101,7 +101,10 @@ save_vars { env(TERM) } {
     setenv TERM ansi
 
     # Start GDB and confirm that the version string is styled.
-    check_gdb_startup_version_string version
+    save_vars { INTERNAL_GDBFLAGS env(HOME) env(XDG_CONFIG_HOME) } {
+	set INTERNAL_GDBFLAGS [string map {"-q" ""} $INTERNAL_GDBFLAGS]
+	check_gdb_startup_version_string version
+    }
 
     # Create an empty directory we can use as HOME for some of the
     # tests below.  When we set XDG_CONFIG_HOME we still need to point
@@ -120,7 +123,7 @@ save_vars { env(TERM) } {
 
     # Now arrange to use the fake home directory early init file.
     save_vars { INTERNAL_GDBFLAGS env(HOME) env(XDG_CONFIG_HOME) } {
-	set INTERNAL_GDBFLAGS [string map {"-nx" ""} $INTERNAL_GDBFLAGS]
+	set INTERNAL_GDBFLAGS [string map {"-nx" "" "-q" ""} $INTERNAL_GDBFLAGS]
 
 	# Now test GDB when using the HOME directory.
 	set env(HOME) $home_dir
@@ -144,7 +147,7 @@ save_vars { env(TERM) } {
 
     # Now arrange to use the fake home directory startup file.
     save_vars { INTERNAL_GDBFLAGS env(HOME) env(XDG_CONFIG_HOME) } {
-	set INTERNAL_GDBFLAGS [string map {"-nx" ""} $INTERNAL_GDBFLAGS]
+	set INTERNAL_GDBFLAGS [string map {"-nx" "" "-q" ""} $INTERNAL_GDBFLAGS]
 
 	# Now test GDB when using the HOME directory.
 	set env(HOME) $home_dir
diff --git a/gdb/testsuite/gdb.base/libsegfault.exp b/gdb/testsuite/gdb.base/libsegfault.exp
index 7862c9600fe..0af96154eff 100644
--- a/gdb/testsuite/gdb.base/libsegfault.exp
+++ b/gdb/testsuite/gdb.base/libsegfault.exp
@@ -84,4 +84,7 @@ proc test_libsegfault {} {
     }
 }
 
-test_libsegfault
+save_vars { ::INTERNAL_GDBFLAGS } {
+    set ::INTERNAL_GDBFLAGS [string map {"-q" ""} $::INTERNAL_GDBFLAGS]
+    test_libsegfault
+}
diff --git a/gdb/testsuite/gdb.base/paginate-execution-startup.exp b/gdb/testsuite/gdb.base/paginate-execution-startup.exp
index 0b14db2f922..4c52d0f73c2 100644
--- a/gdb/testsuite/gdb.base/paginate-execution-startup.exp
+++ b/gdb/testsuite/gdb.base/paginate-execution-startup.exp
@@ -172,12 +172,16 @@ proc test_fg_execution_pagination_cancel { how } {
     }
 }
 
-if {[probe_can_run_cmdline] > 0} {
-    test_fg_execution_pagination_return
-    if ![target_info exists gdb,nointerrupts] {
-       test_fg_execution_pagination_cancel "ctrl-c"
+save_vars { INTERNAL_GDBFLAGS } {
+    set INTERNAL_GDBFLAGS [string map {"-q" ""} $INTERNAL_GDBFLAGS]
+
+    if {[probe_can_run_cmdline] > 0} {
+	test_fg_execution_pagination_return
+	if ![target_info exists gdb,nointerrupts] {
+	    test_fg_execution_pagination_cancel "ctrl-c"
+	}
+	test_fg_execution_pagination_cancel "quit"
     }
-    test_fg_execution_pagination_cancel "quit"
 }
 
 set GDBFLAGS $saved_gdbflags
diff --git a/gdb/testsuite/gdb.base/style.exp b/gdb/testsuite/gdb.base/style.exp
index 0a7228c6890..0370550d251 100644
--- a/gdb/testsuite/gdb.base/style.exp
+++ b/gdb/testsuite/gdb.base/style.exp
@@ -459,7 +459,12 @@ proc test_disassembler_error_handling { } {
 # startup process).
 proc test_startup_version_string { } {
     gdb_exit
-    gdb_spawn
+
+    save_vars { ::INTERNAL_GDBFLAGS } {
+	set ::INTERNAL_GDBFLAGS [string map {"-q" ""} $::INTERNAL_GDBFLAGS]
+
+	gdb_spawn
+    }
 
     # Deliberate use of base STYLE proc here as the style of the
     # startup version string can't (currently) be controlled.
diff --git a/gdb/testsuite/gdb.gdb/selftest.exp b/gdb/testsuite/gdb.gdb/selftest.exp
index ac3f3fc2f6a..23d180a6298 100644
--- a/gdb/testsuite/gdb.gdb/selftest.exp
+++ b/gdb/testsuite/gdb.gdb/selftest.exp
@@ -165,4 +165,7 @@ proc test_with_self { } {
     return 0
 }
 
-do_self_tests captured_main test_with_self
+save_vars { INTERNAL_GDBFLAGS } {
+    set INTERNAL_GDBFLAGS [string map {"-q" ""} $INTERNAL_GDBFLAGS]
+    do_self_tests captured_main test_with_self
+}
diff --git a/gdb/testsuite/gdb.python/py-prompt.exp b/gdb/testsuite/gdb.python/py-prompt.exp
index 35e8144d3f9..d45bf0f9c97 100644
--- a/gdb/testsuite/gdb.python/py-prompt.exp
+++ b/gdb/testsuite/gdb.python/py-prompt.exp
@@ -27,92 +27,96 @@ if {[build_executable $testfile.exp $testfile $srcfile debug] == -1} {
     return -1
 }
 
-global GDBFLAGS
-set saved_gdbflags $GDBFLAGS
-set GDBFLAGS [concat $GDBFLAGS " -ex \"set height 0\""]
-set GDBFLAGS [concat $GDBFLAGS " -ex \"set width 0\""]
-set GDBFLAGS [concat $GDBFLAGS " -ex \"python p = list()\""]
-set prompt_func "python def foo(x): global p; p.append(x);  return \'(Foo) \'"
-set GDBFLAGS [concat $GDBFLAGS " -ex \"$prompt_func\""]
-set GDBFLAGS [concat $GDBFLAGS " -ex \"python gdb.prompt_hook=foo\""]
-
-set tmp_gdbflags $GDBFLAGS
-set gdb_prompt_fail $gdb_prompt
-
-global gdb_prompt
-# Does not include the space at the end of the prompt.
-# gdb_test expects it not to be there.
-set gdb_prompt "\[(\]Foo\[)\]"
-
-with_test_prefix "set editing on" {
-    set GDBFLAGS [concat $tmp_gdbflags " -ex \"set editing on\""]
-    prompt_gdb_start
-    gdb_test "python x = len(p); print (gdb.execute(\"show prompt\", to_string = True))" \
-	".*prompt is \"$gdb_prompt \".*" \
-	"show prompt gets the correct result"
-    gdb_test "python print ('%d %d' % (x, len(p)))" "1 2" \
-	"retrieving the prompt causes no extra prompt_hook calls"
-    gdb_test "python print (\"'\" + str(p\[0\]) + \"'\")" "'$gdb_prompt_fail '" \
-	"prompt_hook argument is default prompt."
-    gdb_exit
-}
-
-with_test_prefix "set editing off" {
-    set GDBFLAGS [concat $tmp_gdbflags " -ex \"set editing off\""]
-    prompt_gdb_start
-    gdb_test "python x = len(p); print (gdb.execute(\"show prompt\", to_string = True))" \
-	".*prompt is \"$gdb_prompt \".*" \
-	"show prompt gets the correct result 2"
-    gdb_test "python print ('%d %d' % (x, len(p)))" "1 2" \
-	"retrieving the prompt causes no extra prompt_hook calls 2"
-    gdb_test "python print (\"'\" + str(p\[0\]) + \"'\")" "'$gdb_prompt_fail '" \
-	"prompt_hook argument is default prompt. 2"
-    gdb_exit
-}
+save_vars { INTERNAL_GDBFLAGS } {
+    set INTERNAL_GDBFLAGS [string map {"-q" ""} $INTERNAL_GDBFLAGS]
+
+    global GDBFLAGS
+    set saved_gdbflags $GDBFLAGS
+    set GDBFLAGS [concat $GDBFLAGS " -ex \"set height 0\""]
+    set GDBFLAGS [concat $GDBFLAGS " -ex \"set width 0\""]
+    set GDBFLAGS [concat $GDBFLAGS " -ex \"python p = list()\""]
+    set prompt_func "python def foo(x): global p; p.append(x);  return \'(Foo) \'"
+    set GDBFLAGS [concat $GDBFLAGS " -ex \"$prompt_func\""]
+    set GDBFLAGS [concat $GDBFLAGS " -ex \"python gdb.prompt_hook=foo\""]
+
+    set tmp_gdbflags $GDBFLAGS
+    set gdb_prompt_fail $gdb_prompt
+
+    global gdb_prompt
+    # Does not include the space at the end of the prompt.
+    # gdb_test expects it not to be there.
+    set gdb_prompt "\[(\]Foo\[)\]"
+
+    with_test_prefix "set editing on" {
+	set GDBFLAGS [concat $tmp_gdbflags " -ex \"set editing on\""]
+	prompt_gdb_start
+	gdb_test "python x = len(p); print (gdb.execute(\"show prompt\", to_string = True))" \
+	    ".*prompt is \"$gdb_prompt \".*" \
+	    "show prompt gets the correct result"
+	gdb_test "python print ('%d %d' % (x, len(p)))" "1 2" \
+	    "retrieving the prompt causes no extra prompt_hook calls"
+	gdb_test "python print (\"'\" + str(p\[0\]) + \"'\")" "'$gdb_prompt_fail '" \
+	    "prompt_hook argument is default prompt."
+	gdb_exit
+    }
+
+    with_test_prefix "set editing off" {
+	set GDBFLAGS [concat $tmp_gdbflags " -ex \"set editing off\""]
+	prompt_gdb_start
+	gdb_test "python x = len(p); print (gdb.execute(\"show prompt\", to_string = True))" \
+	    ".*prompt is \"$gdb_prompt \".*" \
+	    "show prompt gets the correct result 2"
+	gdb_test "python print ('%d %d' % (x, len(p)))" "1 2" \
+	    "retrieving the prompt causes no extra prompt_hook calls 2"
+	gdb_test "python print (\"'\" + str(p\[0\]) + \"'\")" "'$gdb_prompt_fail '" \
+	    "prompt_hook argument is default prompt. 2"
+	gdb_exit
+    }
+
+    if {![can_spawn_for_attach]} {
+	set GDBFLAGS $saved_gdbflags
+	return 0
+    }
+
+    set test_spawn_id [spawn_wait_for_attach $binfile]
+    set testpid [spawn_id_get_pid $test_spawn_id]
+
+    set GDBFLAGS [concat $tmp_gdbflags " -ex \"set pagination off\""]
+    set GDBFLAGS [concat $GDBFLAGS " -ex \"set editing on\""]
+    set GDBFLAGS [concat $GDBFLAGS " -ex \"attach $testpid\""]
+    set GDBFLAGS [concat $GDBFLAGS " -ex \"continue&\""]
+
+    # sync_execution = 1 is_running = 1
+    with_test_prefix "sync_execution = 1, is_running = 1" {
+	prompt_gdb_start
+	gdb_test "python x = len(p); print (gdb.execute(\"show prompt\", to_string = True))" \
+	    ".*prompt is \"$gdb_prompt \".*" \
+	    "show prompt gets the correct result 3"
+	gdb_test "python print ('%d %d' % (x, len(p)))" "1 2" \
+	    "retrieving the prompt causes no extra prompt_hook calls 3"
+	gdb_test "python print (\"'\" + str(p\[0\]) + \"'\")" "'$gdb_prompt_fail '" \
+	    "prompt_hook argument is default prompt. 3"
+	gdb_exit
+    }
+
+    set GDBFLAGS [concat $tmp_gdbflags " -ex \"set pagination off\""]
+    set GDBFLAGS [concat $GDBFLAGS " -ex \"set editing on\""]
+    set GDBFLAGS [concat $GDBFLAGS " -ex \"attach $testpid\""]
+    set GDBFLAGS [concat $GDBFLAGS " -ex \"interrupt\""]
+
+    # sync_execution = 1 is_running = 0
+    with_test_prefix "sync_execution = 1, is_running = 0" {
+	prompt_gdb_start
+	gdb_test "python x = len(p); print (gdb.execute(\"show prompt\", to_string = True))" \
+	    ".*prompt is \"$gdb_prompt \".*" \
+	    "show prompt gets the correct result 4"
+	gdb_test "python print ('%d %d' % (x, len(p)))" "1 2" \
+	    "retrieving the prompt causes no extra prompt_hook calls 4"
+	gdb_test "python print (\"'\" + str(p\[0\]) + \"'\")" "'$gdb_prompt_fail '" \
+	    "prompt_hook argument is default prompt. 4"
+	gdb_exit
+    }
 
-if {![can_spawn_for_attach]} {
     set GDBFLAGS $saved_gdbflags
-    return 0
-}
-
-set test_spawn_id [spawn_wait_for_attach $binfile]
-set testpid [spawn_id_get_pid $test_spawn_id]
-
-set GDBFLAGS [concat $tmp_gdbflags " -ex \"set pagination off\""]
-set GDBFLAGS [concat $GDBFLAGS " -ex \"set editing on\""]
-set GDBFLAGS [concat $GDBFLAGS " -ex \"attach $testpid\""]
-set GDBFLAGS [concat $GDBFLAGS " -ex \"continue&\""]
-
-# sync_execution = 1 is_running = 1
-with_test_prefix "sync_execution = 1, is_running = 1" {
-    prompt_gdb_start
-    gdb_test "python x = len(p); print (gdb.execute(\"show prompt\", to_string = True))" \
-	".*prompt is \"$gdb_prompt \".*" \
-	"show prompt gets the correct result 3"
-    gdb_test "python print ('%d %d' % (x, len(p)))" "1 2" \
-	"retrieving the prompt causes no extra prompt_hook calls 3"
-    gdb_test "python print (\"'\" + str(p\[0\]) + \"'\")" "'$gdb_prompt_fail '" \
-	"prompt_hook argument is default prompt. 3"
-    gdb_exit
-}
-
-set GDBFLAGS [concat $tmp_gdbflags " -ex \"set pagination off\""]
-set GDBFLAGS [concat $GDBFLAGS " -ex \"set editing on\""]
-set GDBFLAGS [concat $GDBFLAGS " -ex \"attach $testpid\""]
-set GDBFLAGS [concat $GDBFLAGS " -ex \"interrupt\""]
-
-# sync_execution = 1 is_running = 0
-with_test_prefix "sync_execution = 1, is_running = 0" {
-    prompt_gdb_start
-    gdb_test "python x = len(p); print (gdb.execute(\"show prompt\", to_string = True))" \
-	".*prompt is \"$gdb_prompt \".*" \
-	"show prompt gets the correct result 4"
-    gdb_test "python print ('%d %d' % (x, len(p)))" "1 2" \
-	"retrieving the prompt causes no extra prompt_hook calls 4"
-    gdb_test "python print (\"'\" + str(p\[0\]) + \"'\")" "'$gdb_prompt_fail '" \
-	"prompt_hook argument is default prompt. 4"
-    gdb_exit
+    kill_wait_spawned_process $test_spawn_id
 }
-
-set GDBFLAGS $saved_gdbflags
-kill_wait_spawned_process $test_spawn_id
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index bb4bd656471..7538071d1cf 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -216,6 +216,7 @@ if ![info exists INTERNAL_GDBFLAGS] {
 	[join [list \
 		   "-nw" \
 		   "-nx" \
+		   "-q" \
 		   {-iex "set height 0"} \
 		   {-iex "set width 0"}]]
 
@@ -2302,6 +2303,14 @@ proc default_gdb_start { } {
 	    # that case, this case is hit.
 	    verbose "GDB initialized."
 	}
+	-re "^$gdb_prompt $" {
+	    # Output with -q.
+	    verbose "GDB initialized."
+	}
+	-re "^\033\\\[.2004h$gdb_prompt $" {
+	    # Output with -q, and bracketed paste mode enabled, see above.
+	    verbose "GDB initialized."
+	}
 	-re "$gdb_prompt $"	{
 	    perror "GDB never initialized."
 	    unset gdb_spawn_id
diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp
index c914ed49150..1841816ffeb 100644
--- a/gdb/testsuite/lib/mi-support.exp
+++ b/gdb/testsuite/lib/mi-support.exp
@@ -265,6 +265,10 @@ proc default_mi_gdb_start { { flags {} } } {
 	    # We have a new format mi startup prompt.
 	    verbose "GDB initialized."
 	}
+	-re "^(=\[^\r\n\]*\r\n)*$mi_gdb_prompt$" {
+	    # Output with -q.
+	    verbose "GDB initialized."
+	}
 	-re ".*unrecognized option.*for a complete list of options." {
 	    untested "skip mi tests (not compiled with mi support)."
 	    remote_close host

base-commit: 3401f947d8612ffad751fc71e7deda8613b6630e
-- 
2.35.3


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

* Re: [PATCH] [gdb/testsuite] Add -q to INTERNAL_GDBFLAGS
  2023-04-05 18:34 [PATCH] [gdb/testsuite] Add -q to INTERNAL_GDBFLAGS Tom de Vries
@ 2023-04-06  0:17 ` Simon Marchi
  2023-04-07  7:25   ` Tom de Vries
  0 siblings, 1 reply; 7+ messages in thread
From: Simon Marchi @ 2023-04-06  0:17 UTC (permalink / raw)
  To: Tom de Vries, gdb-patches

On 4/5/23 14:34, Tom de Vries via Gdb-patches wrote:
> Whenever we start gdb in the testsuite, we have the rather verbose:
> ...
> $ gdb
> GNU gdb (GDB) 14.0.50.20230405-git
> Copyright (C) 2023 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
> Type "show copying" and "show warranty" for details.
> This GDB was configured as "x86_64-pc-linux-gnu".
> Type "show configuration" for configuration details.
> For bug reporting instructions, please see:
> <https://www.gnu.org/software/gdb/bugs/>.
> Find the GDB manual and other documentation resources online at:
>     <http://www.gnu.org/software/gdb/documentation/>.
> 
> For help, type "help".
> Type "apropos word" to search for commands related to "word".
> (gdb)
> ...
> 
> This makes gdb.log longer than necessary and harder to read.
> 
> We do need to test that the output is produced, but that should be limited to
> one or a few test-cases.
> 
> Fix this by adding -q to INTERNAL_GDBFLAGS, such that we simply have:
> ...
> $ gdb -q
> (gdb)

The license text never really bothered me in gdb.log, when I consult
gdb.log I usually search for some string, so it just skips over that.
Not having the license text makes it a little less obvious in the log
when gdb has been restarted, so that might be a bit more confusing.  But
otherwise, I don't really mind your change, I'll get used to it.

Simon

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

* Re: [PATCH] [gdb/testsuite] Add -q to INTERNAL_GDBFLAGS
  2023-04-06  0:17 ` Simon Marchi
@ 2023-04-07  7:25   ` Tom de Vries
  2023-04-07  8:25     ` Tom de Vries
  0 siblings, 1 reply; 7+ messages in thread
From: Tom de Vries @ 2023-04-07  7:25 UTC (permalink / raw)
  To: Simon Marchi, gdb-patches

On 4/6/23 02:17, Simon Marchi wrote:
> On 4/5/23 14:34, Tom de Vries via Gdb-patches wrote:
>> Whenever we start gdb in the testsuite, we have the rather verbose:
>> ...
>> $ gdb
>> GNU gdb (GDB) 14.0.50.20230405-git
>> Copyright (C) 2023 Free Software Foundation, Inc.
>> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
>> This is free software: you are free to change and redistribute it.
>> There is NO WARRANTY, to the extent permitted by law.
>> Type "show copying" and "show warranty" for details.
>> This GDB was configured as "x86_64-pc-linux-gnu".
>> Type "show configuration" for configuration details.
>> For bug reporting instructions, please see:
>> <https://www.gnu.org/software/gdb/bugs/>.
>> Find the GDB manual and other documentation resources online at:
>>      <http://www.gnu.org/software/gdb/documentation/>.
>>
>> For help, type "help".
>> Type "apropos word" to search for commands related to "word".
>> (gdb)
>> ...
>>
>> This makes gdb.log longer than necessary and harder to read.
>>
>> We do need to test that the output is produced, but that should be limited to
>> one or a few test-cases.
>>
>> Fix this by adding -q to INTERNAL_GDBFLAGS, such that we simply have:
>> ...
>> $ gdb -q
>> (gdb)
> 
> The license text never really bothered me in gdb.log, when I consult
> gdb.log I usually search for some string, so it just skips over that.

I see.

FWIW, I've always found it a tiny bit annoying, but got triggered to do 
something about it when playing around with test-case 
gdb.tui/tui-layout-asm.exp where I tried to reduce tui_asm_window_width 
to simulate the problem fixed by commit abdd4204a2f ("Fix for 
gdb.tui/tui-layout-asm.exp") on x86_64, and ran into the paging prompt 
due to the license text.

I'm also working on a patch to use -eiex "set height 0" in 
INTERNAL_GDBFLAGS to make sure that the paging problem still doesn't 
happen when we filter out -q from INTERNAL_GDBFLAGS (and while working 
on that patch I ran into PR30320).

> Not having the license text makes it a little less obvious in the log
> when gdb has been restarted, so that might be a bit more confusing.

Ack, true.

For me, the license text takes about half of my screen estate, so I 
scroll past it often, and it reduces the amount of actual information on 
my screen.

So I guess this is about the balance between small things are hard to 
spot and large things are hard to ignore.

> But
> otherwise, I don't really mind your change, I'll get used to it.
> 

OK, thanks for the review, I'll commit shortly.

Thanks,
- Tom


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

* Re: [PATCH] [gdb/testsuite] Add -q to INTERNAL_GDBFLAGS
  2023-04-07  7:25   ` Tom de Vries
@ 2023-04-07  8:25     ` Tom de Vries
  2023-04-10 19:40       ` John Baldwin
  0 siblings, 1 reply; 7+ messages in thread
From: Tom de Vries @ 2023-04-07  8:25 UTC (permalink / raw)
  To: Simon Marchi, gdb-patches

On 4/7/23 09:25, Tom de Vries via Gdb-patches wrote:
>> Not having the license text makes it a little less obvious in the log
>> when gdb has been restarted, so that might be a bit more confusing.
> 
> Ack, true.

And if you want something more verbose, we could always do some variant of:
...
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 7538071d1cf..4743150a878 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -2305,7 +2305,7 @@ proc default_gdb_start { } {
         }
         -re "^$gdb_prompt $" {
             # Output with -q.
-           verbose "GDB initialized."
+           verbose -log "GDB initialized."
         }
         -re "^\033\\\[.2004h$gdb_prompt $" {
             # Output with -q, and bracketed paste mode enabled, see above.
...
to get:
...
PASS: gdb.threads/attach-many-short-lived-threads.exp: successfully 
compiled posix threads test case
builtin_spawn 
/data/vries/gdb/leap-15-4/build/gdb/testsuite/../../gdb/gdb -nw -nx -q 
-iex set height 0 -iex set width 0 -data-directory 
/data/vries/gdb/leap-15-4/build/gdb/data-directory^M
(gdb) GDB initialized.
set height 0^M
(gdb) set width 0^M
...

Thanks,
- Tom

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

* Re: [PATCH] [gdb/testsuite] Add -q to INTERNAL_GDBFLAGS
  2023-04-07  8:25     ` Tom de Vries
@ 2023-04-10 19:40       ` John Baldwin
  2023-04-19 14:04         ` [PATCH] [gdb/testsuite] Use verbose -log for "GDB initialized" Tom de Vries
  0 siblings, 1 reply; 7+ messages in thread
From: John Baldwin @ 2023-04-10 19:40 UTC (permalink / raw)
  To: Tom de Vries, Simon Marchi, gdb-patches

On 4/7/23 1:25 AM, Tom de Vries via Gdb-patches wrote:
> On 4/7/23 09:25, Tom de Vries via Gdb-patches wrote:
>>> Not having the license text makes it a little less obvious in the log
>>> when gdb has been restarted, so that might be a bit more confusing.
>>
>> Ack, true.
> 
> And if you want something more verbose, we could always do some variant of:
> ...
> diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
> index 7538071d1cf..4743150a878 100644
> --- a/gdb/testsuite/lib/gdb.exp
> +++ b/gdb/testsuite/lib/gdb.exp
> @@ -2305,7 +2305,7 @@ proc default_gdb_start { } {
>           }
>           -re "^$gdb_prompt $" {
>               # Output with -q.
> -           verbose "GDB initialized."
> +           verbose -log "GDB initialized."
>           }
>           -re "^\033\\\[.2004h$gdb_prompt $" {
>               # Output with -q, and bracketed paste mode enabled, see above.
> ...
> to get:
> ...
> PASS: gdb.threads/attach-many-short-lived-threads.exp: successfully
> compiled posix threads test case
> builtin_spawn
> /data/vries/gdb/leap-15-4/build/gdb/testsuite/../../gdb/gdb -nw -nx -q
> -iex set height 0 -iex set width 0 -data-directory
> /data/vries/gdb/leap-15-4/build/gdb/data-directory^M
> (gdb) GDB initialized.
> set height 0^M
> (gdb) set width 0^M

I would prefer this type of approach for the "start of a session" sentinel.

-- 
John Baldwin


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

* [PATCH] [gdb/testsuite] Use verbose -log for "GDB initialized"
  2023-04-10 19:40       ` John Baldwin
@ 2023-04-19 14:04         ` Tom de Vries
  2023-05-02 15:46           ` [PING] " Tom de Vries
  0 siblings, 1 reply; 7+ messages in thread
From: Tom de Vries @ 2023-04-19 14:04 UTC (permalink / raw)
  To: John Baldwin, Simon Marchi, gdb-patches

[-- Attachment #1: Type: text/plain, Size: 1687 bytes --]

[ was: Re: [PATCH] [gdb/testsuite] Add -q to INTERNAL_GDBFLAGS ]

On 4/10/23 21:40, John Baldwin wrote:
> On 4/7/23 1:25 AM, Tom de Vries via Gdb-patches wrote:
>> On 4/7/23 09:25, Tom de Vries via Gdb-patches wrote:
>>>> Not having the license text makes it a little less obvious in the log
>>>> when gdb has been restarted, so that might be a bit more confusing.
>>>
>>> Ack, true.
>>
>> And if you want something more verbose, we could always do some 
>> variant of:
>> ...
>> diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
>> index 7538071d1cf..4743150a878 100644
>> --- a/gdb/testsuite/lib/gdb.exp
>> +++ b/gdb/testsuite/lib/gdb.exp
>> @@ -2305,7 +2305,7 @@ proc default_gdb_start { } {
>>           }
>>           -re "^$gdb_prompt $" {
>>               # Output with -q.
>> -           verbose "GDB initialized."
>> +           verbose -log "GDB initialized."
>>           }
>>           -re "^\033\\\[.2004h$gdb_prompt $" {
>>               # Output with -q, and bracketed paste mode enabled, see 
>> above.
>> ...
>> to get:
>> ...
>> PASS: gdb.threads/attach-many-short-lived-threads.exp: successfully
>> compiled posix threads test case
>> builtin_spawn
>> /data/vries/gdb/leap-15-4/build/gdb/testsuite/../../gdb/gdb -nw -nx -q
>> -iex set height 0 -iex set width 0 -data-directory
>> /data/vries/gdb/leap-15-4/build/gdb/data-directory^M
>> (gdb) GDB initialized.
>> set height 0^M
>> (gdb) set width 0^M
> 
> I would prefer this type of approach for the "start of a session" sentinel.
> 

Hi John,

does this patch (currently testing) address your concern?

Thanks,
- Tom


[-- Attachment #2: 0001-gdb-testsuite-Use-verbose-log-for-GDB-initialized.patch --]
[-- Type: text/x-patch, Size: 2654 bytes --]

From 8ad44441ebb074b05077524e91047b1e7ca40bf5 Mon Sep 17 00:00:00 2001
From: Tom de Vries <tdevries@suse.de>
Date: Wed, 19 Apr 2023 15:50:32 +0200
Subject: [PATCH] [gdb/testsuite] Use verbose -log for "GDB initialized"

Since commit 31c50280179 ("[gdb/testsuite] Add -q to INTERNAL_GDBFLAGS") we
have the somewhat terse:
...
builtin_spawn gdb ... -q ...
(gdb)
...
in gdb.log.

Make this a bit more verbose, to get:
...
builtin_spawn gdb ... -q ...
(gdb) GDB initialized.
...

Tested on x86_64-linux.

Reported-By: John Baldwin <jhb@FreeBSD.org>
---
 gdb/testsuite/lib/gdb.exp        | 8 ++++----
 gdb/testsuite/lib/mi-support.exp | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 9ea0334759d..6360e62031a 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -2292,7 +2292,7 @@ proc default_gdb_start { } {
     # get really slow.  Give gdb at least 3 minutes to start up.
     gdb_expect 360 {
 	-re "\[\r\n\]$gdb_prompt $" {
-	    verbose "GDB initialized."
+	    verbose -log "GDB initialized."
 	}
 	-re "\[\r\n\]\033\\\[.2004h$gdb_prompt $" {
 	    # This special case detects what happens when GDB is
@@ -2301,15 +2301,15 @@ proc default_gdb_start { } {
 	    # default_gdb_init), but for at least one test we turn
 	    # bracketed paste mode back on, and then start GDB.  In
 	    # that case, this case is hit.
-	    verbose "GDB initialized."
+	    verbose -log "GDB initialized."
 	}
 	-re "^$gdb_prompt $" {
 	    # Output with -q.
-	    verbose "GDB initialized."
+	    verbose -log "GDB initialized."
 	}
 	-re "^\033\\\[.2004h$gdb_prompt $" {
 	    # Output with -q, and bracketed paste mode enabled, see above.
-	    verbose "GDB initialized."
+	    verbose -log "GDB initialized."
 	}
 	-re "$gdb_prompt $"	{
 	    perror "GDB never initialized."
diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp
index 0d830d8e4ae..4570973ccf5 100644
--- a/gdb/testsuite/lib/mi-support.exp
+++ b/gdb/testsuite/lib/mi-support.exp
@@ -263,11 +263,11 @@ proc default_mi_gdb_start { { flags {} } } {
     gdb_expect {
 	-re "~\"GNU.*\r\n~\".*$mi_gdb_prompt$" {
 	    # We have a new format mi startup prompt.
-	    verbose "GDB initialized."
+	    verbose -log "GDB initialized."
 	}
 	-re "^(=\[^\r\n\]*\r\n)*$mi_gdb_prompt$" {
 	    # Output with -q.
-	    verbose "GDB initialized."
+	    verbose -log "GDB initialized."
 	}
 	-re ".*unrecognized option.*for a complete list of options." {
 	    untested "skip mi tests (not compiled with mi support)."

base-commit: 28ab94f51dcdee056d96e57ad04c27c22cf854ea
-- 
2.35.3


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

* [PING] [PATCH] [gdb/testsuite] Use verbose -log for "GDB initialized"
  2023-04-19 14:04         ` [PATCH] [gdb/testsuite] Use verbose -log for "GDB initialized" Tom de Vries
@ 2023-05-02 15:46           ` Tom de Vries
  0 siblings, 0 replies; 7+ messages in thread
From: Tom de Vries @ 2023-05-02 15:46 UTC (permalink / raw)
  To: John Baldwin, Simon Marchi, gdb-patches

On 4/19/23 16:04, Tom de Vries via Gdb-patches wrote:
> [ was: Re: [PATCH] [gdb/testsuite] Add -q to INTERNAL_GDBFLAGS ]
> 
> On 4/10/23 21:40, John Baldwin wrote:
>> On 4/7/23 1:25 AM, Tom de Vries via Gdb-patches wrote:
>>> On 4/7/23 09:25, Tom de Vries via Gdb-patches wrote:
>>>>> Not having the license text makes it a little less obvious in the log
>>>>> when gdb has been restarted, so that might be a bit more confusing.
>>>>
>>>> Ack, true.
>>>
>>> And if you want something more verbose, we could always do some 
>>> variant of:
>>> ...
>>> diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
>>> index 7538071d1cf..4743150a878 100644
>>> --- a/gdb/testsuite/lib/gdb.exp
>>> +++ b/gdb/testsuite/lib/gdb.exp
>>> @@ -2305,7 +2305,7 @@ proc default_gdb_start { } {
>>>           }
>>>           -re "^$gdb_prompt $" {
>>>               # Output with -q.
>>> -           verbose "GDB initialized."
>>> +           verbose -log "GDB initialized."
>>>           }
>>>           -re "^\033\\\[.2004h$gdb_prompt $" {
>>>               # Output with -q, and bracketed paste mode enabled, see 
>>> above.
>>> ...
>>> to get:
>>> ...
>>> PASS: gdb.threads/attach-many-short-lived-threads.exp: successfully
>>> compiled posix threads test case
>>> builtin_spawn
>>> /data/vries/gdb/leap-15-4/build/gdb/testsuite/../../gdb/gdb -nw -nx -q
>>> -iex set height 0 -iex set width 0 -data-directory
>>> /data/vries/gdb/leap-15-4/build/gdb/data-directory^M
>>> (gdb) GDB initialized.
>>> set height 0^M
>>> (gdb) set width 0^M
>>
>> I would prefer this type of approach for the "start of a session" 
>> sentinel.
>>
> 
> Hi John,
> 
> does this patch (currently testing) address your concern?
> 

Ping.

Thanks,
- Tom



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

end of thread, other threads:[~2023-05-02 15:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-05 18:34 [PATCH] [gdb/testsuite] Add -q to INTERNAL_GDBFLAGS Tom de Vries
2023-04-06  0:17 ` Simon Marchi
2023-04-07  7:25   ` Tom de Vries
2023-04-07  8:25     ` Tom de Vries
2023-04-10 19:40       ` John Baldwin
2023-04-19 14:04         ` [PATCH] [gdb/testsuite] Use verbose -log for "GDB initialized" Tom de Vries
2023-05-02 15:46           ` [PING] " 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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).