gdb: Convert language la_get_symbol_name_matcher field to a method
[deliverable/binutils-gdb.git] / gdb / dwarf2 / read.c
index 4724738363be70b296cad1ff850d6717b4ff957b..34915be8da7abb9f74998a4c6ad03a9a3c6ab52f 100644 (file)
@@ -3068,9 +3068,10 @@ dwarf2_read_gdb_index
   offset_type cu_list_elements, types_list_elements, dwz_list_elements = 0;
   struct dwz_file *dwz;
   struct objfile *objfile = per_objfile->objfile;
+  dwarf2_per_bfd *per_bfd = per_objfile->per_bfd;
 
   gdb::array_view<const gdb_byte> main_index_contents
-    = get_gdb_index_contents (objfile, per_objfile->per_bfd);
+    = get_gdb_index_contents (objfile, per_bfd);
 
   if (main_index_contents.empty ())
     return 0;
@@ -3089,7 +3090,7 @@ dwarf2_read_gdb_index
 
   /* If there is a .dwz file, read it so we can get its CU list as
      well.  */
-  dwz = dwarf2_get_dwz_file (per_objfile->per_bfd);
+  dwz = dwarf2_get_dwz_file (per_bfd);
   if (dwz != NULL)
     {
       struct mapped_index dwz_map;
@@ -3114,29 +3115,33 @@ dwarf2_read_gdb_index
        }
     }
 
-  create_cus_from_index (per_objfile->per_bfd, cu_list, cu_list_elements,
-                        dwz_list, dwz_list_elements);
+  create_cus_from_index (per_bfd, cu_list, cu_list_elements, dwz_list,
+                        dwz_list_elements);
 
   if (types_list_elements)
     {
       /* We can only handle a single .debug_types when we have an
         index.  */
-      if (per_objfile->per_bfd->types.size () != 1)
+      if (per_bfd->types.size () != 1)
        return 0;
 
-      dwarf2_section_info *section = &per_objfile->per_bfd->types[0];
+      dwarf2_section_info *section = &per_bfd->types[0];
 
-      create_signatured_type_table_from_index (per_objfile->per_bfd,
-                                              section, types_list,
+      create_signatured_type_table_from_index (per_bfd, section, types_list,
                                               types_list_elements);
     }
 
   create_addrmap_from_index (per_objfile, map.get ());
 
-  per_objfile->per_bfd->index_table = std::move (map);
-  per_objfile->per_bfd->using_index = 1;
-  per_objfile->per_bfd->quick_file_names_table =
-    create_quick_file_names_table (per_objfile->per_bfd->all_comp_units.size ());
+  per_bfd->index_table = std::move (map);
+  per_bfd->using_index = 1;
+  per_bfd->quick_file_names_table =
+    create_quick_file_names_table (per_bfd->all_comp_units.size ());
+
+  /* Save partial symtabs in the per_bfd object, for the benefit of subsequent
+     objfiles using the same BFD.  */
+  gdb_assert (per_bfd->partial_symtabs == nullptr);
+  per_bfd->partial_symtabs = objfile->partial_symtabs;
 
   return 1;
 }
@@ -3431,31 +3436,64 @@ struct dw2_symtab_iterator
   int global_seen;
 };
 
-/* Initialize the index symtab iterator ITER.  */
+/* Initialize the index symtab iterator ITER, common part.  */
 
 static void
-dw2_symtab_iter_init (struct dw2_symtab_iterator *iter,
-                     dwarf2_per_objfile *per_objfile,
-                     gdb::optional<block_enum> block_index,
-                     domain_enum domain,
-                     const char *name)
+dw2_symtab_iter_init_common (struct dw2_symtab_iterator *iter,
+                            dwarf2_per_objfile *per_objfile,
+                            gdb::optional<block_enum> block_index,
+                            domain_enum domain)
 {
   iter->per_objfile = per_objfile;
   iter->block_index = block_index;
   iter->domain = domain;
   iter->next = 0;
   iter->global_seen = 0;
+  iter->vec = NULL;
+  iter->length = 0;
+}
 
