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.
+Wed Apr 22 12:58:23 1998 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ 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.
+
Wed Apr 22 14:34:49 1998 Michael Meissner <meissner@cygnus.com>
* Makefile.in (INTL*): Add support to link in the intl library,
/* Native support for the SGI Iris running IRIX version 5, for GDB.
- Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996
+ Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998
Free Software Foundation, Inc.
Contributed by Alessandro Forin(af@cs.cmu.edu) at CMU
and by Per Bothner(bothner@cs.wisc.edu) at U.Wisconsin.
static CORE_ADDR
locate_base PARAMS ((void));
-static void
-solib_map_sections PARAMS ((struct so_list *));
+static int
+solib_map_sections PARAMS ((char *));
/*
SYNOPSIS
- static void solib_map_sections (struct so_list *so)
+ static int solib_map_sections (struct so_list *so)
DESCRIPTION
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;
/* Free the file names, close the file now. */
do_cleanups (old_chain);
+
+ return (1);
}
/*
#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);
}
if (so -> textsection)
text_addr = so -> textsection -> addr;
- else
+ else if (so -> abfd != NULL)
{
asection *lowest_sect;
/* 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.
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 *));
/*
SYNOPSIS
- static void solib_map_sections (struct so_list *so)
+ static int solib_map_sections (struct so_list *so)
DESCRIPTION
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;
/* Free the file names, close the file now. */
do_cleanups (old_chain);
+
+ return (1);
}
/*
}
#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);
}
}
if (so -> textsection)
text_addr = so -> textsection -> addr;
- else
+ else if (so -> abfd != NULL)
{
asection *lowest_sect;
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
SYNOPSIS
- static void solib_map_sections (struct so_list *so)
+ static int solib_map_sections (struct so_list *so)
DESCRIPTION
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;
/* Free the file names, close the file now. */
do_cleanups (old_chain);
+
+ return (1);
}
#ifndef SVR4_SHARED_LIBS
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);
if (so -> textsection)
text_addr = so -> textsection -> addr;
- else
+ else if (so -> abfd != NULL)
{
asection *lowest_sect;