Make add_separate_debug_objfile static

This changes objfile::make to take a "parent" parameter, and makes
add_separate_debug_objfile static.

gdb/ChangeLog
2019-12-12  Tom Tromey  <tom@tromey.com>

	* symfile.c (symbol_file_add_with_addrs): Pass "parent" to
	objfile::make.
	* objfiles.h (struct objjfile) <make>: No longer inline.
	(add_separate_debug_objfile): Don't declare.
	* objfiles.c (add_separate_debug_objfile): Now static.
	(objfile::make): Move from objfiles.h.  Call
	add_separate_debug_objfile.  Add "parent" parameter.

Change-Id: I631f43bb71738dea6ae0697317bf8ef4a0db4617
This commit is contained in:
Tom Tromey 2019-11-01 16:10:48 -06:00
parent bda13cdcf0
commit f65fe5704a
4 changed files with 26 additions and 11 deletions

View file

@ -520,7 +520,7 @@ put_objfile_before (struct objfile *objfile, struct objfile *before_this)
/* Add OBJFILE as a separate debug objfile of PARENT. */
void
static void
add_separate_debug_objfile (struct objfile *objfile, struct objfile *parent)
{
gdb_assert (objfile && parent);
@ -541,6 +541,18 @@ add_separate_debug_objfile (struct objfile *objfile, struct objfile *parent)
put_objfile_before (objfile, parent);
}
/* See objfiles.h. */
objfile *
objfile::make (bfd *bfd_, const char *name_, objfile_flags flags_,
objfile *parent)
{
objfile *result = new objfile (bfd_, name_, flags_);
if (parent != nullptr)
add_separate_debug_objfile (result, parent);
return result;
}
/* Free all separate debug objfile of OBJFILE, but don't free OBJFILE
itself. */