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: RFA: Don't use obsavestring in dwarf2read


Daniel Jacobowitz writes:
 >  
 > +/* A note on memory usage: at the present time, this code reads the debug
 > +   info sections into the objfile's objfile_obstack.  A definite improvement
 > +   for startup time, on platforms which do not emit relocations for debug
 > +   sections, would be to use mmap instead.
 > +
 > +   In either case, the sections should remain loaded until the objfile is
 > +   released, and pointers into the section data can be used for any other
 > +   data associated to the objfile (symbol names, type names, location expressions
 > +   to name a few).  */
 > +


There is a similar comment right before the dwarf2_pinfo structure,
can you somehow either unify the two or 'link' them together? Both peices
of information should be available together.  Actually having this
comment just before an ifdeffed out section of code, makes me wonder
if it won't be overlooked.

 >  #if 0
 >  /* .debug_info header for a compilation unit
 >     Because of alignment constraints, this structure has padding and cannot



 > @@ -2665,8 +2675,7 @@ dwarf2_add_field (struct field_info *fip
 >        attr = dwarf2_attr (die, DW_AT_name, cu);
 >        if (attr && DW_STRING (attr))
 >  	fieldname = DW_STRING (attr);
 > -      fp->name = obsavestring (fieldname, strlen (fieldname),
 > -			       &objfile->objfile_obstack);
 > +      fp->name = fieldname;
 >  

Can you please add a clear comment above the assignment about filename being on the obstack?

 >        /* Change accessibility for artificial fields (e.g. virtual table
 >           pointer or virtual base class pointer) to private.  */
 > @@ -2697,11 +2706,9 @@ dwarf2_add_field (struct field_info *fip
 >        /* Get physical name.  */
 >        physname = dwarf2_linkage_name (die, cu);
 >  
 > -      SET_FIELD_PHYSNAME (*fp, obsavestring (physname, strlen (physname),
 > -					     &objfile->objfile_obstack));
 > +      SET_FIELD_PHYSNAME (*fp, physname ? physname : "");


same here

 >        FIELD_TYPE (*fp) = die_type (die, cu);
 > -      FIELD_NAME (*fp) = obsavestring (fieldname, strlen (fieldname),
 > -				       &objfile->objfile_obstack);
 > +      FIELD_NAME (*fp) = fieldname;

and here

 >      }
 >    else if (die->tag == DW_TAG_inheritance)
 >      {
 > @@ -2869,8 +2876,7 @@ dwarf2_add_member_fn (struct field_info 
 >  
 >    /* Fill in the member function field info.  */
 >    fnp = &new_fnfield->fnfield;
 > -  fnp->physname = obsavestring (physname, strlen (physname),
 > -				&objfile->objfile_obstack);
 > +  fnp->physname = physname ? physname : "";

and here .... and everywhere else?


otherwise ok.


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