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]: Cleanup tui to remove unused functions


Hi!

I've committed this patch to remove a number of functions in TUI code
which are not used.

	Stephane

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

	* tuiSourceWin.c (tuiSrcWinIsDisplayed): Remove.
	(tuiAsmWinIsDisplayed): Remove.
	(tuiShowAllSourceWinsContent): Remove.
	(tuiUpdateOnEnd): Remove.
	* tuiGeneralWin.c (scrollWinForward): Remove.
	(scrollWinBackward): Remove.
	(_winResize): Don't declare.
	* tui.h (tuiUpdateOnEnd): Don't declare.
	(vcatch_errors, va_catch_errors): Likewise.
	* tuiSourceWin.h (tuiUpdateOnEnd): Likewise.
	(tuiShowAllSourceWinsContent): Likewise.
	* tuiGeneralWin.h (scrollWinForward): Likewise.
	(scrollWinBackward): Likewise.

Index: tui.h
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui.h,v
retrieving revision 1.11
diff -u -p -r1.11 tui.h
--- tui.h	28 Sep 2001 17:39:09 -0000	1.11
+++ tui.h	24 Aug 2002 10:13:03 -0000
@@ -48,9 +48,6 @@ Opaque (*OpaqueFuncPtr) (va_list);
  */
      typedef OpaqueFuncPtr TuiOpaqueFuncPtr;
 
-extern Opaque vcatch_errors (OpaqueFuncPtr, ...);
-extern Opaque va_catch_errors (OpaqueFuncPtr, va_list);
-
 extern void strcat_to_buf (char *, int, char *);
 extern void strcat_to_buf_with_fmt (char *, int, char *, ...);
 
@@ -131,7 +128,6 @@ extern TuiStatus tui_set_layout (const c
 /* tuiSourceWin.c */
 extern void tuiDisplayMainFunction (void);
 extern void tuiUpdateAllExecInfos (void);
-extern void tuiUpdateOnEnd (void);
 extern void tui_vAllSetHasBreakAt (va_list);
 extern void tui_vUpdateSourceWindowsWithAddr (va_list);
 
Index: tuiGeneralWin.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tuiGeneralWin.c,v
retrieving revision 1.9
diff -u -p -r1.9 tuiGeneralWin.c
--- tuiGeneralWin.c	1 Mar 2002 06:19:28 -0000	1.9
+++ tuiGeneralWin.c	24 Aug 2002 10:13:03 -0000
@@ -45,12 +45,6 @@
 #include "tuiGeneralWin.h"
 #include "tuiWin.h"
 
-/*
-   ** local support functions
- */
-static void _winResize (void);
-
-
 /***********************
 ** PUBLIC FUNCTIONS
 ***********************/
@@ -296,90 +290,6 @@ makeAllVisible (int visible)
 
   return;
 }				/* makeAllVisible */
