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

Stephane Franck Rey stephane.franck.rey at cern.ch
Wed Jun 1 16:05:54 UTC 2011


Well, usually the debugging is immediate and I do not notice latency when continuing between the 1st and 2nd breakpoint.
When it seems to be lost somewhere before reaching the 1st BP, then I've tried to leave the debugger running several minutes (maybe 5-6mn) before assuming then that something was wrong. I will try to leave it several hours to see what happens...

Regarding your question about CTRL+C : When starting the first time the program, nothing seems happening before reaching 1st BP, So I CTRL+C which halts the debug in the 1st loop, then I continue and it reach BP#2 immediately. If continuing again, then it crashs or seems to crash.

I hope I've been clear in my explanations. Let me know if not

Cheers
Stephane

-----Original Message-----
From: Carlos O'Donell [mailto:carlos at codesourcery.com] 
Sent: mercredi 1 juin 2011 17:53
To: Stephane Franck Rey
Cc: coldfire-gnu-discuss at codesourcery.com
Subject: Re: [coldfire-gnu-discuss] GDB freeze when steping into a loop with P&E BDM

On 5/23/2011 5:52 AM, Stephane Franck Rey wrote:
> Then defined the target connection :
>
> ******************************************************************
> (gdb) target remote | m68k-elf-sprite pe://USBMultilink m51ac128cevb
> Remote debugging using | m68k-elf-sprite pe://USBMultilink m51ac128cevb
> m68k-elf-sprite: Opening P&E USBMultilink port 1 (USB1 : USB-ML-12 Rev C (PE5516
> 318))
> m68k-elf-sprite: Target reset
> 0x00000000 in _ftext ()
> ******************************************************************
>
>
> I've set some breakpoints lines 66 and line 68 :
>
> ******************************************************************
> (gdb) info break
> Num     Type           Disp Enb Address    What
> 1       breakpoint     keep y   0x00000626 in main at ../main.c:66
> 2       breakpoint     keep y   0x0000065a in main at ../main.c:68
> ******************************************************************
>
>
> And ran the program :
>
> ******************************************************************
> (gdb) c
> Continuing.
> Note: automatically using hardware breakpoints for read-only addresses.
> ******************************************************************
>
>
> After a while nothing is happening I press CTRL+C :

If you wait a *very* long time does the program run to completion?

For example if you wait several hours does it complete?

Is it simply that the debug interface is being incredibly slow?

Could you confirm that please?

> ******************************************************************
> Program received signal SIGINT, Interrupt.
> 0x00000620 in main () at ../main.c:57
> 57                      for (i=1; i<50000; i++)
>   (gdb) display i
> 1: i = 24028
> ******************************************************************
> Several tests have shown it halts for random value of I (24028, 37406, ...)
>
> Then I continue the execution until it stops definitely on line 68 :
>
> ******************************************************************
> (gdb) c
> Continuing.
>
> Breakpoint 1, main () at ../main.c:66
> 66                      PTFD&= ~PTFD_PTFD0_MASK;;
> 1: i = 50000
> (gdb) next
> 67                      PTFD |=  PTFD_PTFD1_MASK ;;
> 1: i = 50000
> (gdb) next
>
> Breakpoint 2, main () at ../main.c:68
> 68                      for (i=1; i<40000; i++){asm ("nop");};
> 1: i = 50000
> (gdb)
> ^C

Another question, did your CTRL+C come *before* or *after* Breakpoint 2 
was hit?

If the program isn't running CTRL+C won't do anything.

Cheers,
Carlos.
-- 
Carlos O'Donell
Mentor Graphics / CodeSourcery
carlos at codesourcery.com
+1 (613) 963 1026



More information about the coldfire-gnu-discuss mailing list