Change "set debug symtab-create" to take a verbosity level.

* 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".
This commit is contained in:
Doug Evans 2013-11-08 10:43:23 -08:00
parent e78e02e6d9
commit db0fec5c48
10 changed files with 66 additions and 16 deletions

View 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);
}