NO

Author Topic: How to stop debugger  (Read 3959 times)

puredesi5

  • Guest
How to stop debugger
« on: April 06, 2013, 11:22:20 PM »
I debugger and go through code after setting some break points but can not stop debugger. I tried everything but it doesn't stop. I have to go to task menu and kill C Pelles to get out of it. Any idea?

Offline Bitbeisser

  • Global Moderator
  • Member
  • *****
  • Posts: 772
Re: How to stop debugger
« Reply #1 on: April 06, 2013, 11:46:20 PM »
I debugger and go through code after setting some break points but can not stop debugger. I tried everything but it doesn't stop. I have to go to task menu and kill C Pelles to get out of it. Any idea?
Withe the wealth of information you are providing (or better, the lack thereof), the best guess without a crystal ball or Vulcan mind reading abilities is that you did not compile your project with debug info...

Another WAG could be that you are setting breakpoints on unreachable code...

Ralf

puredesi5

  • Guest
Re: How to stop debugger
« Reply #2 on: April 07, 2013, 12:40:05 AM »
Ralf:
First of all, thanks for replying. I apologize for not providing enough information. Here is my code. It works properly. I set breakpoint on "if" statement and I start debugger (Go/debug next to execute), once program gets two input and stops there, I step into each line. After it gets to last return, all buttons are grayed out and it appears it's hung. I try to close project (File, close Prolect), or even exit (File, exit), there is no effect on the IDS.
Please let me know what other information would be helpful to debug the issue and I will provide.
BTW, project options are set to 'full' for    compiler and assembler and for linker 'Code view and COFF format'.

Code: [Select]
#include <stdio.h>


int main(void)
{
    int hours;
double rate, pay;

printf ("How many hours did you work this week? ");
scanf ("%d",&hours);
printf ("What's your hourly rate? ");
scanf ("%lf",&rate);
/* calculate Pay */

if (hours >0)
{
pay = hours * rate;
printf ("Your pay for this week is $%.2lf  \n", pay);
}
else
{
printf ("There is no need to create pay check for this week  \n");
}
    return 0;
}
« Last Edit: April 07, 2013, 01:01:47 AM by Bitbeisser »

Offline Bitbeisser

  • Global Moderator
  • Member
  • *****
  • Posts: 772
Re: How to stop debugger
« Reply #3 on: April 07, 2013, 01:09:20 AM »
Ralf:
First of all, thanks for replying. I apologize for not providing enough information. Here is my code. It works properly. I set breakpoint on "if" statement and I start debugger (Go/debug next to execute), once program gets two input and stops there, I step into each line. After it gets to last return, all buttons are grayed out and it appears it's hung. I try to close project (File, close Prolect), or even exit (File, exit), there is no effect on the IDS.
Well, I just tested this and it works just fine for me. What I however noticed is that end the end of the program run, it will show the "Press any key to continue..." in the "Console program output" window and all buttons of the IDE are (of course) grey out until you actually hit a key in the console window...

Ralf

puredesi5

  • Guest
Re: How to stop debugger
« Reply #4 on: April 08, 2013, 09:31:32 PM »
Ralf: You are the man! My DOS window was hidden behind the C Pelles. I went to that window, pressed enter. Everything looks OK now.
Thank you so much. I spent more time than I should have but thanks to Ralf and this forum, mystery (Operator error) is solved.
Once again, Thank you Ralf and the forum. 

Offline Bitbeisser

  • Global Moderator
  • Member
  • *****
  • Posts: 772
Re: How to stop debugger
« Reply #5 on: April 08, 2013, 10:31:20 PM »
Ralf: You are the man! My DOS window was hidden behind the C Pelles. I went to that window, pressed enter. Everything looks OK now.
Thank you so much. I spent more time than I should have but thanks to Ralf and this forum, mystery (Operator error) is solved.
Once again, Thank you Ralf and the forum.
Well, sometime things are just that simple...  ;)

Glad to hear the mystery is solved!  8)

Ralf