aboutsummaryrefslogtreecommitdiff
path: root/gdb/psympriv.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2021-03-20 17:23:40 -0600
committerTom Tromey <tom@tromey.com>2021-03-20 17:23:42 -0600
commit484b1090630d273dfb70ee96b152ec6b527a1b65 (patch)
tree0e0a8a9a6e33be2fb7d4dbca9ca632ef9735cca5 /gdb/psympriv.h
parent7e9c0476a7085cbebdc818d163d5c3bd46da6388 (diff)
downloadgdb-484b1090630d273dfb70ee96b152ec6b527a1b65.zip
gdb-484b1090630d273dfb70ee96b152ec6b527a1b65.tar.gz
gdb-484b1090630d273dfb70ee96b152ec6b527a1b65.tar.bz2
Do not pass objfile to psymtab_discarder
This changes the psymtab_discarder to not assume that partial symtabs are attached to the objfile. Instead, a psymtab_storage object is passed directly to it. gdb/ChangeLog 2021-03-20 Tom Tromey <tom@tromey.com> * psympriv.h (psymtab_discarder): Take psymtab_storage parameter. (~psymtab_discarder, keep): Update. <m_objfile>: Remove. <m_partial_symtabs>: New member. * dwarf2/read.c (dwarf2_build_psymtabs): Update.
Diffstat (limited to 'gdb/psympriv.h')
-rw-r--r--gdb/psympriv.h17
1 files changed, 8 insertions, 9 deletions
diff --git a/gdb/psympriv.h b/gdb/psympriv.h
index 73f00a5..0f24c10 100644
--- a/gdb/psympriv.h
+++ b/gdb/psympriv.h
@@ -446,29 +446,28 @@ class psymtab_discarder
{
public:
- psymtab_discarder (struct objfile *objfile)
- : m_objfile (objfile),
- m_psymtab (objfile->partial_symtabs->psymtabs)
+ psymtab_discarder (psymtab_storage *partial_symtabs)
+ : m_partial_symtabs (partial_symtabs),
+ m_psymtab (partial_symtabs->psymtabs)
{
}
~psymtab_discarder ()
{
- if (m_objfile != NULL)
- m_objfile->partial_symtabs->discard_psymtabs_to (m_psymtab);
+ if (m_partial_symtabs != nullptr)
+ m_partial_symtabs->discard_psymtabs_to (m_psymtab);
}
/* Keep any partial symbol tables that were built. */
void keep ()
{
- m_objfile = NULL;
+ m_partial_symtabs = nullptr;
}
private:
- /* The objfile. If NULL this serves as a sentinel to indicate that
- the psymtabs should be kept. */
- struct objfile *m_objfile;
+ /* The partial symbol storage object. */
+ psymtab_storage *m_partial_symtabs;
/* How far back to free. */
struct partial_symtab *m_psymtab;
};