This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit] dwarf2read.c debugging printf tweaks


Hi.

fyi, I committed this.
It's just a bit of maintenance on the debugging printfs in dwarf2read.c
and adding a few more that have been useful to me.

2012-07-02  Doug Evans  <dje@google.com>

	* dwarf2read.c (create_debug_types_hash_table): Use "debug dwarf2-read"
	instead of "debug dwarf2-die" in debugging printfs.
	(create_debug_info_hash_table_reader): Ditto.
	(create_debug_info_hash_table): Ditto.
	(init_dwo_file): Ditto.
	(init_cutu_and_read_dies): Add debugging printf.
	(init_cutu_and_read_dies_no_follow): Ditto.
	(process_psymtab_comp_unit_reader): Ditto.

Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.677
diff -u -p -r1.677 dwarf2read.c
--- dwarf2read.c	1 Jul 2012 02:05:12 -0000	1.677
+++ dwarf2read.c	2 Jul 2012 18:05:38 -0000
@@ -3667,6 +3667,11 @@ create_debug_types_hash_table (struct dw
 		    ? &dwo_file->sections.abbrev
 		    : &dwarf2_per_objfile->abbrev);
 
+  if (dwarf2_read_debug)
+    fprintf_unfiltered (gdb_stdlog, "Reading .debug_types%s for %s:\n",
+			dwo_file ? ".dwo" : "",
+			bfd_get_filename (abbrev_section->asection->owner));
+
   for (ix = 0;
        VEC_iterate (dwarf2_section_info_def, types, ix, section);
        ++ix)
@@ -3692,10 +3697,6 @@ create_debug_types_hash_table (struct dw
 	    types_htab = allocate_signatured_type_table (objfile);
 	}
 
-      if (dwarf2_die_debug)
-	fprintf_unfiltered (gdb_stdlog, "Reading signatured types for %s:\n",
-			    bfd_get_filename (abfd));
-
       /* We don't use init_cutu_and_read_dies_simple, or some such, here
 	 because we don't need to read any dies: the signature is in the
 	 header.  */
@@ -3789,7 +3790,7 @@ create_debug_types_hash_table (struct dw
 	    }
 	  *slot = dwo_file ? (void *) dwo_tu : (void *) sig_type;
 
-	  if (dwarf2_die_debug)
+	  if (dwarf2_read_debug)
 	    fprintf_unfiltered (gdb_stdlog, "  offset 0x%x, signature 0x%s\n",
 				offset.sect_off,
 				phex (signature, sizeof (signature)));
@@ -3908,6 +3909,11 @@ init_cutu_and_read_dies (struct dwarf2_p
      before we can reread the DWO file.  */
   int rereading_dwo_cu = 0;
 
+  if (dwarf2_die_debug)
+    fprintf_unfiltered (gdb_stdlog, "Reading %s unit at offset 0x%x\n",
+			this_cu->is_debug_types ? "type" : "comp",
+			this_cu->offset.sect_off);
+
   if (use_existing_cu)
     gdb_assert (keep);
 
@@ -4229,6 +4235,11 @@ init_cutu_and_read_dies_no_follow (struc
   struct die_info *comp_unit_die;
   int has_children;
 
+  if (dwarf2_die_debug)
+    fprintf_unfiltered (gdb_stdlog, "Reading %s unit at offset 0x%x\n",
+			this_cu->is_debug_types ? "type" : "comp",
+			this_cu->offset.sect_off);
+
   gdb_assert (this_cu->cu == NULL);
 
   /* This is cheap if the section is already read in.  */
@@ -4422,6 +4433,20 @@ process_psymtab_comp_unit_reader (const 
 	 and build a psymtab for each of them.  */
       dwarf2_build_include_psymtabs (cu, comp_unit_die, pst);
     }
+
+  if (dwarf2_read_debug)
+    {
+      struct gdbarch *gdbarch = get_objfile_arch (objfile);
+
+      fprintf_unfiltered (gdb_stdlog,
+			  "Psymtab for %s unit @0x%x: 0x%s - 0x%s"
+			  ", %d global, %d static syms\n",
+			  per_cu->is_debug_types ? "type" : "comp",
+			  per_cu->offset.sect_off,
+			  paddress (gdbarch, pst->textlow),
+			  paddress (gdbarch, pst->texthigh),
+			  pst->n_global_syms, pst->n_static_syms);
+    }
 }
 
 /* Subroutine of dwarf2_build_psymtabs_hard to simplify it.
@@ -7137,7 +7162,7 @@ create_debug_info_hash_table_reader (con
   else
     *slot = dwo_unit;
 
-  if (dwarf2_die_debug)
+  if (dwarf2_read_debug)
     fprintf_unfiltered (gdb_stdlog, "  offset 0x%x, dwo_id 0x%s\n",
 			offset.sect_off,
 			phex (dwo_unit->signature,
@@ -7166,7 +7191,7 @@ create_debug_info_hash_table (struct dwo
      not present, in which case section->asection will be NULL.  */
   abfd = section->asection->owner;
 
-  if (dwarf2_die_debug)
+  if (dwarf2_read_debug)
     fprintf_unfiltered (gdb_stdlog, "Reading .debug_info.dwo for %s:\n",
 			bfd_get_filename (abfd));
 
@@ -7287,7 +7312,7 @@ init_dwo_file (const char *dwo_name, con
   bfd *abfd;
   struct cleanup *cleanups;
 
-  if (dwarf2_die_debug)
+  if (dwarf2_read_debug)
     fprintf_unfiltered (gdb_stdlog, "Reading DWO file %s:\n", dwo_name);
 
   abfd = open_dwo_file (dwo_name, comp_dir);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]