aboutsummaryrefslogtreecommitdiff
path: root/gdb/minsyms.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2003-07-26 22:03:38 +0000
committerDaniel Jacobowitz <drow@false.org>2003-07-26 22:03:38 +0000
commit64ae9269446ecfac0e46940e03322373e1aacc76 (patch)
tree8011b3b0501f77a9fe9efa43043da0a249411ae0 /gdb/minsyms.c
parentb59a021820b83a2fd121ac45552aff5d80187eb2 (diff)
downloadgdb-64ae9269446ecfac0e46940e03322373e1aacc76.zip
gdb-64ae9269446ecfac0e46940e03322373e1aacc76.tar.gz
gdb-64ae9269446ecfac0e46940e03322373e1aacc76.tar.bz2
PR c++/1267
* minsyms.c (lookup_minimal_symbol_by_pc_section): If SECTION is NULL, default to the section containing PC.
Diffstat (limited to 'gdb/minsyms.c')
-rw-r--r--gdb/minsyms.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/gdb/minsyms.c b/gdb/minsyms.c
index fa7209d..319865f 100644
--- a/gdb/minsyms.c
+++ b/gdb/minsyms.c
@@ -403,13 +403,23 @@ lookup_minimal_symbol_by_pc_section (CORE_ADDR pc, asection *section)
struct objfile *objfile;
struct minimal_symbol *msymbol;
struct minimal_symbol *best_symbol = NULL;
+ struct obj_section *pc_section;
/* pc has to be in a known section. This ensures that anything beyond
the end of the last segment doesn't appear to be part of the last
function in the last segment. */
- if (find_pc_section (pc) == NULL)
+ pc_section = find_pc_section (pc);
+ if (pc_section == NULL)
return NULL;
+ /* If no section was specified, then just make sure that the PC is in
+ the same section as the minimal symbol we find. */
+ if (section == NULL)
+ section = pc_section->the_bfd_section;
+
+ /* FIXME drow/2003-07-19: Should we also check that PC is in SECTION
+ if we were passed a non-NULL SECTION argument? */
+
for (objfile = object_files;
objfile != NULL;
objfile = objfile->next)