Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH][gdb/testsuite] Fix ERROR in gdb.dwarf2/dw2-out-of-range-end-of-seq.exp
@ 2021-01-26 18:02 Tom de Vries
  2021-01-27 20:39 ` Tom Tromey
  0 siblings, 1 reply; 4+ messages in thread
From: Tom de Vries @ 2021-01-26 18:02 UTC (permalink / raw)
  To: gdb-patches

Hi,

When running test-case gdb.dwarf2/dw2-out-of-range-end-of-seq.exp on a
system with debug packages installed, I run into:
...
(gdb) maint info line-table^M
  ... <lots of output> ...
ERROR: internal buffer is full.
UNRESOLVED: gdb.dwarf2/dw2-out-of-range-end-of-seq.exp: \
  END with address 1 eliminated
...

Fix this by limiting the output of the command using a regexp.

I also noticed that when making the regexp match nothing, meaning
the command has no output, the test didn't FAIL.  Fixed this by adding a
PASS pattern.

I also noticed that the FAIL pattern didn't work with -m32, fixed that as
well.

Tested on x86_64-linux.

Any comments?

Thanks,
- Tom

[gdb/testsuite] Fix ERROR in gdb.dwarf2/dw2-out-of-range-end-of-seq.exp

gdb/testsuite/ChangeLog:

2021-01-26  Tom de Vries  <tdevries@suse.de>

	* gdb.dwarf2/dw2-out-of-range-end-of-seq.exp: Add regexp to
	"maint info line-table".  Make PASS pattern more specific.  Make
	FAIL pattern work for -m32.

---
 gdb/testsuite/gdb.dwarf2/dw2-out-of-range-end-of-seq.exp | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/gdb/testsuite/gdb.dwarf2/dw2-out-of-range-end-of-seq.exp b/gdb/testsuite/gdb.dwarf2/dw2-out-of-range-end-of-seq.exp
index 7a32a01389c..42cfd0b61ec 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-out-of-range-end-of-seq.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-out-of-range-end-of-seq.exp
@@ -84,11 +84,12 @@ if ![runto_main] {
     return -1
 }
 
-gdb_test_multiple "maint info line-table" "END with address 1 eliminated" {
-    -re -wrap "END *0x0*1 Y \r\n.*" {
+set test "END with address 1 eliminated"
+gdb_test_multiple "maint info line-table $srcfile$" $test {
+    -re -wrap "END *0x0*1 *Y \r\n.*" {
 	fail $gdb_test_name
     }
-    -re -wrap "" {
+    -re -wrap "END *$hex *Y " {
 	pass $gdb_test_name
     }
 }

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

* Re: [PATCH][gdb/testsuite] Fix ERROR in gdb.dwarf2/dw2-out-of-range-end-of-seq.exp
  2021-01-26 18:02 [PATCH][gdb/testsuite] Fix ERROR in gdb.dwarf2/dw2-out-of-range-end-of-seq.exp Tom de Vries
@ 2021-01-27 20:39 ` Tom Tromey
  2021-01-27 20:51   ` tdevries
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Tromey @ 2021-01-27 20:39 UTC (permalink / raw)
  To: Tom de Vries; +Cc: gdb-patches

>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:

Tom> 2021-01-26  Tom de Vries  <tdevries@suse.de>

Tom> 	* gdb.dwarf2/dw2-out-of-range-end-of-seq.exp: Add regexp to
Tom> 	"maint info line-table".  Make PASS pattern more specific.  Make
Tom> 	FAIL pattern work for -m32.

Thanks.

Tom> -gdb_test_multiple "maint info line-table" "END with address 1 eliminated" {
Tom> -    -re -wrap "END *0x0*1 Y \r\n.*" {
Tom> +set test "END with address 1 eliminated"
Tom> +gdb_test_multiple "maint info line-table $srcfile$" $test {
Tom> +    -re -wrap "END *0x0*1 *Y \r\n.*" {
Tom>  	fail $gdb_test_name

Should this just pass $gdb_test_name to gdb_test_multiple, rather than
$test?  It seems like the two things should be the same.

Tom

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

* Re: [PATCH][gdb/testsuite] Fix ERROR in gdb.dwarf2/dw2-out-of-range-end-of-seq.exp
  2021-01-27 20:39 ` Tom Tromey
@ 2021-01-27 20:51   ` tdevries
  2021-01-27 21:51     ` Tom Tromey
  0 siblings, 1 reply; 4+ messages in thread
From: tdevries @ 2021-01-27 20:51 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On 2021-01-27 21:39, Tom Tromey wrote:
>>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:
> 
> Tom> 2021-01-26  Tom de Vries  <tdevries@suse.de>
> 
> Tom> 	* gdb.dwarf2/dw2-out-of-range-end-of-seq.exp: Add regexp to
> Tom> 	"maint info line-table".  Make PASS pattern more specific.  Make
> Tom> 	FAIL pattern work for -m32.
> 
> Thanks.
> 
> Tom> -gdb_test_multiple "maint info line-table" "END with address 1
> eliminated" {
> Tom> -    -re -wrap "END *0x0*1 Y \r\n.*" {
> Tom> +set test "END with address 1 eliminated"
> Tom> +gdb_test_multiple "maint info line-table $srcfile$" $test {
> Tom> +    -re -wrap "END *0x0*1 *Y \r\n.*" {
> Tom>  	fail $gdb_test_name
> 
> Should this just pass $gdb_test_name to gdb_test_multiple, rather than
> $test?  It seems like the two things should be the same.

gdb_test_name is a dedicated variable that's only valid inside 
gdb_test_multiple.

Thanks,
- Tom

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

* Re: [PATCH][gdb/testsuite] Fix ERROR in gdb.dwarf2/dw2-out-of-range-end-of-seq.exp
  2021-01-27 20:51   ` tdevries
@ 2021-01-27 21:51     ` Tom Tromey
  0 siblings, 0 replies; 4+ messages in thread
From: Tom Tromey @ 2021-01-27 21:51 UTC (permalink / raw)
  To: tdevries; +Cc: Tom Tromey, gdb-patches

Tom> gdb_test_name is a dedicated variable that's only valid inside
Tom> gdb_test_multiple.

Ah, ok.  I didn't realize that.
The patch seems fine to me then.

Tom

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

end of thread, other threads:[~2021-01-27 21:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-26 18:02 [PATCH][gdb/testsuite] Fix ERROR in gdb.dwarf2/dw2-out-of-range-end-of-seq.exp Tom de Vries
2021-01-27 20:39 ` Tom Tromey
2021-01-27 20:51   ` tdevries
2021-01-27 21:51     ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox