Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries via Gdb-patches <gdb-patches@sourceware.org>
To: gdb-patches@sourceware.org
Subject: [committed][gdb/testsuite] Fix full buffer in gdb.rust/dwindex.exp
Date: Thu, 30 Sep 2021 12:02:50 +0200	[thread overview]
Message-ID: <20210930100248.GA13509@delia> (raw)

Hi,

On ubuntu 18.04.5, I run into:
...
(gdb) mt print objfiles dwindex^M
^M
Object file build/gdb/testsuite/outputs/gdb.rust/dwindex/dwindex:  \
  Objfile at 0x55dab0b87a50, bfd at 0x55dab0b0cfa0, 1095 minsyms^M
^M
Psymtabs:^M
vendor/compiler_builtins/src/int/specialized_div_rem/mod.rs at 0x55dab0db0720^M
  ...
library/std/src/sys/unix/stdio.rs at 0x55dab0d96320^M
ERROR: internal buffer is full.
UNRESOLVED: gdb.rust/dwindex.exp: check if index present
...

Fix this by using -lbl in proc ensure_gdb_index.

Tested on x86_64-linux.

Committed to trunk.

Thanks,
- Tom

[gdb/testsuite] Fix full buffer in gdb.rust/dwindex.exp

---
 gdb/testsuite/lib/gdb.exp | 34 ++++++++++++++++++++++++----------
 1 file changed, 24 insertions(+), 10 deletions(-)

diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index b7f3a57c4d9..afdc92eec3f 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -7917,22 +7917,36 @@ proc add_gdb_index { program {style ""} } {
 # string (the default) means .gdb_index; "-dwarf-5" means .debug_names.
 
 proc ensure_gdb_index { binfile {style ""} } {
+    global decimal
+
     set testfile [file tail $binfile]
     set test "check if index present"
-    gdb_test_multiple "mt print objfiles ${testfile}" $test {
-	-re -wrap "gdb_index.*" {
-	    return 0
+    set has_index 0
+    gdb_test_multiple "mt print objfiles ${testfile}" $test -lbl {
+	-re "\r\n\\.gdb_index: version ${decimal}(?=\r\n)" {
+	    set has_index 1
+	    gdb_test_lines "" $gdb_test_name ".*"
 	}
-	-re -wrap "debug_names.*" {
-	    return 0
+	-re "\r\n\\.debug_names: exists(?=\r\n)" {
+	    set has_index 1
+	    gdb_test_lines "" $gdb_test_name ".*"
 	}
-	-re -wrap "Psymtabs.*" {
-	    if { [add_gdb_index $binfile $style] != "1" } {
-		return -1
-	    }
-	    return 1
+	-re "\r\nPsymtabs:(?=\r\n)" {
+	    gdb_test_lines "" $gdb_test_name ".*"
 	}
+	-re -wrap "" {
+	    fail $gdb_test_name
+	}
+    }
+
+    if { $has_index } {
+	return 0
     }
+
+    if { [add_gdb_index $binfile $style] == "1" } {
+	return 1
+    }
+
     return -1
 }
 

                 reply	other threads:[~2021-09-30 10:03 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=20210930100248.GA13509@delia \
    --to=gdb-patches@sourceware.org \
    --cc=tdevries@suse.de \
    /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