Change backtrace_command_1 calling to use flags
[deliverable/binutils-gdb.git] / gdb / remote-notif.c
index 5089100099636cf05ff2d520b1f8158f26b61686..85612b1e39f7b7bc83b4f32580f56775e7afffe5 100644 (file)
@@ -1,6 +1,6 @@
 /* Remote notification in GDB protocol
 
-   Copyright (C) 1988-2014 Free Software Foundation, Inc.
+   Copyright (C) 1988-2018 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -34,7 +34,7 @@
 #include "defs.h"
 #include "remote.h"
 #include "remote-notif.h"
-#include "observer.h"
+#include "observable.h"
 #include "event-loop.h"
 #include "target.h"
 #include "inferior.h"
@@ -116,8 +116,8 @@ remote_notif_process (struct remote_notif_state *state,
 static void
 remote_async_get_pending_events_handler (gdb_client_data data)
 {
-  gdb_assert (non_stop);
-  remote_notif_process (data, NULL);
+  gdb_assert (target_is_non_stop_p ());
+  remote_notif_process ((struct remote_notif_state *) data, NULL);
 }
 
 /* Remote notification handler.  Parse BUF, queue notification and
@@ -133,7 +133,7 @@ handle_notification (struct remote_notif_state *state, char *buf)
     {
       const char *name = notifs[i]->name;
 
-      if (strncmp (buf, name, strlen (name)) == 0
+      if (startswith (buf, name)
          && buf[strlen (name)] == ':')
        break;
     }
@@ -166,7 +166,7 @@ handle_notification (struct remote_notif_state *state, char *buf)
       /* Notify the event loop there's a stop reply to acknowledge
         and that there may be more events to fetch.  */
       QUEUE_enque (notif_client_p, state->notif_queue, nc);
-      if (non_stop)
+      if (target_is_non_stop_p ())
        {
          /* In non-stop, We mark REMOTE_ASYNC_GET_PENDING_EVENTS_TOKEN
             in order to go on what we were doing and postpone
@@ -230,7 +230,7 @@ notif_event_xfree (struct notif_event *event)
 static void
 do_notif_event_xfree (void *arg)
 {
-  notif_event_xfree (arg);
+  notif_event_xfree ((struct notif_event *) arg);
 }
 
 /* Return an allocated remote_notif_state.  */
@@ -238,7 +238,7 @@ do_notif_event_xfree (void *arg)
 struct remote_notif_state *
 remote_notif_state_allocate (void)
 {
-  struct remote_notif_state *notif_state = xzalloc (sizeof (*notif_state));
+  struct remote_notif_state *notif_state = XCNEW (struct remote_notif_state);
 
   notif_state->notif_queue = QUEUE_alloc (notif_client_p, NULL);
 
@@ -270,9 +270,6 @@ remote_notif_state_xfree (struct remote_notif_state *state)
   xfree (state);
 }
 
-/* -Wmissing-prototypes */
-extern initialize_file_ftype _initialize_notif;
-
 void
 _initialize_notif (void)
 {
This page took 0.025637 seconds and 4 git commands to generate.