show_memory_packet_size (&memory_write_packet_config);
}
+/* Show the number of hardware watchpoints that can be used. */
+
+static void
+show_hardware_watchpoint_limit (struct ui_file *file, int from_tty,
+ struct cmd_list_element *c,
+ const char *value)
+{
+ fprintf_filtered (file, _("The maximum number of target hardware "
+ "watchpoints is %s.\n"), value);
+}
+
+/* Show the length limit (in bytes) for hardware watchpoints. */
+
+static void
+show_hardware_watchpoint_length_limit (struct ui_file *file, int from_tty,
+ struct cmd_list_element *c,
+ const char *value)
+{
+ fprintf_filtered (file, _("The maximum length (in bytes) of a target "
+ "hardware watchpoint is %s.\n"), value);
+}
+
+/* Show the number of hardware breakpoints that can be used. */
+
+static void
+show_hardware_breakpoint_limit (struct ui_file *file, int from_tty,
+ struct cmd_list_element *c,
+ const char *value)
+{
+ fprintf_filtered (file, _("The maximum number of target hardware "
+ "breakpoints is %s.\n"), value);
+}
+
long
remote_target::get_memory_write_packet_size ()
{
struct inferior *inf = NULL;
int pid = currthread.pid ();
- if (ptid_is_pid (inferior_ptid)
+ if (inferior_ptid.is_pid ()
&& pid == inferior_ptid.pid ())
{
/* inferior_ptid has no thread member yet. This can happen
return;
}
- if (ptid_equal (magic_null_ptid, inferior_ptid))
+ if (magic_null_ptid == inferior_ptid)
{
/* inferior_ptid is not set yet. This can happen with the
vRun -> remote_wait,"TAAthread:" path if the stub
char *buf = rs->buf;
char *endbuf = rs->buf + get_remote_packet_size ();
- if (ptid_equal (state, ptid))
+ if (state == ptid)
return;
*buf++ = 'H';
*buf++ = gen ? 'g' : 'c';
- if (ptid_equal (ptid, magic_null_ptid))
+ if (ptid == magic_null_ptid)
xsnprintf (buf, endbuf - buf, "0");
- else if (ptid_equal (ptid, any_thread_ptid))
+ else if (ptid == any_thread_ptid)
xsnprintf (buf, endbuf - buf, "0");
- else if (ptid_equal (ptid, minus_one_ptid))
+ else if (ptid == minus_one_ptid)
xsnprintf (buf, endbuf - buf, "-1");
else
write_ptid (buf, endbuf, ptid);
static int
remote_thread_always_alive (ptid_t ptid)
{
- if (ptid_equal (ptid, magic_null_ptid))
+ if (ptid == magic_null_ptid)
/* The main thread is always alive. */
return 1;
what's in inferior_ptid, unless it's null at this point. If so,
then since there's no way to know the pid of the reported
threads, use the magic number. */
- if (ptid_equal (inferior_ptid, null_ptid))
+ if (inferior_ptid == null_ptid)
pid = magic_null_ptid.pid ();
else
pid = inferior_ptid.pid ();
internal_error (__FILE__, __LINE__,
_("remote_threads_extra_info"));
- if (ptid_equal (tp->ptid, magic_null_ptid)
+ if (tp->ptid == magic_null_ptid
|| (tp->ptid.pid () != 0 && tp->ptid.lwp () == 0))
/* This is the main thread which was added by GDB. The remote
server doesn't know about it. */
this point. */
if (wait_status != NULL)
ptid = stop_reply_extract_thread (wait_status);
- if (ptid_equal (ptid, null_ptid))
+ if (ptid == null_ptid)
ptid = remote_current_thread (inferior_ptid);
return ptid;
multi-threaded program, this will ideally be the thread
that last reported an event before GDB disconnected. */
inferior_ptid = get_current_thread (wait_status);
- if (ptid_equal (inferior_ptid, null_ptid))
+ if (inferior_ptid == null_ptid)
{
/* Odd... The target was able to list threads, but not
tell us which thread was current (no "thread"
{
struct remote_state *rs = get_remote_state ();
+ /* This should not be necessary, but the handling for D;PID in
+ GDBserver versions prior to 8.2 incorrectly assumes that the
+ selected process points to the same process we're detaching,
+ leading to misbehavior (and possibly GDBserver crashing) when it
+ does not. Since it's easy and cheap, work around it by forcing
+ GDBserver to select GDB's current process. */
+ set_general_process ();
+
if (remote_multi_process_p (rs))
xsnprintf (rs->buf, get_remote_packet_size (), "D;%x", pid);
else
threads with a wildcard (though the protocol allows it,
so stubs shouldn't make an active effort to forbid
it). */
- && !(remote_multi_process_p (rs) && ptid_is_pid (ptid)))
+ && !(remote_multi_process_p (rs) && ptid.is_pid ()))
{
struct thread_info *tp;
- if (ptid_equal (ptid, minus_one_ptid))
+ if (ptid == minus_one_ptid)
{
/* If we don't know about the target thread's tid, then
we're resuming magic_null_ptid (see caller). */
else
p += xsnprintf (p, endp - p, ";c");
- if (remote_multi_process_p (rs) && ptid_is_pid (ptid))
+ if (remote_multi_process_p (rs) && ptid.is_pid ())
{
ptid_t nptid;
p += xsnprintf (p, endp - p, ":");
p = write_ptid (p, endp, nptid);
}
- else if (!ptid_equal (ptid, minus_one_ptid))
+ else if (ptid != minus_one_ptid)
{
p += xsnprintf (p, endp - p, ":");
p = write_ptid (p, endp, ptid);
struct thread_info *thread;
ALL_NON_EXITED_THREADS (thread)
- if (ptid_match (thread->ptid, ptid)
- && !ptid_equal (inferior_ptid, thread->ptid)
+ if (thread->ptid.matches (ptid)
+ && inferior_ptid != thread->ptid
&& thread->suspend.stop_signal != GDB_SIGNAL_0)
{
p = append_resumption (p, endp, thread->ptid,
/* The c/s/C/S resume packets use Hc, so set the continue
thread. */
- if (ptid_equal (ptid, minus_one_ptid))
+ if (ptid == minus_one_ptid)
set_continue_thread (any_thread_ptid);
else
set_continue_thread (ptid);
p += xsnprintf (p, endp - p, "vCont");
- if (ptid_equal (ptid, magic_null_ptid))
+ if (ptid == magic_null_ptid)
{
/* MAGIC_NULL_PTID means that we don't have any active threads,
so we don't have any TID numbers the inferior will
a TID. */
append_resumption (p, endp, minus_one_ptid, step, siggnal);
}
- else if (ptid_equal (ptid, minus_one_ptid) || ptid_is_pid (ptid))
+ else if (ptid == minus_one_ptid || ptid.is_pid ())
{
/* Resume all threads (of all processes, or of a single
process), with preference for INFERIOR_PTID. This assumes
{
remote_thread_info *remote_thr;
- if (ptid_equal (minus_one_ptid, ptid) || ptid_is_pid (ptid))
+ if (minus_one_ptid == ptid || ptid.is_pid ())
remote_thr = get_remote_thread_info (inferior_ptid);
else
remote_thr = get_remote_thread_info (ptid);
if (!rs->supports_vCont.t)
error (_("Remote server does not support stopping threads"));
- if (ptid_equal (ptid, minus_one_ptid)
- || (!remote_multi_process_p (rs) && ptid_is_pid (ptid)))
+ if (ptid == minus_one_ptid
+ || (!remote_multi_process_p (rs) && ptid.is_pid ()))
p += xsnprintf (p, endp - p, "vCont;t");
else
{
p += xsnprintf (p, endp - p, "vCont;t:");
- if (ptid_is_pid (ptid))
+ if (ptid.is_pid ())
/* All (-1) threads of process. */
nptid = ptid_t (ptid.pid (), -1, 0);
else
break;
}
- if (target_is_non_stop_p () && ptid_equal (event->ptid, null_ptid))
+ if (target_is_non_stop_p () && event->ptid == null_ptid)
error (_("No process or thread specified in stop reply: %s"), buf);
}
/* If no thread/process was reported by the stub, assume the current
inferior. */
- if (ptid_equal (ptid, null_ptid))
+ if (ptid == null_ptid)
ptid = inferior_ptid;
if (status->kind != TARGET_WAITKIND_EXITED
else if (status->kind != TARGET_WAITKIND_EXITED
&& status->kind != TARGET_WAITKIND_SIGNALLED)
{
- if (!ptid_equal (event_ptid, null_ptid))
+ if (event_ptid != null_ptid)
record_currthread (rs, event_ptid);
else
event_ptid = inferior_ptid;
static char buf[64];
struct remote_state *rs = get_remote_state ();
- if (ptid_equal (ptid, null_ptid))
+ if (ptid == null_ptid)
return normal_pid_to_str (ptid);
- else if (ptid_is_pid (ptid))
+ else if (ptid.is_pid ())
{
/* Printing an inferior target id. */
}
else
{
- if (ptid_equal (magic_null_ptid, ptid))
+ if (magic_null_ptid == ptid)
xsnprintf (buf, sizeof buf, "Thread <main>");
else if (remote_multi_process_p (rs))
if (ptid.lwp () == 0)
/* Do not try this during initial connection, when we do not know
whether there is a running but stopped thread. */
- if (!target_has_execution || ptid_equal (inferior_ptid, null_ptid))
+ if (!target_has_execution || inferior_ptid == null_ptid)
return beneath ()->read_description ();
if (!VEC_empty (remote_g_packet_guess_s, data->guesses))
_("Show the maximum number of bytes per memory-read packet."),
&remote_show_cmdlist);
- add_setshow_zinteger_cmd ("hardware-watchpoint-limit", no_class,
+ add_setshow_zuinteger_unlimited_cmd ("hardware-watchpoint-limit", no_class,
&remote_hw_watchpoint_limit, _("\
Set the maximum number of target hardware watchpoints."), _("\
Show the maximum number of target hardware watchpoints."), _("\
-Specify a negative limit for unlimited."),
- NULL, NULL, /* FIXME: i18n: The maximum
- number of target hardware
- watchpoints is %s. */
- &remote_set_cmdlist, &remote_show_cmdlist);
- add_setshow_zinteger_cmd ("hardware-watchpoint-length-limit", no_class,
+Specify \"unlimited\" for unlimited hardware watchpoints."),
+ NULL, show_hardware_watchpoint_limit,
+ &remote_set_cmdlist,
+ &remote_show_cmdlist);
+ add_setshow_zuinteger_unlimited_cmd ("hardware-watchpoint-length-limit",
+ no_class,
&remote_hw_watchpoint_length_limit, _("\
Set the maximum length (in bytes) of a target hardware watchpoint."), _("\
Show the maximum length (in bytes) of a target hardware watchpoint."), _("\
-Specify a negative limit for unlimited."),
- NULL, NULL, /* FIXME: i18n: The maximum
- length (in bytes) of a target
- hardware watchpoint is %s. */
+Specify \"unlimited\" to allow watchpoints of unlimited size."),
+ NULL, show_hardware_watchpoint_length_limit,
&remote_set_cmdlist, &remote_show_cmdlist);
- add_setshow_zinteger_cmd ("hardware-breakpoint-limit", no_class,
+ add_setshow_zuinteger_unlimited_cmd ("hardware-breakpoint-limit", no_class,
&remote_hw_breakpoint_limit, _("\
Set the maximum number of target hardware breakpoints."), _("\
Show the maximum number of target hardware breakpoints."), _("\
-Specify a negative limit for unlimited."),
- NULL, NULL, /* FIXME: i18n: The maximum
- number of target hardware
- breakpoints is %s. */
+Specify \"unlimited\" for unlimited hardware breakpoints."),
+ NULL, show_hardware_breakpoint_limit,
&remote_set_cmdlist, &remote_show_cmdlist);
add_setshow_zuinteger_cmd ("remoteaddresssize", class_obscure,