Re: [RFA] "fix" a problem where a breakpoint would be associated with the wrong source

Daniel Jacobowitz
2006-02-14T14:03:31Z

On Mon, Feb 13, 2006 at 07:27:08PM -0800, PAUL GILLIAM wrote:
> There is a compilation unit that uses constructors/destructors for some class.
> There is a .text section for it in the executable, followed by '.gnu.linkonce...'
> sections for those constructors/destructors. Then there is a .text section for
> the compilation unit that contains the function we are trying to set a breakpoint
> on. Then comes a .text section for part of the implementation for that class.
>
> The high/low pc values for the compilation unit for that last .text section are
> not given in it's compilation unit DIE. GDB computes high/low pc values, but these
> are bogus because the code for the compilation unit is not contiguous. When GDB
> searches for the psymtab that contains the function where the breakpoint was set,
> it finds the wrong one because of these bogus high/low pc values. It then returns
> the 'best' sal from the wrong psymtab which has nothing to do with the function being
> breakpointed.

We've got lots of hacks thrown around to try to make this case work.
It might be possible to add another to fix your variant. But, it
sounds like recording discrete range information would be a better
idea.