public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Tom de Vries <vries@sourceware.org>
To: gdb-cvs@sourceware.org
Subject: [binutils-gdb] [gdb/testsuite] Fix gdb.base/watchpoint-reuse-slot.exp with gcc-8
Date: Wed,  6 May 2020 12:27:39 +0000 (GMT)	[thread overview]
Message-ID: <20200506122739.9E494383F85E@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=0d8683a32122f0027d2ab64082d1f9fced98d599

commit 0d8683a32122f0027d2ab64082d1f9fced98d599
Author: Tom de Vries <tdevries@suse.de>
Date:   Wed May 6 14:27:36 2020 +0200

    [gdb/testsuite] Fix gdb.base/watchpoint-reuse-slot.exp with gcc-8
    
    When running test-case gdb.base/watchpoint-reuse-slot.exp with gcc-8 instead
    of gcc-7, we have:
    ...
     (gdb) PASS: $conf: watch *(buf.byte + 0 + 0)@1
     stepi^M
    -0x00000000004004b9      34        for (i = 0; i < 100000; i++);^M
    +34        for (i = 0; i < 100000; i++);^M
    -(gdb) PASS: $conf: stepi advanced
    +(gdb) FAIL: $conf: stepi advanced
    ...
    where $conf is "gdb.base/watchpoint-reuse-slot.exp: hw-watch: always-inserted
    off: watch x watch: : width 1, iter 0: base + 0".
    
    This is due to the fact that gcc-8 generates more precise line info, making
    the instruction at 0x4004b9 a "recommended breakpoint location", such that gdb
    no longer prints the instruction address.
    
    Fix this by getting the instruction address by printing $pc.
    
    Tested on x86_64-linux.
    
    gdb/testsuite/ChangeLog:
    
    2020-05-06  Tom de Vries  <tdevries@suse.de>
    
            * gdb.base/watchpoint-reuse-slot.exp (stepi): Print $pc to get current
            address.

Diff:
---
 gdb/testsuite/ChangeLog                          | 5 +++++
 gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index fde713527d6..d808217ad57 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2020-05-06  Tom de Vries  <tdevries@suse.de>
+
+	* gdb.base/watchpoint-reuse-slot.exp (stepi): Print $pc to get current
+	address.
+
 2020-05-06  Tom de Vries  <tdevries@suse.de>
 
 	* gdb.base/watchpoint-reuse-slot.exp: Fix incorrect assignment.
diff --git a/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp b/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp
index 83b970380ca..3d3d3c479d5 100644
--- a/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp
+++ b/gdb/testsuite/gdb.base/watchpoint-reuse-slot.exp
@@ -66,8 +66,8 @@ proc stepi {} {
     set srcline "  for (i = 0; i < 100000; i++); /* stepi line */"
     set test "stepi advanced"
     gdb_test_multiple "stepi" $test {
-	-re "($hex).*[string_to_regexp $srcline]\r\n$gdb_prompt $" {
-	    set addr $expect_out(1,string)
+	-re -wrap "[string_to_regexp $srcline]" {
+	    set addr [get_valueof "/x" "\$pc" "0"]
 	    if {$addr != $cur_addr} {
 		pass $test
 	    } else {


                 reply	other threads:[~2020-05-06 12:27 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=20200506122739.9E494383F85E@sourceware.org \
    --to=vries@sourceware.org \
    --cc=gdb-cvs@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).