-  mapped_index *index = per_objfile->per_bfd->index_table.get ();
+/* Initialize the index symtab iterator ITER, const char *NAME variant.  */
 
+static void
+dw2_symtab_iter_init (struct dw2_symtab_iterator *iter,
+                     dwarf2_per_objfile *per_objfile,
+                     gdb::optional<block_enum> block_index,
+                     domain_enum domain,
+                     const char *name)
+{
+  dw2_symtab_iter_init_common (iter, per_objfile, block_index, domain);
+
+  mapped_index *index = per_objfile->per_bfd->index_table.get ();
   /* index is NULL if OBJF_READNOW.  */
-  if (index != NULL && find_slot_in_mapped_hash (index, name, &iter->vec))
+  if (index == NULL)
+    return;
+
+  if (find_slot_in_mapped_hash (index, name, &iter->vec))
     iter->length = MAYBE_SWAP (*iter->vec);
-  else
-    {
-      iter->vec = NULL;
-      iter->length = 0;
-    }
+}
+
+/* Initialize the index symtab iterator ITER, offset_type NAMEI variant.  */
+
+static void
+dw2_symtab_iter_init (struct dw2_symtab_iterator *iter,
+                     dwarf2_per_objfile *per_objfile,
+                     gdb::optional<block_enum> block_index,
+                     domain_enum domain, offset_type namei)
+{
+  dw2_symtab_iter_init_common (iter, per_objfile, block_index, domain);
+
+  mapped_index *index = per_objfile->per_bfd->index_table.get ();
+  /* index is NULL if OBJF_READNOW.  */
+  if (index == NULL)
+    return;
+
+  gdb_assert (!index->symbol_name_slot_invalid (namei));
+  const auto &bucket = index->symbol_table[namei];
+
+  iter->vec = (offset_type *) (index->constant_pool
+                              + MAYBE_SWAP (bucket.vec));
+  iter->length = MAYBE_SWAP (*iter->vec);
 }
 
 /* Return the next matching CU or NULL if there are no more.  */
@@ -3740,9 +3778,6 @@ dw2_map_matching_symbols
 
   if (per_objfile->per_bfd->index_table != nullptr)
     {
-      /* Ada currently doesn't support .gdb_index (see PR24713).  We can get
-        here though if the current language is Ada for a non-Ada objfile
-        using GNU index.  */
       mapped_index &index = *per_objfile->per_bfd->index_table;
 
       const char *match_name = name.ada ().lookup_name ().c_str ();
@@ -3760,7 +3795,7 @@ dw2_map_matching_symbols
        struct dwarf2_per_cu_data *per_cu;
 
        dw2_symtab_iter_init (&iter, per_objfile, block_kind, domain,
-                             match_name);
+                             namei);
        while ((per_cu = dw2_symtab_iter_next (&iter)) != NULL)
          dw2_expand_symtabs_matching_one (per_cu, per_objfile, nullptr,
                                           nullptr);
@@ -4062,7 +4097,7 @@ dw2_expand_symtabs_matching_symbol
 
       const language_defn *lang = language_def (lang_e);
       symbol_name_matcher_ftype *name_matcher
