aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2013-11-08 11:47:08 -0800
committerDoug Evans <dje@google.com>2013-11-08 11:47:08 -0800
commit73be47f57c32f50d4695a4b672af9263b5313cbb (patch)
treeb95aa378f812a15af3ea3654468506ee9d3e9240
parent1bd2f0baf15dfb05a884228cee1f9964768e1a27 (diff)
downloadgdb-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".
-rw-r--r--gdb/ChangeLog9
-rw-r--r--gdb/doc/ChangeLog5
-rw-r--r--gdb/doc/gdb.texinfo4
-rw-r--r--gdb/dwarf2read.c30
4 files changed, 37 insertions, 11 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 22de9aa..79abe3d 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,12 @@
+2013-11-08 Doug Evans <dje@google.com>
+
+ * 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.
+
2013-11-08 Tom Tromey <tromey@redhat.com>
* configure: Rebuild.
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index 8b1fee4..2de1dc9 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,6 +1,11 @@
2013-11-08 Doug Evans <dje@google.com>
* gdb.texinfo (Debugging Output): Update text for
+ "set debug dwarf2-read".
+
+2013-11-08 Doug Evans <dje@google.com>
+
+ * gdb.texinfo (Debugging Output): Update text for
"set debug symtab-create".
2013-11-07 Phil Muldoon <pmuldoon@redhat.com>
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 5059243..16671cb 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -22609,7 +22609,9 @@ 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.
+DWARF debug info. The default is 0 (off).
+A value of 1 provides basic information.
+A value greater than 1 provides more verbose information.
@item show debug dwarf2-read
Show the current state of DWARF2 reader debugging.
@item set debug displaced
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);