* corelow.c (add_solib_stub): Remove copying of to_sections,

pass current_target to SOLIB_ADD. The Sep 10 change failed
	if SOLIB_ADD errored out, or if SOLIB_ADD was trying to access
	target memory.
	* corelow.c (core_open):  After reading the shared libraries,
	copy the modified to_sections vector from current_target to
	core_ops, so that core_close can free it later.
	* config/rs6000/nm-rs6000.h, rs6000-nat.c (xcoff_relocate_core):
	Pass down target parameter from SOLIB_ADD and use it instead of
	directly accessing core_ops.
This commit is contained in:
Peter Schauer
1994-09-24 09:00:50 +00:00
parent cacd15c40d
commit 9137a6f461
3 changed files with 26 additions and 12 deletions

View File

@@ -79,12 +79,7 @@ static int
solib_add_stub (from_ttyp)
char *from_ttyp;
{
SOLIB_ADD (NULL, *(int *)from_ttyp, &core_ops);
/* SOLIB_ADD usually modifies core_ops.to_sections, which has to
be reflected in current_target. */
current_target.to_sections = core_ops.to_sections;
current_target.to_sections_end = core_ops.to_sections_end;
SOLIB_ADD (NULL, *(int *)from_ttyp, &current_target);
return 0;
}
#endif /* SOLIB_ADD */
@@ -204,6 +199,11 @@ core_open (filename, from_tty)
#ifdef SOLIB_ADD
catch_errors (solib_add_stub, &from_tty, (char *)0,
RETURN_MASK_ALL);
/* solib_add_stub usually modifies current_target.to_sections, which
has to be reflected in core_ops to enable proper freeing of
of the to_sections vector in core_close. */
core_ops.to_sections = current_target.to_sections;
#endif
/* Now, set up the frame cache, and print the top of stack */