什么是64位大会“影子空间”? [英] What is the 'shadow space' in x64 Assembly?

查看:203
本文介绍了什么是64位大会“影子空间”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我找到了很多关于这个影子空间的话题,但我无法找到他们没有答案,所以我的问题是:

I found plenty of topics about this shadow space, but I couldn't find the answer in none of them, so my question is:

我是多么准确字节需要从堆栈指针减去,进入到一个程序之前?

how much exactly bytes I need to subtract from the stack pointer, before entering to a procedure?

和我应该推过程参数到堆栈中减去影子空间过吗?

and should I push the procedure parameters to the stack before subtracting the "shadow space"?

我拆开我的codeS,但我找不到逻辑。

I've disassembled my codes, but I couldn't find the logic.

先谢谢了。

推荐答案

暗影空间的(有时也称为的溢油空间主页空间的)是为了被使用,以使调试64更容易。

The Shadow space (also sometimes called Spill space or Home space) is meant to be used, to make debugging x64 easier.

回想一下,前4个参数在寄存器中传递的。如果你打破进入调试器,检查调用堆栈一个线程,你将无法看到传递给函数的参数。存储在寄存器中的值是暂时的,不能被重构向上移动调用堆栈时

Recall that the first 4 parameters are passed in registers. If you break into the debugger and inspect the call stack for a thread, you won't be able to see any parameters passed to functions. The values stored in registers are transient, and cannot be reconstructed when moving up the call stack.

这是其中的主页空间的发挥作用:它可以通过编译器来退出寄存器值的副本的堆栈在调试后检查上。这通常发生于未优化的基础之上。当启用优化,但是,编译器一般治疗的主页空间的为可供从头使用。没有副本留在堆栈上,然后调试崩溃转储变成了一场噩梦。

This is where the Home space comes into play: It can be used by compilers to leave a copy of the register values on the stack for later inspection in the debugger. This usually happens for unoptimized builds. When optimizations are enabled, however, compilers generally treat the Home space as available for scratch use. No copies are left on the stack, and debugging a crash dump turns into a nightmare.

<一个href=\"https://blogs.msdn.microsoft.com/ntdebugging/2009/01/09/challenges-of-debugging-optimized-x64-$c$c/\"相对=nofollow>调试的挑战优化的x64 code 提供关于这一问题的详细信息。

Challenges of Debugging Optimized x64 Code offers in-depth information on the issue.

这篇关于什么是64位大会“影子空间”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