Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [committed][gdb/testsuite] Fix gdb.base/maint.exp with cc-with-gdb-index
Date: Sun, 1 Aug 2021 20:05:07 +0200	[thread overview]
Message-ID: <20210801180505.GA9296@delia> (raw)

Hi,

With target board cc-with-gdb-index we run into:
...
FAIL: gdb.base/maint.exp: maint print statistics
...

The output that is checked is:
...
Statistics for 'maint':^M
  Number of "minimal" symbols read: 53^M
  Number of "full" symbols read: 40^M
  Number of "types" defined: 60^M
  Number of symbol tables: 7^M
  Number of symbol tables with line tables: 2^M
  Number of symbol tables with blockvectors: 2^M
  Number of read CUs: 2^M
  Number of unread CUs: 5^M
  Total memory used for objfile obstack: 20320^M
  Total memory used for BFD obstack: 4064^M
  Total memory used for string cache: 4064^M
...
and the regexp doesn't match because it expects the "Number of read/unread
CUs" lines in a different place.

Fix this by updating the regexp.

Tested on x86_64-linux.

Committed to trunk.

Thanks,
- Tom

[gdb/testsuite] Fix gdb.base/maint.exp with cc-with-gdb-index

gdb/testsuite/ChangeLog:

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

	* gdb.base/maint.exp: Update "maint print statistics" to match
	output with target board cc-with-gdb-index.

---
 gdb/testsuite/gdb.base/maint.exp | 34 +++++++++++++++++++++-------------
 1 file changed, 21 insertions(+), 13 deletions(-)

diff --git a/gdb/testsuite/gdb.base/maint.exp b/gdb/testsuite/gdb.base/maint.exp
index 6831d1ba720..0a0cc0f813c 100644
--- a/gdb/testsuite/gdb.base/maint.exp
+++ b/gdb/testsuite/gdb.base/maint.exp
@@ -191,19 +191,27 @@ if [istarget "*-*-cygwin*"] {
 	set timeout [expr $timeout + 500]
 }
 
-send_gdb "maint print statistics\n"
-gdb_expect  {
-    -re "Statistics for\[^\n\r\]*maint\[^\n\r\]*:\r\n  Number of \"minimal\" symbols read: $decimal\r\n  Number of \"full\" symbols read: $decimal\r\n  Number of \"types\" defined: $decimal\r\n(  Number of read CUs: $decimal\r\n  Number of unread CUs: $decimal\r\n)?  Number of symbol tables: $decimal\r\n  Number of symbol tables with line tables: $decimal\r\n  Number of symbol tables with blockvectors: $decimal\r\n(  Number of \"partial\" symbols read: $decimal\r\n)?(  Number of psym tables \\(not yet expanded\\): $decimal\r\n)?  Total memory used for psymbol cache: $decimal\r\n  Total memory used for objfile obstack: $decimal\r\n  Total memory used for BFD obstack: $decimal\r\n  Total memory used for string cache: $decimal\r\n" {
-	gdb_expect {
-	    -re "$gdb_prompt $" {
-		pass "maint print statistics"
-	    }
-	    timeout { fail "(timeout) maint print statistics" }
-	}
-    }
-    -re ".*$gdb_prompt $"     { fail "maint print statistics" }
-    timeout         { fail "(timeout) maint print statistics" }
-}
+set re \
+    [list \
+	 "Statistics for\[^\n\r\]*maint\[^\n\r\]*:" \
+	 "  Number of \"minimal\" symbols read: $decimal" \
+	 "  Number of \"full\" symbols read: $decimal" \
+	 "  Number of \"types\" defined: $decimal" \
+	 "  Number of symbol tables: $decimal" \
+	 "  Number of symbol tables with line tables: $decimal" \
+	 "  Number of symbol tables with blockvectors: $decimal" \
+	 "(  Number of read CUs: $decimal" \
+	 "  Number of unread CUs: $decimal" \
+	 ")?(  Number of \"partial\" symbols read: $decimal" \
+	 ")?(  Number of psym tables \\(not yet expanded\\): $decimal" \
+	 ")?(  Total memory used for psymbol cache: $decimal" \
+	 ")?  Total memory used for objfile obstack: $decimal" \
+	 "  Total memory used for BFD obstack: $decimal" \
+	 "  Total memory used for string cache: $decimal" \
+	 ""]
+
+set re [multi_line {*}$re]
+gdb_test_lines "maint print statistics" "" $re
 
 # There aren't any ...
 gdb_test_no_output "maint print dummy-frames"

                 reply	other threads:[~2021-08-01 18:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20210801180505.GA9296@delia \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    /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