* config.bfd: Add powerpc64 target. Add powerpc64 vectors to
[deliverable/binutils-gdb.git] / gdb / source.c
index 2895dd388f683e76ff2e23cb349b3ee7bf052844..afdc025a9de51cb02ecd0c112a5de240ad7ebec7 100644 (file)
@@ -41,6 +41,7 @@
 #include "gdbtypes.h"
 #include "linespec.h"
 #include "filenames.h"         /* for DOSish file names */
+#include "completer.h"
 #ifdef UI_OUT
 #include "ui-out.h"
 #endif
@@ -153,9 +154,9 @@ select_source_symtab (register struct symtab *s)
 
   /* Make the default place to list be the function `main'
      if one exists.  */
-  if (lookup_symbol ("main", 0, VAR_NAMESPACE, 0, NULL))
+  if (lookup_symbol (main_name (), 0, VAR_NAMESPACE, 0, NULL))
     {
-      sals = decode_line_spec ("main", 1);
+      sals = decode_line_spec (main_name (), 1);
       sal = sals.sals[0];
       xfree (sals.sals);
       current_source_symtab = sal.symtab;
@@ -797,8 +798,6 @@ find_source_lines (struct symtab *s, int desc)
 
   if (mtime && mtime < st.st_mtime)
     {
-      if (tui_version)
-       printf_filtered ("\n");
       warning ("Source file is more recent than executable.\n");
     }
 
@@ -1134,31 +1133,7 @@ print_source_lines_base (struct symtab *s, int line, int stopline, int noerror)
 void
 print_source_lines (struct symtab *s, int line, int stopline, int noerror)
 {
-#if defined(TUI)
-  if (!tui_version ||
-      m_winPtrIsNull (srcWin) || !srcWin->generic.isVisible)
-    print_source_lines_base (s, line, stopline, noerror);
-  else
-    {
-      TuiGenWinInfoPtr locator = locatorWinInfoPtr ();
-extern void tui_vAddWinToLayout (va_list);
-extern void tui_vUpdateSourceWindowsWithLine (va_list);
-
-      /* Regardless of whether we can open the file,
-         set current_source_symtab. */
-      current_source_symtab = s;
-      current_source_line = line;
-      first_line_listed = line;
-
-      /* make sure that the source window is displayed */
-      tuiDo ((TuiOpaqueFuncPtr) tui_vAddWinToLayout, SRC_WIN);
-
-      tuiDo ((TuiOpaqueFuncPtr) tui_vUpdateSourceWindowsWithLine, s, line);
-      tuiDo ((TuiOpaqueFuncPtr) tui_vUpdateLocatorFilename, s->filename);
-    }
-#else
   print_source_lines_base (s, line, stopline, noerror);
-#endif
 }
 \f
 
@@ -1463,29 +1438,7 @@ forward_search_command (char *regex, int from_tty)
   int line;
   char *msg;
 
-#if defined(TUI)
-  /* 
-     ** If this is the TUI, search from the first line displayed in 
-     ** the source window, otherwise, search from last_line_listed+1 
-     ** in current_source_symtab 
-   */
-  if (!tui_version)
-    line = last_line_listed;
-  else
-    {
-      if (srcWin->generic.isVisible && srcWin->generic.contentSize > 0)
-       line = ((TuiWinContent)
-        srcWin->generic.content)[0]->whichElement.source.lineOrAddr.lineNo;
-      else
-       {
-         printf_filtered ("No source displayed.\nExpression not found.\n");
-         return;
-       }
-    }
-  line++;
-#else
   line = last_line_listed + 1;
-#endif
 
   msg = (char *) re_comp (regex);
   if (msg)
@@ -1557,8 +1510,6 @@ forward_search_command (char *regex, int from_tty)
        {
          /* Match! */
          fclose (stream);
-         if (tui_version)
-           print_source_lines_base (current_source_symtab, line, line + 1, 0);
          print_source_lines (current_source_symtab, line, line + 1, 0);
          set_internalvar (lookup_internalvar ("_"),
                           value_from_longest (builtin_type_int,
@@ -1582,29 +1533,8 @@ reverse_search_command (char *regex, int from_tty)
   register FILE *stream;
   int line;
   char *msg;
-#if defined(TUI)
-  /*
-     ** If this is the TUI, search from the first line displayed in
-     ** the source window, otherwise, search from last_line_listed-1
-     ** in current_source_symtab
-   */
-  if (!tui_version)
-    line = last_line_listed;
-  else
-    {
-      if (srcWin->generic.isVisible && srcWin->generic.contentSize > 0)
-       line = ((TuiWinContent)
-        srcWin->generic.content)[0]->whichElement.source.lineOrAddr.lineNo;
-      else
-       {
-         printf_filtered ("No source displayed.\nExpression not found.\n");
-         return;
-       }
-    }
-  line--;
-#else
+
   line = last_line_listed - 1;
-#endif
 
   msg = (char *) re_comp (regex);
   if (msg)
@@ -1665,8 +1595,6 @@ reverse_search_command (char *regex, int from_tty)
        {
          /* Match! */
          fclose (stream);
-         if (tui_version)
-           print_source_lines_base (current_source_symtab, line, line + 1, 0);
          print_source_lines (current_source_symtab, line, line + 1, 0);
          set_internalvar (lookup_internalvar ("_"),
                           value_from_longest (builtin_type_int,
This page took 0.024206 seconds and 4 git commands to generate.