Question: Question 2.3: GDB Assume we have this functions: int strlen(char *ptr) The above function returns the length of a null terminating string. Assume a user

 Question 2.3: GDB Assume we have this functions: int strlen(char *ptr)

Question 2.3: GDB Assume we have this functions: int strlen(char *ptr) The above function returns the length of a null terminating string. Assume a user did not provide a null terminating string. Assume the user does not realize they did not provide a null terminating string. COMP 206 Vybihal Page 2 of 3 Write down all the commands from an imaginary GDB session showing how the programmer could use GDB to discover their error. (1) Show how they would compile their code to be compatible with GDB. (2) Show how they would launch GDB with their program. (3) Show a portion of the GDB session that locates and diagnoses the problem, demonstrating why this problem exists

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!