* 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

@ -1,3 +1,16 @@
Sat Sep 24 01:47:25 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
* 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.
Fri Sep 23 14:58:49 1994 J.T. Conklin (jtc@rtl.cygnus.com)
* solib.c: *BSD systems need <a.out.h> to be included before

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 */

View File

@ -638,7 +638,8 @@ xcoff_relocate_symtab (pid)
from the core file. */
void
xcoff_relocate_core ()
xcoff_relocate_core (target)
struct target_ops *target;
{
/* Offset of member MEMBER in a struct of type TYPE. */
#ifndef offsetof
@ -731,13 +732,13 @@ xcoff_relocate_core ()
int count;
struct section_table *stp;
count = core_ops.to_sections_end - core_ops.to_sections;
count = target->to_sections_end - target->to_sections;
count += 2;
core_ops.to_sections = (struct section_table *)
xrealloc (core_ops.to_sections,
target->to_sections = (struct section_table *)
xrealloc (target->to_sections,
sizeof (struct section_table) * count);
core_ops.to_sections_end = core_ops.to_sections + count;
stp = core_ops.to_sections_end - 2;
target->to_sections_end = target->to_sections + count;
stp = target->to_sections_end - 2;
/* "Why do we add bfd_section_vma?", I hear you cry.
Well, the start of the section in the file is actually