0

I am trying to use debug50 for PSET 4 (Recover). However, when I set the breakpoints the debugger runs through them and do not pause. Only when I set the breakpoint at the if statement shown in the image below does the debugger stop. From what I have read, the debugger will only stop at points where the code is executable. However, I place one breakpoint at "int i = 0", which should be executable and it still runs over.

I am in the directory pset3/recover

If I remove the breakpoint at the if statement then I receive the message: "Could not connect debugger to the debugger proxy" when running debug50.

debug50 for recover PSET3

  • Well, I see a screenshot of the IDE running debug50 on test2.c This doesn't help at all, since you're trying to debug recover. I also see in your text that you said that you have versions of recover.c in directories pset3 and pset4. If you have two different versions of the program open in the IDE and set breakpoints in one while running the other, nothing will change. Also, I'm wondering if it's possible that the program hasn't actually reached the breakpoint, but is actually still running and is waiting to receive input at an earlier point in the code? – Cliff B Feb 11 at 22:00
  • Also, the image above displays test2 and not recover. It would be more helpful if you would shut down all the extraneous files and screenshot ONLY the program that you're trying to debug. Perhaps you can edit the question and clean up the vague and confusing parts that I've mentioned? – Cliff B Feb 11 at 22:01
  • Hello, sorry for the confusion, I have re-uploaded the image. I understand where I went wrong now. The reason why the code stopped at the first if statement "if (argc != 2)" was because I input the command "debug50 ./recover" on the terminal as opposed to the correct command of "debug50 ./recover card.raw". Since there was no "card.raw" and therefore argc did not equal 2 as specified above, the program was returning 1 and skipping to the end of the main. – Gil Ong Feb 11 at 22:50
0

I understand where I went wrong now. The debugger was running correctly. The reason why the debugger skipped to the end of the code after the first if statement: "if (argc != 2)" was because I did not meet this condition. From my code you can see that as a result the program returns a value of 1 which caused it to skip to the end of the program. From the image above I inputted the command "debug50 ./recover" on the terminal as opposed to the correct command of "debug50 ./recover card.raw". Since there was no "card.raw" and therefore argc did not equal 2 as specified above, the program was returning 1 and skipping to the end of the main. As shown in the image below, I am now able to check lines other than the first if statement.

enter image description here

| improve this answer | |

You must log in to answer this question.

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