-       = get_symbol_name_matcher (lang, lookup_name_without_params);
+       = lang->get_symbol_name_matcher (lookup_name_without_params);
 
       name_and_matcher key {
          name_matcher,
@@ -5205,6 +5240,7 @@ dwarf2_read_debug_names (dwarf2_per_objfile *per_objfile)
   std::unique_ptr<mapped_debug_names> map (new mapped_debug_names);
   mapped_debug_names dwz_map;
   struct objfile *objfile = per_objfile->objfile;
+  dwarf2_per_bfd *per_bfd = per_objfile->per_bfd;
 
   if (!read_debug_names_from_section (objfile, objfile_name (objfile),
                                      &per_objfile->per_bfd->debug_names, *map))
@@ -5216,7 +5252,7 @@ dwarf2_read_debug_names (dwarf2_per_objfile *per_objfile)
 
   /* If there is a .dwz file, read it so we can get its CU list as
      well.  */
-  dwz_file *dwz = dwarf2_get_dwz_file (per_objfile->per_bfd);
+  dwz_file *dwz = dwarf2_get_dwz_file (per_bfd);
   if (dwz != NULL)
     {
       if (!read_debug_names_from_section (objfile,
@@ -5229,29 +5265,33 @@ dwarf2_read_debug_names (dwarf2_per_objfile *per_objfile)
        }
     }
 
-  create_cus_from_debug_names (per_objfile->per_bfd, *map, dwz_map);
+  create_cus_from_debug_names (per_bfd, *map, dwz_map);
 
   if (map->tu_count != 0)
     {
       /* We can only handle a single .debug_types when we have an
         index.  */
-      if (per_objfile->per_bfd->types.size () != 1)
+      if (per_bfd->types.size () != 1)
        return false;
 
-      dwarf2_section_info *section = &per_objfile->per_bfd->types[0];
+      dwarf2_section_info *section = &per_bfd->types[0];
 
       create_signatured_type_table_from_debug_names
-       (per_objfile, *map, section, &per_objfile->per_bfd->abbrev);
+       (per_objfile, *map, section, &per_bfd->abbrev);
     }
 
-  create_addrmap_from_aranges (per_objfile,
-                              &per_objfile->per_bfd->debug_aranges);
+  create_addrmap_from_aranges (per_objfile, &per_bfd->debug_aranges);
 
-  per_objfile->per_bfd->debug_names_table = std::move (map);
-  per_objfile->per_bfd->using_index = 1;
-  per_objfile->per_bfd->quick_file_names_table =
+  per_bfd->debug_names_table = std::move (map);
+  per_bfd->using_index = 1;
+  per_bfd->quick_file_names_table =
     create_quick_file_names_table (per_objfile->per_bfd->all_comp_units.size ());
 
+  /* Save partial symtabs in the per_bfd object, for the benefit of subsequent
+     objfiles using the same BFD.  */
+  gdb_assert (per_bfd->partial_symtabs == nullptr);
+  per_bfd->partial_symtabs = objfile->partial_symtabs;
+
   return true;
 }
 
@@ -5972,6 +6012,7 @@ dwarf2_initialize_objfile (struct objfile *objfile, dw_index_kind *index_kind)
   if (per_bfd->debug_names_table != nullptr)
     {
       *index_kind = dw_index_kind::DEBUG_NAMES;
+      per_objfile->objfile->partial_symtabs = per_bfd->partial_symtabs;
       per_objfile->resize_symtabs ();
       return true;
     }
@@ -5981,6 +6022,7 @@ dwarf2_initialize_objfile (struct objfile *objfile, dw_index_kind *index_kind)
   if (per_bfd->index_table != nullptr)
     {
       *index_kind = dw_index_kind::GDB_INDEX;
+      per_objfile->objfile->partial_symtabs = per_bfd->partial_symtabs;
       per_objfile->resize_symtabs ();
       return true;
     }
@@ -8146,6 +8188,9 @@ scan_partial_symbols (struct partial_die_info *first_die, CORE_ADDR *lowpc,
            case DW_TAG_subprogram:
            case DW_TAG_inlined_subroutine:
              add_partial_subprogram (pdi, lowpc, highpc, set_addrmap, cu);
+             if (cu->language == language_cplus)
+               scan_partial_symbols (pdi->die_child, lowpc, highpc,
+                                     set_addrmap, cu);
              break;
            case DW_TAG_constant:
            case DW_TAG_variable:
@@ -9403,8 +9448,7 @@ alloc_rust_variant (struct obstack *obstack, struct type *type,
 
   variant_part *part = new (obstack) variant_part;
   part->discriminant_index = discriminant_index;
-  part->is_unsigned = TYPE_UNSIGNED (TYPE_FIELD_TYPE (type,
-                                                     discriminant_index));
+  part->is_unsigned = TYPE_UNSIGNED (type->field (discriminant_index).type ());
   part->variants = gdb::array_view<variant> (variants, n_variants);
 
   void *storage = obstack_alloc (obstack, sizeof (gdb::array_view<variant_part>));
@@ -9456,7 +9500,7 @@ quirk_rust_enum (struct type *type, struct objfile *objfile)
       /* Decode the field name to find the offset of the
         discriminant.  */
       ULONGEST bit_offset = 0;
-      struct type *field_type = TYPE_FIELD_TYPE (type, 0);
+      struct type *field_type = type->field (0).type ();
       while (name[0] >= '0' && name[0] <= '9')
        {
          char *tail;
@@ -9476,7 +9520,7 @@ quirk_rust_enum (struct type *type, struct objfile *objfile)
          ++name;
 
          bit_offset += TYPE_FIELD_BITPOS (field_type, index);
-         field_type = TYPE_FIELD_TYPE (field_type, index);
+         field_type = field_type->field (index).type ();
        }
 
       /* Smash this type to be a structure type.  We have to do this
@@ -9489,7 +9533,7 @@ quirk_rust_enum (struct type *type, struct objfile *objfile)
        ((struct field *) TYPE_ZALLOC (type, 3 * sizeof (struct field)));
 
       /* Put the discriminant at index 0.  */
-      TYPE_FIELD_TYPE (type, 0) = field_type;
+      type->field (0).set_type (field_type);
       TYPE_FIELD_ARTIFICIAL (type, 0) = 1;
       TYPE_FIELD_NAME (type, 0) = "<<discriminant>>";
       SET_FIELD_BITPOS (type->field (0), bit_offset);
@@ -9498,8 +9542,8 @@ quirk_rust_enum (struct type *type, struct objfile *objfile)
         field at index 1 and the data-less field at index 2.  */
       type->field (1) = saved_field;
       TYPE_FIELD_NAME (type, 1)
-       = rust_last_path_segment (TYPE_FIELD_TYPE (type, 1)->name ());
-      TYPE_FIELD_TYPE (type, 1)->set_name
+       = rust_last_path_segment (type->field (1).type ()->name ());
+      type->field (1).type ()->set_name
        (rust_fully_qualify (&objfile->objfile_obstack, type->name (),
                             TYPE_FIELD_NAME (type, 1)));
 
@@ -9508,7 +9552,7 @@ quirk_rust_enum (struct type *type, struct objfile *objfile)
                              name);
       struct type *dataless_type = init_type (objfile, TYPE_CODE_VOID, 0,
                                              dataless_name);
-      TYPE_FIELD_TYPE (type, 2) = dataless_type;
+      type->field (2).set_type (dataless_type);
       /* NAME points into the original discriminant name, which
         already has the correct lifetime.  */
       TYPE_FIELD_NAME (type, 2) = name;
@@ -9526,7 +9570,7 @@ quirk_rust_enum (struct type *type, struct objfile *objfile)
         because the type has already been recorded.  */
       type->set_code (TYPE_CODE_STRUCT);
 
-      struct type *field_type = TYPE_FIELD_TYPE (type, 0);
+      struct type *field_type = type->field (0).type ();
       const char *variant_name
        = rust_last_path_segment (field_type->name ());
       TYPE_FIELD_NAME (type, 0) = variant_name;
@@ -9539,7 +9583,7 @@ quirk_rust_enum (struct type *type, struct objfile *objfile)
       struct type *disr_type = nullptr;
       for (int i = 0; i < type->num_fields (); ++i)
        {
-         disr_type = TYPE_FIELD_TYPE (type, i);
+         disr_type = type->field (i).type ();
 
          if (disr_type->code () != TYPE_CODE_STRUCT)
            {
@@ -9590,7 +9634,7 @@ quirk_rust_enum (struct type *type, struct objfile *objfile)
 
       /* We need a way to find the correct discriminant given a
         variant name.  For convenience we build a map here.  */
-      struct type *enum_type = FIELD_TYPE (*disr_field);
+      struct type *enum_type = disr_field->type ();
       std::unordered_map<std::string, ULONGEST> discriminant_map;
       for (int i = 0; i < enum_type->num_fields (); ++i)
        {
@@ -9616,7 +9660,7 @@ quirk_rust_enum (struct type *type, struct objfile *objfile)
             That name can be used to look up the correct
             discriminant.  */
          const char *variant_name
-           = rust_last_path_segment (TYPE_FIELD_TYPE (type, i)->name ());
+           = rust_last_path_segment (type->field (i).type ()->name ());
 
          auto iter = discriminant_map.find (variant_name);
          if (iter != discriminant_map.end ())
@@ -9626,7 +9670,7 @@ quirk_rust_enum (struct type *type, struct objfile *objfile)
            }
 
          /* Remove the discriminant field, if it exists.  */
-         struct type *sub_type = TYPE_FIELD_TYPE (type, i);
+         struct type *sub_type = type->field (i).type ();
          if (sub_type->num_fields () > 0)
            {
              sub_type->set_num_fields (sub_type->num_fields () - 1);
@@ -10467,9 +10511,8 @@ dwarf2_compute_name (const char *name,
                     the two cases.  */
                  if (type->num_fields () > 0
                      && TYPE_FIELD_ARTIFICIAL (type, 0)
-                     && TYPE_FIELD_TYPE (type, 0)->code () == TYPE_CODE_PTR
-                     && TYPE_CONST (TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (type,
-                                                                       0))))
+                     && type->field (0).type ()->code () == TYPE_CODE_PTR
+                     && TYPE_CONST (TYPE_TARGET_TYPE (type->field (0).type ())))
                    buf.puts (" const");
                }
            }
@@ -14524,7 +14567,7 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die,
       /* Data member other than a C++ static data member.  */
 
       /* Get type of field.  */
-      fp->type = die_type (die, cu);
+      fp->set_type (die_type (die, cu));
 
       SET_FIELD_BITPOS (*fp, 0);
 
@@ -14578,7 +14621,7 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die,
                     the bit field must be inferred from the type
                     attribute of the data member containing the
                     bit field.  */
-                 anonymous_size = TYPE_LENGTH (fp->type);
+                 anonymous_size = TYPE_LENGTH (fp->type ());
                }
              SET_FIELD_BITPOS (*fp,
                                (FIELD_BITPOS (*fp)
@@ -14644,7 +14687,7 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die,
       /* The name is already allocated along with this objfile, so we don't
         need to duplicate it for the type.  */
       SET_FIELD_PHYSNAME (*fp, physname ? physname : "");
-      FIELD_TYPE (*fp) = die_type (die, cu);
+      fp->set_type (die_type (die, cu));
       FIELD_NAME (*fp) = fieldname;
     }
   else if (die->tag == DW_TAG_inheritance)
@@ -14652,8 +14695,8 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die,
       /* C++ base class field.  */
       handle_data_member_location (die, cu, fp);
       FIELD_BITSIZE (*fp) = 0;
-      FIELD_TYPE (*fp) = die_type (die, cu);
-      FIELD_NAME (*fp) = fp->type->name ();
+      fp->set_type (die_type (die, cu));
+      FIELD_NAME (*fp) = fp->type ()->name ();
     }
   else
     gdb_assert_not_reached ("missing case in dwarf2_add_field");
@@ -14852,8 +14895,7 @@ create_one_variant_part (variant_part &result,
     {
       result.discriminant_index = iter->second;
       result.is_unsigned
-       = TYPE_UNSIGNED (FIELD_TYPE
-                        (fi->fields[result.discriminant_index].field));
+       = TYPE_UNSIGNED (fi->fields[result.discriminant_index].field.type ());
     }
 
   size_t n = builder.variants.size ();
@@ -15228,7 +15270,7 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die,
              else
                {
                  fnp->fcontext
-                   = TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (this_type, 0));
+                   = TYPE_TARGET_TYPE (this_type->field (0).type ());
                }
            }
        }
