This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: [RFC] Improve amd64 prologue analysis
- From: "Pierre Muller" <pierre dot muller at ics-cnrs dot unistra dot fr>
- To: "'Joel Brobecker'" <brobecker at adacore dot com>, <kettenis at gnu dot org>
- Cc: <gdb-patches at sourceware dot org>
- Date: Fri, 19 Nov 2010 23:49:27 +0100
- Subject: RE: [RFC] Improve amd64 prologue analysis
- References: <001701cb84ea$6883c170$398b4450$@muller@ics-cnrs.unistra.fr> <20101118172209.GE2634@adacore.com> <004201cb87c1$dab95cd0$902c1670$@muller@ics-cnrs.unistra.fr> <20101119172011.GI2634@adacore.com>
I think that your code does indeed catch some
instructions that are not covered by my patch,
especially in Windows DLL.
Concerning your pre_prologue function, I
think that I found the explanation in
"amd64 Prolog and Epilog" description page from MSDN.
This page states that before storing
non-volatile registers and allocating the local stack,
the register parameters should be placed into
the stack space that must be allocated anyhow
when calling a function according to the ABI.
http://msdn.microsoft.com/en-us/library/tawsa7cb.aspx
This means that basically only 8 patterns should
be possible:
movq %rcx, 8(%rsp) or movq %xmm0, 8(%rsp)
movq %rdx, 16(%rsp) or movq %xmm1, 16(%rsp)
movq %r8, 24(%rsp) or movq %xmm2, 24(%rsp)
movq %r9, 32(%rsp) or movq %xmm3, 32(%rsp)
But apparently KernelBase DLL
doesn't itself follow this rule,
and other registers are saved into this stack space
allocated for register parameters...
So that keeping it general makes sense.
Mark, what should we do about those patches?
Pierre