summaryrefslogtreecommitdiff
path: root/gdb/tracepoint.c
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@specifix.com>2002-01-08 01:52:12 +0000
committerMichael Snyder <msnyder@specifix.com>2002-01-08 01:52:12 +0000
commitbe805347a93ff183dcdbed2e74c9da2a3683af6e (patch)
tree9b881d1e4abf0fe9f26a1d4c053845283e403dbe /gdb/tracepoint.c
parent1cc3b034d330e306ec97ac6779bfeeb5932e561f (diff)
downloadgdb-be805347a93ff183dcdbed2e74c9da2a3683af6e.tar.gz
2002-01-07 Michael Snyder <msnyder@redhat.com>
* tracepoint.c (tracepoint_save_command): From Klee Deines -- use tilde_expand and strerror for opening save-tracepoints file.
Diffstat (limited to 'gdb/tracepoint.c')
-rw-r--r--gdb/tracepoint.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index 7e2f112daaa..0ccdf6f3232 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -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)