Add "set print symbol-loading on|off".
authorDoug Evans <dje@google.com>
Thu, 10 Jul 2008 23:08:21 +0000 (23:08 +0000)
committerDoug Evans <dje@google.com>
Thu, 10 Jul 2008 23:08:21 +0000 (23:08 +0000)
* NEWS: Document new option.
* symfile.h (print_symbol_loading): Declare.
* symfile.c (print_symbol_loading): New global.
(symbol_file_add_with_addrs_or_offsets): Only print "Reading symbols
from ..." if print_symbol_loading.
(_initialize_symfile): Add set/show print symbol-loading.
* solib.c (solib_read_symbols): Only print "Loaded symbols for ..."
if print_symbol_loading.

* doc/gdb.texinfo: Document "set print symbol-loading on|off".

gdb/ChangeLog
gdb/NEWS
gdb/doc/ChangeLog
gdb/doc/gdb.texinfo
gdb/solib.c
gdb/symfile.c
gdb/symfile.h

index dbea4896c11aaeafe39ab53b06c1f18f3f068a1a..67832fcf8f30009bf5772a3b8b6962226b76f766 100644 (file)
@@ -1,3 +1,15 @@
+2008-07-10  Doug Evans  <dje@google.com>
+
+       Add "set print symbol-loading on|off".
+       * NEWS: Document new option.
+       * symfile.h (print_symbol_loading): Declare.
+       * symfile.c (print_symbol_loading): New global.
+       (symbol_file_add_with_addrs_or_offsets): Only print "Reading symbols
+       from ..." if print_symbol_loading.
+       (_initialize_symfile): Add set/show print symbol-loading.
+       * solib.c (solib_read_symbols): Only print "Loaded symbols for ..."
+       if print_symbol_loading.
+
 2008-07-10  Pedro Alves  <pedro@codesourcery.com>
 
        Non-stop linux native.
index 73726894055ae6f24f2679f3857a7ae6846745a0..e7832594d4d71d5e2e22cd67496db3a8920f03b7 100644 (file)
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -68,6 +68,10 @@ find [/size-char] [/max-count] start-address, end-address|+search-space-size,
     val1 [, val2, ...]
   Search memory for a sequence of bytes.
 
+set print symbol-loading
+show print symbol-loading
+  Control printing of symbol loading messages.
+
 set debug timestamp
 show debug timestamp
   Display timestamps with GDB debugging output.
index 182b9dc4c2b8eb98f889e56e94d9eb30af663e9c..8786b4aeac7785e125311257dacc9be182264e8d 100644 (file)
@@ -1,3 +1,7 @@
+2008-07-10  Doug Evans  <dje@google.com>
+
+       * doc/gdb.texinfo: Document "set print symbol-loading on|off".
+
 2008-07-10  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        * gdb.texinfo (Starting): Document "set disable-randomization".
index 710b96b7c0ecfcb0576a9d4c4018f1b6d60f4c35..2920179533cb0a40d95a3f9a447be875f1bccd2d 100644 (file)
@@ -11533,6 +11533,22 @@ is printed as follows:
 @item show opaque-type-resolution
 Show whether opaque types are resolved or not.
 
+@kindex set print symbol-loading
+@cindex print messages when symbols are loaded
+@item set print symbol-loading
+@itemx set print symbol-loading on
+@itemx set print symbol-loading off
+The @code{set print symbol-loading} command allows you to enable or
+disable printing of messages when @value{GDBN} loads symbols.
+By default, these messages will be printed, and normally this is what
+you want.  Disabling these messages is useful when debugging applications
+with lots of shared libraries where the quantity of output can be more
+annoying than useful.
+
+@kindex show print symbol-loading
+@item show print symbol-loading
+Show whether messages will be printed when @value{GDBN} loads symbols.
+
 @kindex maint print symbols
 @cindex symbol dump
 @kindex maint print psymbols
