DENX . DULG . RemoteGPacketReplyIsTooLong

14.6.5. Remote 'g' packet reply is too long

Question:
I'm trying to debug U-Boot for a PPC4xx processor, but I get the following error:
(gdb) target remote xx.xx.xx.xx:2001
Remote debugging using xx.xx.xx.xx:2001

Remote 'g' packet reply is too long:...
I believe this error is caused by GDB being configured to the wrong architecture. So I did the following:
$ ppc_4xx-gdb u-boot
...
The target architecture is set automatically (currently powerpc:403)
(gdb) show arch
The target architecture is set automatically (currently powerpc:e500)
(gdb) set arch powerpc:403
The target architecture is assumed to be powerpc:e500
(gdb) show arch
The target architecture is assumed to be powerpc:e500
(gdb) set arch powerpc:common
The target architecture is assumed to be powerpc:e500
(gdb) show arch
The target architecture is assumed to be powerpc:e500
(gdb) 
As you see, initially GDB says the target architecture is "powerpc:403". But the "show arch" command claims it is the "powerpc:e500". And any commands that try to change it from "powerpc:e500" do not appear to be working.

What's wrong, and why am I not able to change the architecture?
Answer:
Some versions of GDB are hard coded to try and read the architecture from the ELF file and set the arch based on that at startup. When this happens you cannot change the arch again. In this case it looks like it has set it incorrectly from the ELF file as "powerpc:e500".
Workaround:
The following procedure can be used to work around the problem:
Note:
When you see this problem with the GDB version 6.7-1rh as included with ELDK release 4.2, you may want to install the update to version 6.7-4rh which can be found here: ftp://ftp.denx.de/pub/eldk/4.2/ppc-linux-x86/updates/RPMS/gdb-ppc-6.7-4.i386.rpm

----- Revision r1.2 - 12 Nov 2010 - 21:16 - WolfgangDenk
Copyright © 2002-2019 by DENX Software Engineering