/* Shared utility routines for GDB to interact with agent.
- Copyright (C) 2009-2012 Free Software Foundation, Inc.
+ Copyright (C) 2009-2013 Free Software Foundation, Inc.
This file is part of GDB.
#include <string.h>
#include <unistd.h>
#include "agent.h"
+#include "filestuff.h"
int debug_agent = 0;
(unsigned char *) &helper_thread_id,
sizeof helper_thread_id))
#else
- enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch);
+ enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
gdb_byte buf[4];
if (target_read_memory (ipa_sym_addrs.addr_helper_thread_id,
if (res >= UNIX_PATH_MAX)
return -1;
- res = fd = socket (PF_UNIX, SOCK_STREAM, 0);
+ res = fd = gdb_socket_cloexec (PF_UNIX, SOCK_STREAM, 0);
if (res == -1)
{
warning (_("error opening sync socket: %s"), strerror (errno));
int ret = write_inferior_memory (ipa_sym_addrs.addr_cmd_buf,
(const unsigned char *) cmd, len);
#else
- int ret = target_write_memory (ipa_sym_addrs.addr_cmd_buf, cmd, len);
+ int ret = target_write_memory (ipa_sym_addrs.addr_cmd_buf,
+ (gdb_byte *) cmd, len);
#endif
if (ret != 0)
(unsigned char *) &agent_capability,
sizeof agent_capability))
#else
- enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch);
+ enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
gdb_byte buf[4];
if (target_read_memory (ipa_sym_addrs.addr_capability,