summaryrefslogtreecommitdiff
path: root/gdb/psymtab.c
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2012-06-26 20:14:01 +0000
committerDoug Evans <dje@google.com>2012-06-26 20:14:01 +0000
commit28bc675483dc702ff5bc2ccc9931d9db1f0e8b09 (patch)
treeaea46ac26a46e16884c988094ffbd541c35eae42 /gdb/psymtab.c
parent5b71ff8e2a48fbf09c364cb747285a772bd33335 (diff)
downloadgdb-28bc675483dc702ff5bc2ccc9931d9db1f0e8b09.tar.gz
* NEWS: Mention new options "set debug dwarf2-read" and
"set debug symtab-create". * dwarf2read.c (dwarf2_read_debug): New static global. (dwarf2_build_psymtabs_hard): Add debugging printfs. (process_queue): Ditto. (process_full_comp_unit): Ditto. (_initialize_dwarf2_read): Add new option "set debug dwarf2-read". * elfread.c (elf_symfile_read): Add debugging printf. * minsyms.c (install_minimal_symbols): Ditto. * psymtab.c (allocate_psymtab): Ditto. * symfile.c (allocate_symtab): Ditto. * symtab.c (symtab_create_debug): New global. (_initialize_symtab): Add new option "set debug symtab-create". * symtab.h (symtab_create_debug): Declare. doc/ * gdb.texinfo (Debugging Output): Document debug options dwarf2-read and symtab-create.
Diffstat (limited to 'gdb/psymtab.c')
-rw-r--r--gdb/psymtab.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gdb/psymtab.c b/gdb/psymtab.c
index 647368c800d..c92cab86369 100644
--- a/gdb/psymtab.c
+++ b/gdb/psymtab.c
@@ -1731,6 +1731,26 @@ allocate_psymtab (const char *filename, struct objfile *objfile)
psymtab->next = objfile->psymtabs;
objfile->psymtabs = psymtab;
+ if (symtab_create_debug)
+ {
+ /* Be a bit clever with debugging messages, and don't print objfile
+ every time, only when it changes. */
+ static char *last_objfile_name = NULL;
+
+ if (last_objfile_name == NULL
+ || strcmp (last_objfile_name, objfile->name) != 0)
+ {
+ xfree (last_objfile_name);
+ last_objfile_name = xstrdup (objfile->name);
+ fprintf_unfiltered (gdb_stdlog,
+ "Creating one or more psymtabs for objfile %s ...\n",
+ last_objfile_name);
+ }
+ fprintf_unfiltered (gdb_stdlog,
+ "Created psymtab 0x%lx for module %s.\n",
+ (long) psymtab, filename);
+ }
+
return (psymtab);
}