[PATCH] Save trace files in binary mode
Stan Shebs
stan@codesourcery.com
Tue Apr 20 22:04:00 GMT 2010
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));
More information about the Gdb-patches
mailing list