This is the mail archive of the gdb-patches@sourceware.org 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] Save trace files in binary mode


Saving trace files in binary mode works better for Unix/Windows compat. (I'm posting this without committing yet, in case there are any other considerations to account for.)

Stan

2010-04-20  Stan Shebs  <stan@codesourcery.com>
       Nathan Sidwell  <nathan@codesourcery.com>

* tracepoint.c (trace_save): Open in binary mode.

Index: tracepoint.c
===================================================================
RCS file: /cvs/src/src/gdb/tracepoint.c,v
retrieving revision 1.182
diff -p -r1.182 tracepoint.c
*** tracepoint.c    20 Apr 2010 18:52:59 -0000    1.182
--- tracepoint.c    20 Apr 2010 22:01:09 -0000
*************** trace_save (const char *filename, int ta
*** 2616,2622 ****
   pathname = tilde_expand (filename);
   cleanup = make_cleanup (xfree, pathname);

!   fp = fopen (pathname, "w");
   if (!fp)
     error (_("Unable to open file '%s' for saving trace data (%s)"),
        filename, safe_strerror (errno));
--- 2616,2622 ----
   pathname = tilde_expand (filename);
   cleanup = make_cleanup (xfree, pathname);

!   fp = fopen (pathname, "wb");
   if (!fp)
     error (_("Unable to open file '%s' for saving trace data (%s)"),
        filename, safe_strerror (errno));


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