This is the mail archive of the gdb-patches@sources.redhat.com 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]

Re: Dwarf2 Producer info


Fine by me -- in fact, even the null setting isn't needed now I've found
the bit that ensures the cu is cleared during allocation (do you
agree?).

So here goes:

2004-07-20  David Lecomber  <dsl@sources.redhat.com>

	* dwarf2read.c (read_file_scope): Set producer if attribute 
	present.


Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.156
diff -p -r1.156 dwarf2read.c
*** dwarf2read.c	6 Jul 2004 19:29:30 -0000	1.156
--- dwarf2read.c	21 Jul 2004 07:07:03 -0000
*************** struct dwarf2_cu
*** 262,267 ****
--- 262,269 ----
    enum language language;
    const struct language_defn *language_defn;
  
+   const char* producer;
+ 
    /* The generic symbol table building routines have separate lists
for
       file scope symbols and all all other scopes (local scopes).  So
       we need to select the right one to pass to add_symbol_to_list().
*************** read_file_scope (struct die_info *die, s
*** 2362,2367 ****
--- 2364,2373 ----
        set_cu_language (DW_UNSND (attr), cu);
      }
  
+   attr = dwarf2_attr (die, DW_AT_producer, cu);
+   if (attr) 
+     cu->producer = DW_STRING (attr);
+   
    /* We assume that we're processing GCC output. */
    processing_gcc_compilation = 2;
  #if 0

On Wed, 2004-07-21 at 01:08, Daniel Jacobowitz wrote:
> On Wed, Jul 21, 2004 at 12:56:07AM +0100, David Lecomber wrote:
> > 
> > > Is set_cu_producer going to do anything else?  Otherwise I don't see
> > > the point of the wrapper function.
> > 
> > Hi Dan,
> > 
> > Not in the immediately foreseeable future, but I can imagine a situation
> > where the producer is matched with some known producer strings and an
> > enumerated constant is stored instead; if that ever happens, it will be
> > better if there's one setter.
> 
> There will still be only one setter; let's drop the useless wrapper,
> unless one of the dwarf2 maintainers feels otherwise.


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