This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[commit] dwarf2read.c (dwarf2_cu): Add comment.
- From: dje at google dot com (Doug Evans)
- To: gdb-patches at sourceware dot org
- Date: Thu, 7 Jun 2012 10:31:56 -0700 (PDT)
- Subject: [commit] dwarf2read.c (dwarf2_cu): Add comment.
Hi.
In order to help keep things clear in my head, I've added this comment.
2012-06-07 Doug Evans <dje@google.com>
* dwarf2read.c (dwarf2_cu): Add comment.
Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.658
diff -u -p -r1.658 dwarf2read.c
--- dwarf2read.c 4 Jun 2012 02:57:28 -0000 1.658
+++ dwarf2read.c 7 Jun 2012 17:28:57 -0000
@@ -412,7 +412,15 @@ struct dwarf2_cu
/* To be copied to symtab->call_site_htab. */
htab_t call_site_htab;
- /* Non-NULL if this CU came from a DWO file. */
+ /* Non-NULL if this CU came from a DWO file.
+ There is an invariant here that is important to remember:
+ Except for attributes copied from the top level DIE in the "main"
+ (or "stub") file in preparation for reading the DWO file
+ (e.g., DW_AT_GNU_addr_base), we KISS: there is only *one* CU.
+ Either there isn't a DWO file (in which case this is NULL and the point
+ is moot), or there is and either we're not going to read it (in which
+ case this is NULL) or there is and we are reading it (in which case this
+ is non-NULL). */
struct dwo_unit *dwo_unit;
/* The DW_AT_addr_base attribute if present, zero otherwise