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]: Refresh TUI current line when execution point changes


Hi!

I've committed this patch to refresh the current line (asm or src) when
the execution point changes.  The current line is highlighted (as for gvd).

	Stephane

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

	* tuiSourceWin.c (tuiSetIsExecPointAt): Redraw the previous and
	current line.

Index: tuiSourceWin.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tuiSourceWin.c,v
retrieving revision 1.19
diff -u -p -r1.19 tuiSourceWin.c
--- tuiSourceWin.c	30 Aug 2002 20:07:05 -0000	1.19
+++ tuiSourceWin.c	30 Aug 2002 21:23:02 -0000
@@ -375,28 +375,34 @@ tuiHorizontalSourceScroll (TuiWinInfoPtr
 }				/* tuiHorizontalSourceScroll */
 
 
-/*
-   ** tuiSetHasExecPointAt().
-   **        Set or clear the hasBreak flag in the line whose line is lineNo.
- */
+/* Set or clear the hasBreak flag in the line whose line is lineNo.  */
 void
 tuiSetIsExecPointAt (TuiLineOrAddress l, TuiWinInfoPtr winInfo)
 {
+  int changed = 0;
   int i;
   TuiWinContent content = (TuiWinContent) winInfo->generic.content;
 
   i = 0;
   while (i < winInfo->generic.contentSize)
     {
+      int newState;
+
       if (content[i]->whichElement.source.lineOrAddr.addr == l.addr)
-	content[i]->whichElement.source.isExecPoint = TRUE;
+        newState = TRUE;
       else
-	content[i]->whichElement.source.isExecPoint = FALSE;
+	newState = FALSE;
+      if (newState != content[i]->whichElement.source.isExecPoint)
+        {
+          changed++;
+          content[i]->whichElement.source.isExecPoint = newState;
+          tui_show_source_line (winInfo, i + 1);
+        }
       i++;
     }
-
-  return;
-}				/* tuiSetIsExecPointAt */
+  if (changed)
+    tuiRefreshWin (&winInfo->generic);
+}
 
 /* Update the execution windows to show the active breakpoints.
    This is called whenever a breakpoint is inserted, removed or

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