aboutsummaryrefslogtreecommitdiff
path: root/gdb/solib.c
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>1999-09-28 21:55:21 +0000
committerJason Molenda <jmolenda@apple.com>1999-09-28 21:55:21 +0000
commit6426a772a2645ef6afa596319dba0ff966bff050 (patch)
tree315b42018fc08aad8fc85d0833b1ed983d747de8 /gdb/solib.c
parentf4bda9848fb4c4ae3e4cccba77d5ef26099e451e (diff)
downloadgdb-6426a772a2645ef6afa596319dba0ff966bff050.zip
gdb-6426a772a2645ef6afa596319dba0ff966bff050.tar.gz
gdb-6426a772a2645ef6afa596319dba0ff966bff050.tar.bz2
import gdb-1999-09-28 snapshot
Diffstat (limited to 'gdb/solib.c')
-rw-r--r--gdb/solib.c35
1 files changed, 3 insertions, 32 deletions
diff --git a/gdb/solib.c b/gdb/solib.c
index 7f2f8ca..d719837 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -1174,7 +1174,7 @@ solib_add (arg_string, from_tty, target)
#endif SVR4_SHARED_LIBS
- if ((re_err = re_comp (arg_string ? arg_string : ".")) != NULL)
+ if ((re_err = re_comp (arg_string? arg_string : ".")) != NULL)
{
error ("Invalid regexp: %s", re_err);
}
@@ -1196,38 +1196,9 @@ 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;
- }
-
+
/* Add these section table entries to the target's table. */
+ old = target_resize_to_sections (target, count);
while ((so = find_solib (so)) != NULL)
{
if (so->so_name[0])