diff options
author | Doug Evans <dje@google.com> | 2013-11-08 10:43:23 -0800 |
---|---|---|
committer | Doug Evans <dje@google.com> | 2013-11-08 10:49:44 -0800 |
commit | db0fec5c4881dc2e65eeba47cd574379c03a4cf4 (patch) | |
tree | 1fb58d55d854ef64f7e9c1587d4215c0859ba5d7 /gdb/symtab.c | |
parent | e78e02e6d91ee2ec3c3d1c560366089dfbafab2c (diff) | |
download | gdb-db0fec5c4881dc2e65eeba47cd574379c03a4cf4.zip gdb-db0fec5c4881dc2e65eeba47cd574379c03a4cf4.tar.gz gdb-db0fec5c4881dc2e65eeba47cd574379c03a4cf4.tar.bz2 |
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".
Diffstat (limited to 'gdb/symtab.c')
-rw-r--r-- | gdb/symtab.c | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c index 3660f1a..8eb4eb4 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -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); } |