+2010-03-31  Stan Shebs  <stan@codesourcery.com>
+
+       * breakpoint.c (tracepoint_save_command): Include variables,
+       conditionals, tracepoint types, and default-collect.
+       * tracepoint.c (save_trace_state_variables): New function.
+       * tracepoint.h (save_trace_state_variables): Declare it.
+
 2010-03-31  Pierre Muller  <muller@ics.u-strasbg.fr>
 
        * src/gdb/remote.c (end_thread): ARI fix: Use xstrdup instead of strdup.
 
     error (_("Unable to open file '%s' for saving tracepoints (%s)"),
           args, safe_strerror (errno));
   make_cleanup_ui_file_delete (fp);
-  
+
+  save_trace_state_variables (fp);
+
   ALL_TRACEPOINTS (tp)
   {
+    if (tp->type == bp_fast_tracepoint)
+      fprintf_unfiltered (fp, "ftrace");
+    else
+      fprintf_unfiltered (fp, "trace");
+
     if (tp->addr_string)
-      fprintf_unfiltered (fp, "trace %s\n", tp->addr_string);
+      fprintf_unfiltered (fp, " %s", tp->addr_string);
     else
       {
        sprintf_vma (tmp, tp->loc->address);
-       fprintf_unfiltered (fp, "trace *0x%s\n", tmp);
+       fprintf_unfiltered (fp, " *0x%s", tmp);
       }
 
+    if (tp->cond_string)
+      fprintf_unfiltered (fp, " if %s", tp->cond_string);
+
+    fprintf_unfiltered (fp, "\n");
+
     if (tp->pass_count)
       fprintf_unfiltered (fp, "  passcount %d\n", tp->pass_count);
 
        fprintf_unfiltered (fp, "  end\n");
       }
   }
+
+  if (*default_collect)
+    fprintf_unfiltered (fp, "set default-collect %s\n", default_collect);
+
   do_cleanups (cleanup);
   if (from_tty)
     printf_filtered (_("Tracepoints saved to file '%s'.\n"), args);
 
+2010-03-31  Stan Shebs  <stan@codesourcery.com>
+
+       * gdb.trace/save-trace.exp: Test save/restore of default-collect
+       and tracepoint conditionals.
+       (gdb_verify_tracepoints): Delete unused return.
+
 2010-03-26  Keith Seitz  <keiths@redhat.com>
 
        * gdb.java/jmisc.exp (ptype jmisc): Allow the constructor to
 
             "Setting tracepoint $trcpt.* to $x" \
             "10.x: set passcount for tracepoint $trcpt"
 
+    gdb_test "condition $trcpt $x - 1 == $x / 2" \
+            "" \
+            "10.x: set condition for tracepoint $trcpt"
+
     gdb_trace_setactions "10.x: set actions for tracepoint $x" \
            "" \
            "collect q$x" "^$" \
            "end" "^$"
 }
 
+gdb_test "set default-collect gdb_char_test, gdb_long_test - 100" \
+    "" \
+    "10: set default-collect"
 
 proc gdb_verify_tracepoints { testname } {
     global gdb_prompt;
     set result "pass";
     send_gdb "info tracepoints\n";
     gdb_expect 10 {
-       -re "\[0-9\]+\[\t \]+tracepoint\[\t \]+keep y\[\t \]+0x\[0-9a-fA-F\]+ in gdb_recursion_test\[^\r\n\]+" {
+       -re "\[0-9\]+\[\t \]+tracepoint\[\t \]+keep y\[\t \]+0x\[0-9a-fA-F\]+ in gdb_recursion_test\[^\r\n\]+\r\n\[ \t]+trace only if \[0-9\] - 1 == \[0-9\] / 2" {
 #          if { $expect_out(1,string) != $ourstate } {
 #              set result "fail";
 #          }
        }
     }
     $result $testname;
-    return $result;
+
+    gdb_test "show default-collect" \
+       "The list of expressions to collect by default is \"gdb_char_test, gdb_long_test - 100\"..*" \
+       "10: show default-collect"
 }
 
 gdb_verify_tracepoints "10.x: verify trace setup";
 
   tvariables_info_1 ();
 }
 
+/* Stash definitions of tsvs into the given file.  */
+
+void
+save_trace_state_variables (struct ui_file *fp)
+{
+  struct trace_state_variable *tsv;
+  int ix;
+
+  for (ix = 0; VEC_iterate (tsv_s, tvariables, ix, tsv); ++ix)
+    {
+      fprintf_unfiltered (fp, "tvariable $%s", tsv->name);
+      if (tsv->initial_value)
+       fprintf_unfiltered (fp, " = %s", plongest (tsv->initial_value));
+      fprintf_unfiltered (fp, "\n");
+    }
+}
+
 /* ACTIONS functions: */
 
 /* The three functions:
 
 extern void trace_status_mi (int on_stop);
 
 extern void tvariables_info_1 (void);
+extern void save_trace_state_variables (struct ui_file *fp);
 
 extern void tfind_1 (enum trace_find_type type, int num,
                     ULONGEST addr1, ULONGEST addr2,