Move the context stack to buildsym_compunit
authorTom Tromey <tom@tromey.com>
Mon, 21 May 2018 05:58:35 +0000 (23:58 -0600)
committerTom Tromey <tom@tromey.com>
Fri, 20 Jul 2018 15:42:41 +0000 (09:42 -0600)
commita60f3166aa946336c68e7a873d5eed6061b5733c
tree21da694fb78e8893f2cbb256330907c77998cafd
parent56ba65a04713fd8ff23908d4c57f75427317b8bb
Move the context stack to buildsym_compunit

This moves the context stack globals to be members of
buildsym_compunit, changing the type to a std::vector in the process.

Because the callers expect the context stack object to be valid after
being popped, at Simon's suggestion I've changed pop_context to return
the object rather than the pointer.

gdb/ChangeLog
2018-07-20  Tom Tromey  <tom@tromey.com>

* coffread.c (coff_symtab_read): Update.
* xcoffread.c (read_xcoff_symtab): Update.
* dwarf2read.c (new_symbol): Update.
(read_func_scope, read_lexical_block_scope): Update.
* dbxread.c (process_one_symbol): Update.
* buildsym.h (context_stack, context_stack_depth): Don't declare.
(outermost_context_p): Remove macro.
(outermost_context_p, get_current_context_stack)
(get_context_stack_depth): Declare.
(pop_context): Return struct context_stack.
* buildsym.c (struct buildsym_compunit) <m_context_stack: New
member.
(context_stack_size): Remove.
(INITIAL_CONTEXT_STACK_SIZE): Remove.
(prepare_for_building, end_symtab_get_static_block)
(augment_type_symtab, push_context): Update.
(pop_context): Return struct context_stack.
(outermost_context_p, get_current_context_stack)
(get_context_stack_depth): New functions.
(buildsym_init): Update.
gdb/ChangeLog
gdb/buildsym.c
gdb/buildsym.h
gdb/coffread.c
gdb/dbxread.c
gdb/dwarf2read.c
gdb/xcoffread.c