This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[plaintive noise] Andrew, this old change broke things


Hi Andrew,

I only just had occasion to notice this change that you made a year ago:

2004-02-09 Andrew Cagney <cagney@redhat.com>

       * blockframe.c (find_pc_partial_function): If find_pc_overlay
       fails, try find_pc_section.  Fix PR c++/1267.
       * minsyms.c (lookup_minimal_symbol_by_pc): Use find_pc_section
       instead of find_pc_mapped_section.
       (lookup_minimal_symbol_by_pc_section): If the SECTION is NULL, do
       not default to the section containing PC.  Fix PR symtab/1519.


This is not-the-right-thing (tm), and it breaks things.


The "section" argument for these functions was introduced *only* for
the purpose of overlays.  In fact, all of the functions with like "pc_section"
in their names are overlay-aware versions of other, simpler, pre-existing
functions.  The *only* difference between, for instance, find_pc_psymtab
and find_pc_sect_psymtab is supposed to be that the later works in the
presence of overlays.

lookup_minimal_symbol_by_pc calls find_pc_mapped_section, which *only* returns a non-zero argument if overlay debugging
is in effect. In all other cases, lookup_minimal_symbol_by_pc
should be identical in effect to lookup_minimal_symbol_by_pc_section.
If you're not debugging overlays, the section argument should be zero.


Your comment explains that you found it to be zero most of the time
(which you did not realize was intentional), and so substituted a call to find_pc_section -- but that defeats the intent.


If you can tell me what problem you were trying to solve, I might be able to help figure out the right solution.

Michael


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]