aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.trace/tfile.exp
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2013-03-20 11:28:55 +0000
committerPedro Alves <palves@redhat.com>2013-03-20 11:28:55 +0000
commit3f1175a995f09c90a2e026afae3602c33e1e3e19 (patch)
tree471394e7b6f936d8366b274d1713fa0318596ada /gdb/testsuite/gdb.trace/tfile.exp
parent35a7120b8ccbd9e58daf8a9d108923a8cf4fdc98 (diff)
downloadgdb-3f1175a995f09c90a2e026afae3602c33e1e3e19.zip
gdb-3f1175a995f09c90a2e026afae3602c33e1e3e19.tar.gz
gdb-3f1175a995f09c90a2e026afae3602c33e1e3e19.tar.bz2
tfile.exp: Test printing a non-const global that is not covered by the trace frame; test disassembling.
Make sure we don't fallback to printing the initial value of a non-const variable in the executable. Also make sure we can do 'disassemble', as another test that GDB is able to read read-only parts from the executable (the existing test of printing constglob also covers that case). gdb/testsuite/ 2013-03-20 Pedro Alves <palves@redhat.com> Yao Qi <yao@codesourcery.com> * gdb.trace/tfile.c: Add comments. (nonconstglob): New global. * gdb.trace/tfile.exp: Add comments. Test printing a non-const global that is not covered by the trace frame. Test disassembling.
Diffstat (limited to 'gdb/testsuite/gdb.trace/tfile.exp')
-rw-r--r--gdb/testsuite/gdb.trace/tfile.exp15
1 files changed, 15 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.trace/tfile.exp b/gdb/testsuite/gdb.trace/tfile.exp
index 2bdde37..56e2a79 100644
--- a/gdb/testsuite/gdb.trace/tfile.exp
+++ b/gdb/testsuite/gdb.trace/tfile.exp
@@ -64,8 +64,23 @@ gdb_test "print testglob" " = 31415" "print testglob on trace file"
gdb_test "print testglob2" " = 271828" "print testglob2 on trace file"
+# This global is not covered by the trace frame, but since it's const,
+# we should be able to read it from the executable.
+
gdb_test "print constglob" " = 10000" "print constglob on trace file"
+# Similarly, disassembly should find the read-only pieces in the executable.
+gdb_test "disassemble main" \
+ "Dump of assembler code for function main:.* $hex <\\+0\\>:.*End of assembler dump\."
+
+# This global is also not covered by the trace frame, and since it's
+# non-const, we should _not_ read it from the executable, as that
+# would show the variable's initial value, not the current at time the
+# trace frame was created.
+
+gdb_test "print nonconstglob" \
+ " = <unavailable>" "print nonconstglob on trace file"
+
gdb_test "tfind" "Target failed to find requested trace frame." \
"tfind does not find a second frame in trace file"