Question: This lab exercise is an Individual exercise that you need to carryout on your own. During the lab, the instructor will explain some GDB commands
This lab exercise is an Individual exercise that you need to carryout on your own. During the lab, the instructor will explain some GDB commands that you will need to be able to carryout the lab. All the tasks will be done through the GDB command line shell so you need to launch a terminal from the task bar if you do not have one opened already The follow are the major tasks you need to perform 1. The first thing you need to do is to update your git repo. 1. Change directory using the cd command so your shell points to csce- 1102 directory that contains the repo code: cd /home/cusername>Iesce 1102/ 2. Issue the following comm d to update your repo: git pull 3. You should now find a new directory under your repo with the name debug 4. Make your terminal point to it using the cd command. 2. Inside the debug directory you will find a file named debug-me which is an executable file of a program compiled with debug information using the "-g" g++ compiler switch. 3. You are not provided with the source file of this executable on purpose. 4. The source file of this executable contains a function with the name scramble in addition to the main function. 5. The program does not output anything; also on purpose:) 6. Youarerequiredtoknowthevalueofthevariablenamedstrinthe main function before calling the scramble function and in the scramble function just right before the function returns. 7. You should launch the gdb debugger ogainst this executoble and use the different commands described in the lab session to answer the above question. The follow are some GDB help commands you can use: 1. To launch GDB against an executable write int the terminal gdb cexecutable name>, where the executable needs to be stored in the current directory pointed to by the terminal. e.g. gdb debug me. This will give you a gdb terminal that you can leave at ony point of time by pressing CONTROL+D or writing exit. 2. To list all gdb available commands use help all from the gdb shell 3. To get detailed help on a specific gdb command use help ccommand> CSCE 1102 Spring 201... 2:26 PM Assigned: Tuesd.. 2. To list all gdb available commands use help all from the gdb shell. 3. To get detailed help on a specific gdb command use help
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