@@ -15326,7 +15368,7 @@ quirk_gcc_member_function_pointer (struct type *type, struct objfile *objfile)
     return;
 
   /* Find the type of the method.  */
-  pfn_type = TYPE_FIELD_TYPE (type, 0);
+  pfn_type = type->field (0).type ();
   if (pfn_type == NULL
       || pfn_type->code () != TYPE_CODE_PTR
       || TYPE_TARGET_TYPE (pfn_type)->code () != TYPE_CODE_FUNC)
@@ -15335,11 +15377,11 @@ quirk_gcc_member_function_pointer (struct type *type, struct objfile *objfile)
   /* Look for the "this" argument.  */
   pfn_type = TYPE_TARGET_TYPE (pfn_type);
   if (pfn_type->num_fields () == 0
-      /* || TYPE_FIELD_TYPE (pfn_type, 0) == NULL */
-      || TYPE_FIELD_TYPE (pfn_type, 0)->code () != TYPE_CODE_PTR)
+      /* || pfn_type->field (0).type () == NULL */
+      || pfn_type->field (0).type ()->code () != TYPE_CODE_PTR)
     return;
 
-  self_type = TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (pfn_type, 0));
+  self_type = TYPE_TARGET_TYPE (pfn_type->field (0).type ());
   new_type = alloc_type (objfile);
   smash_to_method_type (new_type, self_type, TYPE_TARGET_TYPE (pfn_type),
                        pfn_type->fields (), pfn_type->num_fields (),
@@ -17212,7 +17254,7 @@ read_subroutine_type (struct die_info *die, struct dwarf2_cu *cu)
       /* TYPE_FIELD_TYPE must never be NULL.  Pre-fill the array to ensure it
         even if we error out during the parameters reading below.  */
       for (iparams = 0; iparams < nparams; iparams++)
-       TYPE_FIELD_TYPE (ftype, iparams) = void_type;
+       ftype->field (iparams).set_type (void_type);
 
       iparams = 0;
       child_die = die->child;
@@ -17269,7 +17311,7 @@ read_subroutine_type (struct die_info *die, struct dwarf2_cu *cu)
                                             arg_type, 0);
                }
 
