* [PATCH] Set print symbol off in some tests
@ 2014-08-14 4:04 Yao Qi
2014-08-14 23:03 ` Joel Brobecker
0 siblings, 1 reply; 3+ messages in thread
From: Yao Qi @ 2014-08-14 4:04 UTC (permalink / raw)
To: gdb-patches
GDB in default prints the symbol associated on an address, and tests
assume that there is no symbol on address zero. However, on bare
metal target, address may be mapped to zero and there may be a
symbol. Then, some tests fails as below:
print const_cast<void *> (0)^M
$8 = (void *) 0x0 <_ftext>^M
(gdb) FAIL: gdb.cp/casts.exp: const_cast of 0
p acp->c1^M
$9 = (A *) 0x0 <_ftext>^M
(gdb) FAIL: gdb.cp/class2.exp: p acp->c1
This patch is to set print symbol off in these tests, like what
I did previously https://sourceware.org/ml/gdb-patches/2014-07/msg00257.html
gdb/testsuite:
2014-08-14 Yao Qi <yao@codesourcery.com>
* gdb.cp/casts.exp: Set print symbol off.
* gdb.cp/class2.exp: Likewise.
* gdb.cp/overload.exp: Likewise.
* gdb.cp/templates.exp: Likewise.
---
gdb/testsuite/gdb.cp/casts.exp | 3 +++
gdb/testsuite/gdb.cp/class2.exp | 3 ++-
gdb/testsuite/gdb.cp/overload.exp | 3 +++
gdb/testsuite/gdb.cp/templates.exp | 2 ++
4 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/gdb/testsuite/gdb.cp/casts.exp b/gdb/testsuite/gdb.cp/casts.exp
index 9122450..e28f311 100644
--- a/gdb/testsuite/gdb.cp/casts.exp
+++ b/gdb/testsuite/gdb.cp/casts.exp
@@ -42,6 +42,9 @@ if ![runto_main] then {
continue
}
+# Prevent symbol on address 0x0 being printed.
+gdb_test_no_output "set print symbol off"
+
gdb_test "break [gdb_get_line_number "casts.exp: 1"]" \
"Breakpoint.*at.* file .*" \
""
diff --git a/gdb/testsuite/gdb.cp/class2.exp b/gdb/testsuite/gdb.cp/class2.exp
index 82faac5..eae5922 100644
--- a/gdb/testsuite/gdb.cp/class2.exp
+++ b/gdb/testsuite/gdb.cp/class2.exp
@@ -28,9 +28,10 @@ if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
return -1
}
-# Start with "set print object off".
+# Start with "set print object off" and "set print symbol off".
gdb_test_no_output "set print object off"
+gdb_test_no_output "set print symbol off"
if ![runto_main] then {
perror "couldn't run to main"
diff --git a/gdb/testsuite/gdb.cp/overload.exp b/gdb/testsuite/gdb.cp/overload.exp
index 73232f7..aea2efc 100644
--- a/gdb/testsuite/gdb.cp/overload.exp
+++ b/gdb/testsuite/gdb.cp/overload.exp
@@ -39,6 +39,9 @@ if ![runto 'marker1'] then {
continue
}
+# Prevent symbol on address 0x0 being printed.
+gdb_test_no_output "set print symbol off"
+
gdb_test "up" ".*main.*" "up from marker1"
# Print the monster class type.
diff --git a/gdb/testsuite/gdb.cp/templates.exp b/gdb/testsuite/gdb.cp/templates.exp
index 0cc0e84..42dc1df 100644
--- a/gdb/testsuite/gdb.cp/templates.exp
+++ b/gdb/testsuite/gdb.cp/templates.exp
@@ -293,6 +293,8 @@ gdb_test "c" \
gdb_test "print fint" \
"\\$\[0-9\]* = \\{x = 0, t = 0\\}"
+# Prevent symbol on address 0x0 being printed.
+gdb_test_no_output "set print symbol off"
gdb_test "print fvpchar" \
"\\$\[0-9\]* = \\{x = 0, t = 0x0\\}"
--
1.9.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Set print symbol off in some tests
2014-08-14 4:04 [PATCH] Set print symbol off in some tests Yao Qi
@ 2014-08-14 23:03 ` Joel Brobecker
2014-08-15 0:01 ` Yao Qi
0 siblings, 1 reply; 3+ messages in thread
From: Joel Brobecker @ 2014-08-14 23:03 UTC (permalink / raw)
To: Yao Qi; +Cc: gdb-patches
> 2014-08-14 Yao Qi <yao@codesourcery.com>
>
> * gdb.cp/casts.exp: Set print symbol off.
> * gdb.cp/class2.exp: Likewise.
> * gdb.cp/overload.exp: Likewise.
> * gdb.cp/templates.exp: Likewise.
OK!
Thanks,
--
Joel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Set print symbol off in some tests
2014-08-14 23:03 ` Joel Brobecker
@ 2014-08-15 0:01 ` Yao Qi
0 siblings, 0 replies; 3+ messages in thread
From: Yao Qi @ 2014-08-15 0:01 UTC (permalink / raw)
To: Joel Brobecker; +Cc: gdb-patches
On 08/15/2014 07:03 AM, Joel Brobecker wrote:
>> 2014-08-14 Yao Qi <yao@codesourcery.com>
>>
>> * gdb.cp/casts.exp: Set print symbol off.
>> * gdb.cp/class2.exp: Likewise.
>> * gdb.cp/overload.exp: Likewise.
>> * gdb.cp/templates.exp: Likewise.
>
> OK!
>
> Thanks,
>
Thanks Joel, patch is pushed in.
--
Yao (é½å°§)
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-08-15 0:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-14 4:04 [PATCH] Set print symbol off in some tests Yao Qi
2014-08-14 23:03 ` Joel Brobecker
2014-08-15 0:01 ` Yao Qi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox