diff options
author | Jim Kingdon <jkingdon@engr.sgi.com> | 1991-04-22 20:09:26 +0000 |
---|---|---|
committer | Jim Kingdon <jkingdon@engr.sgi.com> | 1991-04-22 20:09:26 +0000 |
commit | b3fdaf3d368003efaef252f67e0c7ca2a624277f (patch) | |
tree | c0b1491068c5c48f9464bd93b129b7dbb900675b /gdb/solib.c | |
parent | 777bef06cd075ee4031187fe28381d5d5edd4f94 (diff) | |
download | gdb-b3fdaf3d368003efaef252f67e0c7ca2a624277f.zip gdb-b3fdaf3d368003efaef252f67e0c7ca2a624277f.tar.gz gdb-b3fdaf3d368003efaef252f67e0c7ca2a624277f.tar.bz2 |
* symfile.c (symbol_file_add): Add comment.
solib.c (solib_add): Don't malloc name passed to symbol_file_add.
Diffstat (limited to 'gdb/solib.c')
-rw-r--r-- | gdb/solib.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/gdb/solib.c b/gdb/solib.c index ab9336f..1730b65 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -27,6 +27,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "symtab.h" #include "gdbcore.h" #include "command.h" +#include "target.h" /* ** local data declarations @@ -94,13 +95,18 @@ int i; ** Advance to next local abbreviated load_map structure */ if (!(inferior_lm = so_list_ptr->inferior_lm.lm_next)) { - /* - ** See if any were added - */ - read_memory((CORE_ADDR)so_list_ptr->inferior_lm_add, - &so_list_ptr->inferior_lm, - sizeof(struct link_map)); - inferior_lm = so_list_ptr->inferior_lm.lm_next; + /* See if any were added, but be quiet if we can't read + from the target any more. */ + int status; + + status = target_read_memory ( + (CORE_ADDR)so_list_ptr->inferior_lm_add, + &so_list_ptr->inferior_lm, + sizeof(struct link_map)); + if (status == 0) + inferior_lm = so_list_ptr->inferior_lm.lm_next; + else + inferior_lm = 0; } so_list_next = so_list_ptr->next; } @@ -168,11 +174,7 @@ int from_tty; if (so->symbols_loaded) { printf("Symbols already loaded for %s\n", so->inferior_so_name); } else { - /* File Name String Freed by processing */ - sz = strlen(so->inferior_so_name) + 1; - val = (char *) xmalloc(sz); - bcopy(so->inferior_so_name, val, sz); - symbol_file_add (val, from_tty, + symbol_file_add (so->inferior_so_name, from_tty, (unsigned int)so->inferior_lm.lm_addr, 0); so->symbols_loaded = 1; } |