* minsyms.c (lookup_minimal_symbol_by_pc): Don't use mst_abs symbols.
authorJim Kingdon <jkingdon@engr.sgi.com>
Mon, 4 Oct 1993 22:01:38 +0000 (22:01 +0000)
committerJim Kingdon <jkingdon@engr.sgi.com>
Mon, 4 Oct 1993 22:01:38 +0000 (22:01 +0000)
gdb/ChangeLog
gdb/minsyms.c

index b0299c8bc1c8407fc5e229c7ddeb8c5752e6a64f..8c8f91e141cdbe0d67774a510143b756511e9904 100644 (file)
@@ -1,5 +1,7 @@
 Mon Oct  4 11:02:11 1993  Jim Kingdon  (kingdon@lioth.cygnus.com)
 
+       * minsyms.c (lookup_minimal_symbol_by_pc): Don't use mst_abs symbols.
+
        * dbxread.c (process_one_symbol): Make n_opt_found static.
 
        * Rename i386lynx-tdep.c to i386ly-tdep.c for 14 character file names.
index b8d73723773da41fa834262ea68972811da98dea..dbb4e797d9709e8308972005f56f519b90ae85ed 100644 (file)
@@ -253,9 +253,23 @@ lookup_minimal_symbol_by_pc (pc)
                 objfile's minimal symbol table.  See if it is the best one
                 overall. */
 
-             if ((best_symbol == NULL) ||
-                 (SYMBOL_VALUE_ADDRESS (best_symbol) < 
-                  SYMBOL_VALUE_ADDRESS (&msymbol[hi])))
+             /* Skip any absolute symbols.  This is apparently what adb
+                and dbx do, and is needed for the CM-5.  There are two
+                known possible problems: (1) on ELF, apparently end, edata,
+                etc. are absolute.  Not sure ignoring them here is a big
+                deal, but if we want to use them, the fix would go in
+                elfread.c.  (2) I think shared library entry points on the
+                NeXT are absolute.  If we want special handling for this
+                it probably should be triggered by a special
+                mst_abs_or_lib or some such.  */
+             while (hi >= 0
+                    && msymbol[hi].type == mst_abs)
+               --hi;
+
+             if (hi >= 0
+                 && ((best_symbol == NULL) ||
+                     (SYMBOL_VALUE_ADDRESS (best_symbol) < 
+                      SYMBOL_VALUE_ADDRESS (&msymbol[hi]))))
                {
                  best_symbol = &msymbol[hi];
                }