3

In the copy.c program, when my debugger reaches line 37

FILE* outptr = fopen(outfile, "w");

I can step into it twice, but then the debugger immediatley exits with this prompt

Compiling /home/ubuntu/workspace/pset4/bmp/copy.c ...                                                                                                                                                                                                
make: `copy' is up to date.                                                                                                                                                                                                                          
Process /home/ubuntu/workspace/pset4/bmp/copy created; pid = 51384                                                                                                                                                                                   
Listening on port 15470                                                                                                                                                                                                                              
Remote debugging from host 127.0.0.1                                                                                                                                                                                                                 
Killing all inferiors                                                                                                                                                                                                                                



Process exited with code: 0

I can't even look at how each pixel is being processed.

When I run the program normally with ./copy smiley.bmp copy.bmp, it runs fine, and diff smiley.bmp copy.bmp does not return anything, so that's further confirmation.

Help much appreciated in advance.

  • 1
    DId you ever manage to figure this out? I am stumped with the same issue. – klmo8 Mar 1 '16 at 0:19
  • 1
    I finished that problem and moved onto the next pset, so I haven't tested this new method yet with this particular issue, but try to do "make clean" before debugging. – user10805 Mar 1 '16 at 21:08
  • 1
    I'm having the exact same problem. The debugger starts, stops at the first breakpoint and when I try to step it returns "killing all inferiors" and exits. – B00mstack Apr 6 '16 at 9:20
  • 1
    Whoa!!! same problem. Please do tell me if you have figured this out. Get the debugger to run is key to figuring out how the MSDN structs header files work. – kzernobog Apr 30 '16 at 3:44
  • 1
    Never figured it out. I just kept on chugging along without a debugger and just moved on. – user10805 May 3 '16 at 13:31
1

If you are having problems with the graphical debugger in the CS50 IDE (as I did!) then you should learn to use GDB from the command line, as others have suggested. There are two reasons to do this: it works better, and you may not have access to the Cloud9 IDE if you find a future job as a C programmer.

Google "cs50 gdb youtube" and you should be all set in 20 minutes or so.

| improve this answer | |
  • Having the same problem - just can't get the cs50 debugger to run and have watched the shorts on gdb but I can't work out how to pass command line arguements. In this case there are arguements - the bmp file to be copied and the file to be copied to. the video – peter farrell Aug 22 '16 at 3:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .