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 fail 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-15 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.
+2014-08-15 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.
+
2014-08-11 Doug Evans <dje@google.com>
* gdb.base/print-symbol-loading.exp (test_load_core): Update.
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 .*" \
""
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"
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.
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\\}"