mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-05 15:15:42 +00:00
[gdb/symtab] Add reset_compunit_symtab
Add a new function reset_compunit_symtab.
This commit is contained in:
@@ -1729,7 +1729,8 @@ dwarf2_per_objfile::set_symtab (const dwarf2_per_cu_data *per_cu,
|
|||||||
compunit_symtab *symtab)
|
compunit_symtab *symtab)
|
||||||
{
|
{
|
||||||
gdb_assert (per_cu->index < this->m_symtabs.size ());
|
gdb_assert (per_cu->index < this->m_symtabs.size ());
|
||||||
gdb_assert (this->m_symtabs[per_cu->index] == nullptr);
|
gdb_assert (this->m_symtabs[per_cu->index] == nullptr
|
||||||
|
|| symtab == nullptr);
|
||||||
|
|
||||||
this->m_symtabs[per_cu->index] = symtab;
|
this->m_symtabs[per_cu->index] = symtab;
|
||||||
}
|
}
|
||||||
@@ -5674,6 +5675,10 @@ struct dwarf2_include_psymtab : public partial_symtab
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void reset_compunit_symtab (struct objfile *objfile) override
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
partial_symtab *includer () const
|
partial_symtab *includer () const
|
||||||
{
|
{
|
||||||
@@ -8587,6 +8592,13 @@ dwarf2_psymtab::get_compunit_symtab (struct objfile *objfile) const
|
|||||||
return per_objfile->get_symtab (per_cu_data);
|
return per_objfile->get_symtab (per_cu_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
dwarf2_psymtab::reset_compunit_symtab (struct objfile *objfile)
|
||||||
|
{
|
||||||
|
dwarf2_per_objfile *per_objfile = get_dwarf2_per_objfile (objfile);
|
||||||
|
per_objfile->set_symtab (per_cu_data, nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
/* Trivial hash function for die_info: the hash value of a DIE
|
/* Trivial hash function for die_info: the hash value of a DIE
|
||||||
is its offset in .debug_info for this objfile. */
|
is its offset in .debug_info for this objfile. */
|
||||||
|
|
||||||
|
|||||||
@@ -626,6 +626,7 @@ struct dwarf2_psymtab : public partial_symtab
|
|||||||
void expand_psymtab (struct objfile *) override;
|
void expand_psymtab (struct objfile *) override;
|
||||||
bool readin_p (struct objfile *) const override;
|
bool readin_p (struct objfile *) const override;
|
||||||
compunit_symtab *get_compunit_symtab (struct objfile *) const override;
|
compunit_symtab *get_compunit_symtab (struct objfile *) const override;
|
||||||
|
void reset_compunit_symtab (struct objfile *) override;
|
||||||
|
|
||||||
struct dwarf2_per_cu_data *per_cu_data;
|
struct dwarf2_per_cu_data *per_cu_data;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -173,6 +173,9 @@ struct partial_symtab
|
|||||||
virtual struct compunit_symtab *get_compunit_symtab
|
virtual struct compunit_symtab *get_compunit_symtab
|
||||||
(struct objfile *) const = 0;
|
(struct objfile *) const = 0;
|
||||||
|
|
||||||
|
virtual void reset_compunit_symtab
|
||||||
|
(struct objfile *) = 0;
|
||||||
|
|
||||||
/* Return the raw low text address of this partial_symtab. */
|
/* Return the raw low text address of this partial_symtab. */
|
||||||
CORE_ADDR raw_text_low () const
|
CORE_ADDR raw_text_low () const
|
||||||
{
|
{
|
||||||
@@ -428,6 +431,11 @@ struct standard_psymtab : public partial_symtab
|
|||||||
return compunit_symtab;
|
return compunit_symtab;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void reset_compunit_symtab (struct objfile *) override
|
||||||
|
{
|
||||||
|
compunit_symtab = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
/* True if the symtab corresponding to this psymtab has been
|
/* True if the symtab corresponding to this psymtab has been
|
||||||
readin. */
|
readin. */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user