+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.
+
 2013-03-17  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        * gdb.base/valgrind-infcall.exp
 
 char *trptr;
 char *tfsizeptr;
 
+/* These globals are put in the trace buffer.  */
+
 int testglob = 31415;
 
 int testglob2 = 271828;
 
+/* But these below are not.  */
+
 const int constglob = 10000;
 
+int nonconstglob = 14124;
+
 int
 start_trace_file (char *filename)
 {
 
 
 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"