This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [RFC] Improve amd64 prologue analysis

   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.

  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?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]