[ELDK] GDB hangs on PPC405

hamelin.philippe at ireq.ca hamelin.philippe at ireq.ca
Tue Apr 13 21:52:17 CEST 2010



> -----Message d'origine-----
> De : Wolfgang Denk [mailto:wd at denx.de] 
> Envoyé : 13 avril 2010 14:23
> À : Hamelin, Philippe
> Cc : eldk at lists.denx.de
> Objet : Re: [ELDK] GDB hangs on PPC405
> 
> Dear Philippe,
> 
> In message 
> <76AAA44CB343D848919D13DE5B684A880144C981 at BORDEAUX.ireq.ca> you wrote:
> > 
> > i'm using Xilinx Kernel (2.6.33) on a PPC405 (ML403) and I'm having
> > problem using gdb. I created a hello world application and 
> it runs fine.
> > However, i'm not able to debug any application. I'm using 
> gdb from ELDK
> > 4.2. Here is what I get while running gdb from the target:
> 
> Are you also using the root file system and libraries form ELDK?
> 
> > # gdb hello
> > GNU gdb Red Hat Linux (6.7-1rh)
> > Copyright (C) 2007 Free Software Foundation, Inc.
> > License GPLv3+: GNU GPL version 3 or later
> > <http://gnu.org/licenses/gpl.html> 
> <http://gnu.org/licenses/gpl.html%3E>
> > 
> > This is free software: you are free to change and redistribute it.
> > There is NO WARRANTY, to the extent permitted by law.  Type "show
> > copying"
> > and "show warranty" for details.
> > This GDB was configured as "ppc-linux"...
> > Using host libthread_db library "/lib/libthread_db.so.1".
> > (gdb) set arch auto
> > The target architecture is set automatically (currently 
> powerpc:common)
> > (gdb) run
> > Starting program: /apps/hello
> > 
> > Then, gdb (and the processor) hangs. The same behaviour arises when
> > using gdbserver on the target with gdb on the host. Any help is very
> > welcome!
> 
> What makes you think the processor hangs? Did you try to check it's
> state using a JTAG debugger or such?
> 
> For me there are no such problems:
> 
> -bash-3.2# cat >hello.c
> #include <stdio.h>
> 
> int main (void)
> {
>         printf ("Hello world\n");
> 
>         return 0;
> }
> -bash-3.2# gcc -o hello hello.c
> -bash-3.2# gcc -g -o hello hello.c
> -bash-3.2# gdb hello
> GNU gdb Red Hat Linux (6.7-1rh)
> Copyright (C) 2007 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later 
> <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.  Type 
> "show copying"
> and "show warranty" for details.
> This GDB was configured as "ppc-linux"...
> Using host libthread_db library "/lib/libthread_db.so.1".
> (gdb) list
> 1       #include <stdio.h>
> 2
> 3       int main (void)
> 4       {
> 5               printf ("Hello world\n");
> 6
> 7               return 0;
> 8       }
> (gdb) break 5
> Breakpoint 1 at 0x100003fc: file hello.c, line 5.
> (gdb) run
> Starting program: /tmp/hello 
> 
> Breakpoint 1, main () at hello.c:5
> 5               printf ("Hello world\n");
> (gdb) c
> Continuing.
> Hello world
> 
> Program exited normally.
> (gdb) q
> -bash-3.2# # cat /proc/cpuinfo 
> processor       : 0
> cpu             : 405EX
> clock           : 600.000000MHz
> revision        : 20.127 (pvr 1291 147f)
> bogomips        : 1196.03
> timebase        : 600000000
> platform        : Kilauea
> model           : amcc,kilauea
> Memory          : 256 MB
> 
> 

I did a clean install of ELDK and nfs mounted the ELDK vanilla root file system. Then, I tried exactly the same thing on my platform and it still crashes:

DENX ELDK version 4.2 build 2008-04-01
Linux 2.6.33 on a ppc

10 login: root
Last login: Thu Jan  1 01:00:43 on console
-bash-3.2# cat /proc/cpuinfo
processor       : 0
cpu             : Virtex-4 FX
clock           : 300.000000MHz
revision        : 20.112 (pvr 2001 1470)
bogomips        : 600.00
timebase        : 300000000
platform        : Xilinx Virtex
model           : testing
Memory          : 64 MB
-bash-3.2# gcc -g -o hello hello.c
-bash-3.2# gdb hello
GNU gdb Red Hat Linux (6.7-1rh)
Copyright (C) 2007 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "ppc-linux"...
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) list
1       #include <stdio.h>
2
3       int main(void)
4       {
5               printf("Hello World\n");
6
7               return 0;
8       }
(gdb) break 5
Breakpoint 1 at 0x100003fc: file hello.c, line 5.
(gdb) run
Starting program: /root/hello

I saw via the JTAG debugger (Xilinx XMD) that my CPU has stopped just after the "run" command. Could it have something to do with this particular architecture PPC405 on the ML403? Also, by looking at the PC register I can conclude that it always hangs at the same address. 

Thank you,

Philippe


More information about the eldk mailing list