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

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.

主站蜘蛛池模板: 杭锦旗| 华容县| 若羌县| 武冈市| 临沭县| 朔州市| 玛纳斯县| 南通市| 岐山县| 平顶山市| 闸北区| 沙湾县| 建湖县| 阿瓦提县| 平昌县| 黄浦区| 武隆县| 沽源县| 固始县| 玉溪市| 玉田县| 五大连池市| 碌曲县| 宝应县| 宁陵县| 旺苍县| 英吉沙县| 梅河口市| 隆德县| 新宾| 郴州市| 锦屏县| 垣曲县| 绥德县| 青河县| 叶城县| 射洪县| 冷水江市| 蓬安县| 奉新县| 怀仁县|