diff options
author | Jeff Law <law@redhat.com> | 1995-10-12 23:26:06 +0000 |
---|---|---|
committer | Jeff Law <law@redhat.com> | 1995-10-12 23:26:06 +0000 |
commit | 148070cca4cf7e1b1b7f81835e9ec9991f1895ef (patch) | |
tree | fc5e0c036682acf0eb6bc18a0978c752fe8e5a82 /gdb/irix5-nat.c | |
parent | a8958dd48be372e5b3004c61729071c36f8717a0 (diff) | |
download | fsf-binutils-gdb-148070cca4cf7e1b1b7f81835e9ec9991f1895ef.zip fsf-binutils-gdb-148070cca4cf7e1b1b7f81835e9ec9991f1895ef.tar.gz fsf-binutils-gdb-148070cca4cf7e1b1b7f81835e9ec9991f1895ef.tar.bz2 |
* corelow.c (core_open): Don't update the to_sections and
to_sections_end fields in core_ops here. It's too late.
* irix5-nat.c (solib_add): Update the to_sections and
to_sections_end fields in core_ops here if needed.
* osfsolib.c (solib_add): Likewise.
* rs6000-nat.c (xcoff_reload_core): Likewise.
* solib.c (solib_add): Likewise.
* somsolib.c (solib_add): Likewise.
Diffstat (limited to 'gdb/irix5-nat.c')
-rw-r--r-- | gdb/irix5-nat.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gdb/irix5-nat.c b/gdb/irix5-nat.c index 3bfaef7..3ba00b1 100644 --- a/gdb/irix5-nat.c +++ b/gdb/irix5-nat.c @@ -621,6 +621,13 @@ solib_add (arg_string, from_tty, target) if (count) { + int update_coreops; + + /* We must update the to_sections field in the core_ops structure + here, otherwise we dereference a potential dangling pointer + for each call to target_read/write_memory within this routine. */ + update_coreops = core_ops.to_sections == target->to_sections; + /* Reallocate the target's section table including the new size. */ if (target -> to_sections) { @@ -637,6 +644,14 @@ solib_add (arg_string, from_tty, target) } target -> to_sections_end = target -> to_sections + (count + old); + /* Update the to_sections field in the core_ops structure + if needed. */ + if (update_coreops) + { + core_ops.to_sections = target->to_sections; + core_ops.to_sections_end = target->to_sections_end; + } + /* Add these section table entries to the target's table. */ while ((so = find_solib (so)) != NULL) { |