官术网_书友最值得收藏!

The stack

As we saw in the preceding sections, the stack together with the CPU registers define a task. As mentioned earlier, this stack consists of stack frames, each of which defines the (local) variables, parameters, data, and instructions for that particular instance of task execution. Of note is that although the stack and stack frames are primarily a software concept, it is an essential feature of any modern OS, with hardware support in many CPU instruction sets. Graphically, it can be be visualized like the following:

The SP (ESP on x86) points to the top of the stack, with another pointer (Extended Base Pointer (EBP) for x86). Each frame contains a reference to the preceding frame (caller return address), as set by the OS.

When using a debugger with one's C++ application, this is basically what one sees when requesting the backtrack--the individual frames of the stack showing the initial stack frame leading up until the current frame. Here, one can examine each individual frame's details.

主站蜘蛛池模板: 三河市| 大丰市| 周口市| 华坪县| 连州市| 增城市| 临邑县| 尼勒克县| 马尔康县| 高邮市| 东明县| 韩城市| 上栗县| 施秉县| 青田县| 保康县| 阿坝| 卓尼县| 金乡县| 呼图壁县| 米泉市| 桐城市| 胶州市| 冕宁县| 尼勒克县| 五大连池市| 马公市| 冀州市| 五家渠市| 平遥县| 四川省| 惠水县| 正阳县| 高青县| 唐海县| 横山县| 台江县| 兴城市| 都安| 老河口市| 湖口县|