public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH][gdb/testsuite] Fix FAILs in gdb.mi/mi-breakpoint-changed.exp
@ 2021-10-05 14:46 Tom de Vries
  2021-10-22  6:51 ` [PING][PATCH][gdb/testsuite] " Tom de Vries
  2021-10-22 12:55 ` [PATCH][gdb/testsuite] " Simon Marchi
  0 siblings, 2 replies; 4+ messages in thread
From: Tom de Vries @ 2021-10-05 14:46 UTC (permalink / raw)
  To: gdb-patches

Hi,

Since commit e36788d1354 "[gdb/testsuite] Fix handling of nr_args < 3 in
mi_gdb_test" we run into:
...
PASS: gdb.mi/mi-breakpoint-changed.exp: test_auto_disable: mi runto main
Expecting: ^(-break-insert -f pendfunc1[^M
]+)?((&.*)*.*~"Breakpoint 2 at.*\\n".*=breakpoint-created,\
  bkpt=\{number="2",type="breakpoint".*\}.*\n\^done[^M
]+[(]gdb[)] ^M
[ ]*)
-break-insert -f pendfunc1^M
^done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",\
  addr="0x00007ffff7bd559e",func="pendfunc1",\
  file="gdb/testsuite/gdb.mi/pendshr1.c",\
  fullname="gdb/testsuite/gdb.mi/pendshr1.c",line="21",thread-groups=["i1"],\
  times="0",original-location="pendfunc1"}^M
(gdb) ^M
FAIL: gdb.mi/mi-breakpoint-changed.exp: test_auto_disable: \
  -break-insert -f pendfunc1 (unexpected output)
...

The regexp expects a breakpoint-created event, but that's actually suppressed
by the command:
...
DEF_MI_CMD_MI_1 ("break-insert", mi_cmd_break_insert,
                   &mi_suppress_notification.breakpoint),
...

Fix this by updating the regexp.

Likewise for the following:
...
PASS: gdb.mi/mi-breakpoint-changed.exp: test_auto_disable: \
  -break-insert -f pendfunc1
Expecting: ^(-break-enable count 1 2[^M
]+)?(=breakpoint-modified,\
  bkpt=\{number="2",type="breakpoint",disp="dis",enabled="y".*\}.*\n\^done[^M
]+[(]gdb[)] ^M
[ ]*)
-break-enable count 1 2^M
^done^M
(gdb) ^M
FAIL: gdb.mi/mi-breakpoint-changed.exp: test_auto_disable: \
  -break-enable count 1 2 (unexpected out\
put)
...

Tested on x86_64-linux.

Any comments?

Thanks,
- Tom

[gdb/testsuite] Fix FAILs in gdb.mi/mi-breakpoint-changed.exp

---
 gdb/testsuite/gdb.mi/mi-breakpoint-changed.exp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/gdb.mi/mi-breakpoint-changed.exp b/gdb/testsuite/gdb.mi/mi-breakpoint-changed.exp
