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 printf regexp in gdb.server/sysroot.exp
Date: Wed, 11 Mar 2020 17:57:27 +0100	[thread overview]
Message-ID: <20200311165725.GA8090@delia> (raw)

Hi,

When running gdb.server/sysroot.exp, I run into this FAIL:
...
(gdb) continue^M
Continuing.^M
^M
Breakpoint 2, __printf (format=0x4005c4 "Hello World!\n") at printf.c:28^M
28      {^M
(gdb) FAIL: gdb.server/sysroot.exp: sysroot=local: continue to printf
...
for this test:
...
    gdb_test "continue" "Breakpoint $decimal.* printf .*" "continue to printf"
...

Without debug info for glibc installed, we have instead:
...
(gdb) continue^M
Continuing.^M
^M
Breakpoint 2, 0x00007ffff773c550 in printf () from /lib64/libc.so.6^M
(gdb) PASS: gdb.server/sysroot.exp: sysroot=local: continue to printf
...

Fix this by allowing for GLIBC's printf alias __printf to be printed:
...
    gdb_test "continue" "Breakpoint $decimal.* (__)?printf .*" \
      "continue to printf"
...

Tested on x86_64-linux.

Committed to trunk.

Thanks,
- Tom

[gdb/testsuite] Fix printf regexp in gdb.server/sysroot.exp

gdb/testsuite/ChangeLog:

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

	* gdb.server/sysroot.exp: Allow GLIBC's printf alias __printf.

---
 gdb/testsuite/gdb.server/sysroot.exp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.server/sysroot.exp b/gdb/testsuite/gdb.server/sysroot.exp
index fd6f43b1b1..2c68ebf287 100644
--- a/gdb/testsuite/gdb.server/sysroot.exp
+++ b/gdb/testsuite/gdb.server/sysroot.exp
@@ -73,5 +73,6 @@ foreach_with_prefix sysroot { "local" "remote" } {
 
     # Test that we can stop inside a library.
     gdb_breakpoint printf
-    gdb_test "continue" "Breakpoint $decimal.* printf .*" "continue to printf"
+    gdb_test "continue" "Breakpoint $decimal.* (__)?printf .*" \
+	"continue to printf"
 }


                 reply	other threads:[~2020-03-11 16:57 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=20200311165725.GA8090@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