Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can you solve the problem and show how you did it? [ 10 points ] Problem i Consider the following definition of a struct: struct

Can you solve the problem and show how you did it?

image text in transcribed

image text in transcribed

[ 10 points ] Problem i Consider the following definition of a struct: struct Inode { struct lnode *next; // points to next node address char *str; // points to 16-character string }; We know from the source code that the variable "list" is the start of a linked list. We can execute the following command in gdb to find the start of the linked list: (gdb) print list $1 = (struct Inode *) Ox55555555930 We can also investigate the memory around the above starting address: (gdb) x/52gx Ox555555559280 0x555555559280: Ox0000000000000000 Ox0000000000000000 0x555555559290: Ox0000000000000000 Ox0000000000000021 Ox5555555592a0: Ox0000555555559380 Ox0000555555559400 Ox5555555592b0: OX0000000000000000 Ox0000000000000021 Ox5555555592co: Ox0000555555559300 OxO000555555559300 Ox5555555592do: 0x0000000000000000 Ox0000000000000021 0x5555555592e0: Ox6e616320656e6f20 Ox006920656b617420 Ox5555555592fo: Ox0000000000000000 Ox0000000000000021 0x555555559300: Ox6f626120676e6968 Ox007261656c207475 0x555555559310: 0x0000000000000000 Ox0000000000000021 0x555555559320: Ox00005555555592a0 Ox000055555555920 Ox555555559330: Ox0000000000000000 Ox0000000000000021 Ox555555559340: Ox00002e7265766520 Ox0000000000000000 Ox555555559350: 0x0000000000000000 Ox0000000000000021 Ox555555559360: Ox20736920676e696e Ox006f6e2074616874 0x555555559370: Ox0000000000000000 Ox0000000000000021 Ox555555559380: OX0000000000000000 Ox0000555555559340 Ox555555559390: Ox0000000000000000 Ox0000000000000021 Ox5555555593a0: Ox7561656220656854 Ox0074206c75666974 Ox5555555593b0: 0x0000000000000000 Ox0000000000000021 Ox5555555593c0: Ox0000555555559320 Ox0000555555559360 Ox5555555593do: 0x0000000000000000 Ox0000000000000021 Ox55555555930: Ox00005555555592co 0x00005555555593ae Ox5555555593f0: Ox0000000000000000 Ox0000000000000021 Ox555555559400: Ox6620796177612074 Ox00756f79206d6f72 Ox555555559410: 0x0000000000000000 Ox0000000000000411 Given these snippets of information, answer the following questions about the linked list. 1.1 Detail the structure of the linked list below. In the first table, report the address of the first node of the list. In the second table, report the contents of each node of the linked list in each row, starting at the first node (this is the node whose address is reported in the first table). [.5 points/blank * 13 blanks = 6.5 points ] Starting address (as hex): Address of next node (as hex) Address of string (as hex)

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

Database Design For Mere Mortals

Authors: Michael J Hernandez

4th Edition

978-0136788041

More Books

Students also viewed these Databases questions