This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA 22/42] Move current_subfile to buildsym_compunit
- From: Simon Marchi <simark at simark dot ca>
- To: Tom Tromey <tom at tromey dot com>, gdb-patches at sourceware dot org
- Date: Mon, 9 Jul 2018 21:52:24 -0400
- Subject: Re: [RFA 22/42] Move current_subfile to buildsym_compunit
- References: <20180523045851.11660-1-tom@tromey.com> <20180523045851.11660-23-tom@tromey.com>
> @@ -901,8 +902,10 @@ void
> push_subfile ()
> {
> gdb_assert (buildsym_compunit != nullptr);
> - gdb_assert (! (current_subfile == NULL || current_subfile->name == NULL));
> - buildsym_compunit->m_subfile_stack.push_back (current_subfile->name);
> + gdb_assert (! (buildsym_compunit->m_current_subfile == NULL
> + || buildsym_compunit->m_current_subfile->name == NULL));
Here, you might as well write two separate asserts.
gdb_assert (buildsym_compunit->m_current_subfile != NULL);
gdb_assert (buildsym_compunit->m_current_subfile->name != NULL);
Otherwise, LGTM.
Simon