Change "set debug symtab-create" to take a verbosity level.
authorDoug Evans <dje@google.com>
Fri, 8 Nov 2013 18:43:23 +0000 (10:43 -0800)
committerDoug Evans <dje@google.com>
Fri, 8 Nov 2013 18:49:44 +0000 (10:49 -0800)
* NEWS: Mention that "set debug symtab-create" now accepts a
verbosity level.
* buildsym.c (end_symtab_from_static_block): Call set_symtab_primary
to set the symtab's primary flag.
* jit.c (finalize_symtab): Ditto.
* mdebugread.c (psymtab_to_symtab_1): Ditto.
* symfile.c (allocate_symtab): Only print debugging messages for
symtab_create_debug levels 2 and higher.
* symtab.c (symtab_create_debug): Change type to unsigned int.
(set_symtab_primary): New function.
(_initialize_symtab): Change "set debug symtab-create" to a
zuinteger option.
* symtab.h (set_symtab_primary): Declare.
(symtab_create_debug): Update decl.

doc/
* gdb.texinfo (Debugging Output): Update text for
"set debug symtab-create".

gdb/ChangeLog
gdb/NEWS
gdb/buildsym.c
gdb/doc/ChangeLog
gdb/doc/gdb.texinfo
gdb/jit.c
gdb/mdebugread.c
gdb/symfile.c
gdb/symtab.c
gdb/symtab.h

index 4d1c26d01676c79c3ce4ca6f717e72cf2fe061b2..2be522144e7cd2550e4c33beda703f59e5ba638b 100644 (file)
@@ -1,3 +1,20 @@
+2013-11-08  Doug Evans  <dje@google.com>
+
+       * NEWS: Mention that "set debug symtab-create" now accepts a
+       verbosity level.
+       * buildsym.c (end_symtab_from_static_block): Call set_symtab_primary
+       to set the symtab's primary flag.
+       * jit.c (finalize_symtab): Ditto.
+       * mdebugread.c (psymtab_to_symtab_1): Ditto.
+       * symfile.c (allocate_symtab): Only print debugging messages for
+       symtab_create_debug levels 2 and higher.
+       * symtab.c (symtab_create_debug): Change type to unsigned int.
+       (set_symtab_primary): New function.
+       (_initialize_symtab): Change "set debug symtab-create" to a
+       zuinteger option.
+       * symtab.h (set_symtab_primary): Declare.
+       (symtab_create_debug): Update decl.
+
 2013-11-08  Tom Tromey  <tromey@redhat.com>
 
        * aix-thread.c (aix_thread_detach): Update.
index 779cf30f47c4d813d3ae447068e87098208810d3..fff16e0847f7862918d87a9495e576fe1d1052b8 100644 (file)
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -116,6 +116,10 @@ show startup-with-shell
   trace-buffer-size -1" and "set height unlimited" is now an alias for
   "set height 0".
 
+* The "set debug symtab-create" debugging option of GDB has been changed to
+  accept a verbosity level.  0 means "off", 1 provides basic debugging
+  output, and values of 2 or greater provides more verbose output.
+
 * New command-line options
 --configuration
   Display the details of GDB configure-time options.
