Use outermost_context_p in more places

This changes a few explicit checks of context_stack_depth to use
outermost_context_p instead.  This simplifies some future work.

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

	* xcoffread.c (read_xcoff_symtab): Use outermost_context_p.
	* dwarf2read.c (using_directives, new_symbol): Use
	outermost_context_p.
	* dbxread.c (process_one_symbol): Use outermost_context_p.
	* coffread.c (coff_symtab_read): Use outermost_context_p.
This commit is contained in:
Tom Tromey
2018-05-20 23:42:01 -06:00
parent 6cccc9a891
commit edb0470b99
5 changed files with 21 additions and 13 deletions

View File

@ -1088,7 +1088,7 @@ coff_symtab_read (minimal_symbol_reader &reader,
/* { main_aux.x_sym.x_misc.x_lnsz.x_lnno
contains number of lines to '}' */
if (context_stack_depth <= 0)
if (outermost_context_p ())
{ /* We attempted to pop an empty context stack. */
complaint (_("`.ef' symbol without matching `.bf' "
"symbol ignored starting at symnum %d"),
@ -1099,7 +1099,7 @@ coff_symtab_read (minimal_symbol_reader &reader,
newobj = pop_context ();
/* Stack must be empty now. */
if (context_stack_depth > 0 || newobj == NULL)
if (!outermost_context_p () || newobj == NULL)
{
complaint (_("Unmatched .ef symbol(s) ignored "
"starting at symnum %d"),
@ -1152,7 +1152,7 @@ coff_symtab_read (minimal_symbol_reader &reader,
}
else if (strcmp (cs->c_name, ".eb") == 0)
{
if (context_stack_depth <= 0)
if (outermost_context_p ())
{ /* We attempted to pop an empty context stack. */
complaint (_("`.eb' symbol without matching `.bb' "
"symbol ignored starting at symnum %d"),
@ -1168,7 +1168,7 @@ coff_symtab_read (minimal_symbol_reader &reader,
symnum);
break;
}
if (local_symbols && context_stack_depth > 0)
if (local_symbols && !outermost_context_p ())
{
tmpaddr =
cs->c_value + ANOFFSET (objfile->section_offsets,