aboutsummaryrefslogtreecommitdiff
path: root/gdb/osfsolib.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/osfsolib.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/osfsolib.c')
-rw-r--r--gdb/osfsolib.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/gdb/osfsolib.c b/gdb/osfsolib.c
index ea07208..21b423b 100644
--- a/gdb/osfsolib.c
+++ b/gdb/osfsolib.c
@@ -1,5 +1,5 @@
/* Handle OSF/1 shared libraries for GDB, the GNU Debugger.
- Copyright 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
+ Copyright 1993, 1994, 1995, 1996, 1998 Free Software Foundation, Inc.
This file is part of GDB.
@@ -193,8 +193,8 @@ next_link_map_member PARAMS ((struct so_list *));
static void
xfer_link_map_member PARAMS ((struct so_list *, struct link_map *));
-static void
-solib_map_sections PARAMS ((struct so_list *));
+static int
+solib_map_sections PARAMS ((char *));
/*
@@ -204,7 +204,7 @@ LOCAL FUNCTION
SYNOPSIS
- static void solib_map_sections (struct so_list *so)
+ static int solib_map_sections (struct so_list *so)
DESCRIPTION
@@ -223,10 +223,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;
@@ -288,6 +289,8 @@ solib_map_sections (so)
/* Free the file names, close the file now. */
do_cleanups (old_chain);
+
+ return (1);
}
/*
@@ -485,7 +488,9 @@ xfer_link_map_member (so_list_ptr, lm)
}
#endif
- solib_map_sections (so_list_ptr);
+ catch_errors (solib_map_sections, (char *) so_list_ptr,
+ "Error while mapping shared library sections:\n",
+ RETURN_MASK_ALL);
}
}
@@ -570,7 +575,7 @@ symbol_add_stub (arg)
if (so -> textsection)
text_addr = so -> textsection -> addr;
- else
+ else if (so -> abfd != NULL)
{
asection *lowest_sect;