* [PATCH OBV] set print symbol off in py-value.exp and scm-value.exp
@ 2014-08-22 13:33 Yao Qi
2014-08-22 17:07 ` Doug Evans
0 siblings, 1 reply; 3+ messages in thread
From: Yao Qi @ 2014-08-22 13:33 UTC (permalink / raw)
To: gdb-patches
I see the following fails on arm-none-eabi target,
print sn^M
$14 = 0x0 <_ftext>^M
(gdb) FAIL: gdb.python/py-value.exp: print sn
print sn^M
$14 = 0x0 <_ftext>^M
(gdb) FAIL: gdb.guile/scm-value.exp: print sn
as <_ftext> is unexpected. This patch is to set print symbol off to
avoid printing this. It is obvious and I'll commit it in two days.
gdb/testsuite:
2014-08-22 Yao Qi <yao@codesourcery.com>
* gdb.guile/scm-value.exp (test_lazy_strings): Set print
symbol off.
* gdb.python/py-value.exp (test_lazy_strings): Likewise.
---
gdb/testsuite/gdb.guile/scm-value.exp | 2 ++
gdb/testsuite/gdb.python/py-value.exp | 4 ++++
2 files changed, 6 insertions(+)
diff --git a/gdb/testsuite/gdb.guile/scm-value.exp b/gdb/testsuite/gdb.guile/scm-value.exp
index 91e1a56..3641f75 100644
--- a/gdb/testsuite/gdb.guile/scm-value.exp
+++ b/gdb/testsuite/gdb.guile/scm-value.exp
@@ -219,6 +219,8 @@ proc test_lazy_strings {} {
"= const char \*." "Test lazy-string type name equality"
gdb_test "gu (print (value-type sptr))" \
"= const char \*." "Test string type name equality"
+ # Prevent symbol on address 0x0 being printed.
+ gdb_test_no_output "set print symbol off"
gdb_test "print sn" "0x0"
gdb_scm_test_silent_cmd "gu (define snptr (history-ref 0))" \
"lazy strings: get snptr value from history"
diff --git a/gdb/testsuite/gdb.python/py-value.exp b/gdb/testsuite/gdb.python/py-value.exp
index 0728266..0d18bef 100644
--- a/gdb/testsuite/gdb.python/py-value.exp
+++ b/gdb/testsuite/gdb.python/py-value.exp
@@ -302,7 +302,11 @@ proc test_lazy_strings {} {
gdb_py_test_silent_cmd "python lstr = sptr.lazy_string()" "Aquire lazy string" 1
gdb_test "python print (lstr.type)" "const char \*." "Test lazy-string type name equality"
gdb_test "python print (sptr.type)" "const char \*." "Test string type name equality"
+
+ # Prevent symbol on address 0x0 being printed.
+ gdb_test_no_output "set print symbol off"
gdb_test "print sn" "0x0"
+
gdb_py_test_silent_cmd "python snptr = gdb.history (0)" "Get value from history" 1
gdb_test "python snstr = snptr.lazy_string(length=5)" ".*Cannot create a lazy string with address.*" "Test lazy string"
gdb_py_test_silent_cmd "python snstr = snptr.lazy_string(length=0)" "Succesfully create a lazy string" 1
--
1.9.3
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH OBV] set print symbol off in py-value.exp and scm-value.exp
2014-08-22 13:33 [PATCH OBV] set print symbol off in py-value.exp and scm-value.exp Yao Qi
@ 2014-08-22 17:07 ` Doug Evans
2014-08-24 12:30 ` Yao Qi
0 siblings, 1 reply; 3+ messages in thread
From: Doug Evans @ 2014-08-22 17:07 UTC (permalink / raw)
To: Yao Qi; +Cc: gdb-patches
Yao Qi writes:
> 2014-08-22 Yao Qi <yao@codesourcery.com>
>
> * gdb.guile/scm-value.exp (test_lazy_strings): Set print
> symbol off.
> * gdb.python/py-value.exp (test_lazy_strings): Likewise.
> ---
> gdb/testsuite/gdb.guile/scm-value.exp | 2 ++
> gdb/testsuite/gdb.python/py-value.exp | 4 ++++
> 2 files changed, 6 insertions(+)
>
> diff --git a/gdb/testsuite/gdb.guile/scm-value.exp b/gdb/testsuite/gdb.guile/scm-value.exp
> index 91e1a56..3641f75 100644
> --- a/gdb/testsuite/gdb.guile/scm-value.exp
> +++ b/gdb/testsuite/gdb.guile/scm-value.exp
> @@ -219,6 +219,8 @@ proc test_lazy_strings {} {
> "= const char \*." "Test lazy-string type name equality"
> gdb_test "gu (print (value-type sptr))" \
> "= const char \*." "Test string type name equality"
> + # Prevent symbol on address 0x0 being printed.
> + gdb_test_no_output "set print symbol off"
> gdb_test "print sn" "0x0"
> gdb_scm_test_silent_cmd "gu (define snptr (history-ref 0))" \
> "lazy strings: get snptr value from history"
> diff --git a/gdb/testsuite/gdb.python/py-value.exp b/gdb/testsuite/gdb.python/py-value.exp
> index 0728266..0d18bef 100644
> --- a/gdb/testsuite/gdb.python/py-value.exp
> +++ b/gdb/testsuite/gdb.python/py-value.exp
> @@ -302,7 +302,11 @@ proc test_lazy_strings {} {
> gdb_py_test_silent_cmd "python lstr = sptr.lazy_string()" "Aquire lazy string" 1
> gdb_test "python print (lstr.type)" "const char \*." "Test lazy-string type name equality"
> gdb_test "python print (sptr.type)" "const char \*." "Test string type name equality"
> +
> + # Prevent symbol on address 0x0 being printed.
> + gdb_test_no_output "set print symbol off"
> gdb_test "print sn" "0x0"
> +
> gdb_py_test_silent_cmd "python snptr = gdb.history (0)" "Get value from history" 1
> gdb_test "python snstr = snptr.lazy_string(length=5)" ".*Cannot create a lazy string with address.*" "Test lazy string"
> gdb_py_test_silent_cmd "python snstr = snptr.lazy_string(length=0)" "Succesfully create a lazy string" 1
Nit.
I like the blank lines added in py-value.exp.
I also like consistency. :-)
Please add them to scm-value.exp too.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH OBV] set print symbol off in py-value.exp and scm-value.exp
2014-08-22 17:07 ` Doug Evans
@ 2014-08-24 12:30 ` Yao Qi
0 siblings, 0 replies; 3+ messages in thread
From: Yao Qi @ 2014-08-24 12:30 UTC (permalink / raw)
To: Doug Evans; +Cc: gdb-patches
Doug Evans <dje@google.com> writes:
> Nit.
> I like the blank lines added in py-value.exp.
> I also like consistency. :-)
> Please add them to scm-value.exp too.
No problem, patch is pushed in.
--
Yao (齐尧)
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-08-24 12:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-22 13:33 [PATCH OBV] set print symbol off in py-value.exp and scm-value.exp Yao Qi
2014-08-22 17:07 ` Doug Evans
2014-08-24 12:30 ` Yao Qi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox