aboutsummaryrefslogtreecommitdiff
path: root/gdb/solib.c
diff options
context:
space:
mode:
authorPeter Schauer <Peter.Schauer@mytum.de>1998-04-22 20:17:44 +0000
committerPeter Schauer <Peter.Schauer@mytum.de>1998-04-22 20:17:44 +0000
commitb420cea7eb00a0cce5a1383ef9d743c281bd3d7a (patch)
tree3d2c5b20fe5c35529cc268a2f3d420871bf73f79 /gdb/solib.c
parentf3b96ecc601e313d87507a164d939e34845a6dd5 (diff)
downloadgdb-b420cea7eb00a0cce5a1383ef9d743c281bd3d7a.zip
gdb-b420cea7eb00a0cce5a1383ef9d743c281bd3d7a.tar.gz
gdb-b420cea7eb00a0cce5a1383ef9d743c281bd3d7a.tar.bz2
Handle missing shared libraries during the examination of a core
dump gracefully. * solib.c (find_solib): Use catch_errors around call to solib_map_sections. Use warning instead of error if reading of the shared library name fails. (solib_map_sections): Change return and argument types to make it callable from catch_errors. (symbol_add_stub): Avoid GDB core dump if solib->abfd is NULL. * irix5-nat.c, osfsolib.c (xfer_link_map_member, solib_map_sections, symbol_add_stub): Ditto.
Diffstat (limited to 'gdb/solib.c')
-rw-r--r--gdb/solib.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/gdb/solib.c b/gdb/solib.c
index 71faffd..3f6e730 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -186,8 +186,8 @@ first_link_map_member PARAMS ((void));
static CORE_ADDR
locate_base PARAMS ((void));
-static void
-solib_map_sections PARAMS ((struct so_list *));
+static int
+solib_map_sections PARAMS ((char *));
#ifdef SVR4_SHARED_LIBS
@@ -224,7 +224,7 @@ LOCAL FUNCTION
SYNOPSIS
- static void solib_map_sections (struct so_list *so)
+ static int solib_map_sections (struct so_list *so)
DESCRIPTION
@@ -243,10 +243,11 @@ FIXMES
expansion stuff?).
*/
-static void
-solib_map_sections (so)
- struct so_list *so;
+static int
+solib_map_sections (arg)
+ char *arg;
{
+ struct so_list *so = (struct so_list *) arg; /* catch_errors bogon */
char *filename;
char *scratch_pathname;
int scratch_chan;
@@ -343,6 +344,8 @@ solib_map_sections (so)
/* Free the file names, close the file now. */
do_cleanups (old_chain);
+
+ return (1);
}
#ifndef SVR4_SHARED_LIBS
@@ -986,12 +989,17 @@ find_solib (so_list_ptr)
target_read_string ((CORE_ADDR) LM_NAME (new), &buffer,
MAX_PATH_SIZE - 1, &errcode);
if (errcode != 0)
- error ("find_solib: Can't read pathname for load map: %s\n",
- safe_strerror (errcode));
+ {
+ warning ("find_solib: Can't read pathname for load map: %s\n",
+ safe_strerror (errcode));
+ return (so_list_next);
+ }
strncpy (new -> so_name, buffer, MAX_PATH_SIZE - 1);
new -> so_name[MAX_PATH_SIZE - 1] = '\0';
free (buffer);
- solib_map_sections (new);
+ catch_errors (solib_map_sections, (char *) new,
+ "Error while mapping shared library sections:\n",
+ RETURN_MASK_ALL);
}
}
return (so_list_next);
@@ -1008,7 +1016,7 @@ symbol_add_stub (arg)
if (so -> textsection)
text_addr = so -> textsection -> addr;
- else
+ else if (so -> abfd != NULL)
{
asection *lowest_sect;