"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.
2012-06-26 Doug Evans <dje@google.com>
+ * 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.
+
* dwarf2read.c (lookup_dwo_comp_unit): Enhance comment.
(lookup_dwo_type_unit): Ditto.
* New options
+set debug dwarf2-read
+show debug dwarf2-read
+ Turns on or off display of debugging messages related to reading
+ DWARF debug info. The default is off.
+
+set debug symtab-create
+show debug symtab-create
+ Turns on or off display of debugging messages related to symbol table
+ creation. The default is off.
+
set extended-prompt
show extended-prompt
Set the GDB prompt, and allow escape sequences to be inserted to
+2012-06-26 Doug Evans <dje@google.com>
+
+ * gdb.texinfo (Debugging Output): Document debug options dwarf2-read
+ and symtab-create.
+
2012-06-25 Keith Seitz <keiths@redhat.com>
* gdb.texinfo (GDB/MI Breakpoint Commands): Remove "-r" option
A value of zero turns off the display.
@item show debug dwarf2-die
Show the current state of DWARF2 DIE debugging.
+@item set debug dwarf2-read
+@cindex DWARF2 Reading
+Turns on or off display of debugging messages related to reading
+DWARF debug info. The default is off.
+@item show debug dwarf2-read
+Show the current state of DWARF2 reader debugging.
@item set debug displaced
@cindex displaced stepping debugging info
Turns on or off display of @value{GDBN} debugging info for the
@item show debug solib-frv
Display the current state of FR-V shared-library code 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.
+@item show debug symtab-create
+Show the current state of symbol table creation debugging.
@item set debug target
@cindex target debugging info
Turns on or off display of @value{GDBN} target debugging info. This info
typedef struct symbol *symbolp;
DEF_VEC_P (symbolp);
+/* When non-zero, print basic high level tracing messages.
+ This is in contrast to the low level DIE reading of dwarf2_die_debug. */
+static int dwarf2_read_debug = 0;
+
/* When non-zero, dump DIEs after they are read in. */
static int dwarf2_die_debug = 0;
struct obstack temp_obstack;
int i;
+ if (dwarf2_read_debug)
+ {
+ fprintf_unfiltered (gdb_stdlog, "Building psymtabs of objfile %s ...\n",
+ objfile->name);
+ }
+
dwarf2_per_objfile->reading_partial_symbols = 1;
dwarf2_read_section (objfile, &dwarf2_per_objfile->info);
discard_cleanups (addrmap_cleanup);
do_cleanups (back_to);
+
+ if (dwarf2_read_debug)
+ fprintf_unfiltered (gdb_stdlog, "Done building psymtabs of %s\n",
+ objfile->name);
}
/* die_reader_func for load_partial_comp_unit. */
{
struct dwarf2_queue_item *item, *next_item;
+ if (dwarf2_read_debug)
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "Expanding one or more symtabs of objfile %s ...\n",
+ dwarf2_per_objfile->objfile->name);
+ }
+
/* The queue starts out with one item, but following a DIE reference
may load a new CU, adding it to the end of the queue. */
for (item = dwarf2_queue; item != NULL; dwarf2_queue = item = next_item)
}
dwarf2_queue_tail = NULL;
+
+ if (dwarf2_read_debug)
+ {
+ fprintf_unfiltered (gdb_stdlog, "Done expanding symtabs of %s.\n",
+ dwarf2_per_objfile->objfile->name);
+ }
}
/* Free all allocated queue entries. This function only releases anything if
struct cleanup *back_to, *delayed_list_cleanup;
CORE_ADDR baseaddr;
+ if (dwarf2_read_debug)
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "Expanding symtab of %s at offset 0x%x\n",
+ per_cu->is_debug_types ? "TU" : "CU",
+ per_cu->offset.sect_off);
+ }
+
baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
buildsym_init ();
VEC_safe_push (dwarf2_per_cu_ptr, dwarf2_per_objfile->just_read_cus, per_cu);
do_cleanups (back_to);
+
+ if (dwarf2_read_debug)
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "Done expanding symtab of %s at offset 0x%x\n",
+ per_cu->is_debug_types ? "TU" : "CU",
+ per_cu->offset.sect_off);
+ }
}
/* Process an imported unit DIE. */
&set_dwarf2_cmdlist,
&show_dwarf2_cmdlist);
+ add_setshow_boolean_cmd ("dwarf2-read", no_class, &dwarf2_read_debug, _("\
+Set debugging of the dwarf2 reader."), _("\
+Show debugging of the dwarf2 reader."), _("\
+When enabled, debugging messages are printed during dwarf2 reading\n\
+and symtab expansion."),
+ NULL,
+ NULL,
+ &setdebuglist, &showdebuglist);
+
add_setshow_zinteger_cmd ("dwarf2-die", no_class, &dwarf2_die_debug, _("\
Set debugging of the dwarf2 DIE reader."), _("\
Show debugging of the dwarf2 DIE reader."), _("\
asymbol **symbol_table = NULL, **dyn_symbol_table = NULL;
asymbol *synthsyms;
+ if (symtab_create_debug)
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "Reading minimal symbols of objfile %s ...\n",
+ objfile->name);
+ }
+
init_minimal_symbol_collection ();
back_to = make_cleanup_discard_minimal_symbols ();
xfree (debugfile);
}
}
+
+ if (symtab_create_debug)
+ fprintf_unfiltered (gdb_stdlog, "Done reading minimal symbols.\n");
}
/* Callback to lazily read psymtabs. */
if (msym_count > 0)
{
+ if (symtab_create_debug)
+ {
+ fprintf_unfiltered (gdb_stdlog,
+ "Installing %d minimal symbols of objfile %s.\n",
+ msym_count, objfile->name);
+ }
+
/* Allocate enough space in the obstack, into which we will gather the
bunches of new and existing minimal symbols, sort them, and then
compact out the duplicate entries. Once we have a final table,
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);
}
symtab->next = objfile->symtabs;
objfile->symtabs = symtab;
+ 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 symtabs for objfile %s ...\n",
+ last_objfile_name);
+ }
+ fprintf_unfiltered (gdb_stdlog,
+ "Created symtab 0x%lx for module %s.\n",
+ (long) symtab, filename);
+ }
+
return (symtab);
}
\f
/* */
+/* When non-zero, print debugging messages related to symtab creation. */
+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.
Default set to "off" to not slow down the common case. */
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);
+
observer_attach_executable_changed (symtab_observer_executable_changed);
}
struct objfile *lookup_objfile_from_block (const struct block *block);
+extern int symtab_create_debug;
+
extern int basenames_may_differ;
int compare_filenames_for_search (const char *filename,