Google "cs50 gdb youtube" and you will find two helpful videos explaining how to use the debugger from the command line. It's much more reliable, and has the added benefit of being a tool that will always be available to you in the future even if you do not use the Cloud9 IDE for development.
Basically, to debug myprog
with a breakpoint at myfunc
, passing arguments arg1
and arg2
, do the following:
gdb ./myprog
break myfunc
run arg1 arg2
To debug functions in multiple files, set your breakpoints and then as you are stepping through statements with n
, pay attention and when you get to the line that calls the externally-defined function, step into it with s
instead.