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]

[patch] gnu-nat.c assert() -> gdb_assert()


FYI,

I've checked in the attatched (obvious fix rule).  I've also vague
memory of, long ago, getting approval for the change.

	Andrew
2001-03-12  Andrew Cagney  <ac131313@redhat.com>

	* gnu-nat.c: Include "gdb_assert.h" instead of <assert.h>.
	(proc_update_sc): Use gdb_assert instead of assert.
	(proc_abort): Ditto.
	(inf_set_step_thread): Ditto.
	(gnu_wait): Ditto.
	(S_exception_raise_request): Ditto.
	(gnu_terminal_init_inferior): Ditto.

Index: gnu-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/gnu-nat.c,v
retrieving revision 1.10
diff -p -r1.10 gnu-nat.c
*** gnu-nat.c	2001/03/06 08:21:07	1.10
--- gnu-nat.c	2001/03/13 00:48:29
***************
*** 24,30 ****
     Boston, MA 02111-1307, USA.
   */
  
- #include <assert.h>
  #include <errno.h>
  #include <limits.h>
  #include <setjmp.h>
--- 24,29 ----
***************
*** 61,66 ****
--- 60,66 ----
  #include "gdbcmd.h"
  #include "gdbcore.h"
  #include "gdbthread.h"
+ #include "gdb_assert.h"
  
  #include "gnu-nat.h"
  
*************** proc_update_sc (struct proc *proc)
*** 262,268 ****
    if (proc->sc == 0 && proc->state_changed)
      /* Since PROC may start running, we must write back any state changes. */
      {
!       assert (proc_is_thread (proc));
        proc_debug (proc, "storing back changed thread state");
        err = thread_set_state (proc->port, THREAD_STATE_FLAVOR,
  			 (thread_state_t) &proc->state, THREAD_STATE_SIZE);
--- 262,268 ----
    if (proc->sc == 0 && proc->state_changed)
      /* Since PROC may start running, we must write back any state changes. */
      {
!       gdb_assert (proc_is_thread (proc));
        proc_debug (proc, "storing back changed thread state");
        err = thread_set_state (proc->port, THREAD_STATE_FLAVOR,
  			 (thread_state_t) &proc->state, THREAD_STATE_SIZE);
*************** proc_update_sc (struct proc *proc)
*** 318,324 ****
  void
  proc_abort (struct proc *proc, int force)
  {
!   assert (proc_is_thread (proc));
  
    if (!proc->aborted)
      {
--- 318,324 ----
  void
  proc_abort (struct proc *proc, int force)
  {
!   gdb_assert (proc_is_thread (proc));
  
    if (!proc->aborted)
      {
*************** inf_suspend (struct inf *inf)
*** 1157,1163 ****
  void
  inf_set_step_thread (struct inf *inf, struct proc *thread)
  {
!   assert (!thread || proc_is_thread (thread));
  
    if (thread)
      inf_debug (inf, "setting step thread: %d/%d", inf->pid, thread->tid);
--- 1157,1163 ----
  void
  inf_set_step_thread (struct inf *inf, struct proc *thread)
  {
!   gdb_assert (!thread || proc_is_thread (thread));
  
    if (thread)
      inf_debug (inf, "setting step thread: %d/%d", inf->pid, thread->tid);
*************** gnu_wait (int tid, struct target_waitsta
*** 1429,1435 ****
    extern int notify_server (mach_msg_header_t *, mach_msg_header_t *);
    extern int process_reply_server (mach_msg_header_t *, mach_msg_header_t *);
  
!   assert (inf->task);
  
    if (!inf->threads && !inf->pending_execs)
      /* No threads!  Assume that maybe some outside agency is frobbing our
--- 1429,1435 ----
    extern int notify_server (mach_msg_header_t *, mach_msg_header_t *);
    extern int process_reply_server (mach_msg_header_t *, mach_msg_header_t *);
  
!   gdb_assert (inf->task);
  
    if (!inf->threads && !inf->pending_execs)
      /* No threads!  Assume that maybe some outside agency is frobbing our
*************** S_exception_raise_request (mach_port_t p
*** 1669,1675 ****
  	      inf_debug (waiting_inf, "Handler is task exception port <%d>",
  			 inf->task->saved_exc_port);
  	      inf->wait.exc.handler = inf->task->saved_exc_port;
! 	      assert (inf->task->exc_port == port);
  	    }
  	  if (inf->wait.exc.handler != MACH_PORT_NULL)
  	    /* Add a reference to the exception handler. */
--- 1669,1675 ----
  	      inf_debug (waiting_inf, "Handler is task exception port <%d>",
  			 inf->task->saved_exc_port);
  	      inf->wait.exc.handler = inf->task->saved_exc_port;
! 	      gdb_assert (inf->task->exc_port == port);
  	    }
  	  if (inf->wait.exc.handler != MACH_PORT_NULL)
  	    /* Add a reference to the exception handler. */
*************** gnu_detach (char *args, int from_tty)
*** 2195,2201 ****
  static void
  gnu_terminal_init_inferior (void)
  {
!   assert (current_inferior);
    terminal_init_inferior_with_pgrp (current_inferior->pid);
  }
  
--- 2195,2201 ----
  static void
  gnu_terminal_init_inferior (void)
  {
!   gdb_assert (current_inferior);
    terminal_init_inferior_with_pgrp (current_inferior->pid);
  }
  

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