Question: After exploring the use of the set command interactively with Gdb, use an editor to open the file q1.gdb. In this file, you will write

After exploring the use of the set command interactively with Gdb, use an editor to open the file q1.gdb. In this file, you will write the definition for a user defined Gdb function (a simple list of Gdb commands that you can invoke via the functions name) called q1. When run, this function should set the values of the registers so that when the bgprs command is run, the following output will be produced:

(gdb) source q1.gdb

(gdb) q1

(gdb) bgprs

Binary General Purpose Register Dump:

rax: 1 $91 = 1

rbx: 2 $92 = 10

rcx: c $93 = 1100

rdx: 61 $94 = 1100001

rsi: 0 $95 = 0 r

di: 0 $96 = 0

rbp: 0 $97 = 0

rsp: ffffa000 $98 = 11111111111111111010000000000000

r8: 62 $99 = 1100010

r9: 0 $100 = 0

r10: 0 $101 = 0 r

11: 0 $102 = 0

r12: 0 $103 = 0

r13: 0 $104 = 0

r14: 0 $105 = 0

r15: 0 $106 = 0

rip: 1000 $107 = 1000000000000

eflags: 86 $108 = 10000110

To see if your solution is correct, you may run testq1 from the shell prompt on your csa1, csa2, or csa3 accounts.

This test is the same test that we will use to test your code: $ make q1 If your function q1 is correct, you will see the message q1 PASS.

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!