[coldfire-gnu-discuss] GDB freeze when steping into a loop with P&E BDM

Carlos O'Donell carlos at codesourcery.com
Fri May 20 20:21:50 UTC 2011


On 5/20/2011 4:16 PM, Stephane Franck Rey wrote:

Please keep the list in the CC so others can learn about the problem.

> #define SOPT (*( unsigned char *)0xFFFF9802)
> #define SOPT_COPE_MASK                  128
>
> #define PTFD (*( unsigned char *)0xFFFF800A)
> #define NVFTRIM (*(unsigned char *)0x000003FE)
> #define PTFDD (*( unsigned char *)0xFFFF800B)

Should be volatile otherwise the compiler will optimize them away as 
constants when -ON for N > 0.

>    // Turn ON/OFF PTE6/7 LEDs
>    PTFDD |=  0 | PTFDD_PTFDD0_MASK   | PTFDD_PTFDD1_MASK;
>    PTFD =0xff ;
>    PTFD =0x00 ;
>
>    for (;;) {
> 	  PTFD |=  PTFD_PTFD0_MASK ;
> 	  PTFD&= ~PTFD_PTFD1_MASK;
> 	  for (i=1; i<50000; i++){asm ("nop");};
>
>           PTFD&= ~PTFD_PTFD0_MASK;;
>           PTFD |=  PTFD_PTFD1_MASK ;;
> 	 for (i=1; i<40000; i++){asm ("nop");};
>    }

Have you debugged this from the command line gdb to show it's not an IDE 
problem?

Cheers,
Carlos.
-- 
Carlos O'Donell
Mentor Graphics / CodeSourcery
carlos at codesourcery.com
+1 (650) 331-3385 x716



More information about the coldfire-gnu-discuss mailing list