From: Jeff Law Date: Fri, 11 Nov 1994 17:55:38 +0000 (+0000) Subject: * hppa-tdep.c (rp_saved): Handle IMPORT stubs too. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c2e00af68ec68a2c6aaf4f82d909185de11168aa;p=binutils-gdb.git * hppa-tdep.c (rp_saved): Handle IMPORT stubs too. * somsolib.c (som_solib_add): Check the value of __dld_flags, if it indicates __dld_list is not valid return an error. If it indicates that libraries were not mapped privately, issue a warning. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ffb2bd9a7e8..6e4a1223e37 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,12 @@ +Fri Nov 11 10:51:07 1994 Jeff Law (law@snake.cs.utah.edu) + + * hppa-tdep.c (rp_saved): Handle IMPORT stubs too. + + * somsolib.c (som_solib_add): Check the value of __dld_flags, if + it indicates __dld_list is not valid return an error. If it + indicates that libraries were not mapped privately, issue a + warning. + Thu Nov 10 23:17:45 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) * symfile.c (syms_from_objfile): Only call find_lowest_section if diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index 8832f9e4f0d..b503ed2793b 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c @@ -708,6 +708,7 @@ rp_saved (pc) switch (u->stub_type) { case EXPORT: + case IMPORT: return -24; case PARAMETER_RELOCATION: return -8; diff --git a/gdb/somsolib.c b/gdb/somsolib.c index 67d12ab8fb4..0418bd9a3f8 100644 --- a/gdb/somsolib.c +++ b/gdb/somsolib.c @@ -83,8 +83,44 @@ som_solib_add (arg_string, from_tty, target) struct minimal_symbol *msymbol; CORE_ADDR addr; int status; + unsigned int dld_flags; char buf[4]; + /* If we're debugging a core file, or have attached to a running + process, then som_solib_create_inferior_hook will not have been + called. + + We need to examine __dld_flags to determine if the shared library + list is valid, and to determine if the libraries have been privately + mapped. */ + msymbol = lookup_minimal_symbol ("__dld_flags", (struct objfile *) NULL); + if (msymbol == NULL) + { + error ("Unable to find __dld_flags symbol in object file.\n"); + return; + } + + addr = SYMBOL_VALUE_ADDRESS (msymbol); + /* Read the current contents. */ + status = target_read_memory (addr, buf, 4); + if (status != 0) + { + error ("Unable to read __dld_flags\n"); + return; + } + dld_flags = extract_unsigned_integer (buf, 4); + + /* __dld_list may not be valid. If it's not valid tell the user. */ + if ((dld_flags & 4) == 0) + { + error ("__dld_list is not valid according to __dld_flags.\n"); + return; + } + + /* If the libraries were not mapped private, warn the user. */ + if ((dld_flags & 1) == 0) + warning ("The shared libraries were not privately mapped;\nsetting a breakpoint in a shared library will not work.\n"); + msymbol = lookup_minimal_symbol ("__dld_list", (struct objfile *) NULL); if (!msymbol) {