This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]