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] Limit verbose scope in gdb.base/break-interp.exp
Date: Wed, 11 Mar 2020 14:25:49 +0100	[thread overview]
Message-ID: <20200311132547.GA725@delia> (raw)

Hi,

I'm running into the following failure (and 17 more like it) in
gdb.base/break-interp.exp:
...
 (gdb) bt^M
 #0  0x00007fde85a3b0c1 in __GI___nanosleep \
   (requested_time=requested_time@entry=0x7ffe5044ee70, \
   remaining=remaining@entry=0x7ffe5044ee70) at nanosleep.c:27^M
 #1  0x00007fde85a3affa in __sleep (seconds=0) at sleep.c:55^M
 #2  0x00007fde8606789c in libfunc (Reading in symbols for libc-start.c...^M
 action=0x7ffe5044fa12 "sleep") at gdb.base/break-interp-lib.c:41^M
 #3  0x0000000000400708 in main ()^M
 Reading in symbols for ../sysdeps/x86_64/start.S...^M
 (gdb) FAIL: gdb.base/break-interp.exp: LDprelinkNOdebugNO: \
   BINprelinkNOdebugNOpieNO: INNER: attach: attach main bt
...

The problem is that the test uses verbose mode to detect the "PIE (Position
Independent Executable) displacement" messages, but the verbose mode also
triggers "Reading in symbols for" messages, which may appear in the middle of
a backtrace (or not, depending on whether debug info is available).

[ In fact, the messages appear in the middle of a backtrace line, which is
PR25613. ]

Fix these FAILs by limiting the scope of verbose to the parts of the test that
need it.

Tested on x86_64-linux.


Committed to trunk.

Thanks,
- Tom

[gdb/testsuite] Limit verbose scope in gdb.base/break-interp.exp

gdb/testsuite/ChangeLog:

2020-03-11  Tom de Vries  <tdevries@suse.de>

	* gdb.base/break-interp.exp: Limit verbose scope.

---
 gdb/testsuite/gdb.base/break-interp.exp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gdb/testsuite/gdb.base/break-interp.exp b/gdb/testsuite/gdb.base/break-interp.exp
index 6f1af0e5b1..ba05a22268 100644
--- a/gdb/testsuite/gdb.base/break-interp.exp
+++ b/gdb/testsuite/gdb.base/break-interp.exp
@@ -251,6 +251,7 @@ proc test_core {file displacement} {
 	if ![regexp {^(NONE|FOUND-.*)$} $displacement] {
 	    fail $test_displacement
 	}
+	gdb_test_no_output "set verbose off"
 
 	gdb_test "bt" "#\[0-9\]+ +\[^\r\n\]*\\mlibfunc\\M\[^\r\n\]*\r\n#\[0-9\]+ +\[^\r\n\]*\\mmain\\M.*" "core main bt"
     }
@@ -301,6 +302,7 @@ proc test_attach_gdb {file pid displacement prefix} {
 	if ![regexp {^(NONE|FOUND-.*)$} $displacement] {
 	    fail $test_displacement
 	}
+	gdb_test_no_output "set verbose off"
 
 	gdb_test "bt" "#\[0-9\]+ +\[^\r\n\]*\\mlibfunc\\M\[^\r\n\]*\r\n#\[0-9\]+ +\[^\r\n\]*\\mmain\\M.*" "attach main bt"
 	gdb_exit
@@ -409,19 +411,24 @@ proc test_ld {file ifmain trynosym displacement} {
 
     reach $solib_bp "run" $displacement 1
 
+    gdb_test_no_output "set verbose off"
     gdb_test "bt" "#0 +\[^\r\n\]*\\m(__GI_)?$solib_bp\\M.*" "dl bt"
+    gdb_test_no_output "set verbose on"
 
     if $ifmain {
 	reach "main" continue "NONE"
 
 	reach "libfunc" continue "NONE"
 
+	gdb_test_no_output "set verbose off"
 	gdb_test "bt" "#0 +\[^\r\n\]*\\mlibfunc\\M\[^\r\n\]*\r\n#1 +\[^\r\n\]*\\mmain\\M.*" "main bt"
+	gdb_test_no_output "set verbose on"
     }
 
     # Try re-run if the new PIE displacement takes effect.
     gdb_test "kill" "" "kill" {Kill the program being debugged\? \(y or n\) } "y"
     reach $solib_bp "run" $displacement 2
+    gdb_test_no_output "set verbose off"
 
     if $ifmain {
 	test_core $file $displacement
@@ -524,6 +531,7 @@ proc test_ld {file ifmain trynosym displacement} {
 		fail $test_displacement
 	    }
 	}
+	gdb_test_no_output "set verbose off"
     }
 }
 


                 reply	other threads:[~2020-03-11 13:25 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=20200311132547.GA725@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