#include "gdbcore.h"
#include "gdbthread.h"
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
+
/* List of all available core_fns. On gdb startup, each core file register
reader calls add_core_fns() to register information on each core format it
is prepared to read. */
/* Walk through the list of core functions to find a set that can
handle the core file open on ABFD. Default to the first one in the
- list of nothing matches. Returns pointer to set that is
+ list if nothing matches. Returns pointer to set that is
selected. */
static struct core_fns *
if (!bfd_close (core_bfd))
warning ("cannot close \"%s\": %s",
name, bfd_errmsg (bfd_get_error ()));
- free (name);
+ xfree (name);
core_bfd = NULL;
if (core_ops.to_sections)
{
- free ((PTR) core_ops.to_sections);
+ xfree (core_ops.to_sections);
core_ops.to_sections = NULL;
core_ops.to_sections_end = NULL;
}
if (filename[0] != '/')
{
temp = concat (current_directory, "/", filename, NULL);
- free (filename);
+ xfree (filename);
filename = temp;
}
- old_chain = make_cleanup (free, filename);
+ old_chain = make_cleanup (xfree, filename);
- scratch_chan = open (filename, write_files ? O_RDWR : O_RDONLY, 0);
+ scratch_chan = open (filename, O_BINARY | ( write_files ? O_RDWR : O_RDONLY ), 0);
if (scratch_chan < 0)
perror_with_name (filename);
siggy = bfd_core_file_failing_signal (core_bfd);
if (siggy > 0)
/* NOTE: target_signal_from_host() converts a target signal value
- into gdb's internal signal value. Unfortunatly gdb's internal
+ into gdb's internal signal value. Unfortunately gdb's internal
value is called ``target_signal'' and this function got the
name ..._from_host(). */
printf_filtered ("Program terminated with signal %d, %s.\n", siggy,