-
-
-/*
-   ** scrollWinForward
- */
-void
-scrollWinForward (TuiGenWinInfoPtr winInfo, int numLines)
-{
-  if (winInfo->content != (OpaquePtr) NULL &&
-      winInfo->lastVisibleLine < winInfo->contentSize - 1)
-    {
-      int i, firstLine, newLastLine;
-
-      firstLine = winInfo->lastVisibleLine - winInfo->viewportHeight + 1;
-      if (winInfo->lastVisibleLine + numLines > winInfo->contentSize)
-	newLastLine = winInfo->contentSize - 1;
-      else
-	newLastLine = winInfo->lastVisibleLine + numLines - 1;
-
-      for (i = (newLastLine - winInfo->viewportHeight);
-	   (i <= newLastLine); i++)
-	{
-	  TuiWinElementPtr line;
-	  int lineHeight;
-
-	  line = (TuiWinElementPtr) winInfo->content[i];
-	  if (line->highlight)
-	    wstandout (winInfo->handle);
-	  mvwaddstr (winInfo->handle,
-		     i - (newLastLine - winInfo->viewportHeight),
-		     1,
-		     displayableWinContentOf (winInfo, line));
-	  if (line->highlight)
-	    wstandend (winInfo->handle);
-	  lineHeight = winElementHeight (winInfo, line);
-	  newLastLine += (lineHeight - 1);
-	}
-      winInfo->lastVisibleLine = newLastLine;
-    }
-
-  return;
-}				/* scrollWinForward */
-
-
-/*
-   ** scrollWinBackward
- */
-void
-scrollWinBackward (TuiGenWinInfoPtr winInfo, int numLines)
-{
-  if (winInfo->content != (OpaquePtr) NULL &&
-      (winInfo->lastVisibleLine - winInfo->viewportHeight) > 0)
-    {
-      int i, newLastLine, firstLine;
-
-      firstLine = winInfo->lastVisibleLine - winInfo->viewportHeight + 1;
-      if ((firstLine - numLines) < 0)
-	newLastLine = winInfo->viewportHeight - 1;
-      else
-	newLastLine = winInfo->lastVisibleLine - numLines + 1;
-
-      for (i = newLastLine - winInfo->viewportHeight; (i <= newLastLine); i++)
-	{
-	  TuiWinElementPtr line;
-	  int lineHeight;
-
-	  line = (TuiWinElementPtr) winInfo->content[i];
-	  if (line->highlight)
-	    wstandout (winInfo->handle);
-	  mvwaddstr (winInfo->handle,
-		     i - (newLastLine - winInfo->viewportHeight),
-		     1,
-		     displayableWinContentOf (winInfo, line));
-	  if (line->highlight)
-	    wstandend (winInfo->handle);
-	  lineHeight = winElementHeight (winInfo, line);
-	  newLastLine += (lineHeight - 1);
-	}
-      winInfo->lastVisibleLine = newLastLine;
-    }
-
-  return;
-}				/* scrollWinBackward */
-
 
 /*
    ** refreshAll().
Index: tuiGeneralWin.h
===================================================================
RCS file: /cvs/src/src/gdb/tui/tuiGeneralWin.h,v
retrieving revision 1.3
diff -u -p -r1.3 tuiGeneralWin.h
--- tuiGeneralWin.h	14 Jul 2001 19:01:25 -0000	1.3
+++ tuiGeneralWin.h	24 Aug 2002 10:13:03 -0000
@@ -29,8 +29,6 @@ extern void tuiClearWin (TuiGenWinInfoPt
 extern void unhighlightWin (TuiWinInfoPtr);
 extern void makeVisible (TuiGenWinInfoPtr, int);
 extern void makeAllVisible (int);
-extern void scrollWinForward (TuiGenWinInfoPtr, int);
-extern void scrollWinBackward (TuiGenWinInfoPtr, int);
 extern void makeWindow (TuiGenWinInfoPtr, int);
 extern TuiWinInfoPtr copyWin (TuiWinInfoPtr);
 extern void boxWin (TuiGenWinInfoPtr, int);
Index: tuiSourceWin.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tuiSourceWin.c,v
retrieving revision 1.11
diff -u -p -r1.11 tuiSourceWin.c
--- tuiSourceWin.c	1 Mar 2002 06:19:28 -0000	1.11
+++ tuiSourceWin.c	24 Aug 2002 10:13:03 -0000
@@ -66,44 +66,6 @@
 extern int current_source_line;
 extern struct symtab *current_source_symtab;
 
-
-/*****************************************
-** STATIC LOCAL FUNCTIONS FORWARD DECLS    **
-******************************************/
-
-/*****************************************
-** STATIC LOCAL DATA                    **
-******************************************/
-
-
-/*****************************************
-** PUBLIC FUNCTIONS                        **
-******************************************/
-
-/*********************************
-** SOURCE/DISASSEM  FUNCTIONS    **
-*********************************/
-
-/*
-   ** tuiSrcWinIsDisplayed().
- */
-int
-tuiSrcWinIsDisplayed (void)
-{
-  return (m_winPtrNotNull (srcWin) && srcWin->generic.isVisible);
-}				/* tuiSrcWinIsDisplayed */
-
-
-/*
-   ** tuiAsmWinIsDisplayed().
- */
-int
-tuiAsmWinIsDisplayed (void)
-{
-  return (m_winPtrNotNull (disassemWin) && disassemWin->generic.isVisible);
-}				/* tuiAsmWinIsDisplayed */
-
-
 /*
    ** tuiDisplayMainFunction().
    **        Function to display the "main" routine"
@@ -402,21 +364,6 @@ tuiShowSourceContent (TuiWinInfoPtr winI
 
 
 /*
-   ** tuiShowAllSourceWinsContent()
- */
-void
-tuiShowAllSourceWinsContent (void)
-{
-  int i;
-
-  for (i = 0; i < (sourceWindows ())->count; i++)
-    tuiShowSourceContent ((TuiWinInfoPtr) (sourceWindows ())->list[i]);
-
-  return;
-}				/* tuiShowAllSourceWinsContent */
-
-
-/*
    ** tuiHorizontalSourceScroll().
    **      Scroll the source forward or backward horizontally
  */
