diff options
author | Daniel Jacobowitz <drow@false.org> | 2003-08-04 03:07:01 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2003-08-04 03:07:01 +0000 |
commit | 44f160bbd027e93d89dbde115fac71e85827009d (patch) | |
tree | db583cd453d65b18a90cde066463c7a78d5d0c1b /gdb | |
parent | 8a294b6ccb9bf92b90671a7349f9bacbb62efb68 (diff) | |
download | gdb-44f160bbd027e93d89dbde115fac71e85827009d.zip gdb-44f160bbd027e93d89dbde115fac71e85827009d.tar.gz gdb-44f160bbd027e93d89dbde115fac71e85827009d.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')
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/minsyms.c | 12 |
2 files changed, 17 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 684b9ef..f614c86 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2003-08-03 Daniel Jacobowitz <drow@mvista.com> + + PR c++/1267 + * minsyms.c (lookup_minimal_symbol_by_pc_section): If SECTION is + NULL, default to the section containing PC. + 2003-08-02 Andrew Cagney <cagney@redhat.com> * config/djgpp/fnchange.lst: Fix up testsuite/gdb.c++/annota3.cc, 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) |