Discard space for relocs against symbols with copy relocs
[deliverable/binutils-gdb.git] / gdb / remote-notif.c
index 0d5927912b1b190a913c79a34fd60ac9434013a3..5089100099636cf05ff2d520b1f8158f26b61686 100644 (file)
@@ -1,6 +1,6 @@
 /* Remote notification in GDB protocol
 
-   Copyright (C) 1988-2013 Free Software Foundation, Inc.
+   Copyright (C) 1988-2014 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
 #include "event-loop.h"
 #include "target.h"
 #include "inferior.h"
+#include "infrun.h"
 #include "gdbcmd.h"
 
-#include <string.h>
-
 int notif_debug = 0;
 
 /* Supported clients of notifications.  */
@@ -127,22 +126,25 @@ remote_async_get_pending_events_handler (gdb_client_data data)
 void
 handle_notification (struct remote_notif_state *state, char *buf)
 {
-  struct notif_client *nc = NULL;
-  int i;
+  struct notif_client *nc;
+  size_t i;
 
   for (i = 0; i < ARRAY_SIZE (notifs); i++)
     {
-      nc = notifs[i];
-      if (strncmp (buf, nc->name, strlen (nc->name)) == 0
-         && buf[strlen (nc->name)] == ':')
+      const char *name = notifs[i]->name;
+
+      if (strncmp (buf, name, strlen (name)) == 0
+         && buf[strlen (name)] == ':')
        break;
     }
 
   /* We ignore notifications we don't recognize, for compatibility
      with newer stubs.  */
-  if (nc == NULL)
+  if (i == ARRAY_SIZE (notifs))
     return;
 
+  nc =  notifs[i];
+
   if (state->pending_event[nc->id] != NULL)
     {
       /* We've already parsed the in-flight reply, but the stub for some
This page took 0.024707 seconds and 4 git commands to generate.