From: Tom Tromey <tromey@adacore.com>
To: Simon Marchi <simark@simark.ca>
Cc: Tom Tromey <tromey@adacore.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 4/6] Change pop_context to return a block
Date: Mon, 20 Apr 2026 08:09:34 -0600 [thread overview]
Message-ID: <87a4uxsoyp.fsf@tromey.com> (raw)
In-Reply-To: <b5e8ecc3-5ea5-46fa-9424-4c9230ff0945@simark.ca> (Simon Marchi's message of "Fri, 17 Apr 2026 16:11:21 -0400")
>>>>> "Simon" == Simon Marchi <simark@simark.ca> writes:
Simon> My understanding is that the "current" locals and local_using_directives
Simon> vectors are not held in m_context_stack, they are held in these
Simon> m_local_symbols and m_local_using_directives fields. An entry in
Simon> m_context_stack is a saved context, to be restored later. I wonder if
Simon> it would simplify the code if we removed m_local_symbols and
Simon> m_local_using_directives, and said that the topmost m_context_stack
Simon> entry holds the current locals and local_using_directives. That would
Simon> mean pushing an initial context_stack entry for the global scope, I
Simon> guess?
Simon> We wouldn't need moving in and out of m_local_symbols and
Simon> m_local_using_directives anymore. I don't think it would simplify that
Simon> much in terms of number of lines, but it might make the code a bit
Simon> easier to follow. Just something to explore, I think this patch is
Simon> good.
Yeah, this might be a good future change, considering that right now the
stack is incoherent: the current function is stored in the stack entry
but other things are not.
I had considered this but I didn't really feel like making the change
and then debugging the inevitable bug I'd introduce. I.e., I wanted to
keep this series relatively straightforward.
Tom
next prev parent reply other threads:[~2026-04-20 14:10 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-17 18:24 [PATCH 0/6] Some buildsym cleanups Tom Tromey
2026-04-17 18:24 ` [PATCH 1/6] Use scoped_restore for dwarf2_cu::list_in_scope Tom Tromey
2026-04-17 18:24 ` [PATCH 2/6] Remove some dead code from buildsym.c Tom Tromey
2026-04-17 20:10 ` Simon Marchi
2026-04-20 14:19 ` Tom Tromey
2026-04-17 18:24 ` [PATCH 3/6] Remove context_stack::depth Tom Tromey
2026-04-17 18:24 ` [PATCH 4/6] Change pop_context to return a block Tom Tromey
2026-04-17 20:11 ` Simon Marchi
2026-04-20 14:09 ` Tom Tromey [this message]
2026-04-20 14:20 ` Tom Tromey
2026-04-17 18:24 ` [PATCH 5/6] Return void from buildsym_compunit::push_context Tom Tromey
2026-04-17 20:22 ` Simon Marchi
2026-04-20 14:11 ` Tom Tromey
2026-04-17 18:24 ` [PATCH 6/6] Rename context_stack and make it private Tom Tromey
2026-04-17 20:24 ` [PATCH 0/6] Some buildsym cleanups Simon Marchi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87a4uxsoyp.fsf@tromey.com \
--to=tromey@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=simark@simark.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox