]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2002-01-07 Michael Snyder <msnyder@redhat.com>
authorMichael Snyder <msnyder@vmware.com>
Tue, 8 Jan 2002 01:52:12 +0000 (01:52 +0000)
committerMichael Snyder <msnyder@vmware.com>
Tue, 8 Jan 2002 01:52:12 +0000 (01:52 +0000)
* tracepoint.c (tracepoint_save_command): From Klee Deines --
use tilde_expand and strerror for opening save-tracepoints file.

gdb/ChangeLog
gdb/tracepoint.c

index 028960b52097b5613de54e05f8530cfab3b7d83a..1ab3eb4e86dd47a9da2d47bf8c915c430b696c85 100644 (file)
@@ -1,5 +1,8 @@
 2002-01-07  Michael Snyder  <msnyder@redhat.com>
 
+       * tracepoint.c (tracepoint_save_command): From Klee Dienes --
+       use tilde_expand and strerror for opening save-tracepoints file.
+
        * thread-db.c (thread_db_new_objfile): Indendation fix.
 
        * infptrace.c (GDB_MAX_ALLOCA): New define.
index 7e2f112daaaba444eb0d2eb6403c186a9f96ba8b..0ccdf6f32326aa93dea664ca83b5cd1196dac775 100644 (file)
@@ -2263,7 +2263,7 @@ tracepoint_save_command (char *args, int from_tty)
   struct action_line *line;
   FILE *fp;
   char *i1 = "    ", *i2 = "      ";
-  char *indent, *actionline;
+  char *indent, *actionline, *pathname;
   char tmp[40];
 
   if (args == 0 || *args == 0)
@@ -2275,9 +2275,12 @@ tracepoint_save_command (char *args, int from_tty)
       return;
     }
 
-  if (!(fp = fopen (args, "w")))
-    error ("Unable to open file '%s' for saving tracepoints");
-
+  pathname = tilde_expand (args);
+  if (!(fp = fopen (pathname, "w")))
+    error ("Unable to open file '%s' for saving tracepoints (%s)",
+          args, strerror (errno));
+  xfree (pathname);
+  
   ALL_TRACEPOINTS (tp)
   {
     if (tp->addr_string)