This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA] event loop whitespace tweaks


Elena, OK?

2005-01-13  Michael Snyder  <msnyder@redhat.com>

	* event-loop.c: Whitespace tweaks.
	* event-top.c: Whitespace tweaks.

Index: event-loop.c
===================================================================
RCS file: /cvs/src/src/gdb/event-loop.c,v
retrieving revision 1.22
diff -p -r1.22 event-loop.c
*** event-loop.c	12 Jan 2005 18:31:30 -0000	1.22
--- event-loop.c	14 Jan 2005 00:02:55 -0000
***************
*** 17,23 ****
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
     Foundation, Inc., 59 Temple Place - Suite 330,
!    Boston, MA 02111-1307, USA. */
  
  #include "defs.h"
  #include "event-loop.h"
--- 17,23 ----
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
     Foundation, Inc., 59 Temple Place - Suite 330,
!    Boston, MA 02111-1307, USA.  */
  
  #include "defs.h"
  #include "event-loop.h"
*************** start_event_loop (void)
*** 407,413 ****
  	{
  	  /* FIXME: this should really be a call to a hook that is
  	     interface specific, because interfaces can display the
! 	     prompt in their own way. */
  	  display_gdb_prompt (0);
  	  /* This call looks bizarre, but it is required.  If the user
  	     entered a command that caused an error,
--- 407,413 ----
  	{
  	  /* FIXME: this should really be a call to a hook that is
  	     interface specific, because interfaces can display the
! 	     prompt in their own way.  */
  	  display_gdb_prompt (0);
  	  /* This call looks bizarre, but it is required.  If the user
  	     entered a command that caused an error,
*************** start_event_loop (void)
*** 418,436 ****
  	  if (after_char_processing_hook)
  	    (*after_char_processing_hook) ();
  	  /* Maybe better to set a flag to be checked somewhere as to
! 	     whether display the prompt or not. */
  	}
      }
  
!   /* We are done with the event loop. There are no more event sources
!      to listen to.  So we exit GDB. */
    return;
  }
  
  
  /* Wrapper function for create_file_handler, so that the caller
     doesn't have to know implementation details about the use of poll
!    vs. select. */
  void
  add_file_handler (int fd, handler_func * proc, gdb_client_data client_data)
  {
--- 418,436 ----
  	  if (after_char_processing_hook)
  	    (*after_char_processing_hook) ();
  	  /* Maybe better to set a flag to be checked somewhere as to
! 	     whether display the prompt or not.  */
  	}
      }
  