index a694b813307be50b7c11cf7e1cffb8ccdc42cef7..515402e675548777ae9120d6d2ea6f5482492784 100644 (file)
@@ -448,7 +448,7 @@ solib_read_symbols (struct so_list *so, int from_tty)
                        "Error while reading shared library symbols:\n",
                        RETURN_MASK_ALL))
        {
-         if (from_tty)
+         if (from_tty && print_symbol_loading)
            printf_unfiltered (_("Loaded symbols for %s\n"), so->so_name);
          so->symbols_loaded = 1;
          return 1;
index d98f62b670cb570e77d0e88f7791dff8a1522142..12f17ac5bc2a5c2ac059e6664e952f62fea6f07c 100644 (file)
@@ -171,6 +171,12 @@ Dynamic symbol table reloading multiple times in one run is %s.\n"),
                    value);
 }
 
+/* If non-zero, gdb will notify the user when it is loading symbols
+   from a file.  This is almost always what users will want to have happen;
+   but for programs with lots of dynamically linked libraries, the output
+   can be more noise than signal.  */
+
+int print_symbol_loading = 1;
 
 /* If non-zero, shared library symbols will be added automatically
    when the inferior is created, new libraries are loaded, or when
@@ -1046,9 +1052,12 @@ symbol_file_add_with_addrs_or_offsets (bfd *abfd, int from_tty,
        deprecated_pre_add_symbol_hook (name);
       else
        {
-         printf_unfiltered (_("Reading symbols from %s..."), name);
-         wrap_here ("");
-         gdb_flush (gdb_stdout);
+          if (print_symbol_loading)
+           {
+             printf_unfiltered (_("Reading symbols from %s..."), name);
+             wrap_here ("");
+             gdb_flush (gdb_stdout);
+           }
        }
     }
   syms_from_objfile (objfile, addrs, offsets, num_offsets,
@@ -1061,7 +1070,7 @@ symbol_file_add_with_addrs_or_offsets (bfd *abfd, int from_tty,
 
   if ((flags & OBJF_READNOW) || readnow_symbol_files)
     {
-      if (from_tty || info_verbose)
+      if ((from_tty || info_verbose) && print_symbol_loading)
        {
          printf_unfiltered (_("expanding to full symbols..."));
          wrap_here ("");
@@ -1103,7 +1112,8 @@ symbol_file_add_with_addrs_or_offsets (bfd *abfd, int from_tty,
       xfree (debugfile);
     }
 
-  if (!have_partial_symbols () && !have_full_symbols ())
+  if (!have_partial_symbols () && !have_full_symbols ()
+      && print_symbol_loading)
     {
       wrap_here ("");
       printf_filtered (_("(no debugging symbols found)"));
@@ -1120,7 +1130,8 @@ symbol_file_add_with_addrs_or_offsets (bfd *abfd, int from_tty,
        deprecated_post_add_symbol_hook ();
       else
        {
-         printf_unfiltered (_("done.\n"));
+         if (print_symbol_loading)
+           printf_unfiltered (_("done.\n"));
        }
     }
 
@@ -4219,4 +4230,12 @@ the global debug-file directory prepended."),
                                     NULL,
                                     show_debug_file_directory,
                                     &setlist, &showlist);
+
+  add_setshow_boolean_cmd ("symbol-loading", no_class,
+                           &print_symbol_loading, _("\
+Set printing of symbol loading messages."), _("\
+Show printing of symbol loading messages."), NULL,
+                           NULL,
+                           NULL,
+                           &setprintlist, &showprintlist);
 }
index 948cef74383dbdff09e39ee35712874ae833a897..02fb7df8d6ac92d6c32855ca55e869f568b2b518 100644 (file)
@@ -267,6 +267,13 @@ extern char *obconcat (struct obstack *obstackp, const char *, const char *,
 
                        /*   Variables   */
 
+/* If non-zero, gdb will notify the user when it is loading symbols
+   from a file.  This is almost always what users will want to have happen;
+   but for programs with lots of dynamically linked libraries, the output
+   can be more noise than signal.  */
+
+extern int print_symbol_loading;
+
 /* If non-zero, shared library symbols will be added automatically
    when the inferior is created, new libraries are loaded, or when
    attaching to the inferior.  This is almost always what users will
This page took 0.0482089999999999 seconds and 4 git commands to generate.