File gdb-6.3-readnever-20050907.patch of Package gdb.783

2004-11-18  Andrew Cagney  <cagney@gnu.org>

        * dwarf2read.c: Include "top.c".
        (dwarf2_has_info): Check for readnever_symbol_files.
        * symfile.c (readnever_symbol_files): Define.
        * top.h (readnever_symbol_files): Declare.
        * main.c (captured_main): Add --readnever option.
        (print_gdb_help): Ditto.

2004-11-18  Andrew Cagney  <cagney@gnu.org>

        * gdb.texinfo (File Options): Document --readnever.

Index: gdb-7.8.50.20141228/gdb/doc/gdb.texinfo
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/doc/gdb.texinfo	2015-01-01 17:01:08.308881292 +0100
+++ gdb-7.8.50.20141228/gdb/doc/gdb.texinfo	2015-01-01 17:01:10.302880126 +0100
@@ -1032,6 +1032,12 @@ Read each symbol file's entire symbol ta
 the default, which is to read it incrementally as it is needed.
 This makes startup slower, but makes future operations faster.
 
+@item --readnever
+@cindex @code{--readnever}
+Do not read each symbol file's symbolic debug information.  This makes
+startup faster but at the expense of not being able to perform
+symbolic debugging.
+
 @end table
 
 @node Mode Options
Index: gdb-7.8.50.20141228/gdb/main.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/main.c	2015-01-01 17:01:08.312881290 +0100
+++ gdb-7.8.50.20141228/gdb/main.c	2015-01-01 17:01:10.303880125 +0100
@@ -590,6 +590,7 @@ captured_main (void *data)
       {"xdb", no_argument, &xdb_commands, 1},
       {"dbx", no_argument, &dbx_commands, 1},
       {"readnow", no_argument, &readnow_symbol_files, 1},
+      {"readnever", no_argument, &readnever_symbol_files, 1},
       {"r", no_argument, &readnow_symbol_files, 1},
       {"quiet", no_argument, &quiet, 1},
       {"q", no_argument, &quiet, 1},
@@ -1245,6 +1246,7 @@ Selection of debuggee and its files:\n\n
   --se=FILE          Use FILE as symbol file and executable file.\n\
   --symbols=SYMFILE  Read symbols from SYMFILE.\n\
   --readnow          Fully read symbol files on first access.\n\
+  --readnever        Do not read symbol files.\n\
   --write            Set writing into executable and core files.\n\n\
 "), stream);
   fputs_unfiltered (_("\
Index: gdb-7.8.50.20141228/gdb/symfile.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/symfile.c	2015-01-01 17:01:08.313881289 +0100
+++ gdb-7.8.50.20141228/gdb/symfile.c	2015-01-01 17:01:10.304880125 +0100
@@ -80,6 +80,7 @@ static void clear_symtab_users_cleanup (
 
 /* Global variables owned by this file.  */
 int readnow_symbol_files;	/* Read full symbols immediately.  */
+int readnever_symbol_files;	/* Never read full symbols.  */
 
 /* Functions this file defines.  */
 
Index: gdb-7.8.50.20141228/gdb/dwarf2read.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/dwarf2read.c	2015-01-01 17:01:08.319881285 +0100
+++ gdb-7.8.50.20141228/gdb/dwarf2read.c	2015-01-01 17:01:26.888870511 +0100
@@ -69,6 +69,7 @@
 #include "source.h"
 #include "filestuff.h"
 #include "build-id.h"
+#include "top.h"
 
 #include <fcntl.h>
 #include <sys/types.h>
@@ -1989,7 +1990,8 @@ dwarf2_has_info (struct objfile *objfile
                              (void *) names);
       dwarf2_per_objfile->objfile = objfile;
     }
-  return (!dwarf2_per_objfile->info.is_virtual
+  return !readnever_symbol_files &&
+	 (!dwarf2_per_objfile->info.is_virtual
 	  && dwarf2_per_objfile->info.s.asection != NULL
 	  && !dwarf2_per_objfile->abbrev.is_virtual
 	  && dwarf2_per_objfile->abbrev.s.asection != NULL);
Index: gdb-7.8.50.20141228/gdb/top.h
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/top.h	2015-01-01 17:01:08.320881284 +0100
+++ gdb-7.8.50.20141228/gdb/top.h	2015-01-01 17:01:10.310880121 +0100
@@ -67,6 +67,7 @@ extern void set_prompt (const char *s);
 
 /* From random places.  */
 extern int readnow_symbol_files;
+extern int readnever_symbol_files;
 
 /* Perform _initialize initialization.  */
 extern void gdb_init (char *);