diff options
author | Doug Evans <dje@google.com> | 2013-11-08 11:47:08 -0800 |
---|---|---|
committer | Doug Evans <dje@google.com> | 2013-11-08 11:47:08 -0800 |
commit | 73be47f57c32f50d4695a4b672af9263b5313cbb (patch) | |
tree | b95aa378f812a15af3ea3654468506ee9d3e9240 /gdb/dwarf2read.c | |
parent | 1bd2f0baf15dfb05a884228cee1f9964768e1a27 (diff) | |
download | gdb-73be47f57c32f50d4695a4b672af9263b5313cbb.zip gdb-73be47f57c32f50d4695a4b672af9263b5313cbb.tar.gz gdb-73be47f57c32f50d4695a4b672af9263b5313cbb.tar.bz2 |
Change "set debug dwarf2-read" to take a verbosity level.
* dwarf2read.c (dwarf2_read_debug): Change to unsigned int.
(create_debug_types_hash_table): Only print debugging messages for
each TU if dwarf2-read >= 2.
(process_queue): Ditto.
(_initialize_dwarf2_read): Make "set debug dwarf2-read" a zuinteger.
Update doc string.
doc/
* gdb.texinfo (Debugging Output): Update text for
"set debug dwarf2-read".
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r-- | gdb/dwarf2read.c | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index bc8e8ca..7e87ed9 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -79,9 +79,10 @@ typedef struct symbol *symbolp; DEF_VEC_P (symbolp); -/* When non-zero, print basic high level tracing messages. +/* When == 1, print basic high level tracing messages. + When > 1, be more verbose. This is in contrast to the low level DIE reading of dwarf2_die_debug. */ -static int dwarf2_read_debug = 0; +static unsigned int dwarf2_read_debug = 0; /* When non-zero, dump DIEs after they are read in. */ static unsigned int dwarf2_die_debug = 0; @@ -4606,7 +4607,7 @@ create_debug_types_hash_table (struct dwo_file *dwo_file, } *slot = dwo_file ? (void *) dwo_tu : (void *) sig_type; - if (dwarf2_read_debug) + if (dwarf2_read_debug > 1) fprintf_unfiltered (gdb_stdlog, " offset 0x%x, signature %s\n", offset.sect_off, hex_string (signature)); @@ -7285,6 +7286,7 @@ process_queue (void) : (item->per_cu->v.psymtab && !item->per_cu->v.psymtab->readin)) { struct dwarf2_per_cu_data *per_cu = item->per_cu; + unsigned int debug_print_threshold; char buf[100]; if (per_cu->is_debug_types) @@ -7293,12 +7295,19 @@ process_queue (void) (struct signatured_type *) per_cu; sprintf (buf, "TU %s at offset 0x%x", - hex_string (sig_type->signature), per_cu->offset.sect_off); + hex_string (sig_type->signature), + per_cu->offset.sect_off); + /* There can be 100s of TUs. + Only print them in verbose mode. */ + debug_print_threshold = 2; } else - sprintf (buf, "CU at offset 0x%x", per_cu->offset.sect_off); + { + sprintf (buf, "CU at offset 0x%x", per_cu->offset.sect_off); + debug_print_threshold = 1; + } - if (dwarf2_read_debug) + if (dwarf2_read_debug >= debug_print_threshold) fprintf_unfiltered (gdb_stdlog, "Expanding symtab of %s\n", buf); if (per_cu->is_debug_types) @@ -7306,7 +7315,7 @@ process_queue (void) else process_full_comp_unit (per_cu, item->pretend_language); - if (dwarf2_read_debug) + if (dwarf2_read_debug >= debug_print_threshold) fprintf_unfiltered (gdb_stdlog, "Done expanding %s\n", buf); } @@ -22382,11 +22391,12 @@ conversational style, when possible."), &set_dwarf2_cmdlist, &show_dwarf2_cmdlist); - add_setshow_boolean_cmd ("dwarf2-read", no_class, &dwarf2_read_debug, _("\ + add_setshow_zuinteger_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."), +When enabled (non-zero), debugging messages are printed during dwarf2\n\ +reading and symtab expansion. A value of 1 (one) provides basic\n\ +information. A value greater than 1 provides more verbose information."), NULL, NULL, &setdebuglist, &showdebuglist); |