Avoid shadowing in linux-tdep.c

This is one of the uglier changes to avoid local shadowing.  Because
obstack.h uses statement expressions, in some cases a nested obstack
call will result in shadowing.  Rather than try to fix obstack.h, this
patch simply works around the one instance of this problem.

gdb/ChangeLog
2018-10-04  Tom Tromey  <tom@tromey.com>

	* linux-tdep.c (linux_make_mappings_corefile_notes): Introduce new
	variable "size".
This commit is contained in:
Tom Tromey 2018-04-22 10:46:51 -06:00
parent 795afcbbb4
commit 3fba72f761
2 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2018-10-04 Tom Tromey <tom@tromey.com>
* linux-tdep.c (linux_make_mappings_corefile_notes): Introduce new
variable "size".
2018-10-04 Tom Tromey <tom@tromey.com>
* mdebugread.c (parse_partial_symbols): Use std::string.

View File

@ -1547,8 +1547,9 @@ linux_make_mappings_corefile_notes (struct gdbarch *gdbarch, bfd *obfd,
long_type, mapping_data.file_count);
/* Copy the filenames to the data obstack. */
int size = obstack_object_size (&filename_obstack);
obstack_grow (&data_obstack, obstack_base (&filename_obstack),
obstack_object_size (&filename_obstack));
size);
note_data = elfcore_write_note (obfd, note_data, note_size,
"CORE", NT_FILE,