You can construct the object on the heap or on the stack frame of a function.
可以在堆或函数的堆栈帧上构造对象。
It displays the stack frame for the suspended threads for each target you're debugging.
它可以显示每个调试目标中挂起线程的堆栈框架。
A yellow arrow identifies the stack frame where the execution pointer is currently located.
执行指标目前所在的堆叠框架位置会以黄色箭头识别。
The computer refers to this point as the return address and keeps track of it in the stack frame.
计算机引用这一点作为返回地址,会在堆栈框架中跟踪它。
The final item in the stack frame is a pointer to the previous stack frame, often called the back pointer.
堆栈帧中的最后一个条目是一个指向前一堆栈帧的指针,通常被称为后向指针(back pointer)。
You load register 3 with the return value and perform the function epilogue to restore the stack frame and return.
需要用返回值加载寄存器3并执行函数尾声(epilogue)来恢复堆栈框架并返回。
If the stack frame is not active, this address is the next instruction to execute when the stack frame is reactivated.
如果堆栈帧未处于活动状态,则此地址是在重新激活堆栈帧时要执行的下一条指令。
So you simply need to move the stack pointer by adding the stack frame size to the stack pointer using ai $sp, $sp, FRAME_SIZE.
所以您只需通过使用ai $sp, $sp, FRAME_SIZE 将堆栈框架大小加到堆栈指针来移动堆栈指针即可。
If this stack frame is not active, the offset is the address of the next instruction to be executed when the stack frame is reactivated.
如果此堆栈帧处于非活动状态,则该偏移量将是在重新激活该堆栈帧后要执行的下一条指令的地址。
This means that when the stack frame is popped (e. g. when your function returns), the memory for the block will be open to overwriting.
这意味着当堆栈弹出(例如,当函数返回),对块的内存将重写。
In practice this is easy; just don't write code that does low-level manipulations of the stack frame or makes assumptions about the stack layout.
这在实践上是很容易的;只要不编写对堆栈桢执行低级操作或对堆栈的布局作假设的代码就行了。
However, since the base case doesn't call any other functions, you don't need to load the link register from the stack frame — the value is still there.
但由于基线条件并不调用任何其他函数,所以无需从堆栈框架加载链接寄存器——值还在原处。
The epilogue will be discussed in the analysis of the factorial code, but it basically just takes down the stack frame and returns to the previous function.
该段代码的尾声(epilogue)将在分析factorial 代码时再作讨论,但总的来说,它的作用是结束堆栈框架并返回到先前的函数。
The most difficult part is determining the different offsets of the different parts of the stack frame, knowing where each piece should go, and what size it should be.
最困难的部分是确定堆栈帧不同部分的不同偏移量,了解每个部分应该放到哪里,以及大小应该是多少。
Functions create the stack frame during the beginning of the function (called the function prologue) and tear it down at the end of a function (called the function epilogue).
函数在函数开始过程中(称为函数序言(function prologue))创建堆栈帧,并在函数结束时(称为函数尾声(functionepilogue))销毁它。
You might wonder why I check whether the method is static at the start of my parameter size calculation, then initialize the stack frame slot to zero if it is (as opposed to one if it is not).
您可能会奇怪为什么在开始参数大小计算时要检查方法是否是静态的,如果是静态的,将堆栈帧槽初始化为零(不是静态正好相反)。
Next, the current stack frame pointer is stored as the back pointer for the next stack frame, even though you haven't established the stack frame yet (this is done through negative offsets).
接下来,当前堆栈框架指针会被存储为指向下一个堆栈框架的后向指针,虽然尚未建立堆栈框架(这是通过负的偏移量实现的)。
Notice that since there is nothing left to do in the function, the actual stack frame for the function is not needed either.
注意,由于在函数中不再做任何事情,那个函数的实际的栈结构也就不需要了。
Internally, all the variables declared within a method, including the parameters, are stored together in a stack frame.
在内部,所有方法内部声明的变量,包括参数,都一起存储在堆栈框架中。
These will all be used to make access to stack frame offsets much clearer in the main body of code.
上述这些做法目的是使在代码的主体访问堆栈框架变得更为清楚明了。
Every time a function is called, a new stack frame (an area of memory inside the stack) is used to support the call.
每当调用一个函数,就会使用一个新的堆栈帧来支持该调用。
Each stack frame holds a pointer to the previous stack frame (called the back chain pointer), as well as a space for return addresses for when it calls other functions.
每个堆栈框架都有一个指向前一个堆栈框架的指针(称为回链指针),还有一个当它调用其他函数时用于存放返回地址的空间。
Therefore, before using a non-volatile register in a function, its value must be saved in the function's stack frame, and then restored before the function returns.
因此,在函数中使用非易失性寄存器之前,它的值必须保存到该函数的堆栈帧中,然后在函数返回之前恢复。
References to variables within an expression can then be statically bound to a particular slot in either the local stack frame or the list of global variables.
然后表达式中对变量的引用可以静态绑定到本地堆栈框架或一列全局变量的特定槽上。
This will lead to better stack tracebacks, as the frame pointer register is used as a frame pointer rather than a general purpose register.
这将产生更好的堆栈回溯,因为帧指针寄存器被用作帧指针而不是通用寄存器。
mbackchain and -mno-backchain: These options control whether the address of the caller's frame is stored as so-called "backchain" pointer into the callee's stack frame.
mbackchain和 -mno-backchain:这些选项控制调用方帧的地址是否作为 “backchain”指针存储到被调用方的堆栈帧。
Before moving into a discussion of the factorial function, look at the layout of a stack frame more closely. Here is how the stack is supposed to be laid out according to the abi.
在讨论factorial函数之前,先要了解堆栈框架的布局。
Since you have not yet defined your own stack frame, the offset is from the end of the calling function's stack frame.
由于您尚未定义自己的堆栈框架,所以偏移量是由调用函数的堆栈框架的末端算起的。
Otherwise, it assumes the provided address as a valid stack frame start address and attempts to traceback.
否则,它假定所提供的地址是有效的堆栈帧起始地址并设法进行回溯。
Otherwise, it assumes the provided address as a valid stack frame start address and attempts to traceback.
否则,它假定所提供的地址是有效的堆栈帧起始地址并设法进行回溯。
应用推荐