Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [plaintive noise] Andrew, this old change broke things
@ 2005-03-09  1:46 Michael Snyder
  0 siblings, 0 replies; only message in thread
From: Michael Snyder @ 2005-03-09  1:46 UTC (permalink / raw)
  To: cagney; +Cc: gdb-patches

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-03-09  1:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-09  1:46 [plaintive noise] Andrew, this old change broke things Michael Snyder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox