This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] tracepoint.c
- From: Michael Snyder <msnyder at cygnus dot com>
- To: gdb-patches at sources dot redhat dot com
- Cc: klee at apple dot com
- Date: Mon, 7 Jan 2002 17:49:17 -0800
- Subject: [PATCH] tracepoint.c
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.
Index: tracepoint.c
===================================================================
RCS file: /cvs/src/src/gdb/tracepoint.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -p -r1.29 -r1.30
*** tracepoint.c 2001/12/25 22:24:38 1.29
--- tracepoint.c 2002/01/08 01:52:12 1.30
*************** tracepoint_save_command (char *args, int
*** 2263,2269 ****
struct action_line *line;
FILE *fp;
char *i1 = " ", *i2 = " ";
! char *indent, *actionline;
char tmp[40];
if (args == 0 || *args == 0)
--- 2263,2269 ----
struct action_line *line;
FILE *fp;
char *i1 = " ", *i2 = " ";
! char *indent, *actionline, *pathname;
char tmp[40];
if (args == 0 || *args == 0)
*************** tracepoint_save_command (char *args, int
*** 2275,2283 ****
return;
}
! if (!(fp = fopen (args, "w")))
! error ("Unable to open file '%s' for saving tracepoints");
!
ALL_TRACEPOINTS (tp)
{
if (tp->addr_string)
--- 2275,2286 ----
return;
}
! 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)