gdb/gdbserver/notif.h - gdb

Global variables defined

Data types defined

Source code

  1. /* Notification to GDB.
  2.    Copyright (C) 1989-2015 Free Software Foundation, Inc.

  3.    This file is part of GDB.

  4.    This program is free software; you can redistribute it and/or modify
  5.    it under the terms of the GNU General Public License as published by
  6.    the Free Software Foundation; either version 3 of the License, or
  7.    (at your option) any later version.

  8.    This program is distributed in the hope that it will be useful,
  9.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  10.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  11.    GNU General Public License for more details.

  12.    You should have received a copy of the GNU General Public License
  13.    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */

  14. #include "target.h"
  15. #include "queue.h"

  16. /* Structure holding information related to a single event.  We
  17.    keep a queue of these to push to GDB.  It can be extended if
  18.    the event of given notification contains more information.  */

  19. typedef struct notif_event
  20. {
  21.   /* C requires that a struct or union has at least one member.  */
  22.   char dummy;
  23. } *notif_event_p;

  24. DECLARE_QUEUE_P (notif_event_p);

  25. /* A type notification to GDB.  An object of 'struct notif_server'
  26.    represents a type of notification.  */

  27. typedef struct notif_server
  28. {
  29.   /* The name of ack packet, for example, 'vStopped'.  */
  30.   const char *ack_name;

  31.   /* The notification packet, for example, '%Stop'.  Note that '%' is
  32.      not in 'notif_name'.  */
  33.   const char *notif_name;

  34.   /* A queue of events to GDB.  A new notif_event can be enque'ed
  35.      into QUEUE at any appropriate time, and the notif_reply is
  36.      deque'ed only when the ack from GDB arrives.  */
  37.   QUEUE (notif_event_p) *queue;

  38.   /* Write event EVENT to OWN_BUF.  */
  39.   void (*write) (struct notif_event *event, char *own_buf);
  40. } *notif_server_p;

  41. extern struct notif_server notif_stop;

  42. int handle_notif_ack (char *own_buf, int packet_len);
  43. void notif_write_event (struct notif_server *notif, char *own_buf);

  44. void notif_push (struct notif_server *np, struct notif_event *event);
  45. void notif_event_enque (struct notif_server *notif,
  46.                         struct notif_event *event);

  47. void initialize_notif (void);