+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
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, ¤t_target);
return 0;
}
#endif /* SOLIB_ADD */
#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 */
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
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