[PATCH] [PR 26056] gdb/tui: install SIGWINCH only when connected to a TTY
Pedro Alves
pedro@palves.net
Wed Dec 15 14:31:18 GMT 2021
On 2021-12-15 13:46, Six, Lancelot wrote:
> [AMD Official Use Only]
>
> Hi,
>
> Great! Thanks for the testcase!
>
> I will add it to my original patch, with one modification, see below.
>
> +# If GDB mishandles the SIGWINCH and crashes, that happens before we #
> +see the "inferior exited normally" message, so this will ERROR with #
> +eof.
> +gdb_test_multiple "" "wait for sleep exit" {
> + -re "Editing of command lines as they are typed is off.*$inferior_exited_re normally.*$gdb_prompt " {
> + pass $gdb_test_name
> + }
> +}
>
> If I run this part as is with the faulty GDB (before fix), I have:
>
> Running .../gdb.base/sigwinch-notty.exp ...
> ERROR: GDB process no longer exists
>
> === gdb Summary ===
>
> # of unresolved testcases 1
>
Yes, I went a bit back and forth on that, but ended with that, note the comment above.
> But I would expect a plain FAIL instead. To me "unresolved testcase" is more about a faulty testcase than a bug caught in GDB.
I don't mind. My thinking was that GDB crashes can happen for any test, and we get an unresolved for them as well. I
wasn't considering this test any special. I.e., I was looking at it from the perspective of assuming a fixed GDB, and
then from that angle, a GDB crash here is just like any other.
>
> I propose to change the following addition:
>
> diff --git a/gdb/testsuite/gdb.base/sigwinch-notty.exp b/gdb/testsuite/gdb.base/sigwinch-notty.exp
> index 9084c258388..b81a227b284 100644
> --- a/gdb/testsuite/gdb.base/sigwinch-notty.exp
> +++ b/gdb/testsuite/gdb.base/sigwinch-notty.exp
> @@ -59,6 +59,11 @@ gdb_test_multiple "" "wait for sleep exit" {
> -re "Editing of command lines as they are typed is off.*$inferior_exited_re normally.*$gdb_prompt " {
> pass $gdb_test_name
> }
> + eof {
> + fail $gdb_test_name
> + # The rest of the file cannot execute if this part of the test failed.
> + return
As I said, I don't mind. But please do the wait -i + print status thing here too then. And remember
to update the comment that refers to ERROR/eof.
> + }
> }
>
> With this, if I run the testsuite with GDB before fix, I have:
>
> Running .../gdb.base/sigwinch-notty.exp ...
> FAIL: gdb.base/sigwinch-notty.exp: wait for sleep exit
>
> === gdb Summary ===
>
> # of unexpected failures 1
>
> WDYT?
>
> Best,
> Lancelot.
>
More information about the Gdb-patches
mailing list