Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

5. This problem considers a linked list that has been created in memory. (15 points total) We know the linked list consists of 4 nodes,

image text in transcribed

5. This problem considers a linked list that has been created in memory. (15 points total) We know the linked list consists of 4 nodes, starts at address Ox0403130, and has the following declaration in the C code struct Inode char "firstname; char "lastname; struct lnode "next; \: We decide to look at the memory a bit before the beginning of the linked list: (gdb) x/40x 0x004030a0 0x4030a0: 0x4030b0: 0x4030c0: 0x4030d0: 0x4030e0: 0x4030f0: 0x403100: 0x403110: 0x403120: 0x403130: 0x403140: 04:03150: 0x403160: 0x403170: 0x403180: 0x0000000000000000 0x6e6f737265646e61 0x0000000000000000 0x00000000004030f0 0x0000000000403070 0x0000006563696c61 0x0000000000000000 0x00000a73656e6f6a 0x0000000000000000 0x0000000000403150 0x00000000004030do 0x6e696c6b6e617266 0x0000000000000000 0x0000000a65706f70 0x0000000000000000 0x0000000000000021 0x000000000000000a 0:0000000000000021 0:0000000000403110 0x0000000000000021 0x0000000000000000 0x0000000000000021 0x0000000000000000 0x0000000000000021 0x0000000000403170 0x0000000000000021 0x0000000000000000 0x0000000000000021 0x0000000000000000 0x0000000000020e81 a) Label in the memory dump where all of the fields of the structure are for the node starting at address 0x0403130. (3 points) b) Label in the memory dump where the first and last character are for all the c-strings associated with the node starting at address 0x0403130. (4 points) c) How many of the 4 nodes are shown in the memory dump above? Circle your answer below (4 points) 6 4 3 2 d) How much space (in bytes) does one node of the structure require? Put your answer in the box below (4 points) 5. This problem considers a linked list that has been created in memory. (15 points total) We know the linked list consists of 4 nodes, starts at address Ox0403130, and has the following declaration in the C code struct Inode char "firstname; char "lastname; struct lnode "next; \: We decide to look at the memory a bit before the beginning of the linked list: (gdb) x/40x 0x004030a0 0x4030a0: 0x4030b0: 0x4030c0: 0x4030d0: 0x4030e0: 0x4030f0: 0x403100: 0x403110: 0x403120: 0x403130: 0x403140: 04:03150: 0x403160: 0x403170: 0x403180: 0x0000000000000000 0x6e6f737265646e61 0x0000000000000000 0x00000000004030f0 0x0000000000403070 0x0000006563696c61 0x0000000000000000 0x00000a73656e6f6a 0x0000000000000000 0x0000000000403150 0x00000000004030do 0x6e696c6b6e617266 0x0000000000000000 0x0000000a65706f70 0x0000000000000000 0x0000000000000021 0x000000000000000a 0:0000000000000021 0:0000000000403110 0x0000000000000021 0x0000000000000000 0x0000000000000021 0x0000000000000000 0x0000000000000021 0x0000000000403170 0x0000000000000021 0x0000000000000000 0x0000000000000021 0x0000000000000000 0x0000000000020e81 a) Label in the memory dump where all of the fields of the structure are for the node starting at address 0x0403130. (3 points) b) Label in the memory dump where the first and last character are for all the c-strings associated with the node starting at address 0x0403130. (4 points) c) How many of the 4 nodes are shown in the memory dump above? Circle your answer below (4 points) 6 4 3 2 d) How much space (in bytes) does one node of the structure require? Put your answer in the box below (4 points)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Programming The Perl DBI Database Programming With Perl

Authors: Tim Bunce, Alligator Descartes

1st Edition

1565926994, 978-1565926998

More Books

Students also viewed these Databases questions