Pelles C forum

Pelles C => Bug reports => Topic started by: ebelcrom on June 01, 2009, 10:15:17 PM

Title: Debugger stepping indication problem
Post by: ebelcrom on June 01, 2009, 10:15:17 PM
Description:
In debugging mode the stepping indication isn't working properly. During debugging the first while loop I get into the break statement while index is greater 0: the continue statement should be entered. Nearly the same situation with 2nd while loop but here neither break nor continue is entered. See attachment picture.

Source file While-Schleife.c:

#include <stdio.h>
#include <stdlib.h>

int main(void)
{
unsigned char index;
unsigned short index2;

// count back from 5 to 1 and print
index = 5;
while (1)
{
printf("index = %i\n", index);
index--;
if (index >= 1)
continue;
else
break;
}

// count from 0 to 1000 and print at 50th step
index2 = 0;
do
{
if ((index2 % 50) == 0)
{
printf("index2 = %i\n", index2);
}
index2++;
if (index2 <= 1000)
continue;
else
break;
}
while (1);

return EXIT_SUCCESS;
}


Settings:
Compiler: debug information = Full, optimization = None
Assembler: debug information = Full
Linker: debug information = CodeView & COFF Format

Version:
PellesC for Windows Version 5.00.8, 32-bit
RSRC0007.DLL: Version 5.00.2
SUPPORT.DLL: Version 5.00.2
POCFMT.DLL: Version 5.00.1
PORC.DLL: Version 5.00.1
POBR.DLL: Version 5.00.2
SQLITE3.DLL: Version 3.5.3
POCC.EXE: Version 5.00.13
POASM.EXE: Version 5.00.4
POLINK.EXE: Version 5.00.1
IDESPAWN.EXE: Version 5.00.1
Title: Re: Debugger stepping indication problem
Post by: ebelcrom on June 10, 2009, 12:02:53 AM
Any suggestions? Did somebody tried to reproduce the problem?
Title: Re: Debugger stepping indication problem
Post by: AlexN on June 10, 2009, 07:57:43 AM
I assume you use Pelles C 5.0. I have tried it with Pelles C 6.0 and there the debugger jumps as expected.  :)

If you switch in Pelles C 5.0 debugging to the assembler view (by context-menu) you will see that there is no code for the continue statement in the first case and in the second case there is no code for the continue and break statement. It seems that the code generator here makes little optimizatioin in any case.
Title: Re: Debugger stepping indication problem
Post by: Romashka on June 14, 2009, 11:54:48 PM
Quote from: ebelcrom on June 10, 2009, 12:02:53 AM
Any suggestions? Did somebody tried to reproduce the problem?
Looks similar to my issue (http://forum.pellesc.de/index.php?topic=2875.0) that turned out to be wrong jumping in the debugger too.
Title: Re: Debugger stepping indication problem
Post by: ebelcrom on June 21, 2009, 11:56:21 AM
Indeed, it seems there is no debugging code indicating the right jump commands for continue and break (see the picture).

@Pelle: a feature improvement of the debugger indication resp. code generation with additional debugging code would help a lot!