Question: Without leaving the debugger set a breakpoint at the end of the handleMyStuff function, i . e . , on the line of the final

Without leaving the debugger set a breakpoint at the end of the handleMyStuff function, i.e., on the line of the final right brace (}) in that function. Then continue with the c command. At the prompt for the next offset, enter a q. Then, when the program hits the breakpoint, display the disassembled program using:
display/i $pc
stepi
And single step through the remainder of the handleMyStuff function disassembly by repeatedly pressing the Return key until the program gets to the ret instruction.
This is the point in the program at which the handleMyStuff function will return to the main function. The ret instruction directs the processor to jump to the instruction at the address contained at the current stack pointer. Display the memory content pointed to by the stack register using:
x $esp
The displayed value will become the next instruction address, which you can confirm using one more nexti. Make note of that current instruction pointer. Look again at the stack address that held this re- turn value. Note that it is higher than the address of the data structure observed in the showMemory function in the first address printed when you displayed 10 words of data. Compute and record the difference between the two addresses.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!