diff options
Diffstat (limited to 'gdb/irix5-nat.c')
-rw-r--r-- | gdb/irix5-nat.c | 33 |
1 files changed, 2 insertions, 31 deletions
diff --git a/gdb/irix5-nat.c b/gdb/irix5-nat.c index dc9abe0..50bae76 100644 --- a/gdb/irix5-nat.c +++ b/gdb/irix5-nat.c @@ -908,37 +908,8 @@ 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) - { - old = target->to_sections_end - target->to_sections; - target->to_sections = (struct section_table *) - xrealloc ((char *) target->to_sections, - (sizeof (struct section_table)) * (count + old)); - } - else - { - old = 0; - target->to_sections = (struct section_table *) - xmalloc ((sizeof (struct section_table)) * count); - } - 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; - } - + old = target_resize_to_sections (target, count); + /* Add these section table entries to the target's table. */ while ((so = find_solib (so)) != NULL) { |