aboutsummaryrefslogtreecommitdiff
path: root/gdb/irix5-nat.c
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1994-03-01 21:00:18 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1994-03-01 21:00:18 +0000
commit4ad0021ebc16093209b5067aa2b8ed708c34d177 (patch)
tree78dc7893c3e2518f7765d5f0c9e484ed35233f45 /gdb/irix5-nat.c
parent8b1d1557f36283b8d669eede6fcd603151d67632 (diff)
downloadgdb-4ad0021ebc16093209b5067aa2b8ed708c34d177.zip
gdb-4ad0021ebc16093209b5067aa2b8ed708c34d177.tar.gz
gdb-4ad0021ebc16093209b5067aa2b8ed708c34d177.tar.bz2
* target.c, target.h (target_read_string): Provide error detection to
caller. Put string in malloc'd space, so caller need not impose arbitrary limits. * solib.c (find_solib): Update to use new interface. * irix5-nat.c (find_solib): Read o_path from inferior (clear_solib): Free storage for o_path. * valprint.c (val_print_string): Add comments.
Diffstat (limited to 'gdb/irix5-nat.c')
-rw-r--r--gdb/irix5-nat.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gdb/irix5-nat.c b/gdb/irix5-nat.c
index 9057964..73382cd 100644
--- a/gdb/irix5-nat.c
+++ b/gdb/irix5-nat.c
@@ -524,6 +524,9 @@ find_solib (so_list_ptr)
}
if ((so_list_next == NULL) && (lm != NULL))
{
+ int errcode;
+ char *buffer;
+
/* Get next link map structure from inferior image and build a local
abbreviated load_map structure */
new = (struct so_list *) xmalloc (sizeof (struct so_list));
@@ -544,6 +547,10 @@ find_solib (so_list_ptr)
sizeof (struct obj_list));
read_memory ((CORE_ADDR) new->ll.data, (char *) &(new -> lm),
sizeof (struct obj));
+ target_read_string (new->lm.o_path, &buffer, INT_MAX, &errcode);
+ if (errcode != 0)
+ memory_error (errcode, new->lm.o_path);
+ new->lm.o_path = buffer;
solib_map_sections (new);
}
return (so_list_next);
@@ -797,10 +804,11 @@ clear_solib()
else
/* This happens for the executable on SVR4. */
bfd_filename = NULL;
-
+
next = so_list_head -> next;
if (bfd_filename)
free ((PTR)bfd_filename);
+ free (so_list_head->lm.o_path);
free ((PTR)so_list_head);
so_list_head = next;
}