diff options
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 15 | ||||
-rw-r--r-- | gdb/NEWS | 10 | ||||
-rw-r--r-- | gdb/doc/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/doc/gdb.texinfo | 12 | ||||
-rw-r--r-- | gdb/dwarf2read.c | 52 | ||||
-rw-r--r-- | gdb/elfread.c | 10 | ||||
-rw-r--r-- | gdb/minsyms.c | 7 | ||||
-rw-r--r-- | gdb/psymtab.c | 20 | ||||
-rw-r--r-- | gdb/symfile.c | 20 | ||||
-rw-r--r-- | gdb/symtab.c | 11 | ||||
-rw-r--r-- | gdb/symtab.h | 2 |
11 files changed, 164 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2c4a8a4..61efcbf 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,20 @@ 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. @@ -468,6 +468,16 @@ tstop [NOTES] * 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 diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 267a2df..b0efb1d 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,8 @@ +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 diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index d3f702a..3282b46 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -21741,6 +21741,12 @@ The value is the number of nesting levels to print. 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 @@ -21838,6 +21844,12 @@ Turns on or off debugging messages for FR-V shared-library code. @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 diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 0919a71..8af954c 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -82,6 +82,10 @@ 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; @@ -4450,6 +4454,12 @@ dwarf2_build_psymtabs_hard (struct objfile *objfile) 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); @@ -4483,6 +4493,10 @@ dwarf2_build_psymtabs_hard (struct objfile *objfile) 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. */ @@ -5387,6 +5401,13 @@ process_queue (void) { 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) @@ -5402,6 +5423,12 @@ process_queue (void) } 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 @@ -5791,6 +5818,14 @@ process_full_comp_unit (struct dwarf2_per_cu_data *per_cu, 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 (); @@ -5866,6 +5901,14 @@ process_full_comp_unit (struct dwarf2_per_cu_data *per_cu, 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. */ @@ -18278,6 +18321,15 @@ conversational style, when possible."), &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."), _("\ diff --git a/gdb/elfread.c b/gdb/elfread.c index 679d081..1edfb27 100644 --- a/gdb/elfread.c +++ b/gdb/elfread.c @@ -1251,6 +1251,13 @@ elf_symfile_read (struct objfile *objfile, int symfile_flags) 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 (); @@ -1443,6 +1450,9 @@ elf_symfile_read (struct objfile *objfile, int symfile_flags) xfree (debugfile); } } + + if (symtab_create_debug) + fprintf_unfiltered (gdb_stdlog, "Done reading minimal symbols.\n"); } /* Callback to lazily read psymtabs. */ diff --git a/gdb/minsyms.c b/gdb/minsyms.c index d762b2d..1070fff 100644 --- a/gdb/minsyms.c +++ b/gdb/minsyms.c @@ -1167,6 +1167,13 @@ install_minimal_symbols (struct objfile *objfile) 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, diff --git a/gdb/psymtab.c b/gdb/psymtab.c index 647368c..c92cab8 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); } diff --git a/gdb/symfile.c b/gdb/symfile.c index 37d98d9..01252e2 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -2873,6 +2873,26 @@ allocate_symtab (const char *filename, struct objfile *objfile) 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); } diff --git a/gdb/symtab.c b/gdb/symtab.c index 215c53d..ee37f30 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -109,6 +109,9 @@ void _initialize_symtab (void); /* */ +/* 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. */ @@ -5014,5 +5017,13 @@ 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); + observer_attach_executable_changed (symtab_observer_executable_changed); } diff --git a/gdb/symtab.h b/gdb/symtab.h index 8ee187e..57f618d 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -1250,6 +1250,8 @@ void fixup_section (struct general_symbol_info *ginfo, 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, |