mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-27 17:40:49 +00:00
* 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:
@@ -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, ¤t_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 */
|
||||
|
||||
Reference in New Issue
Block a user