!   /* We are done with the event loop.  There are no more event sources
!      to listen to.  So we exit GDB.  */
    return;
  }
  
  
  /* Wrapper function for create_file_handler, so that the caller
     doesn't have to know implementation details about the use of poll
!    vs. select.  */
  void
  add_file_handler (int fd, handler_func * proc, gdb_client_data client_data)
  {
*************** add_file_handler (int fd, handler_func *
*** 445,451 ****
           use select. This can happen on systems like
           m68k-motorola-sys, `poll' cannot be used to wait for `stdin'.
           On m68k-motorola-sysv, tty's are not stream-based and not
!          `poll'able. */
        fds.fd = fd;
        fds.events = POLLIN;
        if (poll (&fds, 1, 0) == 1 && (fds.revents & POLLNVAL))
--- 445,451 ----
           use select. This can happen on systems like
           m68k-motorola-sys, `poll' cannot be used to wait for `stdin'.
           On m68k-motorola-sysv, tty's are not stream-based and not
!          `poll'able.  */
        fds.fd = fd;
        fds.events = POLLIN;
        if (poll (&fds, 1, 0) == 1 && (fds.revents & POLLNVAL))
*************** add_file_handler (int fd, handler_func *
*** 479,485 ****
     PROC is the procedure that will be called when an event occurs for
     FD.  CLIENT_DATA is the argument to pass to PROC. */
  static void
! create_file_handler (int fd, int mask, handler_func * proc, gdb_client_data client_data)
  {
    file_handler *file_ptr;
  
--- 479,486 ----
     PROC is the procedure that will be called when an event occurs for
     FD.  CLIENT_DATA is the argument to pass to PROC. */
  static void
! create_file_handler (int fd, int mask, handler_func * proc, 
! 		     gdb_client_data client_data)
  {
    file_handler *file_ptr;
  
*************** delete_file_handler (int fd)
*** 576,583 ****
    if (use_poll)
      {
  #ifdef HAVE_POLL
!       /* Create a new poll_fds array by copying every fd's information but the
!          one we want to get rid of. */
  
        new_poll_fds =
  	(struct pollfd *) xmalloc ((gdb_notifier.num_fds - 1) * sizeof (struct pollfd));
--- 577,584 ----
    if (use_poll)
      {
  #ifdef HAVE_POLL
!       /* Create a new poll_fds array by copying every fd's information
!          but the one we want to get rid of. */
  
        new_poll_fds =
  	(struct pollfd *) xmalloc ((gdb_notifier.num_fds - 1) * sizeof (struct pollfd));
*************** handle_file_event (int event_file_desc)
*** 686,698 ****
  	      if (error_mask_returned != 0)
  		{
  		  /* Work in progress. We may need to tell somebody what
! 		     kind of error we had. */
  		  if (error_mask_returned & POLLHUP)
! 		    printf_unfiltered ("Hangup detected on fd %d\n", file_ptr->fd);
  		  if (error_mask_returned & POLLERR)
! 		    printf_unfiltered ("Error detected on fd %d\n", file_ptr->fd);
  		  if (error_mask_returned & POLLNVAL)
! 		    printf_unfiltered ("Invalid or non-`poll'able fd %d\n", file_ptr->fd);
  		  file_ptr->error = 1;
  		}
  	      else
--- 687,702 ----
  	      if (error_mask_returned != 0)
  		{
  		  /* Work in progress. We may need to tell somebody what
! 		     kind of error we had.  */
  		  if (error_mask_returned & POLLHUP)
! 		    printf_unfiltered ("Hangup detected on fd %d\n", 
! 				       file_ptr->fd);
  		  if (error_mask_returned & POLLERR)
! 		    printf_unfiltered ("Error detected on fd %d\n", 
! 				       file_ptr->fd);
  		  if (error_mask_returned & POLLNVAL)
! 		    printf_unfiltered ("Invalid or non-`poll'able fd %d\n", 
! 				       file_ptr->fd);
  		  file_ptr->error = 1;
  		}
  	      else
*************** handle_file_event (int event_file_desc)
*** 706,712 ****
  	    {
  	      if (file_ptr->ready_mask & GDB_EXCEPTION)
  		{
! 		  printf_unfiltered ("Exception condition detected on fd %d\n", file_ptr->fd);
  		  file_ptr->error = 1;
  		}
  	      else
--- 710,717 ----
  	    {
  	      if (file_ptr->ready_mask & GDB_EXCEPTION)
  		{
! 		  printf_unfiltered ("Exception condition detected on fd %d\n",
! 				     file_ptr->fd);
  		  file_ptr->error = 1;
  		}
  	      else
*************** gdb_wait_for_event (void)
*** 868,874 ****
     PROC is the function to call with CLIENT_DATA argument 
     whenever the handler is invoked. */
  async_signal_handler *
! create_async_signal_handler (sig_handler_func * proc, gdb_client_data client_data)
  {
    async_signal_handler *async_handler_ptr;
  
--- 873,880 ----
     PROC is the function to call with CLIENT_DATA argument 
     whenever the handler is invoked. */
  async_signal_handler *
! create_async_signal_handler (sig_handler_func * proc, 
! 			     gdb_client_data client_data)
  {
    async_signal_handler *async_handler_ptr;
  
*************** check_async_ready (void)
*** 965,971 ****
     aded to the timers queue.  This queue is kept sorted in order of
     increasing timers. Return a handle to the timer struct. */
  int
! create_timer (int milliseconds, timer_handler_func * proc, gdb_client_data client_data)
  {
    struct gdb_timer *timer_ptr, *timer_index, *prev_timer;
    struct timeval time_now, delta;
--- 971,978 ----
     aded to the timers queue.  This queue is kept sorted in order of
     increasing timers. Return a handle to the timer struct. */
  int
! create_timer (int milliseconds, timer_handler_func * proc, 
! 	      gdb_client_data client_data)
  {
    struct gdb_timer *timer_ptr, *timer_index, *prev_timer;
    struct timeval time_now, delta;
Index: event-top.c
===================================================================
RCS file: /cvs/src/src/gdb/event-top.c,v
retrieving revision 1.36
diff -p -r1.36 event-top.c
*** event-top.c	12 Jan 2005 18:31:31 -0000	1.36
--- event-top.c	14 Jan 2005 00:02:55 -0000
*************** void (*after_char_processing_hook) ();
*** 160,166 ****
  
  /* Wrapper function for calling into the readline library. The event
     loop expects the callback function to have a paramter, while readline 
!    expects none. */
  static void
  rl_callback_read_char_wrapper (gdb_client_data client_data)
  {
--- 160,166 ----
  
  /* Wrapper function for calling into the readline library. The event
     loop expects the callback function to have a paramter, while readline 
!    expects none.  */
  static void
  rl_callback_read_char_wrapper (gdb_client_data client_data)
  {
*************** rl_callback_read_char_wrapper (gdb_clien
*** 170,176 ****
  }
  
  /* Initialize all the necessary variables, start the event loop,
!    register readline, and stdin, start the loop. */
  void
  cli_command_loop (void)
  {
--- 170,176 ----
  }
  
  /* Initialize all the necessary variables, start the event loop,
!    register readline, and stdin, start the loop.  */
  void
  cli_command_loop (void)
  {
*************** handle_sigwinch (int sig)
*** 1078,1091 ****
  
  /* Called by do_setshow_command.  */
  void
! set_async_editing_command (char *args, int from_tty, struct cmd_list_element *c)
  {
    change_line_handler ();
  }
  
  /* Called by do_setshow_command.  */
  void
! set_async_annotation_level (char *args, int from_tty, struct cmd_list_element *c)
  {
    change_annotation_level ();
  }
--- 1078,1093 ----
  
  /* Called by do_setshow_command.  */
  void
! set_async_editing_command (char *args, int from_tty, 
! 			   struct cmd_list_element *c)
  {
    change_line_handler ();
  }
  
  /* Called by do_setshow_command.  */
  void
! set_async_annotation_level (char *args, int from_tty, 
! 			    struct cmd_list_element *c)
  {
    change_annotation_level ();
  }
*************** set_async_prompt (char *args, int from_t
*** 1099,1105 ****
  
  /* Set things up for readline to be invoked via the alternate
     interface, i.e. via a callback function (rl_callback_read_char),
!    and hook up instream to the event loop. */
  void
  gdb_setup_readline (void)
  {
--- 1101,1107 ----
  
  /* Set things up for readline to be invoked via the alternate
     interface, i.e. via a callback function (rl_callback_read_char),
!    and hook up instream to the event loop.  */
  void
  gdb_setup_readline (void)
  {

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]