Discussion 0 Exercise - Using GDB

Description

The code in main.c causes a segmentation fault when executed (interruption caused by a memory access violation).

Your job is to use GDB to find the cause of the segmentation fault and fix the error, such that the program does what it is intended to do (copy a string from one location to another).

The purpose of the exercise is to introduce you to debugging with GDB, which will be crucial throughout the course.

Download main.c file here.

Download makefile file here.

Getting started

Further instructions

Feel free to discuss and look up other GDB commands that can help you. Some ideas are:

GDB cheatsheet: https://darkdust.net/files/GDB%20Cheat%20Sheet.pdf