I am doing pset 4 whodunnit project. I just can't get the cs50 debugger to run and after reading other posts have given up on it and switched to the gdb debugger but I can't work out how to pass command line arguements. In this case there are 2 arguements - the bmp file to be copied and the file to be copied to. how do you pass command line arguements in gdb? I have tried lots of variations but nothing seems to work
2 Answers
I couldn't get the hang of the ide50 debugger either.
Launch gdb like: gdb whodunit
Then to run: r file1.bmp file2.bmp
In case you have more gdb related questions in the future, I use this site, and just control f whatever I need: http://www.yolinux.com/TUTORIALS/GDB-Commands.html
If your program call is:
./ arg1 arg2
then using gdb you can execute the same as follows:
gdb ./
and then when this is prompted:
DETAILS ABOUT THE VERSION OF GDB ETC.
(gdb)
try:
(gdb) run arg1 arg2
And in place of run you can also use just 'r' (without single quotes). Infact that goes with all commands like list break etc. These can be replaced by l and b respectively.