Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <qiyaoltc@gmail.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 1/3] Use get_var_address in test cases
Date: Fri, 14 Oct 2016 10:53:00 -0000	[thread overview]
Message-ID: <1476442387-17291-2-git-send-email-yao.qi@linaro.org> (raw)
In-Reply-To: <1476442387-17291-1-git-send-email-yao.qi@linaro.org>

This patch uses get_var_address more.

gdb/testsuite:

2016-10-13  Yao Qi  <yao.qi@linaro.org>

	* gdb.python/py-events.exp: Call get_var_address.
	* gdb.trace/tracecmd.exp: Call get_var_address and match possible
	leading zeros.
---
 gdb/testsuite/gdb.python/py-events.exp | 7 +------
 gdb/testsuite/gdb.trace/tracecmd.exp   | 9 ++++-----
 2 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/gdb/testsuite/gdb.python/py-events.exp b/gdb/testsuite/gdb.python/py-events.exp
index de8de07..602fbae 100644
--- a/gdb/testsuite/gdb.python/py-events.exp
+++ b/gdb/testsuite/gdb.python/py-events.exp
@@ -88,12 +88,7 @@ gdb_test_multiple "info threads" "get current thread" {
     }
 }
 
-gdb_test_multiple "print do_nothing" "get address of do_nothing" {
-    -re "\[^\n\r\]*(0x\[0-9a-f\]+) \<do_nothing\>.*$gdb_prompt $" {
-	set addr $expect_out(1,string)
-	pass "get address of do_nothing"
-    }
-}
+set addr [get_var_address "do_nothing"]
 
 set expected [list "event type: pre-call"]
 lappend expected "ptid: \\($process_id, $process_id, 0\\)" "address: $addr"
diff --git a/gdb/testsuite/gdb.trace/tracecmd.exp b/gdb/testsuite/gdb.trace/tracecmd.exp
index 11ef691..7e1dc4b 100644
--- a/gdb/testsuite/gdb.trace/tracecmd.exp
+++ b/gdb/testsuite/gdb.trace/tracecmd.exp
@@ -114,11 +114,10 @@ gdb_test "info trace" "$asm_test_addr.*gdb_asm_test.*" \
 
 # 1.7 trace at function's exact address
 #     Collect the address of the function for comparison
-gdb_test_multiple "print gdb_recursion_test" "" {
-    -re "\[$\]\[0-9\].*0x(\[0-9a-fA-F\]+).*$gdb_prompt $" {
-	set c_test_addr $expect_out(1,string)
-    }
-}
+set c_test_addr [get_var_address "gdb_recursion_test"]
+# Match leading zeros in address.
+set c_test_addr [string range $c_test_addr 2 [expr {[string length $c_test_addr] -1}]]
+set c_test_addr "0x(0)*$c_test_addr"
 
 gdb_delete_tracepoints
 gdb_test "trace \*gdb_recursion_test" \
-- 
1.9.1


      parent reply	other threads:[~2016-10-14 10:53 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-14 10:53 [PATCH 0/3] Fix gdb.base/func-ptrs.exp fails in ppc64 and arm thumb mode Yao Qi
2016-10-14 10:53 ` [RFC 3/3] Update test cases Yao Qi
2016-10-14 10:53 ` [RFC 2/3] Record function descriptor address instead of function address in value Yao Qi
2016-10-14 17:35   ` Simon Marchi
2016-10-17 11:40     ` Yao Qi
2016-10-17 15:40       ` Simon Marchi
2016-10-17 15:51   ` Ulrich Weigand
2016-10-18  2:27     ` Maciej W. Rozycki
2016-10-18 13:03       ` Yao Qi
2016-10-28 16:20       ` Yao Qi
2017-10-03 18:12         ` Maciej W. Rozycki
2017-10-04 21:25           ` Yao Qi
2016-10-28 16:10     ` Yao Qi
2016-10-28 18:41       ` Ulrich Weigand
2016-10-14 10:53 ` Yao Qi [this message]

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=1476442387-17291-2-git-send-email-yao.qi@linaro.org \
    --to=qiyaoltc@gmail.com \
    --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