https://gcc.gnu.org/g:d1a7de943529a14a0ac4af220db9845b73c443fa
commit r17-5696-gd1a7de943529a14a0ac4af220db9845b73c443fa Author: Pierre-Emmanuel Patry <[email protected]> Date: Thu Aug 13 15:24:39 2026 +0200 gccrs: Output cursor position within forever stack debug This data structure is complex, when using the debug dump within a debugger we often need to know what is the current state and where new nodes will be pushed within the forever stack. gcc/rust/ChangeLog: * resolve/rust-forever-stack.hxx: Debug the forever stack cursor position. Signed-off-by: Pierre-Emmanuel Patry <[email protected]> Diff: --- gcc/rust/resolve/rust-forever-stack.hxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gcc/rust/resolve/rust-forever-stack.hxx b/gcc/rust/resolve/rust-forever-stack.hxx index 788584bf93a1..698bb1e8a2bb 100644 --- a/gcc/rust/resolve/rust-forever-stack.hxx +++ b/gcc/rust/resolve/rust-forever-stack.hxx @@ -717,7 +717,11 @@ ForeverStack<N>::stream_node (std::stringstream &stream, unsigned indentation, auto next = std::string (indentation + 4, ' '); auto next_next = std::string (indentation + 8, ' '); - stream << indent << "Node {\n" + std::string cursor_text = ""; + if (node.id == cursor ().id) + cursor_text = "(C)"; + + stream << indent << "Node " << cursor_text << "{\n" << next << "is_root: " << (node.is_root () ? "true" : "false") << ",\n" << next << "is_leaf: " << (node.is_leaf () ? "true" : "false") << ",\n";
