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]

[PATCH] breakpoint.c, coding standard fix-ups


2002-01-31  Michael Snyder  <msnyder@redhat.com>

	* breakpoint.c (insert_breakpoints, remove_breakpoint, 
	breakpoint_here_p, breakpoint_inserted_here_p, 
	breakpoint_thread_match, bpstat_stop_status, 
	describe_other_breakpoints, check_duplicates, clear_command):
	Coding standard fixes.

Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.58
diff -p -r1.58 breakpoint.c
*** breakpoint.c	2002/01/17 22:15:16	1.58
--- breakpoint.c	2002/02/01 01:03:00
*************** insert_breakpoints (void)
*** 749,756 ****
  	       if so, we should set the breakpoint at the LMA address.
  	       Only if the section is currently mapped should we ALSO
  	       set a break at the VMA address. */
! 	    if (overlay_debugging && b->section &&
! 		section_is_overlay (b->section))
  	      {
  		CORE_ADDR addr;
  
--- 749,756 ----
  	       if so, we should set the breakpoint at the LMA address.
  	       Only if the section is currently mapped should we ALSO
  	       set a break at the VMA address. */
! 	    if (overlay_debugging && b->section 
! 		&& section_is_overlay (b->section))
  	      {
  		CORE_ADDR addr;
  
*************** remove_breakpoint (struct breakpoint *b,
*** 1277,1284 ****
  	     if so, we should remove the breakpoint at the LMA address.
  	     If that is not equal to the raw address, then we should 
  	     presumably remove the breakpoint there as well.  */
! 	  if (overlay_debugging && b->section &&
! 	      section_is_overlay (b->section))
  	    {
  	      CORE_ADDR addr;
  
--- 1277,1284 ----
  	     if so, we should remove the breakpoint at the LMA address.
  	     If that is not equal to the raw address, then we should 
  	     presumably remove the breakpoint there as well.  */
! 	  if (overlay_debugging && b->section 
! 	      && section_is_overlay (b->section))
  	    {
  	      CORE_ADDR addr;
  
*************** breakpoint_here_p (CORE_ADDR pc)
*** 1510,1518 ****
  	 || b->enable_state == bp_permanent)
  	&& b->address == pc)	/* bp is enabled and matches pc */
        {
! 	if (overlay_debugging &&
! 	    section_is_overlay (b->section) &&
! 	    !section_is_mapped (b->section))
  	  continue;		/* unmapped overlay -- can't be a match */
  	else if (b->enable_state == bp_permanent)
  	  return permanent_breakpoint_here;
--- 1510,1518 ----
  	 || b->enable_state == bp_permanent)
  	&& b->address == pc)	/* bp is enabled and matches pc */
        {
! 	if (overlay_debugging 
! 	    && section_is_overlay (b->section) 
! 	    && !section_is_mapped (b->section))
  	  continue;		/* unmapped overlay -- can't be a match */
  	else if (b->enable_state == bp_permanent)
  	  return permanent_breakpoint_here;
*************** breakpoint_inserted_here_p (CORE_ADDR pc
*** 1537,1545 ****
      if (b->inserted
  	&& b->address == pc)	/* bp is inserted and matches pc */
      {
!       if (overlay_debugging &&
! 	  section_is_overlay (b->section) &&
! 	  !section_is_mapped (b->section))
  	continue;		/* unmapped overlay -- can't be a match */
        else
  	return 1;
--- 1537,1545 ----
      if (b->inserted
  	&& b->address == pc)	/* bp is inserted and matches pc */
      {
!       if (overlay_debugging 
! 	  && section_is_overlay (b->section) 
! 	  && !section_is_mapped (b->section))
  	continue;		/* unmapped overlay -- can't be a match */
        else
  	return 1;
*************** breakpoint_thread_match (CORE_ADDR pc, p
*** 1598,1606 ****
  	&& b->address == pc
  	&& (b->thread == -1 || b->thread == thread))
      {
!       if (overlay_debugging &&
! 	  section_is_overlay (b->section) &&
! 	  !section_is_mapped (b->section))
  	continue;		/* unmapped overlay -- can't be a match */
        else
  	return 1;
--- 1598,1606 ----
  	&& b->address == pc
  	&& (b->thread == -1 || b->thread == thread))
      {
!       if (overlay_debugging 
! 	  && section_is_overlay (b->section) 
! 	  && !section_is_mapped (b->section))
  	continue;		/* unmapped overlay -- can't be a match */
        else
  	return 1;
*************** bpstat_stop_status (CORE_ADDR *pc, int n
*** 2386,2396 ****
  	&& b->type != bp_catch_exec
  	&& b->type != bp_catch_catch
  	&& b->type != bp_catch_throw)	/* a non-watchpoint bp */
!       if (b->address != bp_addr ||	/* address doesn't match or */
! 	  (overlay_debugging &&	/* overlay doesn't match */
! 	   section_is_overlay (b->section) &&
! 	   !section_is_mapped (b->section)))
! 	continue;
  
      if (b->type == bp_hardware_breakpoint
  	&& b->address != (*pc - DECR_PC_AFTER_HW_BREAK))
--- 2386,2399 ----
  	&& b->type != bp_catch_exec
  	&& b->type != bp_catch_catch
  	&& b->type != bp_catch_throw)	/* a non-watchpoint bp */
!       {
! 	if (b->address != bp_addr) 	/* address doesn't match */
! 	  continue;
! 	if (overlay_debugging		/* unmapped overlay section */
! 	    && section_is_overlay (b->section) 
! 	    && !section_is_mapped (b->section))
! 	  continue;
!       }
  
      if (b->type == bp_hardware_breakpoint
  	&& b->address != (*pc - DECR_PC_AFTER_HW_BREAK))
*************** describe_other_breakpoints (CORE_ADDR pc
*** 3506,3534 ****
    register struct breakpoint *b;
  
    ALL_BREAKPOINTS (b)
!     if (b->address == pc)
!     if (overlay_debugging == 0 ||
! 	b->section == section)
!       others++;
    if (others > 0)
      {
        printf_filtered ("Note: breakpoint%s ", (others > 1) ? "s" : "");
        ALL_BREAKPOINTS (b)
! 	if (b->address == pc)
! 	if (overlay_debugging == 0 ||
! 	    b->section == section)
! 	  {
! 	    others--;
! 	    printf_filtered ("%d%s%s ",
! 			     b->number,
! 			     ((b->enable_state == bp_disabled || 
! 			       b->enable_state == bp_shlib_disabled || 
! 			       b->enable_state == bp_call_disabled) ? " (disabled)" 
! 			      : b->enable_state == bp_permanent ? " (permanent)"
! 			      : ""),
! 			     (others > 1) ? "," 
! 			     : ((others == 1) ? " and" : ""));
! 	  }
        printf_filtered ("also set at pc ");
        print_address_numeric (pc, 1, gdb_stdout);
        printf_filtered (".\n");
--- 3509,3537 ----
    register struct breakpoint *b;
  
    ALL_BREAKPOINTS (b)
!     if (b->address == pc)	/* address match / overlay match */
!       if (!overlay_debugging || b->section == section)
! 	others++;
    if (others > 0)
      {
        printf_filtered ("Note: breakpoint%s ", (others > 1) ? "s" : "");
        ALL_BREAKPOINTS (b)
! 	if (b->address == pc)	/* address match / overlay match */
! 	  if (!overlay_debugging || b->section == section)
! 	    {
! 	      others--;
! 	      printf_filtered ("%d%s%s ",
! 			       b->number,
! 			       ((b->enable_state == bp_disabled || 
! 				 b->enable_state == bp_shlib_disabled || 
! 				 b->enable_state == bp_call_disabled) 
! 				? " (disabled)" 
! 				: b->enable_state == bp_permanent 
! 				? " (permanent)"
! 				: ""),
! 			       (others > 1) ? "," 
! 			       : ((others == 1) ? " and" : ""));
! 	    }
        printf_filtered ("also set at pc ");
        print_address_numeric (pc, 1, gdb_stdout);
        printf_filtered (".\n");
*************** check_duplicates (struct breakpoint *bpt
*** 3604,3611 ****
      if (b->enable_state != bp_disabled
  	&& b->enable_state != bp_shlib_disabled
  	&& b->enable_state != bp_call_disabled
! 	&& b->address == address
! 	&& (overlay_debugging == 0 || b->section == section)
  	&& breakpoint_address_is_meaningful (b))
      {
        /* Have we found a permanent breakpoint?  */
--- 3607,3614 ----
      if (b->enable_state != bp_disabled
  	&& b->enable_state != bp_shlib_disabled
  	&& b->enable_state != bp_call_disabled
! 	&& b->address == address	/* address / overlay match */
! 	&& (!overlay_debugging || b->section == section)
  	&& breakpoint_address_is_meaningful (b))
      {
        /* Have we found a permanent breakpoint?  */
*************** check_duplicates (struct breakpoint *bpt
*** 3643,3650 ****
  	    if (b->enable_state != bp_disabled
  		&& b->enable_state != bp_shlib_disabled
  		&& b->enable_state != bp_call_disabled
! 		&& b->address == address
! 		&& (overlay_debugging == 0 || b->section == section)
  		&& breakpoint_address_is_meaningful (b))
  	      b->duplicate = 1;
  	  }
--- 3646,3653 ----
  	    if (b->enable_state != bp_disabled
  		&& b->enable_state != bp_shlib_disabled
  		&& b->enable_state != bp_call_disabled
! 		&& b->address == address	/* address / overlay match */
! 		&& (!overlay_debugging || b->section == section)
  		&& breakpoint_address_is_meaningful (b))
  	      b->duplicate = 1;
  	  }
*************** clear_command (char *arg, int from_tty)
*** 6405,6413 ****
           of the same address as "sal.pc" should
           wind up being deleted. */
  
! 	     && (((sal.pc && (breakpoint_chain->address == sal.pc)) &&
! 		  (overlay_debugging == 0 ||
! 		   breakpoint_chain->section == sal.section))
  		 || ((default_match || (0 == sal.pc))
  		     && breakpoint_chain->source_file != NULL
  		     && sal.symtab != NULL
--- 6408,6416 ----
           of the same address as "sal.pc" should
           wind up being deleted. */
  
! 	     && (((sal.pc && (breakpoint_chain->address == sal.pc)) 
! 		  && (!overlay_debugging 
! 		      || breakpoint_chain->section == sal.section))
  		 || ((default_match || (0 == sal.pc))
  		     && breakpoint_chain->source_file != NULL
  		     && sal.symtab != NULL
*************** clear_command (char *arg, int from_tty)
*** 6422,6437 ****
  	}
  
        ALL_BREAKPOINTS (b)
- 
  	while (b->next
  	       && b->next->type != bp_none
  	       && b->next->type != bp_watchpoint
  	       && b->next->type != bp_hardware_watchpoint
  	       && b->next->type != bp_read_watchpoint
  	       && b->next->type != bp_access_watchpoint
! 	       && (((sal.pc && (b->next->address == sal.pc)) &&
! 		    (overlay_debugging == 0 ||
! 		     b->next->section == sal.section))
  		   || ((default_match || (0 == sal.pc))
  		       && b->next->source_file != NULL
  		       && sal.symtab != NULL
--- 6425,6438 ----
  	}
  
        ALL_BREAKPOINTS (b)
  	while (b->next
  	       && b->next->type != bp_none
  	       && b->next->type != bp_watchpoint
  	       && b->next->type != bp_hardware_watchpoint
  	       && b->next->type != bp_read_watchpoint
  	       && b->next->type != bp_access_watchpoint
! 	       && (((sal.pc && (b->next->address == sal.pc)) 
! 		    && (!overlay_debugging || b->next->section == sal.section))
  		   || ((default_match || (0 == sal.pc))
  		       && b->next->source_file != NULL
  		       && sal.symtab != NULL


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