aboutsummaryrefslogtreecommitdiff
path: root/gdb/somsolib.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>1994-11-11 17:55:38 +0000
committerJeff Law <law@redhat.com>1994-11-11 17:55:38 +0000
commitc2e00af68ec68a2c6aaf4f82d909185de11168aa (patch)
treeebdd796f381d0044f3e15507014e27d1141aefc8 /gdb/somsolib.c
parent63ba709f374898815e2ba4ff94827d7ffa8265dc (diff)
downloadgdb-c2e00af68ec68a2c6aaf4f82d909185de11168aa.zip
gdb-c2e00af68ec68a2c6aaf4f82d909185de11168aa.tar.gz
gdb-c2e00af68ec68a2c6aaf4f82d909185de11168aa.tar.bz2
* 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.
Diffstat (limited to 'gdb/somsolib.c')
-rw-r--r--gdb/somsolib.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/gdb/somsolib.c b/gdb/somsolib.c
index 67d12ab..0418bd9 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)
{