index cee0cc54c880a96eebf07198322c720e8c628da5..68a667a92563b91e18670e73b24816e16bf842d9 100644 (file)
@@ -1231,8 +1231,7 @@ end_symtab_from_static_block (struct block *static_block,
          /* All symtabs for the main file and the subfiles share a
             blockvector, so we need to clear primary for everything
             but the main file.  */
-
-         symtab->primary = 0;
+         set_symtab_primary (symtab, 0);
        }
       else
         {
@@ -1280,7 +1279,7 @@ end_symtab_from_static_block (struct block *static_block,
   /* Set this for the main source file.  */
   if (symtab)
     {
-      symtab->primary = 1;
+      set_symtab_primary (symtab, 1);
 
       if (symtab->blockvector)
        {
index 3894647d2622aee5fbcf19f695749766f453279b..8b1fee456d3d2e64444085ba186c80cf049bed4b 100644 (file)
@@ -1,3 +1,8 @@
+2013-11-08  Doug Evans  <dje@google.com>
+
+       * gdb.texinfo (Debugging Output): Update text for
+       "set debug symtab-create".
+
 2013-11-07  Phil Muldoon  <pmuldoon@redhat.com>
 
         * gdb.texinfo (Commands In Python): Document COMPLETE_EXPRESSION
index 6a1ed8d628b2f5c9360ba044b4e255a3897f5996..5059243a330f4214e91936bb0d38c61143aad367 100644 (file)
@@ -22731,7 +22731,9 @@ Show the current state of symbol file debugging messages.
 @item set debug symtab-create
 @cindex symbol table creation
 Turns on or off display of debugging messages related to symbol table creation.
-The default is off.
+The default is 0 (off).
+A value of 1 provides basic information.
+A value greater than 1 provides more verbose information.
 @item show debug symtab-create
 Show the current state of symbol table creation debugging.
 @item set debug target
index ba0be5e440e80e00c4bcc09052c0c50393d77dfe..3daa9faa0fc4fbe7e706d2664deecd2f79e05235 100644 (file)
--- a/gdb/jit.c
+++ b/gdb/jit.c
@@ -665,7 +665,7 @@ finalize_symtab (struct gdb_symtab *stab, struct objfile *objfile)
 
   /* (begin, end) will contain the PC range this entire blockvector
      spans.  */
-  symtab->primary = 1;
+  set_symtab_primary (symtab, 1);
   BLOCKVECTOR_MAP (symtab->blockvector) = NULL;
   begin = stab->blocks->begin;
   end = stab->blocks->end;
index 5549610b1715fe4d50fc543651b2032c9e092e4d..0e6109af3cfd5066ee36bc76a254b5d60b2d28f4 100644 (file)
@@ -4334,7 +4334,7 @@ psymtab_to_symtab_1 (struct objfile *objfile,
        }
       pop_parse_stack ();
 
-      st->primary = 1;
+      set_symtab_primary (st, 1);
 
       sort_blocks (st);
     }
index e0a234cd97c6a74cf4e5419753c19914212f360a..13071897a6f4505b5f7c2aec14f88d05311cb038 100644 (file)
@@ -2891,7 +2891,9 @@ allocate_symtab (const char *filename, struct objfile *objfile)
   symtab->next = objfile->symtabs;
   objfile->symtabs = symtab;
 
-  if (symtab_create_debug)
+  /* This can be very verbose with lots of headers.
+     Only print at higher debug levels.  */
+  if (symtab_create_debug >= 2)
     {
       /* Be a bit clever with debugging messages, and don't print objfile
         every time, only when it changes.  */
index 3660f1ab6c8322a9039cb43bb8cb64d824a3efce..8eb4eb4251fc57a0621d95c475af0c7193a928c2 100644 (file)
@@ -106,7 +106,7 @@ void _initialize_symtab (void);
 /* */
 
 /* When non-zero, print debugging messages related to symtab creation.  */
-int symtab_create_debug = 0;
+unsigned int symtab_create_debug = 0;
 
 /* Non-zero if a file may be known by two different basenames.
    This is the uncommon case, and significantly slows down gdb.
@@ -174,6 +174,22 @@ search_domain_name (enum search_domain e)
     }
 }
 
+/* Set the primary field in SYMTAB.  */
+
+void
+set_symtab_primary (struct symtab *symtab, int primary)
+{
+  symtab->primary = primary;
+
+  if (symtab_create_debug && primary)
+    {
+      fprintf_unfiltered (gdb_stdlog,
+                         "Created primary symtab %s for %s.\n",
+                         host_address_to_string (symtab),
+                         symtab_to_filename_for_display (symtab));
+    }
+}
+
 /* See whether FILENAME matches SEARCH_NAME using the rule that we
    advertise to the user.  (The manual's description of linespecs
    describes what we advertise).  Returns true if they match, false
@@ -5273,13 +5289,15 @@ one base name, and gdb will do file name comparisons more efficiently."),
                           NULL, NULL,
                           &setlist, &showlist);
 
-  add_setshow_boolean_cmd ("symtab-create", no_class, &symtab_create_debug,
-                          _("Set debugging of symbol table creation."),
-                          _("Show debugging of symbol table creation."), _("\
-When enabled, debugging messages are printed when building symbol tables."),
-                           NULL,
-                           NULL,
-                           &setdebuglist, &showdebuglist);
+  add_setshow_zuinteger_cmd ("symtab-create", no_class, &symtab_create_debug,
+                            _("Set debugging of symbol table creation."),
+                            _("Show debugging of symbol table creation."), _("\
+When enabled (non-zero), debugging messages are printed when building\n\
+symbol tables.  A value of 1 (one) normally provides enough information.\n\
+A value greater than 1 provides more verbose information."),
+                            NULL,
+                            NULL,
+                            &setdebuglist, &showdebuglist);
 
   observer_attach_executable_changed (symtab_observer_executable_changed);
 }
index 3d3c05caf30ecd506632e62f9e6ebfcf16602c6d..7cc66673e755975bcae9011c0dba9360cf64e747 100644 (file)
@@ -941,6 +941,9 @@ struct symtab
 #define LINETABLE(symtab)      (symtab)->linetable
 #define SYMTAB_PSPACE(symtab)  (symtab)->objfile->pspace
 
+/* Call this to set the "primary" field in struct symtab.  */
+extern void set_symtab_primary (struct symtab *, int primary);
+
 typedef struct symtab *symtab_ptr;
 DEF_VEC_P (symtab_ptr);
 
@@ -1335,7 +1338,7 @@ void fixup_section (struct general_symbol_info *ginfo,
 
 struct objfile *lookup_objfile_from_block (const struct block *block);
 
-extern int symtab_create_debug;
+extern unsigned int symtab_create_debug;
 
 extern int basenames_may_differ;
 
This page took 0.07107 seconds and 4 git commands to generate.