Change "set debug symtab-create" to take a verbosity level.
[binutils-gdb.git] / gdb / symtab.c
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);
 }