[gdb/testsuite] Use verbose -log for "GDB initialized"
Commit Message
[ 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
Comments
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
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(-)
@@ -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."
@@ -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