* buildsym.c (patch_subfile_names): Use set_last_source_file.

(start_symtab): Make 'name' and 'dirname' const.  Use
	set_last_source_file.
	(restart_symtab, reset_symtab_globals): Use set_last_source_file.
	(last_source_file): Define.  Now static.
	(set_last_source_file, get_last_source_file): New functions.
	* buildsym.h (last_source_file): Don't declare.
	(start_symtab): Update.
	(set_last_source_file, get_last_source_file): Declare.
	* coffread.c (complete_symtab): Use set_last_source_file.
	(coff_end_symtab): Likewise.
	(coff_symtab_read): Use set_last_source_file, get_last_source_file.
	* dbxread.c (read_dbx_symtab, read_ofile_symtab): Use
	set_last_source_file.
	(process_one_symbol): Use get_last_source_file.
	* mdebugread.c (parse_partial_symbols): Use set_last_source_file.
	(psymtab_to_symtab_1): Use get_last_source_file.
	* xcoffread.c (process_linenos): Use get_last_source_file.
	(complete_symtab): Use set_last_source_file.
	(read_xcoff_symtab): Use set_last_source_file, get_last_source_file.
	(scan_xcoff_symtab): Use set_last_source_file.
This commit is contained in:
Tom Tromey
2013-01-21 18:05:13 +00:00
parent 9d2ceabe7f
commit 46212e0bb5
7 changed files with 87 additions and 34 deletions

View File

@ -2394,7 +2394,7 @@ parse_partial_symbols (struct objfile *objfile)
(struct partial_symtab **) alloca (dependencies_allocated *
sizeof (struct partial_symtab *));
last_source_file = NULL;
set_last_source_file (NULL);
/*
* Big plan:
@ -4079,7 +4079,7 @@ psymtab_to_symtab_1 (struct objfile *objfile,
would otherwise be ended twice, once in
process_one_symbol, and once after this loop. */
if (type_code == N_SO
&& last_source_file
&& get_last_source_file ()
&& previous_stab_code != (unsigned char) N_SO
&& *name == '\000')
{