Change "set debug dwarf2-read" to take a verbosity level.
authorDoug Evans <dje@google.com>
Fri, 8 Nov 2013 19:47:08 +0000 (11:47 -0800)
committerDoug Evans <dje@google.com>
Fri, 8 Nov 2013 19:47:08 +0000 (11:47 -0800)
* 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".

gdb/ChangeLog
gdb/doc/ChangeLog
gdb/doc/gdb.texinfo
gdb/dwarf2read.c

index 22de9aaf5d862e5d2b8e6321c145d9a782e25036..79abe3ddc5897953ae322c1eee1a574ccf3b3d7d 100644 (file)
@@ -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.
index 8b1fee456d3d2e64444085ba186c80cf049bed4b..2de1dc9496c17782d8099856b43bf4a82825b59f 100644 (file)
@@ -1,3 +1,8 @@
+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
index 5059243a330f4214e91936bb0d38c61143aad367..16671cbf2d8669e0768ce3aec6125c9727522f94 100644 (file)
@@ -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
index bc8e8ca6966c5173bcd043219147986804565730..7e87ed9adde38402d707ac2bd7c3757ba87847a6 100644 (file)
 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);