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/dwarf] Partial DIE support for specifications


Overall, I think it makes the partial symbol processing much more
legible.  It's much easier to follow the flow of things.  It's a shame
about the speed hit, but I think we just have to take that for now.
So once the points below are addressed or answered, I think it can go
in.

- In fixup_partial_die, in the last 'if', you check for
  DW_TAG_structure_type twice.  And shouldn't that same 'if' make sure
  part_die->name is NULL before calling guess_structure_name?

And some trivial comments:

- Could the 'make_cleanup (free_stack_comp_unit, &cu)' call be moved
  to directly after the call to 'obstack_init (&cu.comp_unit_obstack)'?

- The comment atop 'scan_partial_symbols' says "Read in all interesting
  dies".  But it doesn't do that any more.

- Why not write the body of scan_partial_symbols like this?  It seems
  clearer to me, but if you don't agree, then don't bother:

      /* Namespaces have interesting children, anonymous or not.  */
      if (pdi->tag == DW_TAG_namespace)
        add_partial_namespace (pdi, lowpc, highpc, cu);
        
      /* Enums have interesting children, anonymous or not.  */
      else if (pdi->tag == DW_TAG_enumeration_type)
        {
          if (!pdi->is_declaration)
            add_partial_enumeration (pdi, cu);
        }
        
      /* Everything else is only interesting if it has a name.  */
      else if (pdi->name != NULL)
	{
	  switch (pdi->tag)
	    {
	    case DW_TAG_subprogram:
	      if (pdi->has_pc_info)
		{
		  if (pdi->lowpc < *lowpc)
		    {
		      *lowpc = pdi->lowpc;
		    }
		  if (pdi->highpc > *highpc)
		    {
		      *highpc = pdi->highpc;
		    }
		  if (!pdi->is_declaration)
		    {
		      add_partial_symbol (pdi, cu);
		    }
		}
	      break;
	    case DW_TAG_variable:
	    case DW_TAG_typedef:
	    case DW_TAG_union_type:
	      if (!pdi->is_declaration)
		{
		  add_partial_symbol (pdi, cu);
		}
	      break;
	    case DW_TAG_class_type:
	    case DW_TAG_structure_type:
	      if (!pdi->is_declaration)
		{
		  add_partial_symbol (pdi, cu);
		}
	      break;
	    case DW_TAG_base_type:
            case DW_TAG_subrange_type:
	      /* File scope base type definitions are added to the partial
	         symbol table.  */
	      add_partial_symbol (pdi, cu);
	      break;
	    default:
	      break;
	    }
	}


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