static void init_extended_remote_ops (void);
-static void remote_stop (ptid_t);
+static void remote_stop (struct target_ops *self, ptid_t);
static int stubhex (int ch);
static void remote_async_inferior_event_handler (gdb_client_data);
-static void remote_terminal_ours (void);
+static void remote_terminal_ours (struct target_ops *self);
static int remote_read_description_p (struct target_ops *target);
static void remote_console_output (char *msg);
-static int remote_supports_cond_breakpoints (void);
+static int remote_supports_cond_breakpoints (struct target_ops *self);
-static int remote_can_run_breakpoint_commands (void);
+static int remote_can_run_breakpoint_commands (struct target_ops *self);
/* For "remote". */
it can simply pass through to the inferior without reporting. */
static void
-remote_pass_signals (int numsigs, unsigned char *pass_signals)
+remote_pass_signals (struct target_ops *self,
+ int numsigs, unsigned char *pass_signals)
{
if (remote_protocol_packets[PACKET_QPassSignals].support != PACKET_DISABLE)
{
signals it should pass through to the inferior when detaching. */
static void
-remote_program_signals (int numsigs, unsigned char *signals)
+remote_program_signals (struct target_ops *self,
+ int numsigs, unsigned char *signals)
{
if (remote_protocol_packets[PACKET_QProgramSignals].support != PACKET_DISABLE)
{
*/
static char *
-remote_threads_extra_info (struct thread_info *tp)
+remote_threads_extra_info (struct target_ops *self, struct thread_info *tp)
{
struct remote_state *rs = get_remote_state ();
int result;
/* Implement the to_get_ada_task_ptid function for the remote targets. */
static ptid_t
-remote_get_ada_task_ptid (long lwp, long thread)
+remote_get_ada_task_ptid (struct target_ops *self, long lwp, long thread)
{
return ptid_build (ptid_get_pid (inferior_ptid), 0, lwp);
}
/* Make sure we leave stdin registered in the event loop, and we
don't leave the async SIGINT signal handler installed. */
- remote_terminal_ours ();
+ remote_terminal_ours (self);
serial_close (rs->remote_desc);
rs->remote_desc = NULL;
gdb_assert (wait_status == NULL);
/* Report all signals during attach/startup. */
- remote_pass_signals (0, NULL);
+ remote_pass_signals (target, 0, NULL);
}
/* If we connected to a live target, do some additional setup. */
will eventually end up here. */
static void
-remote_stop (ptid_t ptid)
+remote_stop (struct target_ops *self, ptid_t ptid)
{
if (remote_debug)
fprintf_unfiltered (gdb_stdlog, "remote_stop called\n");
is required. */
static void
-remote_terminal_inferior (void)
+remote_terminal_inferior (struct target_ops *self)
{
if (!target_async_permitted)
/* Nothing to do. */
}
static void
-remote_terminal_ours (void)
+remote_terminal_ours (struct target_ops *self)
{
if (!target_async_permitted)
/* Nothing to do. */
}
static int
-extended_remote_supports_disable_randomization (void)
+extended_remote_supports_disable_randomization (struct target_ops *self)
{
return (remote_protocol_packets[PACKET_QDisableRandomization].support
== PACKET_ENABLE);
target_async (inferior_event_handler, 0);
/* Disable address space randomization if requested (and supported). */
- if (extended_remote_supports_disable_randomization ())
+ if (extended_remote_supports_disable_randomization (ops))
extended_remote_disable_randomization (disable_randomization);
/* Now restart the remote server. */
p += hexnumstr (p, addr);
xsnprintf (p, endbuf - p, ",%d", bpsize);
- if (remote_supports_cond_breakpoints ())
+ if (remote_supports_cond_breakpoints (ops))
remote_add_target_side_condition (gdbarch, bp_tgt, p, endbuf);
- if (remote_can_run_breakpoint_commands ())
+ if (remote_can_run_breakpoint_commands (ops))
remote_add_target_side_commands (gdbarch, bp_tgt, p);
putpkt (rs->buf);
}
static int
-remote_insert_watchpoint (CORE_ADDR addr, int len, int type,
+remote_insert_watchpoint (struct target_ops *self,
+ CORE_ADDR addr, int len, int type,
struct expression *cond)
{
struct remote_state *rs = get_remote_state ();
static int
-remote_remove_watchpoint (CORE_ADDR addr, int len, int type,
+remote_remove_watchpoint (struct target_ops *self,
+ CORE_ADDR addr, int len, int type,
struct expression *cond)
{
struct remote_state *rs = get_remote_state ();
int remote_hw_breakpoint_limit = -1;
static int
-remote_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len)
+remote_region_ok_for_hw_watchpoint (struct target_ops *self,
+ CORE_ADDR addr, int len)
{
if (remote_hw_watchpoint_length_limit == 0)
return 0;
static int
-remote_insert_hw_breakpoint (struct gdbarch *gdbarch,
+remote_insert_hw_breakpoint (struct target_ops *self, struct gdbarch *gdbarch,
struct bp_target_info *bp_tgt)
{
CORE_ADDR addr;
p += hexnumstr (p, (ULONGEST) addr);
xsnprintf (p, endbuf - p, ",%x", bp_tgt->placed_size);
- if (remote_supports_cond_breakpoints ())
+ if (remote_supports_cond_breakpoints (self))
remote_add_target_side_condition (gdbarch, bp_tgt, p, endbuf);
- if (remote_can_run_breakpoint_commands ())
+ if (remote_can_run_breakpoint_commands (self))
remote_add_target_side_commands (gdbarch, bp_tgt, p);
putpkt (rs->buf);
static int
-remote_remove_hw_breakpoint (struct gdbarch *gdbarch,
+remote_remove_hw_breakpoint (struct target_ops *self, struct gdbarch *gdbarch,
struct bp_target_info *bp_tgt)
{
CORE_ADDR addr;
}
static void
-remote_rcmd (char *command,
+remote_rcmd (struct target_ops *self, char *command,
struct ui_file *outbuf)
{
struct remote_state *rs = get_remote_state ();
*REMOTE_ERRNO). */
static int
-remote_hostio_open (const char *filename, int flags, int mode,
+remote_hostio_open (struct target_ops *self,
+ const char *filename, int flags, int mode,
int *remote_errno)
{
struct remote_state *rs = get_remote_state ();
set *REMOTE_ERRNO). */
static int
-remote_hostio_pwrite (int fd, const gdb_byte *write_buf, int len,
+remote_hostio_pwrite (struct target_ops *self,
+ int fd, const gdb_byte *write_buf, int len,
ULONGEST offset, int *remote_errno)
{
struct remote_state *rs = get_remote_state ();
gdb_assert (remote_filename_p (filename));
- fd = remote_hostio_open (filename + 7, FILEIO_O_RDONLY, 0, &remote_errno);
+ fd = remote_hostio_open (find_target_at (process_stratum),
+ filename + 7, FILEIO_O_RDONLY, 0, &remote_errno);
if (fd == -1)
{
errno = remote_fileio_errno_to_host (remote_errno);
perror_with_name (local_file);
back_to = make_cleanup_fclose (file);
- fd = remote_hostio_open (remote_file, (FILEIO_O_WRONLY | FILEIO_O_CREAT
+ fd = remote_hostio_open (find_target_at (process_stratum),
+ remote_file, (FILEIO_O_WRONLY | FILEIO_O_CREAT
| FILEIO_O_TRUNC),
0700, &remote_errno);
if (fd == -1)
bytes += bytes_in_buffer;
bytes_in_buffer = 0;
- retcode = remote_hostio_pwrite (fd, buffer, bytes,
+ retcode = remote_hostio_pwrite (find_target_at (process_stratum),
+ fd, buffer, bytes,
offset, &remote_errno);
if (retcode < 0)
if (!rs->remote_desc)
error (_("command can only be used with remote target"));
- fd = remote_hostio_open (remote_file, FILEIO_O_RDONLY, 0, &remote_errno);
+ fd = remote_hostio_open (find_target_at (process_stratum),
+ remote_file, FILEIO_O_RDONLY, 0, &remote_errno);
if (fd == -1)
remote_hostio_error (remote_errno);
}
static int
-remote_can_execute_reverse (void)
+remote_can_execute_reverse (struct target_ops *self)
{
if (remote_protocol_packets[PACKET_bs].support == PACKET_ENABLE
|| remote_protocol_packets[PACKET_bc].support == PACKET_ENABLE)
}
static int
-remote_supports_non_stop (void)
+remote_supports_non_stop (struct target_ops *self)
{
return 1;
}
static int
-remote_supports_disable_randomization (void)
+remote_supports_disable_randomization (struct target_ops *self)
{
/* Only supported in extended mode. */
return 0;
}
static int
-remote_supports_multi_process (void)
+remote_supports_multi_process (struct target_ops *self)
{
struct remote_state *rs = get_remote_state ();
}
static int
-remote_supports_cond_breakpoints (void)
+remote_supports_cond_breakpoints (struct target_ops *self)
{
struct remote_state *rs = get_remote_state ();
}
static int
-remote_supports_enable_disable_tracepoint (void)
+remote_supports_enable_disable_tracepoint (struct target_ops *self)
{
struct remote_state *rs = get_remote_state ();
}
static int
-remote_supports_string_tracing (void)
+remote_supports_string_tracing (struct target_ops *self)
{
struct remote_state *rs = get_remote_state ();
}
static int
-remote_can_run_breakpoint_commands (void)
+remote_can_run_breakpoint_commands (struct target_ops *self)
{
struct remote_state *rs = get_remote_state ();
/* Implementation of to_load. */
static void
-remote_load (char *name, int from_tty)
+remote_load (struct target_ops *self, char *name, int from_tty)
{
generic_load (name, from_tty);
}