public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: John Baldwin <jhb@FreeBSD.org>, Simon Marchi <simark@simark.ca>,
	gdb-patches@sourceware.org
Subject: [PATCH] [gdb/testsuite] Use verbose -log for "GDB initialized"
Date: Wed, 19 Apr 2023 16:04:25 +0200	[thread overview]
Message-ID: <c11b0528-e32c-a5b0-6242-599d5eddf8ff@suse.de> (raw)
In-Reply-To: <a101636f-9694-c7f1-7b6d-7832c2373b2c@FreeBSD.org>

[-- 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


  reply	other threads:[~2023-04-19 14:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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         ` Tom de Vries [this message]
2023-05-02 15:46           ` [PING] [PATCH] [gdb/testsuite] Use verbose -log for "GDB initialized" Tom de Vries

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c11b0528-e32c-a5b0-6242-599d5eddf8ff@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    --cc=jhb@FreeBSD.org \
    --cc=simark@simark.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).