/* Generate a core file for the inferior process.
- Copyright (C) 2001-2015 Free Software Foundation, Inc.
+ Copyright (C) 2001-2016 Free Software Foundation, Inc.
This file is part of GDB.
#include "regset.h"
#include "gdb_bfd.h"
#include "readline/tilde.h"
+#include <algorithm>
/* The largest amount of memory to read from the target at once. We
must throttle it to limit the amount of memory used by GDB during
bfd_size_type size, total_size = bfd_section_size (obfd, osec);
file_ptr offset = 0;
struct cleanup *old_chain = NULL;
- void *memhunk;
+ gdb_byte *memhunk;
/* Read-only sections are marked; we don't have to copy their contents. */
if ((bfd_get_section_flags (obfd, osec) & SEC_LOAD) == 0)
if (!startswith (bfd_section_name (obfd, osec), "load"))
return;
- size = min (total_size, MAX_COPY_BYTES);
- memhunk = xmalloc (size);
+ size = std::min (total_size, (bfd_size_type) MAX_COPY_BYTES);
+ memhunk = (gdb_byte *) xmalloc (size);
old_chain = make_cleanup (xfree, memhunk);
while (total_size > 0)