[RFC] Target-defined breakpoints [5/9] notification flags

Hui Zhu hui_zhu@mentor.com
Wed Oct 24 15:04:00 GMT 2012


Target-defined breakpoint sync function need know when does the notification get because it sync packet that through notification just can be handled when GDB in the right status(I will introduce it clear in sync patch).
This patch add a flags in function handle_notification to help notification handler know about the GDB status.

Thanks,
Hui

2012-10-24  Hui Zhu  <hui_zhu@mentor.com>

	* remote.c (NOTIFICATION_SEND, NOTIFICATION_RECV,
	NOTIFICATION_RECV_FOREVER, NOTIFICATION_ASYNC): New macro.
	(handle_notification): Add argument flags.
	(putpkt_binary): Ditto.
	(getpkt_or_notif_sane_1): Ditto.
	(remote_async_serial_handler): Ditto.
-------------- next part --------------
--- a/remote.c
+++ b/remote.c
@@ -6809,8 +6809,13 @@ remote_read_bytes (CORE_ADDR memaddr, gd
 
 /* Remote notification handler.  */
 
+#define NOTIFICATION_SEND		0x1
+#define NOTIFICATION_RECV		0x2
+#define NOTIFICATION_RECV_FOREVER	0x4
+#define NOTIFICATION_ASYNC		0x8
+
 static void
-handle_notification (char *buf)
+handle_notification (char *buf, unsigned int flags)
 {
   if (strncmp (buf, "Stop:", 5) == 0)
     {
@@ -7247,7 +7252,7 @@ putpkt_binary (char *buf, int cnt)
 					    str);
 			do_cleanups (old_chain);
 		      }
-		    handle_notification (rs->buf);
+		    handle_notification (rs->buf, NOTIFICATION_SEND);
 		    /* We're in sync now, rewait for the ack.  */
 		    tcount = 0;
 		  }
@@ -7629,7 +7634,8 @@ getpkt_or_notif_sane_1 (char **buf, long
 	      do_cleanups (old_chain);
 	    }
 
-	  handle_notification (*buf);
+	  handle_notification (*buf, forever ? NOTIFICATION_RECV_FOREVER
+					     : NOTIFICATION_RECV);
 
 	  /* Notifications require no acknowledgement.  */
 
@@ -11301,7 +11307,7 @@ remote_async_serial_handler (struct seri
 				  str);
 	      do_cleanups (old_chain);
 	    }
-	  handle_notification (rs->buf);
+	  handle_notification (rs->buf, NOTIFICATION_ASYNC);
 	}
       else
 	{


More information about the Gdb-patches mailing list