-             TYPE_FIELD_TYPE (ftype, iparams) = arg_type;
+             ftype->field (iparams).set_type (arg_type);
              iparams++;
            }
          child_die = child_die->sibling;
@@ -18246,7 +18288,8 @@ load_partial_dies (const struct die_reader_specs *reader,
       if (!load_all
          && cu->language == language_cplus
          && parent_die != NULL
-         && parent_die->tag == DW_TAG_subprogram)
+         && parent_die->tag == DW_TAG_subprogram
+         && abbrev->tag != DW_TAG_inlined_subroutine)
        {
          info_ptr = skip_one_die (reader, info_ptr + bytes_read, abbrev);
          continue;
@@ -18831,8 +18874,8 @@ guess_partial_die_structure_name (struct partial_die_info *struct_pdi,
          && child_pdi->linkage_name != NULL)
        {
          gdb::unique_xmalloc_ptr<char> actual_class_name
-           (language_class_name_from_physname (cu->language_defn,
-                                               child_pdi->linkage_name));
+           (cu->language_defn->class_name_from_physname
+            (child_pdi->linkage_name));
          if (actual_class_name != NULL)
            {
              struct objfile *objfile = cu->per_objfile->objfile;
@@ -20040,6 +20083,15 @@ private:
   /* The last file a line number was recorded for.  */
   struct subfile *m_last_subfile = NULL;
 
+  /* The address of the last line entry.  */
+  CORE_ADDR m_last_address;
+
+  /* Set to true when a previous line at the same address (using
+     m_last_address) had m_is_stmt true.  This is reset to false when a
+     line entry at a new address (m_address different to m_last_address) is
+     processed.  */
+  bool m_stmt_at_address = false;
+
   /* When true, record the lines we decode.  */
   bool m_currently_recording_lines = false;
 
@@ -20233,14 +20285,34 @@ lnp_state_machine::record_line (bool end_sequence)
       fe->included_p = 1;
       if (m_record_lines_p)
        {
-         if (m_last_subfile != m_cu->get_builder ()->get_current_subfile ()
-             || end_sequence)
+         /* When we switch files we insert an end maker in the first file,
+            switch to the second file and add a new line entry.  The
+            problem is that the end marker inserted in the first file will
+            discard any previous line entries at the same address.  If the
+            line entries in the first file are marked as is-stmt, while
+            the new line in the second file is non-stmt, then this means
+            the end marker will discard is-stmt lines so we can have a
+            non-stmt line.  This means that there are less addresses at
+            which the user can insert a breakpoint.
+
+            To improve this we track the last address in m_last_address,
+            and whether we have seen an is-stmt at this address.  Then
+            when switching files, if we have seen a stmt at the current
+            address, and we are switching to create a non-stmt line, then
+            discard the new line.  */
+         bool file_changed
+           = m_last_subfile != m_cu->get_builder ()->get_current_subfile ();
+         bool ignore_this_line
+           = (file_changed && !end_sequence && m_last_address == m_address
+              && !m_is_stmt && m_stmt_at_address);
+
+         if ((file_changed && !ignore_this_line) || end_sequence)
            {
              dwarf_finish_line (m_gdbarch, m_last_subfile, m_address,
                                 m_currently_recording_lines ? m_cu : nullptr);
            }
 
-         if (!end_sequence)
+         if (!end_sequence && !ignore_this_line)
            {
              bool is_stmt = producer_is_codewarrior (m_cu) || m_is_stmt;
 
@@ -20259,6 +20331,15 @@ lnp_state_machine::record_line (bool end_sequence)
            }
        }
     }
+
+  /* Track whether we have seen any m_is_stmt true at m_address in case we
+     have multiple line table entries all at m_address.  */
+  if (m_last_address != m_address)
+    {
+      m_stmt_at_address = false;
+      m_last_address = m_address;
+    }
+  m_stmt_at_address |= m_is_stmt;
 }
 
 lnp_state_machine::lnp_state_machine (struct dwarf2_cu *cu, gdbarch *arch,
@@ -20278,6 +20359,9 @@ lnp_state_machine::lnp_state_machine (struct dwarf2_cu *cu, gdbarch *arch,
   m_address = gdbarch_adjust_dwarf2_line (arch, 0, 0);
   m_is_stmt = lh->default_is_stmt;
   m_discriminator = 0;
+
+  m_last_address = m_address;
+  m_stmt_at_address = false;
 }
 
 void
@@ -21631,8 +21715,7 @@ guess_full_die_structure_name (struct die_info *die, struct dwarf2_cu *cu)
          if (linkage_name != NULL)
            {
              gdb::unique_xmalloc_ptr<char> actual_name
-               (language_class_name_from_physname (cu->language_defn,
-                                                   linkage_name));
+               (cu->language_defn->class_name_from_physname (linkage_name));
              const char *name = NULL;
 
              if (actual_name != NULL)
This page took 0.043552 seconds and 4 git commands to generate.