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]: Use breakpoint_here_p in tuiSetDisassemContent


Hi!

I've committed this patch to use breakpoint_here_p() instead of a specific
function that does the same (for TUI disassembly window to tell if a given
line has a breakpoint).

	Stephane

2002-08-25  Stephane Carrez  <stcarrez@nerim.fr>

	* tuiDisassem.c (tuiSetDisassemContent): Use breakpoint_here_p.
	(_hasBreak): Remove.
Index: tuiDisassem.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tuiDisassem.c,v
retrieving revision 1.13
diff -u -p -r1.13 tuiDisassem.c
--- tuiDisassem.c	25 Aug 2002 19:39:45 -0000	1.13
+++ tuiDisassem.c	25 Aug 2002 19:49:42 -0000
@@ -54,17 +54,6 @@
 #include "tui-file.h"
 
 
-/*****************************************
-** STATIC LOCAL FUNCTIONS FORWARD DECLS    **
-******************************************/
-
-static struct breakpoint *_hasBreak (CORE_ADDR);
-
-
-/*****************************************
-** PUBLIC FUNCTIONS                        **
-******************************************/
-
 /*
    ** tuiSetDisassemContent().
    **        Function to set the disassembly window's content.
@@ -107,7 +96,6 @@ extern void strcat_address_numeric (CORE
 	  for (curLine = 0, pc = startAddr; (curLine < maxLines);)
 	    {
 	      TuiWinElementPtr element = (TuiWinElementPtr) disassemWin->generic.content[curLine];
-	      struct breakpoint *bp;
 
 	      print_address (pc, gdb_dis_out);
 
@@ -137,11 +125,9 @@ extern void strcat_address_numeric (CORE
 	      element->whichElement.source.lineOrAddr.addr = pc;
 	      element->whichElement.source.isExecPoint =
 		(pc == (CORE_ADDR) ((TuiWinElementPtr) locator->content[0])->whichElement.locator.addr);
-	      bp = _hasBreak (pc);
 	      element->whichElement.source.hasBreak =
-		(bp != (struct breakpoint *) NULL &&
-		 (!element->whichElement.source.isExecPoint ||
-		  (bp->disposition != disp_del || bp->hit_count <= 0)));
+		(breakpoint_here_p (pc) != no_breakpoint_here
+		 && !element->whichElement.source.isExecPoint);
 	      curLine++;
 	      pc = newpc;
 	      /* reset the buffer to empty */
@@ -301,31 +287,3 @@ tuiVerticalDisassemScroll (TuiScrollDire
 
   return;
 }				/* tuiVerticalDisassemScroll */
-
-
-
-/*****************************************
-** STATIC LOCAL FUNCTIONS                 **
-******************************************/
-/*
-   ** _hasBreak().
-   **      Answer whether there is a break point at the input line in the
-   **      source file indicated
- */
-static struct breakpoint *
-_hasBreak (CORE_ADDR addr)
-{
-  struct breakpoint *bpWithBreak = (struct breakpoint *) NULL;
-  struct breakpoint *bp;
-  extern struct breakpoint *breakpoint_chain;
-
-
-  for (bp = breakpoint_chain;
-       (bp != (struct breakpoint *) NULL &&
-	bpWithBreak == (struct breakpoint *) NULL);
-       bp = bp->next)
-    if (addr == bp->address)
-      bpWithBreak = bp;
-
-  return bpWithBreak;
-}				/* _hasBreak */

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