Re: [RFC/RFA/i386] pb reading insns if breakpoints still inserted

Jim Blandy
2006-04-28T20:58:48Z

On 4/28/06, Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
> I don't completely disagree with you here, but, a different way to
> view the problem is putting the blame with the fact that we (ab)use
> the prologue analyzer for skipping the prologue when trying to place a
> breakpoint at the start of a function, where we really should be able
> to use the debug info for doing this.

I certainly agree that debug info is preferable to pig-nosing through
machine code. Perhaps there should be generic code that does what
find_function_start_sal does, and everybody should be using that
instead of calling SKIP_PROLOGUE directly.

But sometimes we don't have debugging information. I had thought that
prologue analysis was pretty much dead, given that .debug_frame does a
much better job, and puts the problem in the hands of somebody who can
solve it (the compiler). But it still seems to come up fairly often.

The other argument is just from first principles: dad gum it, even if
we only know the object file, we should be able to read its
instructions. If the user has said "break foo" and we're not going to
give an error message or mark it pending on shared library load, then
that means we're alleging we know what "foo" refers to. So we should
be able to look at its code.