Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Programming in C Stop the program at its second call to bar(). When I do so, I got the following. Use the below for reference.
Programming in C
Stop the program at its second call to bar(). When I do so, I got the following. Use the below for reference. File is not provided.
(gdb) break bar Breakpoint 1 at 0x4004d1 (gdb) run Starting program: /home/instructor/Documents/Academic/DePaul/Classes/CSC373/20178-4SumI/Assign3/toAnalyze Breakpoint 1, 0x00000000004004d1 in bar () Missing separate debuginfos, use: debuginfo-install glibc-2.17-222.el7.x86_64 (gdb) c Continuing. Breakpoint 1, 0x00000000004004d1 in bar () (gdb) stepi 0x00000000004004d4 in bar () (gdb) stepi 0x00000000004004d7 in bar () (gdb) stepi 0x00000000004004d9 in bar () (gdb) stepi 0x00000000004004dc in bar () (gdb) stepi 0x00000000004004df in bar () (gdb) info reg rax 0x4 4 rbx 0x0 0 rcx 0x400560 4195680 rdx 0x2 2 rsi 0x4 4 rdi 0x2 2 rbp 0x7fffffffdbd0 0x7fffffffdbd0 rsp 0x7fffffffdbd0 0x7fffffffdbd0 r8 0x7ffff7dd5e80 140737351868032 r9 0x0 0 r10 0x7fffffffd760 140737488344928 r11 0x7ffff7a30350 140737348043600 r12 0x4003e0 4195296 r13 0x7fffffffdd30 140737488346416 r14 0x0 0 r15 0x0 0 rip 0x4004df 0x4004dfeflags 0x202 [ IF ] cs 0x33 51 ss 0x2b 43 ds 0x0 0 es 0x0 0 fs 0x0 0 gs 0x0 0
TO DO: fill in the chart below Write the activation record for bar() when %rip gets to 0x00000000004004df. Under Value put the numeric value held at that address. Under Purpose put one of the following:
- not part of bar()'s activation record
- argument to bar()
- the address inx foo() to which rip should return
- the stored rbp address for foo()
- local variable to bar()
- in the activation record of bar(), but not used
Address: | Value: | Purpose: | |
---|---|---|---|
rbp + 0x10 | ___________ | ___________ | |
rbp + 0xC | ___________ | ___________ | |
rbp + 0x8 | ___________ | ___________ | |
rbp + 0x4 | ___________ | ___________ | |
rbp --> | rbp + 0x0 | ___________ | ___________ |
rbp - 0x4 | ___________ | ___________ | |
rbp - 0x8 | ___________ | ___________ | |
rbp - 0xC | ___________ | ___________ | |
rbp - 0x10 | ___________ | ___________ | |
rbp - 0x14 | ___________ | ___________ | |
rbp - 0x18 | ___________ | ___________ |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started