2004-08-20 Michael Chastain <mec.gnu@mindspring.com>
[deliverable/binutils-gdb.git] / gdb / dwarf2read.c
index c1f6c654f332e35d075588530e582c03a4bc0c7b..fa11475a69117f6ed88abaaa13579ffe93374053 100644 (file)
@@ -262,6 +262,8 @@ struct dwarf2_cu
   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().
@@ -1840,7 +1842,8 @@ guess_structure_name (struct partial_die_info *struct_pdi,
          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
@@ -2361,6 +2364,10 @@ read_file_scope (struct die_info *die, struct dwarf2_cu *cu)
       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
@@ -3557,7 +3564,9 @@ determine_class_name (struct die_info *die, struct dwarf2_cu *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)
@@ -5968,6 +5977,7 @@ dwarf_decode_lines (struct line_header *lh, char *comp_dir, bfd *abfd,
              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 */
@@ -5987,6 +5997,7 @@ dwarf_decode_lines (struct line_header *lh, char *comp_dir, bfd *abfd,
                {
                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;
@@ -6021,6 +6032,7 @@ dwarf_decode_lines (struct line_header *lh, char *comp_dir, bfd *abfd,
                }
              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));
@@ -6045,7 +6057,6 @@ dwarf_decode_lines (struct line_header *lh, char *comp_dir, bfd *abfd,
                 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
This page took 0.025442 seconds and 4 git commands to generate.