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().
sometimes DW_TAG_MIPS_linkage_name or a string computed in some
other fashion. */
char *name;
+ char *dirname;
/* The scope to prepend to our children. This is generally
allocated on the comp_unit_obstack, so will disappear
{
if (strcmp (sectp->name, INFO_SECTION) == 0)
{
- dwarf2_per_objfile->info_size = bfd_get_section_size_before_reloc (sectp);
+ dwarf2_per_objfile->info_size = bfd_get_section_size (sectp);
dwarf_info_section = sectp;
}
else if (strcmp (sectp->name, ABBREV_SECTION) == 0)
{
- dwarf2_per_objfile->abbrev_size = bfd_get_section_size_before_reloc (sectp);
+ dwarf2_per_objfile->abbrev_size = bfd_get_section_size (sectp);
dwarf_abbrev_section = sectp;
}
else if (strcmp (sectp->name, LINE_SECTION) == 0)
{
- dwarf2_per_objfile->line_size = bfd_get_section_size_before_reloc (sectp);
+ dwarf2_per_objfile->line_size = bfd_get_section_size (sectp);
dwarf_line_section = sectp;
}
else if (strcmp (sectp->name, PUBNAMES_SECTION) == 0)
{
- dwarf2_per_objfile->pubnames_size = bfd_get_section_size_before_reloc (sectp);
+ dwarf2_per_objfile->pubnames_size = bfd_get_section_size (sectp);
dwarf_pubnames_section = sectp;
}
else if (strcmp (sectp->name, ARANGES_SECTION) == 0)
{
- dwarf2_per_objfile->aranges_size = bfd_get_section_size_before_reloc (sectp);
+ dwarf2_per_objfile->aranges_size = bfd_get_section_size (sectp);
dwarf_aranges_section = sectp;
}
else if (strcmp (sectp->name, LOC_SECTION) == 0)
{
- dwarf2_per_objfile->loc_size = bfd_get_section_size_before_reloc (sectp);
+ dwarf2_per_objfile->loc_size = bfd_get_section_size (sectp);
dwarf_loc_section = sectp;
}
else if (strcmp (sectp->name, MACINFO_SECTION) == 0)
{
- dwarf2_per_objfile->macinfo_size = bfd_get_section_size_before_reloc (sectp);
+ dwarf2_per_objfile->macinfo_size = bfd_get_section_size (sectp);
dwarf_macinfo_section = sectp;
}
else if (strcmp (sectp->name, STR_SECTION) == 0)
{
- dwarf2_per_objfile->str_size = bfd_get_section_size_before_reloc (sectp);
+ dwarf2_per_objfile->str_size = bfd_get_section_size (sectp);
dwarf_str_section = sectp;
}
else if (strcmp (sectp->name, FRAME_SECTION) == 0)
{
- dwarf2_per_objfile->frame_size = bfd_get_section_size_before_reloc (sectp);
+ dwarf2_per_objfile->frame_size = bfd_get_section_size (sectp);
dwarf_frame_section = sectp;
}
else if (strcmp (sectp->name, EH_FRAME_SECTION) == 0)
flagword aflag = bfd_get_section_flags (ignore_abfd, sectp);
if (aflag & SEC_HAS_CONTENTS)
{
- dwarf2_per_objfile->eh_frame_size = bfd_get_section_size_before_reloc (sectp);
+ dwarf2_per_objfile->eh_frame_size = bfd_get_section_size (sectp);
dwarf_eh_frame_section = sectp;
}
}
else if (strcmp (sectp->name, RANGES_SECTION) == 0)
{
- dwarf2_per_objfile->ranges_size = bfd_get_section_size_before_reloc (sectp);
+ dwarf2_per_objfile->ranges_size = bfd_get_section_size (sectp);
dwarf_ranges_section = sectp;
}
}
objfile->global_psymbols.next,
objfile->static_psymbols.next);
+ if (comp_unit_die.dirname)
+ pst->dirname = xstrdup (comp_unit_die.dirname);
+
pst->read_symtab_private = (char *)
obstack_alloc (&objfile->objfile_obstack, sizeof (struct dwarf2_pinfo));
DWARF_INFO_OFFSET (pst) = beg_of_comp_unit - dwarf2_per_objfile->info_buffer;
if (child_pdi->tag == DW_TAG_subprogram)
{
char *actual_class_name
- = class_name_from_physname (child_pdi->name);
+ = language_class_name_from_physname (cu->language_defn,
+ child_pdi->name);
if (actual_class_name != NULL)
{
struct_pdi->name
}
}
- if (objfile->ei.entry_point >= lowpc &&
- objfile->ei.entry_point < highpc)
- {
- objfile->ei.deprecated_entry_file_lowpc = lowpc;
- objfile->ei.deprecated_entry_file_highpc = highpc;
- }
-
attr = dwarf2_attr (die, DW_AT_language, cu);
if (attr)
{
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
/* Record the function range for dwarf_decode_lines. */
add_to_cu_func_list (name, lowpc, highpc, cu);
- if (objfile->ei.entry_point >= lowpc &&
- objfile->ei.entry_point < highpc)
- {
- objfile->ei.entry_func_lowpc = lowpc;
- objfile->ei.entry_func_highpc = highpc;
- }
-
new = push_context (0, lowpc);
new->name = new_symbol (die, die->type, cu);
{
if (child->tag == DW_TAG_subprogram)
{
- new_prefix = class_name_from_physname (dwarf2_linkage_name
+ new_prefix
+ = language_class_name_from_physname (cu->language_defn,
+ dwarf2_linkage_name
(child, cu));
if (new_prefix != NULL)
{
bfd *abfd = objfile->obfd;
char *buf, *retbuf;
- bfd_size_type size = bfd_get_section_size_before_reloc (sectp);
+ bfd_size_type size = bfd_get_section_size (sectp);
if (size == 0)
return NULL;
if (part_die->name == NULL)
part_die->name = DW_STRING (&attr);
break;
+ case DW_AT_comp_dir:
+ if (part_die->dirname == NULL)
+ part_die->dirname = DW_STRING (&attr);
+ break;
case DW_AT_MIPS_linkage_name:
part_die->name = DW_STRING (&attr);
break;
address += (adj_opcode / lh->line_range)
* lh->minimum_instruction_length;
line += lh->line_base + (adj_opcode % lh->line_range);
+ lh->file_names[file - 1].included_p = 1;
if (!decode_for_pst_p)
{
/* append row to matrix using current values */
else switch (op_code)
{
case DW_LNS_extended_op:
- line_ptr += 1; /* ignore length */
+ read_unsigned_leb128 (abfd, line_ptr, &bytes_read);
+ line_ptr += bytes_read;
extended_op = read_1_byte (abfd, line_ptr);
line_ptr += 1;
switch (extended_op)
{
case DW_LNE_end_sequence:
end_sequence = 1;
+ lh->file_names[file - 1].included_p = 1;
if (!decode_for_pst_p)
record_line (current_subfile, 0, address);
break;
}
break;
case DW_LNS_copy:
+ lh->file_names[file - 1].included_p = 1;
if (!decode_for_pst_p)
record_line (current_subfile, line,
check_cu_functions (address, cu));
file = read_unsigned_leb128 (abfd, line_ptr, &bytes_read);
line_ptr += bytes_read;
fe = &lh->file_names[file - 1];
- fe->included_p = 1;
if (fe->dir_index)
dir = lh->include_dirs[fe->dir_index - 1];
else