aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2007-07-01 22:39:04 +0000
committerDaniel Jacobowitz <drow@false.org>2007-07-01 22:39:04 +0000
commit962257181f42f4faa4a02a316c3e5a4f6d2e057b (patch)
treec639900f44faa7fd20a7cdd24a0c31b882067ce8
parent1b05479a47026fdfdaf28c22966489eefac124b8 (diff)
downloadgdb-962257181f42f4faa4a02a316c3e5a4f6d2e057b.zip
gdb-962257181f42f4faa4a02a316c3e5a4f6d2e057b.tar.gz
gdb-962257181f42f4faa4a02a316c3e5a4f6d2e057b.tar.bz2
* minsyms.c (lookup_minimal_symbol_by_pc_section): Search fewer
objfiles.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/minsyms.c28
2 files changed, 19 insertions, 14 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 9fa7e7b..a8670d1 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2007-07-01 Daniel Jacobowitz <dan@codesourcery.com>
+ * minsyms.c (lookup_minimal_symbol_by_pc_section): Search fewer
+ objfiles.
+
+2007-07-01 Daniel Jacobowitz <dan@codesourcery.com>
+
* top.c (gdb_readline_wrapper_line): Call rl_callback_handler_remove.
(struct gdb_readline_wrapper_cleanup): Remove prompt_orig.
(gdb_readline_wrapper_cleanup): Do not reset the prompt.
diff --git a/gdb/minsyms.c b/gdb/minsyms.c
index 45f0c2f..68193bb 100644
--- a/gdb/minsyms.c
+++ b/gdb/minsyms.c
@@ -387,20 +387,20 @@ lookup_minimal_symbol_by_pc_section (CORE_ADDR pc, asection *section)
if (pc_section == NULL)
return NULL;
- /* NOTE: cagney/2004-01-27: Removed code (added 2003-07-19) that was
- trying to force the PC into a valid section as returned by
- find_pc_section. It broke IRIX 6.5 mdebug which relies on this
- code returning an absolute symbol - the problem was that
- find_pc_section wasn't returning an absolute section and hence
- the code below would skip over absolute symbols. Since the
- original problem was with finding a frame's function, and that
- uses [indirectly] lookup_minimal_symbol_by_pc, the original
- problem has been fixed by having that function use
- find_pc_section. */
-
- for (objfile = object_files;
- objfile != NULL;
- objfile = objfile->next)
+ /* We can not require the symbol found to be in pc_section, because
+ e.g. IRIX 6.5 mdebug relies on this code returning an absolute
+ symbol - but find_pc_section won't return an absolute section and
+ hence the code below would skip over absolute symbols. We can
+ still take advantage of the call to find_pc_section, though - the
+ object file still must match. In case we have separate debug
+ files, search both the file and its separate debug file. There's
+ no telling which one will have the minimal symbols. */
+
+ objfile = pc_section->objfile;
+ if (objfile->separate_debug_objfile)
+ objfile = objfile->separate_debug_objfile;
+
+ for (; objfile != NULL; objfile = objfile->separate_debug_objfile_backlink)
{
/* If this objfile has a minimal symbol table, go search it using
a binary search. Note that a minimal symbol table always consists