index d068a25b9f4..4376bb883e6 100644
--- a/gdb/testsuite/gdb.mi/mi-breakpoint-changed.exp
+++ b/gdb/testsuite/gdb.mi/mi-breakpoint-changed.exp
@@ -273,11 +273,11 @@ proc test_auto_disable { } {
 
     # Set the breakpoint.
     mi_gdb_test "-break-insert -f pendfunc1" \
-	{(&.*)*.*~"Breakpoint 2 at.*\\n".*=breakpoint-created,bkpt=\{number="2",type="breakpoint".*\}.*\n\^done}
+	{\^done,bkpt=\{number="2",type="breakpoint".*\}.*}
 
     # Enable for one shot only.
     mi_gdb_test "-break-enable count 1 2" \
-	{=breakpoint-modified,bkpt=\{number="2",type="breakpoint",disp="dis",enabled="y".*\}.*\n\^done}
+	{\^done}
 
     mi_send_resuming_command "exec-continue" "continuing execution to breakpoint"
 

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

* [PING][PATCH][gdb/testsuite] Fix FAILs in gdb.mi/mi-breakpoint-changed.exp
  2021-10-05 14:46 [PATCH][gdb/testsuite] Fix FAILs in gdb.mi/mi-breakpoint-changed.exp Tom de Vries
@ 2021-10-22  6:51 ` Tom de Vries
  2021-10-22 12:55 ` [PATCH][gdb/testsuite] " Simon Marchi
  1 sibling, 0 replies; 4+ messages in thread
From: Tom de Vries @ 2021-10-22  6:51 UTC (permalink / raw)
  To: gdb-patches

On 10/5/21 4:46 PM, Tom de Vries wrote:
> Hi,
> 
> Since commit e36788d1354 "[gdb/testsuite] Fix handling of nr_args < 3 in
> mi_gdb_test" we run into:
> ...
> PASS: gdb.mi/mi-breakpoint-changed.exp: test_auto_disable: mi runto main
> Expecting: ^(-break-insert -f pendfunc1[^M
> ]+)?((&.*)*.*~"Breakpoint 2 at.*\\n".*=breakpoint-created,\
>   bkpt=\{number="2",type="breakpoint".*\}.*\n\^done[^M
> ]+[(]gdb[)] ^M
> [ ]*)
> -break-insert -f pendfunc1^M
> ^done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",\
>   addr="0x00007ffff7bd559e",func="pendfunc1",\
>   file="gdb/testsuite/gdb.mi/pendshr1.c",\
>   fullname="gdb/testsuite/gdb.mi/pendshr1.c",line="21",thread-groups=["i1"],\
>   times="0",original-location="pendfunc1"}^M
> (gdb) ^M
> FAIL: gdb.mi/mi-breakpoint-changed.exp: test_auto_disable: \
>   -break-insert -f pendfunc1 (unexpected output)
> ...
> 
> The regexp expects a breakpoint-created event, but that's actually suppressed
> by the command:
> ...
> DEF_MI_CMD_MI_1 ("break-insert", mi_cmd_break_insert,
>                    &mi_suppress_notification.breakpoint),
> ...
> 
> Fix this by updating the regexp.
> 
> Likewise for the following:
> ...
> PASS: gdb.mi/mi-breakpoint-changed.exp: test_auto_disable: \
>   -break-insert -f pendfunc1
> Expecting: ^(-break-enable count 1 2[^M
> ]+)?(=breakpoint-modified,\
>   bkpt=\{number="2",type="breakpoint",disp="dis",enabled="y".*\}.*\n\^done[^M
> ]+[(]gdb[)] ^M
> [ ]*)
> -break-enable count 1 2^M
> ^done^M
> (gdb) ^M
> FAIL: gdb.mi/mi-breakpoint-changed.exp: test_auto_disable: \
>   -break-enable count 1 2 (unexpected out\
> put)
> ...
> 
> Tested on x86_64-linux.
> 
> Any comments?
> 

Ping.

Thanks,
- Tom

> [gdb/testsuite] Fix FAILs in gdb.mi/mi-breakpoint-changed.exp
> 
> ---
>  gdb/testsuite/gdb.mi/mi-breakpoint-changed.exp | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/gdb/testsuite/gdb.mi/mi-breakpoint-changed.exp b/gdb/testsuite/gdb.mi/mi-breakpoint-changed.exp
> index d068a25b9f4..4376bb883e6 100644
> --- a/gdb/testsuite/gdb.mi/mi-breakpoint-changed.exp
> +++ b/gdb/testsuite/gdb.mi/mi-breakpoint-changed.exp
> @@ -273,11 +273,11 @@ proc test_auto_disable { } {
>  
>      # Set the breakpoint.
>      mi_gdb_test "-break-insert -f pendfunc1" \
> -	{(&.*)*.*~"Breakpoint 2 at.*\\n".*=breakpoint-created,bkpt=\{number="2",type="breakpoint".*\}.*\n\^done}
> +	{\^done,bkpt=\{number="2",type="breakpoint".*\}.*}
>  
>      # Enable for one shot only.
>      mi_gdb_test "-break-enable count 1 2" \
> -	{=breakpoint-modified,bkpt=\{number="2",type="breakpoint",disp="dis",enabled="y".*\}.*\n\^done}
> +	{\^done}
>  
>      mi_send_resuming_command "exec-continue" "continuing execution to breakpoint"
>  
> 

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

* Re: [PATCH][gdb/testsuite] Fix FAILs in gdb.mi/mi-breakpoint-changed.exp
  2021-10-05 14:46 [PATCH][gdb/testsuite] Fix FAILs in gdb.mi/mi-breakpoint-changed.exp Tom de Vries
  2021-10-22  6:51 ` [PING][PATCH][gdb/testsuite] " Tom de Vries
@ 2021-10-22 12:55 ` Simon Marchi
  2021-10-22 15:43   ` Tom de Vries
  1 sibling, 1 reply; 4+ messages in thread
From: Simon Marchi @ 2021-10-22 12:55 UTC (permalink / raw)
  To: Tom de Vries, gdb-patches



On 2021-10-05 10:46, Tom de Vries via Gdb-patches wrote:
> Hi,
> 
> Since commit e36788d1354 "[gdb/testsuite] Fix handling of nr_args < 3 in
> mi_gdb_test" we run into:
> ...
> PASS: gdb.mi/mi-breakpoint-changed.exp: test_auto_disable: mi runto main
> Expecting: ^(-break-insert -f pendfunc1[^M
> ]+)?((&.*)*.*~"Breakpoint 2 at.*\\n".*=breakpoint-created,\
>   bkpt=\{number="2",type="breakpoint".*\}.*\n\^done[^M
> ]+[(]gdb[)] ^M
> [ ]*)
> -break-insert -f pendfunc1^M
> ^done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",\
>   addr="0x00007ffff7bd559e",func="pendfunc1",\
>   file="gdb/testsuite/gdb.mi/pendshr1.c",\
>   fullname="gdb/testsuite/gdb.mi/pendshr1.c",line="21",thread-groups=["i1"],\
>   times="0",original-location="pendfunc1"}^M
> (gdb) ^M
> FAIL: gdb.mi/mi-breakpoint-changed.exp: test_auto_disable: \
>   -break-insert -f pendfunc1 (unexpected output)
> ...
> 
> The regexp expects a breakpoint-created event, but that's actually suppressed
> by the command:
> ...
> DEF_MI_CMD_MI_1 ("break-insert", mi_cmd_break_insert,
>                    &mi_suppress_notification.breakpoint),
> ...
> 
> Fix this by updating the regexp.
> 
> Likewise for the following:
> ...
> PASS: gdb.mi/mi-breakpoint-changed.exp: test_auto_disable: \
>   -break-insert -f pendfunc1
> Expecting: ^(-break-enable count 1 2[^M
> ]+)?(=breakpoint-modified,\
>   bkpt=\{number="2",type="breakpoint",disp="dis",enabled="y".*\}.*\n\^done[^M
> ]+[(]gdb[)] ^M
> [ ]*)
> -break-enable count 1 2^M
> ^done^M
> (gdb) ^M
> FAIL: gdb.mi/mi-breakpoint-changed.exp: test_auto_disable: \
>   -break-enable count 1 2 (unexpected out\
> put)
> ...
> 
> Tested on x86_64-linux.
> 
> Any comments?

So, the test used to wrongfully pass because mi_gdb_test was broken, and
fixing mi_gdb_test exposed that the test is wrong?  If so, this looks
good to me.

Simon

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

* Re: [PATCH][gdb/testsuite] Fix FAILs in gdb.mi/mi-breakpoint-changed.exp
  2021-10-22 12:55 ` [PATCH][gdb/testsuite] " Simon Marchi
@ 2021-10-22 15:43   ` Tom de Vries
  0 siblings, 0 replies; 4+ messages in thread
From: Tom de Vries @ 2021-10-22 15:43 UTC (permalink / raw)
  To: Simon Marchi, gdb-patches

On 10/22/21 2:55 PM, Simon Marchi wrote:
> 
> 
> On 2021-10-05 10:46, Tom de Vries via Gdb-patches wrote:
>> Hi,
>>
>> Since commit e36788d1354 "[gdb/testsuite] Fix handling of nr_args < 3 in
>> mi_gdb_test" we run into:
>> ...
>> PASS: gdb.mi/mi-breakpoint-changed.exp: test_auto_disable: mi runto main
>> Expecting: ^(-break-insert -f pendfunc1[^M
>> ]+)?((&.*)*.*~"Breakpoint 2 at.*\\n".*=breakpoint-created,\
>>   bkpt=\{number="2",type="breakpoint".*\}.*\n\^done[^M
>> ]+[(]gdb[)] ^M
>> [ ]*)
>> -break-insert -f pendfunc1^M
>> ^done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",\
>>   addr="0x00007ffff7bd559e",func="pendfunc1",\
>>   file="gdb/testsuite/gdb.mi/pendshr1.c",\
>>   fullname="gdb/testsuite/gdb.mi/pendshr1.c",line="21",thread-groups=["i1"],\
>>   times="0",original-location="pendfunc1"}^M
>> (gdb) ^M
>> FAIL: gdb.mi/mi-breakpoint-changed.exp: test_auto_disable: \
>>   -break-insert -f pendfunc1 (unexpected output)
>> ...
>>
>> The regexp expects a breakpoint-created event, but that's actually suppressed
>> by the command:
>> ...
>> DEF_MI_CMD_MI_1 ("break-insert", mi_cmd_break_insert,
>>                    &mi_suppress_notification.breakpoint),
>> ...
>>
>> Fix this by updating the regexp.
>>
>> Likewise for the following:
>> ...
>> PASS: gdb.mi/mi-breakpoint-changed.exp: test_auto_disable: \
>>   -break-insert -f pendfunc1
>> Expecting: ^(-break-enable count 1 2[^M
>> ]+)?(=breakpoint-modified,\
>>   bkpt=\{number="2",type="breakpoint",disp="dis",enabled="y".*\}.*\n\^done[^M
>> ]+[(]gdb[)] ^M
>> [ ]*)
>> -break-enable count 1 2^M
>> ^done^M
>> (gdb) ^M
>> FAIL: gdb.mi/mi-breakpoint-changed.exp: test_auto_disable: \
>>   -break-enable count 1 2 (unexpected out\
>> put)
>> ...
>>
>> Tested on x86_64-linux.
>>
>> Any comments?
> 
> So, the test used to wrongfully pass because mi_gdb_test was broken, and
> fixing mi_gdb_test exposed that the test is wrong?

Yes, that's my understanding.

> If so, this looks
> good to me.

Thanks for the review, committed.
- Tom

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

end of thread, other threads:[~2021-10-22 15:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-05 14:46 [PATCH][gdb/testsuite] Fix FAILs in gdb.mi/mi-breakpoint-changed.exp Tom de Vries
2021-10-22  6:51 ` [PING][PATCH][gdb/testsuite] " Tom de Vries
2021-10-22 12:55 ` [PATCH][gdb/testsuite] " Simon Marchi
2021-10-22 15:43   ` 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).