/* Supported clients of notifications. */
-static struct notif_client *notifs[] =
+static const notif_client *const notifs[] =
{
¬if_client_stop,
};
void
remote_notif_ack (remote_target *remote,
- struct notif_client *nc, const char *buf)
+ const notif_client *nc, const char *buf)
{
notif_event_up event = nc->alloc_event ();
struct notif_event *
remote_notif_parse (remote_target *remote,
- struct notif_client *nc, const char *buf)
+ const notif_client *nc, const char *buf)
{
notif_event_up event = nc->alloc_event ();
void
remote_notif_process (struct remote_notif_state *state,
- struct notif_client *except)
+ const notif_client *except)
{
while (!state->notif_queue.empty ())
{
- struct notif_client *nc = state->notif_queue.front ();
+ const notif_client *nc = state->notif_queue.front ();
state->notif_queue.pop_front ();
gdb_assert (nc != except);
void
handle_notification (struct remote_notif_state *state, const char *buf)
{
- struct notif_client *nc;
+ const notif_client *nc;
size_t i;
for (i = 0; i < ARRAY_SIZE (notifs); i++)
function may throw exception if contents in BUF is not the
expected event. */
void (*parse) (remote_target *remote,
- struct notif_client *self, const char *buf,
+ const notif_client *self, const char *buf,
struct notif_event *event);
/* Send field <ack_command> to remote, and do some checking. If
something wrong, throw an exception. */
void (*ack) (remote_target *remote,
- struct notif_client *self, const char *buf,
+ const notif_client *self, const char *buf,
struct notif_event *event);
/* Check this notification client can get pending events in
'remote_notif_process'. */
int (*can_get_pending_events) (remote_target *remote,
- struct notif_client *self);
+ const notif_client *self);
/* Allocate an event. */
notif_event_up (*alloc_event) ();
/* Notification queue. */
- std::list<notif_client *> notif_queue;
+ std::list<const notif_client *> notif_queue;
/* Asynchronous signal handle registered as event loop source for when
the remote sent us a notification. The registered callback
struct notif_event *pending_event[REMOTE_NOTIF_LAST] {};
};
-void remote_notif_ack (remote_target *remote, notif_client *nc,
+void remote_notif_ack (remote_target *remote, const notif_client *nc,
const char *buf);
struct notif_event *remote_notif_parse (remote_target *remote,
- notif_client *nc,
+ const notif_client *nc,
const char *buf);
void handle_notification (struct remote_notif_state *notif_state,
const char *buf);
void remote_notif_process (struct remote_notif_state *state,
- struct notif_client *except);
+ const notif_client *except);
remote_notif_state *remote_notif_state_allocate (remote_target *remote);
-extern struct notif_client notif_client_stop;
+extern const notif_client notif_client_stop;
extern bool notif_debug;
void send_interrupt_sequence ();
void interrupt_query ();
- void remote_notif_get_pending_events (notif_client *nc);
+ void remote_notif_get_pending_events (const notif_client *nc);
int fetch_register_using_p (struct regcache *regcache,
packet_reg *reg);
mechanism. */
if (strcmp (rs->buf.data (), "OK") != 0)
{
- struct notif_client *notif = ¬if_client_stop;
+ const notif_client *notif = ¬if_client_stop;
/* remote_notif_get_pending_replies acks this one, and gets
the rest out. */
static void
remote_notif_stop_parse (remote_target *remote,
- struct notif_client *self, const char *buf,
+ const notif_client *self, const char *buf,
struct notif_event *event)
{
remote->remote_parse_stop_reply (buf, (struct stop_reply *) event);
static void
remote_notif_stop_ack (remote_target *remote,
- struct notif_client *self, const char *buf,
+ const notif_client *self, const char *buf,
struct notif_event *event)
{
struct stop_reply *stop_reply = (struct stop_reply *) event;
static int
remote_notif_stop_can_get_pending_events (remote_target *remote,
- struct notif_client *self)
+ const notif_client *self)
{
/* We can't get pending events in remote_notif_process for
notification stop, and we have to do this in remote_wait_ns
/* A client of notification Stop. */
-struct notif_client notif_client_stop =
+const notif_client notif_client_stop =
{
"Stop",
"vStopped",
void
remote_target::remove_new_fork_children (threads_listing_context *context)
{
- struct notif_client *notif = ¬if_client_stop;
+ const notif_client *notif = ¬if_client_stop;
/* For any threads stopped at a fork event, remove the corresponding
fork child threads from the CONTEXT list. */
remote_target::check_pending_events_prevent_wildcard_vcont
(bool *may_global_wildcard)
{
- struct notif_client *notif = ¬if_client_stop;
+ const notif_client *notif = ¬if_client_stop;
remote_notif_get_pending_events (notif);
for (auto &event : get_remote_state ()->stop_reply_queue)
*/
void
-remote_target::remote_notif_get_pending_events (notif_client *nc)
+remote_target::remote_notif_get_pending_events (const notif_client *nc)
{
struct remote_state *rs = get_remote_state ();
avoid having to export the whole remote_target class. */
void
-remote_notif_get_pending_events (remote_target *remote, notif_client *nc)
+remote_notif_get_pending_events (remote_target *remote, const notif_client *nc)
{
remote->remote_notif_get_pending_events (nc);
}
remote_target::kill_new_fork_children (inferior *inf)
{
remote_state *rs = get_remote_state ();
- struct notif_client *notif = ¬if_client_stop;
+ const notif_client *notif = ¬if_client_stop;
/* Kill the fork child threads of any threads in inferior INF that are stopped
at a fork event. */
int *poffset);
extern void remote_notif_get_pending_events (remote_target *remote,
- struct notif_client *np);
+ const notif_client *np);
extern bool remote_target_is_non_stop_p (remote_target *t);
/* An abstract class that represents the set of callbacks that are made