21 #include "target/target.h"
32 debug_agent_printf (const
char *fmt, ...)
43 #define DEBUG_AGENT debug_agent_printf
117 warning (
_(
"Error reading helper thread's id in lib"));
124 #include <sys/socket.h>
126 #define SOCK_DIR P_tmpdir
128 #ifndef UNIX_PATH_MAX
129 #define UNIX_PATH_MAX sizeof(((struct sockaddr_un *) NULL)->sun_path)
141 struct sockaddr_un addr;
143 char path[UNIX_PATH_MAX];
145 res =
xsnprintf (path, UNIX_PATH_MAX,
"%s/gdb_ust%d", P_tmpdir, pid);
146 if (res >= UNIX_PATH_MAX)
156 addr.sun_family = AF_UNIX;
158 res =
xsnprintf (addr.sun_path, UNIX_PATH_MAX,
"%s", path);
159 if (res >= UNIX_PATH_MAX)
161 warning (
_(
"string overflow allocating socket name"));
166 res = connect (fd, (
struct sockaddr *) &addr,
sizeof (addr));
169 warning (
_(
"error connecting sync socket (%s): %s. "
170 "Make sure the directory exists and that it is writable."),
219 ret = write (fd, buf, 1);
220 }
while (ret == -1 &&
errno == EINTR);
222 DEBUG_AGENT (
"agent: waiting for helper thread's response\n");
226 ret = read (fd, buf, 1);
227 }
while (ret == -1 &&
errno == EINTR);
231 DEBUG_AGENT (
"agent: helper thread's response received\n");
249 warning (
_(
"Error reading command response"));
269 warning (
_(
"Error reading capability of agent"));
int agent_look_up_symbols(void *arg)
int ptid_equal(ptid_t ptid1, ptid_t ptid2)
void warning(const char *fmt,...)
int gdb_socket_cloexec(int domain, int style, int protocol)
void debug_vprintf(const char *format, va_list ap)
int target_read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
static uint32_t agent_capability
static unsigned int agent_get_helper_thread_id(void)
int find_minimal_symbol_address(const char *name, CORE_ADDR *addr, struct objfile *objfile)
ptid_t ptid_build(int pid, long lwp, long tid)
int agent_run_command(int pid, const char *cmd, int len)
static uint32_t helper_thread_id
static struct ipa_sym_addresses ipa_sym_addrs
static int all_agent_symbols_looked_up
int target_read_uint32(CORE_ADDR memaddr, uint32_t *result)
void target_continue_no_signal(ptid_t ptid)
int agent_capability_check(enum agent_capa agent_capa)
static void ATTRIBUTE_PRINTF(1, 2)
void agent_capability_invalidate(void)
int xsnprintf(char *str, size_t size, const char *format,...)
void target_stop_and_wait(ptid_t ptid)
static int gdb_connect_sync_socket(int pid)
CORE_ADDR addr_capability
static struct @6 symbol_list[]
int target_write_memory(CORE_ADDR memaddr, const gdb_byte *myaddr, ssize_t len)
CORE_ADDR addr_helper_thread_id