Re: [RFC] Improve amd64 prologue analysis

Mark Kettenis
2010-12-15T23:07:36Z

> Date: Tue, 14 Dec 2010 11:05:35 +0400
> From: Joel Brobecker <brobecker@adacore.com>
>
> Hi Mark,
>
> > I think that your code does indeed catch some
> > instructions that are not covered by my patch,
> > especially in Windows DLL.
>
> If Pierre were to submit a patch that merges both our changes,
> do you think it would have a chance of being included?
>
> The alternative is to start working on a pdata/xdata unwinder,
> but I don't see myself having the time to look into that anytime
> soon (not within the next 12 months).
>
> You mentioned that, if we have prologue instruction parsers, they should
> be Windows-specific. But I would think that this extra level of
> precaution is unnecessary, since the prologue analyzer should almost
> never be used on the other platforms where we have the DWARF frame info.
> Is that wishful thinking?

Many years ago we realized that prologue analyzers are a dead end.
Compilers will continue to invent silly new ways to set up a stack
frame and save registers, and we'll forever play catch up. Then amd64
showed up and the folks who designed the ABI actually had the insight
to make unwind information pretty much mandatory. As a result we
survived very well without an amd64 prologue analyzer. I hope you'll
understand my reluctance to add one after managing 7 years or so
without. So if support for pdata/xdata gets added I would expect that
the prologue analyzer won't be needed on 64-bit Windows either. At
that point the prologue analyzer will become dead code and we should
remove it again. By not adding the prologue analyzer to other
platforms we'll increase the chance that will indeed be possible.

The fact that this is for a an OS that in my view should never have
been supported by GDB, that has a 64-bit ABI that I consider horribly
broken doesn't help. If you stick it somewhere where I don't need to
look at it, I won't care as much.