@@ -686,22 +633,6 @@ tuiEraseExecInfoContent (TuiWinInfoPtr w
   return;
 }				/* tuiEraseExecInfoContent */
 
-
-/*
-   ** tuiEraseAllExecInfosContent()
- */
-void
-tuiEraseAllExecInfosContent (void)
-{
-  int i;
-
-  for (i = 0; i < (sourceWindows ())->count; i++)
-    tuiEraseExecInfoContent ((TuiWinInfoPtr) (sourceWindows ())->list[i]);
-
-  return;
-}				/* tuiEraseAllExecInfosContent */
-
-
 /*
    ** tuiClearExecInfoContent().
  */
@@ -714,22 +645,6 @@ tuiClearExecInfoContent (TuiWinInfoPtr w
   return;
 }				/* tuiClearExecInfoContent */
 
-
-/*
-   ** tuiClearAllExecInfosContent()
- */
-void
-tuiClearAllExecInfosContent (void)
-{
-  int i;
-
-  for (i = 0; i < (sourceWindows ())->count; i++)
-    tuiClearExecInfoContent ((TuiWinInfoPtr) (sourceWindows ())->list[i]);
-
-  return;
-}				/* tuiClearAllExecInfosContent */
-
-
 /*
    ** tuiUpdateExecInfo().
    **        Function to update the execution info window
@@ -755,55 +670,6 @@ tuiUpdateAllExecInfos (void)
 
   return;
 }				/* tuiUpdateAllExecInfos */
-
-
-
-/* tuiUpdateOnEnd()
-   **       elz: This function clears the execution info from the source windows
-   **       and resets the locator to display no line info, procedure info, pc
-   **       info.  It is called by stack_publish_stopped_with_no_frame, which
-   **       is called then the target terminates execution
- */
-void
-tuiUpdateOnEnd (void)
-{
-  int i;
-  TuiGenWinInfoPtr locator;
-  char *filename;
-  TuiWinInfoPtr winInfo;
-
-  locator = locatorWinInfoPtr ();
-
-  /* for all the windows (src, asm) */
-  for (i = 0; i < (sourceWindows ())->count; i++)
-    {
-      TuiLineOrAddress l;
-      
-      winInfo = (TuiWinInfoPtr) (sourceWindows ())->list[i];
-
-      l.addr = -1;
-      l.lineNo = -1;
-      tuiSetIsExecPointAt (l, winInfo);	/* the target is'n running */
-      /* -1 should not match any line number or pc */
-      tuiSetExecInfoContent (winInfo);	/*set winInfo so that > is'n displayed */
-      tuiShowExecInfoContent (winInfo);		/* display the new contents */
-    }
-
-  /*now update the locator */
-  tuiClearLocatorDisplay ();
-  tuiGetLocatorFilename (locator, &filename);
-  tuiSetLocatorInfo (
-		      filename,
-		      (char *) NULL,
-		      0,
-		      (CORE_ADDR) 0,
-	   &((TuiWinElementPtr) locator->content[0])->whichElement.locator);
-  tuiShowLocatorContent ();
-
-  return;
-}				/* tuiUpdateOnEnd */
-
-
 
 TuiStatus
 tuiAllocSourceBuffer (TuiWinInfoPtr winInfo)
Index: tuiSourceWin.h
===================================================================
RCS file: /cvs/src/src/gdb/tui/tuiSourceWin.h,v
retrieving revision 1.7
diff -u -p -r1.7 tuiSourceWin.h
--- tuiSourceWin.h	20 Jul 2001 23:06:48 -0000	1.7
+++ tuiSourceWin.h	24 Aug 2002 10:13:03 -0000
@@ -36,11 +36,8 @@ extern void tuiEraseSourceContent (TuiWi
 extern void tuiEraseAllSourceWinsContent (int);
 extern void tuiSetSourceContentNil (TuiWinInfoPtr, char *);
 extern void tuiShowSourceContent (TuiWinInfoPtr);
-extern void tuiShowAllSourceWinsContent (void);
 extern void tuiHorizontalSourceScroll (TuiWinInfoPtr, TuiScrollDirection,
 				       int);
-extern void tuiUpdateOnEnd (void);
-
 extern TuiStatus tuiSetExecInfoContent (TuiWinInfoPtr);
 extern void tuiShowExecInfoContent (TuiWinInfoPtr);
 extern void tuiShowAllExecInfosContent (void);

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